Skip to content

Commit f767566

Browse files
fix: accept proofless transfer messages, count them separately
Archives do not persist RLN proofs (no proof column in the message store schema), so every message served from a peer's archive via store-sync transfer arrives proofless and was rejected in an endless retry loop (observed in the simulator: same missing messages re-transferred and re-rejected every sync round). Validate only proof-carrying messages; count proofless ones via the new total_transfer_messages_unverified metric. Real enforcement requires persisting proofs in the archive - recorded as a production gap. Part of the "Store as a startup-only dependency" experiment (step 8 fix). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent e57546b commit f767566

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

logos_delivery/waku/node/waku_node.nim

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,19 @@ proc mountStoreSync*(
404404
## RLN mounts after store sync (but before the switch starts accepting
405405
## connections), so capture the node and check at call time; nil rln
406406
## means RLN is not configured on this network. Freshness is not
407-
## checked: synced messages are old by design. Known gap: proofs built
408-
## against roots older than the acceptable root window are rejected,
409-
## so history sync across heavy membership churn is bounded by it.
407+
## checked: synced messages are old by design. Known gaps: archives do
408+
## not persist RLN proofs, so archive-served messages arrive proofless
409+
## and can only be counted, not verified (enforcement needs proof
410+
## persistence); and proofs built against roots older than the
411+
## acceptable root window are rejected, bounding history sync across
412+
## heavy membership churn.
410413
if node.rln.isNil():
411414
return true
412415

416+
if msg.proof.len == 0:
417+
total_transfer_messages_unverified.inc()
418+
return true
419+
413420
let res = await node.rln.validateMessage(msg, checkFreshness = false)
414421
return res == MessageValidationResult.Valid
415422

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{.push raises: [].}
22

33
import
4-
./waku_store_sync/reconciliation, ./waku_store_sync/transfer, ./waku_store_sync/common
4+
./waku_store_sync/reconciliation,
5+
./waku_store_sync/transfer,
6+
./waku_store_sync/common,
7+
./waku_store_sync/protocols_metrics
58

6-
export reconciliation, transfer, common
9+
export reconciliation, transfer, common, protocols_metrics

logos_delivery/waku/waku_store_sync/protocols_metrics.nim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ declarePublicCounter total_bytes_exchanged,
2020
declarePublicCounter total_transfer_messages_rejected,
2121
"number of received transfer messages dropped by validation"
2222

23+
declarePublicCounter total_transfer_messages_unverified,
24+
"number of received transfer messages accepted without proof verification (archives do not persist RLN proofs)"
25+
2326
declarePublicCounter total_transfer_messages_exchanged,
2427
"the number of messages sent and received by the transfer protocol", ["direction"]
2528

0 commit comments

Comments
 (0)