diff --git a/logos_delivery/waku/node/waku_node.nim b/logos_delivery/waku/node/waku_node.nim index 47fbfd89c..3b10d5b7b 100644 --- a/logos_delivery/waku/node/waku_node.nim +++ b/logos_delivery/waku/node/waku_node.nim @@ -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 diff --git a/logos_delivery/waku/waku_store_sync.nim b/logos_delivery/waku/waku_store_sync.nim index 03c1b33af..cadde72ea 100644 --- a/logos_delivery/waku/waku_store_sync.nim +++ b/logos_delivery/waku/waku_store_sync.nim @@ -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 diff --git a/logos_delivery/waku/waku_store_sync/protocols_metrics.nim b/logos_delivery/waku/waku_store_sync/protocols_metrics.nim index 02b0df9b1..f76db8b47 100644 --- a/logos_delivery/waku/waku_store_sync/protocols_metrics.nim +++ b/logos_delivery/waku/waku_store_sync/protocols_metrics.nim @@ -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"]