Skip to content

feat(consume direct, tests): add erigon support, also add test to showcase erigon statetest bug#2951

Merged
marioevz merged 2 commits into
ethereum:forks/amsterdamfrom
felix314159:erigon-statetest-fix
Jun 3, 2026
Merged

feat(consume direct, tests): add erigon support, also add test to showcase erigon statetest bug#2951
marioevz merged 2 commits into
ethereum:forks/amsterdamfrom
felix314159:erigon-statetest-fix

Conversation

@felix314159

@felix314159 felix314159 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🗒️ Description

firstly, this title allows us to run consume direct against erigon (a bit tricky, cuz just from the version output alone you can't differentiate it reliably from geth's evm). but i check for certain strings in the binary so now it is robust.

secondly, differential fuzzing found a bug in erigon's evm (not relevant for mainnet, but annoying during fuzzing):

problem

erigon, when it has to reconstruct and sign a state-test transaction itself (no txbytes in fixture, pre-London fork), skips the pre-execution validity check (only happens pre-London) and executes the transaction instead of rejecting it for insufficient funds. all other clients reject the tx.

note: because txbytes it missing, the clients reconstruct that field from the human-readable tx object. so the bug only happens in this specific code path which is not relevant for mainnet. but it is important to get this fixed to reduce noise during differential fuzzing.

how to reproduce

step 0: get latest erigon main and build the t8n via make all


step 1: fill fixtures using:
uv run fill tests/frontier/validation/test_transaction.py::test_sender_balance_insufficient_state_test --clean -v -s


step 2: artifically remove 'txbytes' keys from fixtures (not possible in execution-specs, but requirement to trigger this bug in erigon's statetest t8n):

find fixtures/state_tests -path '*sender_balance_insufficient*' -name '*.json' -exec sh -c 'jq "del(.. | .txbytes?)" "$1" > "$1.tmp" && mv "$1.tmp" "$1"' _ {} \;

this step is necessary because our framework would never delete those keys, so this standalone command is simpler than adding it as a feature in execution-specs


step 3: run consume direct:
uv run consume direct --bin /home/$USER/Documents/go-ethereum/build/bin/evm --input ./fixtures --sim.limit ".*sender_balance_insufficient_state_test.*"

-> erigon will fail 6/12 tests with: AssertionError: State test failed: expected error "TransactionException.INSUFFICIENT_ACCOUNT_FUNDS", got no error (will fail for all 6 pre-London forks)

-> geth and other clients with pass all 12/12

Cute Animal Picture

Cute Animal Picture

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.50%. Comparing base (abf6ff6) to head (7373050).
⚠️ Report is 6 commits behind head on forks/amsterdam.

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #2951   +/-   ##
================================================
  Coverage            90.49%   90.50%           
================================================
  Files                  535      535           
  Lines                32430    32407   -23     
  Branches              3012     3011    -1     
================================================
- Hits                 29349    29331   -18     
+ Misses                2563     2559    -4     
+ Partials               518      517    -1     
Flag Coverage Δ
unittests 90.50% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marioevz marioevz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@marioevz marioevz merged commit b47f025 into ethereum:forks/amsterdam Jun 3, 2026
24 checks passed
pull Bot pushed a commit to Dustin4444/erigon that referenced this pull request Jun 4, 2026
…ed pre-london (erigontech#21607)

annoying when doing differential fuzzing across client t8n's, but not
relevant for mainnet. more context and reproducible test in
[execution-specs
pr](ethereum/execution-specs#2951)

Co-authored-by: milen <94537774+taratorio@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants