Skip to content

refactor(tests): enhance EIP-8037 test coverage part 3 - #3485

Merged
marioevz merged 2 commits into
ethereum:forks/amsterdamfrom
LouisTsai-Csie:enhance-8037-pt3
Sep 1, 2026
Merged

refactor(tests): enhance EIP-8037 test coverage part 3#3485
marioevz merged 2 commits into
ethereum:forks/amsterdamfrom
LouisTsai-Csie:enhance-8037-pt3

Conversation

@LouisTsai-Csie

@LouisTsai-Csie LouisTsai-Csie commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

Part 3 of EIP-8037 state-gas test cleanup: test_state_gas_create.py. No spec changes, no new behavior. All edits either pin claimed gas, fix opcode metadata, or clarify docstrings.

  1. Gas assertions: Tests without gas checks now pin Header(gas_used=...) and TransactionReceipt(cumulative_gas_used=...) with named assertions.
  2. Opcode metadata: Fixed missing metadata (init_code_size, new_memory_size, code_deposit_size, account_new, SSTORE values) that silently mis-priced budgets.
  3. Magic numbers: Derived from execution_cost + state_cost (including 63/64 gross-up).
  4. Reservoir funding: Changed gas_limit = cap + X to state_gas_reservoir; test_create_with_reservoir adds exact_fit / one_short.
  5. Post-state asserts: Direct account checks replace maskable SSTORE probes.
  6. Wording & renames: Fixed EIP-2780 description (top-frame, not intrinsic); 3 test renames.

Related Issues or PRs

N/A.

Checklist

  • Ran fast static checks to avoid CI fails, see Code Standards & Verifying Changes: just static
  • PR title has the form <type>(<area>): <title>, where <type> and <area> come from an appropriate C-<type>, respectively A-<area>, label. The title should match the target squash commit message.

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.90%. Comparing base (c4deda5) to head (983c8ed).
⚠️ Report is 15 commits behind head on forks/amsterdam.

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #3485   +/-   ##
================================================
  Coverage            93.90%   93.90%           
================================================
  Files                  624      624           
  Lines                36905    36905           
  Branches              3326     3326           
================================================
  Hits                 34655    34655           
  Misses                1569     1569           
  Partials               681      681           
Flag Coverage Δ
unittests 93.90% <ø> (ø)

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.

@LouisTsai-Csie LouisTsai-Csie added A-tests Area: Consensus tests. C-refactor Category: refactor labels Sep 1, 2026
@LouisTsai-Csie
LouisTsai-Csie marked this pull request as ready for review September 1, 2026 07:29
@LouisTsai-Csie LouisTsai-Csie self-assigned this Sep 1, 2026

@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.

Awesome work on all of these changes, a lot of great detail and verification was added. I added a couple more variants to many of the tests in order to either verify test via an off-by-one variant, or verify both kinds of CREATE opcodes when possible (including the create collision test).

@marioevz
marioevz merged commit 3d3d43b into ethereum:forks/amsterdam Sep 1, 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-refactor Category: refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants