From d262837ea5aaf300f168a3ee3ce8c1f8e827b4c0 Mon Sep 17 00:00:00 2001 From: Aaryamann Challani <43716372+rymnc@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:19:43 +0530 Subject: [PATCH] fix(rln-relay): deserialization of valid merkle roots (#1973) --- waku/waku_rln_relay/rln/wrappers.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/waku/waku_rln_relay/rln/wrappers.nim b/waku/waku_rln_relay/rln/wrappers.nim index 0edbcced7..fb120ed6d 100644 --- a/waku/waku_rln_relay/rln/wrappers.nim +++ b/waku/waku_rln_relay/rln/wrappers.nim @@ -371,13 +371,13 @@ proc deserialize*(T: type MerkleNodeSeq, merkleNodeByteSeq: seq[byte]): T = ## the order of serialization is |merkle_node_len<8>|merkle_node[len]| var roots = newSeq[MerkleNode]() - var i = 1'u64 let len = uint64.fromBytes(merkleNodeByteSeq[0..7], Endianness.littleEndian) trace "length of valid roots", len - let offset = 8'u64 - for i in 1'u64..len: + for i in 0'u64..