mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 11:41:19 +00:00
434ac76f79
This PR extends the function merged in #7337 to cover the proof generation paths as well. The first commit simply migrates the internal proof checking code from the rpc `eth_getProof` test to be available externally exported under `turbo/trie`. In the process, it translates the in place testing assertions to return more normally as errors and adapts to use the pre-existing trie node types which are defined slightly differently (although this code is still intended only for testing purposes). The second commit refactors the existing trie fuzzing tests from the previous PR and adds new fuzzing tests for the proof generation. In order to validate the proofs, these fuzzing tests fundamentally do two things. Firstly, after bootstrapping the test (by seeding, and modifying the db), for each key we compute the 'naive' proof utilizing the existing code in `proof.go` and the in memory `trie.Trie` structure. The `trie.Trie` code actually had a couple small bugs which are fixed in this PR (not handling value nodes, and not honoring the `NewTestRLPTrie` contract of pre-RLP encoded nodes in proof generation). Secondly, we re-compute the same proof for the flatDB production variant, and verify that it is exactly the same proof as computed by the naive implementation. This fuzzing has been run for ~72 hours locally with no errors. Although this code hasn't identified any new bugs in the proof generation path, it improves coverage and should help to prevent regressions. Additional extensions will be provided in a subsequent PR. --------- Co-authored-by: Jason Yellick <jason@enya.ai> |
||
---|---|---|
.. | ||
adapter | ||
app | ||
builder | ||
cli | ||
cmdtest | ||
debug | ||
engineapi | ||
logging | ||
mock | ||
node | ||
rlphacks | ||
rpchelper | ||
services | ||
shards | ||
snapshotsync | ||
stages | ||
testlog | ||
transactions | ||
trie | ||
README.md |
Erigon-API
Erigon-API is a set of tools for building applications containing Erigon node.
Our own binary erigon
is built using it.
Modules
-
cli
- erigon-cli, methods & helpers to run a CLI app with Erigon node. -
node
- represents an Ethereum node, running devp2p and sync and writing state to the database. -
stagedsync
- staged sync algorithm.
Examples
-
erigon
- our binary is using erigon-api with all defaults -
erigoncustom
- a very simple example of adding a custom stage, a custom bucket and a custom command-line parameter -
erigon-examples - a series of examples for Erigon api