Skip to content

Commit

Permalink
Quickfix for possible IndexError in state network recursive gossip (#…
Browse files Browse the repository at this point in the history
…2052)

This would currently manifest sometimes in state gossip test in
CI or locally. But could occur on fluffy binary in case state
network  is enable and data is gossiped.
  • Loading branch information
kdeme authored Feb 27, 2024
1 parent d830692 commit b656875
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fluffy/network/state/state_network.nim
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ proc recursiveGossipAccountTrieNode(
nibbles = decodedKey.accountTrieNodeKey.path.unpackNibbles()
proof = decodedValue.proof

# When nibbles is empty this means the root node was received. Recursive
# gossiping is finished.
if nibbles.len() == 0:
return

discard nibbles.pop()
discard (distinctBase proof).pop()
let
Expand Down

0 comments on commit b656875

Please sign in to comment.