Skip to content
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 bug verifying merkle-patricia-tree proofs from ethereum #556

Merged
merged 6 commits into from
Apr 15, 2021

Conversation

mfornet
Copy link
Contributor

@mfornet mfornet commented Apr 14, 2021

Our code had several unhandled edge cases while verifying the proofs, and some valid proofs weren't accepted. This PR reimplements the verification in a simpler and more robust way.

Sources used for reference:

Added proof of concept in python with similar implementation:

Copy link
Contributor

@abacabadabacaba abacabadabacaba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (but see the comments below).

contracts/near/eth-prover/src/lib.rs Outdated Show resolved Hide resolved
contracts/near/eth-prover/src/lib.rs Show resolved Hide resolved
@mfornet mfornet enabled auto-merge (squash) April 14, 2021 21:39
@mfornet mfornet merged commit 76bb4be into master Apr 15, 2021
@mfornet mfornet deleted the fix_mpt_bug branch April 20, 2021 18:02
karim-en pushed a commit that referenced this pull request Dec 20, 2021
* Fix bug while verifying MPT proofs from Ethereum

Made code more simple and robust

* Compile prover contract

* Run rustfmt

* Compile eth_prover contract

* Address comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants