Skip to content

feat(tests): add precompile as block coinbase coverage - #3462

Merged
spencer-tb merged 2 commits into
ethereum:forks/amsterdamfrom
shubham5080:test/precompile-coinbase
Sep 2, 2026
Merged

spencer-tb merged 2 commits into
ethereum:forks/amsterdamfrom
shubham5080:test/precompile-coinbase

Conversation

@shubham5080

@shubham5080 shubham5080 commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a Frontier blockchain test that uses each enabled precompile as the block coinbase / fee recipient and then calls that address.

This covers issue #1669: setting an enabled precompile as coinbase must not break the state transition. Pattern matches tests/shanghai/eip4895_withdrawals/test_withdrawals.py::test_withdrawing_to_precompiles (@pytest.mark.with_all_precompiles, two blocks, empty post).

Filled locally:

uv run fill tests/frontier/precompiles/test_precompile_coinbase.py --from Frontier --until Amsterdam

221 passed.

Related Issues or PRs

Fixes #1669.

Checklist

  • Ran fast static checks to avoid CI fails: just static
  • PR title has the form <type>(<area>): <title>

Cute Animal Picture

panda

@shubham5080
shubham5080 marked this pull request as ready for review August 28, 2026 03:49
@shubham5080
shubham5080 force-pushed the test/precompile-coinbase branch 2 times, most recently from 60aaa92 to 5183f8b Compare August 30, 2026 19:10

@LouisTsai-Csie LouisTsai-Csie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the contribution! I've left some comments. Could you move this test to test_precompiles.py?

Comment thread tests/frontier/precompiles/test_precompile_coinbase.py Outdated
Comment thread tests/frontier/precompiles/test_precompile_coinbase.py Outdated
@danceratopz danceratopz added the A-tests Area: Consensus tests. label Aug 31, 2026
@danceratopz danceratopz changed the title test(tests): add precompile as block coinbase coverage feat(tests): add precompile as block coinbase coverage Aug 31, 2026
@danceratopz danceratopz added the C-feat Category: an improvement or new feature label Aug 31, 2026
@codecov

codecov Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.01%. Comparing base (aee3eb2) to head (ac4835c).
⚠️ Report is 1 commits behind head on forks/amsterdam.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           forks/amsterdam    #3462      +/-   ##
===================================================
+ Coverage            93.90%   94.01%   +0.10%     
===================================================
  Files                  624      624              
  Lines                36905    36905              
  Branches              3326     3326              
===================================================
+ Hits                 34655    34695      +40     
+ Misses                1569     1533      -36     
+ Partials               681      677       -4     
Flag Coverage Δ
unittests 94.01% <ø> (+0.10%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

Cover enabled precompile addresses used as coinbase/fee recipient so
the state transition still succeeds, including a follow-up call to
that precompile. Fixes ethereum#1669.
Move the test into test_precompiles.py, tighten the docstring to
state-transition only, and drop the hardcoded gas_limit.
@shubham5080
shubham5080 force-pushed the test/precompile-coinbase branch from 5183f8b to ac4835c Compare August 31, 2026 07:59
@shubham5080

Copy link
Copy Markdown
Contributor Author

@LouisTsai-Csie
Addressed review feedback:

  • moved test into test_precompiles.py
  • docstring is state-transition only
  • removed hardcoded gas_limit

@spencer-tb
spencer-tb merged commit a7d4186 into ethereum:forks/amsterdam Sep 2, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tests Area: Consensus tests. C-feat Category: an improvement or new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New test: Precompile as block coinbase/fee recipient

4 participants