-
Notifications
You must be signed in to change notification settings - Fork 456
feat(spec-specs, spec-tests): add EIP-7843 SLOTNUM opcode #2853
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
marioevz
merged 8 commits into
ethereum:forks/amsterdam
from
kclowes:eips/amsterdam/eip-7843
May 14, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
50ec4af
feat(src): Initial EIP-7843 (SLOTNUM) Implementation (#2007)
felix314159 e2e5eae
fix(tests): minor fixes and updates for eip7843 (#2057)
fselmo 7e20de8
execution-api 7843 pr 731 implemented (#2101)
felix314159 35c3351
src(fix): framework bug fix for slotnum (#2108)
felix314159 cf7e5e9
refactor(tests): Condition EIP-7843 tests to EIP inclusion
marioevz 409d33f
fix(specs): align EIP-7843 SLOTNUM gas references with renamed constants
spencer-tb 525ecde
Remove stray header_bal_hash_required checks
kclowes 08a7dac
Remove unneeded eip7843 spec.py
kclowes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
packages/testing/src/execution_testing/forks/forks/eips/amsterdam/eip_7843.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| """ | ||
| EIP-7843: SLOTNUM opcode. | ||
|
|
||
| Opcode to get the current slot number. | ||
|
|
||
| https://eips.ethereum.org/EIPS/eip-7843 | ||
| """ | ||
|
|
||
| from typing import Callable, Dict, List | ||
|
|
||
| from execution_testing.vm import ( | ||
| OpcodeBase, | ||
| Opcodes, | ||
| ) | ||
|
|
||
| from ....base_fork import BaseFork | ||
|
|
||
|
|
||
| class EIP7843( | ||
| BaseFork, | ||
| # Engine API method version bumps | ||
| # New field `slotNumber` in ExecutionPayload | ||
| engine_new_payload_version_bump=True, | ||
| engine_get_payload_version_bump=True, | ||
| engine_forkchoice_updated_version_bump=True, | ||
| ): | ||
| """EIP-7843 class.""" | ||
|
|
||
| @classmethod | ||
| def header_slot_number_required(cls) -> bool: | ||
| """Slot number in header required.""" | ||
| return True | ||
|
|
||
| @classmethod | ||
| def engine_payload_attribute_slot_number(cls) -> bool: | ||
| """Payload attributes include the slot number.""" | ||
| return True | ||
|
|
||
| @classmethod | ||
| def opcode_gas_map( | ||
| cls, | ||
| ) -> Dict[OpcodeBase, int | Callable[[OpcodeBase], int]]: | ||
| """Add SLOTNUM opcode gas cost.""" | ||
| gas_costs = cls.gas_costs() | ||
| base_map = super(EIP7843, cls).opcode_gas_map() | ||
| return { | ||
| **base_map, | ||
| Opcodes.SLOTNUM: gas_costs.BASE, | ||
| } | ||
|
|
||
| @classmethod | ||
| def valid_opcodes(cls) -> List[Opcodes]: | ||
| """Add SLOTNUM opcode.""" | ||
| return [Opcodes.SLOTNUM] + super(EIP7843, cls).valid_opcodes() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.