Commit ba1f789
authored
feat(range-proof-verification): 4/6 complete range proof verification (#1833)
## Why this should be merged
Implements standalone range proof verification by reconstructing a
partial trie from the proven key-value pairs and comparing its root hash
against the expected one.
## How this works
The verifier builds an in-memory trie (via MemStore +
new_empty_proposal), inserts the proven keys, then reconciles each proof
node into the trie. Three new helper functions compute which child
branches fall outside the proven range and must use the proof's original
hashes:
- compute_outside_children: walks the proof edge path to determine which
child indices are outside the proven range at each node
- mark_outside: marks children strictly less than (left edge) or greater
than (right edge) the on-path nibble
- compute_root_hash_with_proofs: recursively hashes the trie, using
proof sibling hashes for children marked as outside
Also un-gates several functions so they are available outside of test
builds.
## How this was tested
Some tests were enabled here but more exhaustive testing is in the next
PR of the series.
## Breaking Changes
None1 parent fffb3e9 commit ba1f789
0 commit comments