Skip to content

bug(test-benchmark): update code padding in fixed opcode count mode#1983

Merged
spencer-tb merged 1 commit intoethereum:forks/amsterdamfrom
LouisTsai-Csie:fix-padding-code
Jan 7, 2026
Merged

bug(test-benchmark): update code padding in fixed opcode count mode#1983
spencer-tb merged 1 commit intoethereum:forks/amsterdamfrom
LouisTsai-Csie:fix-padding-code

Conversation

@LouisTsai-Csie
Copy link
Collaborator

🗒️ Description

Summary

  • Fix benchmark tests hitting INVALID opcode when using --fixed-opcode-count
  • Add STOP instruction before padding in generate_repeated_code to ensure clean termination

Problem

  • When fixed_opcode_count is set, the generated code was:
  • setup + JUMPDEST + attack_block * N + INVALID padding

After executing all iterations, execution fell through into INVALID padding.

Solution

  • Insert STOP before padding:
  • setup + JUMPDEST + attack_block * N + STOP + INVALID padding

🔗 Related Issues or PRs

N/A.

✅ Checklist

  • All: Ran fast tox checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    uvx tox -e 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 adding an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

Cute Animal Picture

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

@LouisTsai-Csie LouisTsai-Csie marked this pull request as ready for review January 7, 2026 12:48
Copy link
Contributor

@spencer-tb spencer-tb left a comment

Choose a reason for hiding this comment

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

LGTM!

@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.33%. Comparing base (685eba7) to head (b76e4b8).
⚠️ Report is 4 commits behind head on forks/amsterdam.

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #1983   +/-   ##
================================================
  Coverage            86.33%   86.33%           
================================================
  Files                  538      538           
  Lines                34557    34557           
  Branches              3222     3222           
================================================
  Hits                 29835    29835           
  Misses                4148     4148           
  Partials               574      574           
Flag Coverage Δ
unittests 86.33% <ø> (ø)

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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@spencer-tb spencer-tb changed the title fix(test-benchmark): update code padding in fixed opcode count mode bug(test-benchmark): update code padding in fixed opcode count mode Jan 7, 2026
@spencer-tb spencer-tb added C-bug Category: this is a bug, deviation, or other problem A-test-benchmark Area: execution_testing.benchmark and tests/benchmark labels Jan 7, 2026
@spencer-tb spencer-tb merged commit 850a26e into ethereum:forks/amsterdam Jan 7, 2026
14 checks passed
CPerezz pushed a commit to CPerezz/execution-specs that referenced this pull request Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-test-benchmark Area: execution_testing.benchmark and tests/benchmark 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