erigon-pulse/turbo
Jason Yellick 434ac76f79
Add additional trie proof testing (#7382)
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>
2023-04-26 09:33:46 +07:00
..
adapter eip-4844: NewMessage now expectes maxFeePerDataGas & GetPayloadV3 impl (#7365) 2023-04-23 18:27:05 +01:00
app [Diagnostics] initial support for body downloader visualisation (#7373) 2023-04-23 18:56:37 +01:00
builder blockValue should use gasUsed rather than gasLimit (#6875) 2023-02-14 15:05:27 +00:00
cli cli: use SplitAndTrim instead of strgings.Split(",") (#7369) 2023-04-23 10:54:55 +07:00
cmdtest move all packages from "internal" folder - to simplify users live (#5857) 2022-10-25 09:58:25 +07:00
debug [Diagnostics] initial support for body downloader visualisation (#7373) 2023-04-23 18:56:37 +01:00
engineapi go 1.19 atomics (#7164) 2023-03-23 05:11:28 +00:00
logging [Diagnostics] Simplify logging settings, introduce correct log rotation with lumberjack (#7273) 2023-04-07 21:08:44 +00:00
mock reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
node [Diagnostics] Simplify logging settings, introduce correct log rotation with lumberjack (#7273) 2023-04-07 21:08:44 +00:00
rlphacks Use go:build lines and remove obsolete +build lines (#4175) 2022-05-17 14:46:53 +07:00
rpchelper eip-4844: NewMessage now expectes maxFeePerDataGas & GetPayloadV3 impl (#7365) 2023-04-23 18:27:05 +01:00
services reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
shards [interfaces] lower_snake_case field names (#7293) 2023-04-12 10:35:54 +00:00
snapshotsync Fix nil withdrawals in eth_getBlockByHash (#7332) 2023-04-18 11:23:22 +00:00
stages [Diagnostics] initial support for body downloader visualisation (#7373) 2023-04-23 18:56:37 +01:00
testlog move all packages from "internal" folder - to simplify users live (#5857) 2022-10-25 09:58:25 +07:00
transactions eip-4844: setting header's excess_data_gas, verifiying eip-4844 headers (#7308) 2023-04-16 08:12:40 +00:00
trie Add additional trie proof testing (#7382) 2023-04-26 09:33:46 +07:00
README.md Rename to Erigon (#2018) 2021-05-26 11:35:39 +01:00

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