Skip to content

fix(tests) fix ported quadratic complexity tests#2784

Open
danceratopz wants to merge 2 commits intoethereum:forks/amsterdamfrom
danceratopz:fix-ported-quadratic-complexity
Open

fix(tests) fix ported quadratic complexity tests#2784
danceratopz wants to merge 2 commits intoethereum:forks/amsterdamfrom
danceratopz:fix-ported-quadratic-complexity

Conversation

@danceratopz
Copy link
Copy Markdown
Member

🗒️ Description

These tests were failing to fill; they are marked as slow, so not tested in CI.

This was discovered while trying to release from https://github.com/ethereum/execution-specs/tree/devnets/snobal/5 - cherry-picked from fd56c5d

🔗 Related Issues or PRs

N/A.

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    just static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).

Cute Animal Picture

image

Three of these tests embed the runtime caller address directly in
their target contract's bytecode. The expected post hashed in a
literal hex string of the bytecode that hardcoded the pre-dynamic
EOA address (e.g. \`0xd9b97c712eb…\`), so once \`pre.fund_eoa()\`
started picking addresses dynamically the deployed code no longer
matched the expected hex. Hoist the bytecode into a \`target_code\`
variable used both at deploy time and as the expected \`code\`, so
the address baked in via \`Op.CALL(address=addr, …)\` is whatever
\`addr\` resolves to at fill time:

- \`test_call50000\`
- \`test_callcode50000\`
- \`test_call20_kbytes_contract50_2\`

\`test_quadratic_complexity_solidity_call_data_copy\` had a
different drift: its post asserted empty storage on \`contract_0\`,
but the success path (\`g=1\`, 250M gas) commits \`SSTORE(0, 50000)\`
before entering the loop. Make the expected storage \`g\`-conditional
so \`g=0\` (OOG) keeps an empty \`storage\` and \`g=1\` records slot 0.
@danceratopz danceratopz added C-bug Category: this is a bug, deviation, or other problem A-tests Area: Consensus tests. labels Apr 30, 2026
@danceratopz danceratopz requested a review from leolara April 30, 2026 07:42
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.17%. Comparing base (bf9dbb4) to head (cba5a90).

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #2784   +/-   ##
================================================
  Coverage            88.17%   88.17%           
================================================
  Files                  577      577           
  Lines                35659    35659           
  Branches              3490     3490           
================================================
  Hits                 31442    31442           
  Misses                3654     3654           
  Partials               563      563           
Flag Coverage Δ
unittests 88.17% <ø> (ø)

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.

@leolara
Copy link
Copy Markdown
Member

leolara commented Apr 30, 2026

@danceratopz we need to add the @manually-enhanced in the docstring at the top level of the file, to avoid the script overwritting these fixes.

I am also going to apply these changes to #2783

@leolara
Copy link
Copy Markdown
Member

leolara commented Apr 30, 2026

Like here:

@manually-enhanced: Do not overwrite. This test has been manually reviewed and

leolara added a commit to leolara/execution-specs that referenced this pull request Apr 30, 2026
…ly-enhanced

The four post-state corrections cherry-picked from PR ethereum#2784 should not be
overwritten the next time `tests/ported_static/` is regenerated by
`scripts/filler_to_python`. Add the `@manually-enhanced` marker to each
docstring so the regenerator skips them.
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-bug Category: this is a bug, deviation, or other problem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants