erigon-pulse/turbo/trie
Jason Yellick 80530e10a9
Add storage proof support to eth_getProof (#7202)
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>
2023-04-05 03:01:31 +00:00
..
vtree remove simd lib, because it doesn't work with ghcr.io/goreleaser/goreleaser-cross (which producing release binaries) (#7229) 2023-03-31 05:07:43 +00:00
.gitignore move ./trie to ./turbo/trie (#1114) 2020-09-14 11:33:39 +01:00
account_node_test.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
debug_test.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
debug.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
delete_subrtee_test.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
encoding_test.go rename (#1978) 2021-05-20 19:25:53 +01:00
encoding.go rename (#1978) 2021-05-20 19:25:53 +01:00
errors.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
flatdb_sub_trie_loader_test.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
gen_struct_step.go Add storage proof support to eth_getProof (#7202) 2023-04-05 03:01:31 +00:00
hack.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
hashbuilder.go Add storage proof support to eth_getProof (#7202) 2023-04-05 03:01:31 +00:00
hasher_test.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
hasher.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
intermediate_hash_receiver.go move ./trie to ./turbo/trie (#1114) 2020-09-14 11:33:39 +01:00
intermediate_hashes_test.go rename (#1978) 2021-05-20 19:25:53 +01:00
node.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
proof.go rename (#1978) 2021-05-20 19:25:53 +01:00
retain_list_test.go Add storage proof support to eth_getProof (#7202) 2023-04-05 03:01:31 +00:00
retain_list.go Add storage proof support to eth_getProof (#7202) 2023-04-05 03:01:31 +00:00
stark_stats.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
stream_test.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
stream.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
structural_branch_test.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
structural_test.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
sub_trie_loader.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
trie_from_witness.go up version of uint256 lib (#2082) 2021-06-04 17:25:28 +01:00
trie_root.go Add storage proof support to eth_getProof (#7202) 2023-04-05 03:01:31 +00:00
trie_test.go move math big constants to erigon-lib (#6719) 2023-01-27 11:39:34 +07:00
trie_transform.go Aggregator22.Unwind() (#5039) 2022-08-13 18:51:25 +07:00
trie_witness.go move ./trie to ./turbo/trie (#1114) 2020-09-14 11:33:39 +01:00
trie.go enable more linters #954 (#7179) 2023-03-25 05:13:27 +00:00
utils.go Fix lints and remove more unused code (#1621) 2021-03-29 10:58:45 +07:00
visual.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
witness_builder_test.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
witness_builder.go enable more linters #954 (#7179) 2023-03-25 05:13:27 +00:00
witness_marshalling.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
witness_operators_test.go move ./trie to ./turbo/trie (#1114) 2020-09-14 11:33:39 +01:00
witness_operators.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
witness_stats.go move ./trie to ./turbo/trie (#1114) 2020-09-14 11:33:39 +01:00
witness_test.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
witness.go Fixed get-payload and Hanging ForkChoice (#3575) 2022-02-22 14:47:23 +01:00