-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix single node tree verification bug #219
Conversation
litt3
commented
Dec 18, 2024
- Remove the incorrect invariant check, which would fail proof with 0 length
- Add unit test to confirm 0 length proofs can succeed verification
- closes Inclusion proof verification doesn't permit trees consisting of a single node #215
@@ -7,9 +7,18 @@ import ( | |||
"github.com/ethereum/go-ethereum/crypto" | |||
) | |||
|
|||
// ProcessInclusionProof processes the Merkle root proof | |||
// ProcessInclusionProof computes the merkle root hash based on the provided leaf and proof, returning the result. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
knit - should we link the on-chain method we're referencing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 6357d45
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Agree everytime we are mimicking onchain logic (which we should minimize and make eth_calls instead when applicable / not latency sensitive), we def need to add this as comment, because its a VERY important invariant that needs to be maintained.
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
6357d45
to
b412bea
Compare