Skip to content

fix(tests/benchmark): update jump seq for valid dest #1710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 18, 2025

Conversation

LouisTsai-Csie
Copy link
Collaborator

@LouisTsai-Csie LouisTsai-Csie commented Jun 3, 2025

🗒️ Description

There is an issue with the original test case: the jump target is not a valid JUMPDEST operation.
More details could be found in the discussion.

The updated version precomputes valid jump destinations to improve the density of JUMP operations.

The repeated pattern is structured as follows:

0x00 PUSH2 DEST
0x03 JUMP
0x04 JUMPDEST
...

The first JUMPDEST is at offset 0x04. Since each pattern occupies 5 bytes, subsequent JUMPDEST locations can be calculated as 4 + 5 * i, where i is the pattern index. The total code size must remain within the allowed limit.

🔗 Related Issues

✅ Checklist

  • All: Set appropriate labels for the changes.
  • All: Added an entry to CHANGELOG.md.
  • Tests: Included the type and version of evm t8n tool used to locally execute test cases: e.g., ref with commit hash or geth 1.13.1-stable-3f40e65.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

@LouisTsai-Csie LouisTsai-Csie self-assigned this Jun 16, 2025
@LouisTsai-Csie LouisTsai-Csie marked this pull request as ready for review June 16, 2025 09:11
@LouisTsai-Csie LouisTsai-Csie force-pushed the fix/invalid-jump-dest branch 2 times, most recently from 21bb88d to 09f9ca4 Compare June 16, 2025 12:29
Copy link
Member

@jochem-brouwer jochem-brouwer left a comment

Choose a reason for hiding this comment

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

This looks good to me, but CI is failing 😅

@LouisTsai-Csie
Copy link
Collaborator Author

I've tried rebased for several times, but i will give it a try again.

@LouisTsai-Csie LouisTsai-Csie force-pushed the fix/invalid-jump-dest branch from 8e1c300 to c2d8f01 Compare June 17, 2025 08:41
@marioevz marioevz requested a review from jochem-brouwer June 17, 2025 14:40
@LouisTsai-Csie
Copy link
Collaborator Author

Thanks @marioevz for explanation, we've checked the reason for the failing CI.

There are two issues in the evmone coverage.

0 :         state.status = EVMC_BAD_JUMP_DESTINATION;753               
0 :         return nullptr;

This originates from the previous test case, since the code sequence will jump to an invalid destination.

0 : inline code_iterator pc(StackTop stack, ExecutionState& state, code_iterator pos) noexcept: {
0 :     stack.push(static_cast<uint64_t>(pos - state.analysis.baseline->executable_code().data()));
0 :     return pos + 1;

This also originates from the previous test, it uses PC opcode but the fixed one does not use this operation.

Since this PR intends to fix the issue in the JUMP operation, these CI error is normal here

Screenshot 2025-06-17 at 4 33 21 PM

Copy link
Member

@jochem-brouwer jochem-brouwer left a comment

Choose a reason for hiding this comment

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

LGTM. Not sure why CI fails.

@marioevz marioevz merged commit 4533396 into ethereum:main Jun 18, 2025
14 of 15 checks passed
@spencer-tb spencer-tb changed the title fix(tests/zkevm): update jump seq for valid dest fix(tests/benchmark): update jump seq for valid dest Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants