From 2e0db18cde7604895e4dd8a945d2e7583cc65bf2 Mon Sep 17 00:00:00 2001 From: Aaryamann Challani <43716372+rymnc@users.noreply.github.com> Date: Mon, 5 Dec 2022 23:52:54 +0530 Subject: [PATCH] chore(rln-relay): re-enable root validation (#1445) * fix(rln-relay): enable root validation * fix(rln-relay): unused import --- waku/v2/protocol/waku_rln_relay/protocol_types.nim | 1 - waku/v2/protocol/waku_rln_relay/utils.nim | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/waku/v2/protocol/waku_rln_relay/protocol_types.nim b/waku/v2/protocol/waku_rln_relay/protocol_types.nim index 17ac4a1fc..4f0e0b30a 100644 --- a/waku/v2/protocol/waku_rln_relay/protocol_types.nim +++ b/waku/v2/protocol/waku_rln_relay/protocol_types.nim @@ -7,7 +7,6 @@ import std/[options, tables, deques], stew/arrayops, chronos, - stint, web3, eth/keys import diff --git a/waku/v2/protocol/waku_rln_relay/utils.nim b/waku/v2/protocol/waku_rln_relay/utils.nim index 4a9a43da8..c6b423651 100644 --- a/waku/v2/protocol/waku_rln_relay/utils.nim +++ b/waku/v2/protocol/waku_rln_relay/utils.nim @@ -734,11 +734,10 @@ proc validateMessage*(rlnPeer: WakuRLNRelay, msg: WakuMessage, waku_rln_invalid_messages_total.inc(labelValues=["invalid_epoch"]) return MessageValidationResult.Invalid - ## TODO: FIXME after resolving this issue https://github.com/status-im/nwaku/issues/1247 if not rlnPeer.validateRoot(proof.merkleRoot): debug "invalid message: provided root does not belong to acceptable window of roots", provided=proof.merkleRoot, validRoots=rlnPeer.validMerkleRoots.mapIt(it.inHex()) waku_rln_invalid_messages_total.inc(labelValues=["invalid_root"]) - # return MessageValidationResult.Invalid + return MessageValidationResult.Invalid # verify the proof let