mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-09 12:31:21 +00:00
b21569ccc5
This PR adds missing tests for eth_getProof and does some mild refactoring with switching from strings to more strict types. It's likely best/most easily reviewed commit by commit. Note, the tests include quite a number of helper types and functions for doing the proof validation. This is largely because unlike Geth, Erigon's approach to trie computations only requires serializing the trie nodes, not deserializing them. Consequently, it wasn't obvious how to leverage the existing trie code for doing deserialization and proof checks. I checked on Discord, but, there were no suggestions. Of course, any feedback is welcome and I'd be happy to remove this code if it can be avoided. Additionally, I've opted to change the interface type for `GetProof` to use a `common.Hash` for the storage keys instead of a `string`. I _think_ this should be fairly safe, as until very recently it was unimplemented. That being said, since it's an interface, it has the potential to break other consumers, anyone who was generating mocks against it etc. There's additionally a `GetStorageAt` that follows the same parameter. I'd be happy to submit a PR modifying this one as well if desired. Also, as a small note, there is test code for checking storage proofs, but, storage proofs aren't currently supported by the implementation. My hope is to add storage proofs and historic proofs in a followup PR. --------- Co-authored-by: Jason Yellick <jason@enya.ai> |
||
---|---|---|
.. | ||
vtree | ||
.gitignore | ||
account_node_test.go | ||
debug_test.go | ||
debug.go | ||
delete_subrtee_test.go | ||
encoding_test.go | ||
encoding.go | ||
errors.go | ||
flatdb_sub_trie_loader_test.go | ||
gen_struct_step.go | ||
hack.go | ||
hashbuilder.go | ||
hasher_test.go | ||
hasher.go | ||
intermediate_hash_receiver.go | ||
intermediate_hashes_test.go | ||
node.go | ||
proof.go | ||
retain_list.go | ||
stark_stats.go | ||
stream_test.go | ||
stream.go | ||
structural_branch_test.go | ||
structural_test.go | ||
sub_trie_loader.go | ||
trie_from_witness.go | ||
trie_root.go | ||
trie_test.go | ||
trie_transform.go | ||
trie_witness.go | ||
trie.go | ||
utils.go | ||
visual.go | ||
witness_builder_test.go | ||
witness_builder.go | ||
witness_marshalling.go | ||
witness_operators_test.go | ||
witness_operators.go | ||
witness_stats.go | ||
witness_test.go | ||
witness.go |