mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-07-19 11:09:26 +00:00
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>
This commit is contained in:
parent
e57546b66f
commit
f767566d1a
@ -404,12 +404,19 @@ proc mountStoreSync*(
|
||||
## RLN mounts after store sync (but before the switch starts accepting
|
||||
## connections), so capture the node and check at call time; nil rln
|
||||
## means RLN is not configured on this network. Freshness is not
|
||||
## checked: synced messages are old by design. Known gap: proofs built
|
||||
## against roots older than the acceptable root window are rejected,
|
||||
## so history sync across heavy membership churn is bounded by it.
|
||||
## checked: synced messages are old by design. Known gaps: archives do
|
||||
## not persist RLN proofs, so archive-served messages arrive proofless
|
||||
## and can only be counted, not verified (enforcement needs proof
|
||||
## persistence); and proofs built against roots older than the
|
||||
## acceptable root window are rejected, bounding history sync across
|
||||
## heavy membership churn.
|
||||
if node.rln.isNil():
|
||||
return true
|
||||
|
||||
if msg.proof.len == 0:
|
||||
total_transfer_messages_unverified.inc()
|
||||
return true
|
||||
|
||||
let res = await node.rln.validateMessage(msg, checkFreshness = false)
|
||||
return res == MessageValidationResult.Valid
|
||||
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
{.push raises: [].}
|
||||
|
||||
import
|
||||
./waku_store_sync/reconciliation, ./waku_store_sync/transfer, ./waku_store_sync/common
|
||||
./waku_store_sync/reconciliation,
|
||||
./waku_store_sync/transfer,
|
||||
./waku_store_sync/common,
|
||||
./waku_store_sync/protocols_metrics
|
||||
|
||||
export reconciliation, transfer, common
|
||||
export reconciliation, transfer, common, protocols_metrics
|
||||
|
||||
@ -20,6 +20,9 @@ declarePublicCounter total_bytes_exchanged,
|
||||
declarePublicCounter total_transfer_messages_rejected,
|
||||
"number of received transfer messages dropped by validation"
|
||||
|
||||
declarePublicCounter total_transfer_messages_unverified,
|
||||
"number of received transfer messages accepted without proof verification (archives do not persist RLN proofs)"
|
||||
|
||||
declarePublicCounter total_transfer_messages_exchanged,
|
||||
"the number of messages sent and received by the transfer protocol", ["direction"]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user