-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add storage proof support to eth_getProof #7202
Add storage proof support to eth_getProof #7202
Conversation
81cefba
to
e9c52c7
Compare
tests/testdata
Outdated
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.
probably committed by mistake
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.
@jyellick exclude testdata
from PR plz. everything else looks great
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.
Good catch, thank you! (fixed)
Because storage proofs are potentially overlapping, the existing strategy of simply aggregating all proofs together into a single result was challenging. Instead, this commit rewires things to introduce a ProofRetainer, which aggregates proofs and their corresponding nibble encoded paths in the trie. Once all of the proofs have been aggregated, the caller requests the proof result, which then iterates over the aggregated proofs, placing each into the relevant proof array into the result.
Updates that eth_getProof is now implemented (so long as the requested block is within the last 100 blocks).
e9c52c7
to
92a6c32
Compare
This PR completes the implementation of `eth_getProof` by adding support for storage proofs. Because storage proofs are potentially overlapping, the existing strategy of simply aggregating all proofs together into a single result was challenging. Instead, this commit rewires things to introduce a ProofRetainer, which aggregates proofs and their corresponding nibble encoded paths in the trie. Once all of the proofs have been aggregated, the caller requests the proof result, which then iterates over the aggregated proofs, placing each into the relevant proof array into the result. Although there are tests for `eth_getProof` as an RPC and for the new `ProofRetainer` code, the code coverage for the proof generation over complex tries is lacking. But, since this is not a new problem I'll plan to follow up this PR with an additional one adding more coverage into `turbo/trie`. --------- Co-authored-by: Jason Yellick <jason@enya.ai>
This PR completes the implementation of `eth_getProof` by adding support for storage proofs. Because storage proofs are potentially overlapping, the existing strategy of simply aggregating all proofs together into a single result was challenging. Instead, this commit rewires things to introduce a ProofRetainer, which aggregates proofs and their corresponding nibble encoded paths in the trie. Once all of the proofs have been aggregated, the caller requests the proof result, which then iterates over the aggregated proofs, placing each into the relevant proof array into the result. Although there are tests for `eth_getProof` as an RPC and for the new `ProofRetainer` code, the code coverage for the proof generation over complex tries is lacking. But, since this is not a new problem I'll plan to follow up this PR with an additional one adding more coverage into `turbo/trie`. --------- Co-authored-by: Jason Yellick <jason@enya.ai>
This PR completes the implementation of
eth_getProof
by adding support for storage proofs.Because storage proofs are potentially overlapping, the existing strategy of simply aggregating all proofs together into a single result was challenging. Instead, this commit rewires things to introduce a ProofRetainer, which aggregates proofs and their corresponding nibble encoded paths in the trie. Once all of the proofs have been aggregated, the caller requests the proof result, which then iterates over the aggregated proofs, placing each into the relevant proof array into the result.
Although there are tests for
eth_getProof
as an RPC and for the newProofRetainer
code, the code coverage for the proof generation over complex tries is lacking. But, since this is not a new problem I'll plan to follow up this PR with an additional one adding more coverage intoturbo/trie
.