Skip to content

Commit

Permalink
add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
weiihann committed Dec 11, 2024
1 parent 4f1f334 commit fd0879a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/trie/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ func VerifyRangeProof(root, first *felt.Felt, keys, values []*felt.Felt, proof *
firstKey := FeltToKey(globalTrieHeight, first)

// Special case: there is a provided proof but no key-value pairs, make sure regenerated trie has no more values
// Empty range proof with more elements on the right is not accepted in this function.
// This is due to snap sync specification detail, where the responder must send an existing key (if any) if the requested range is empty.
if len(keys) == 0 {
rootKey, val, err := proofToPath(root, &firstKey, proof, nodes)
if err != nil {
Expand Down

0 comments on commit fd0879a

Please sign in to comment.