-
Notifications
You must be signed in to change notification settings - Fork 511
feat(spec,tests): Implement EIP-8282 #2990
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 18 commits into
ethereum:eips/amsterdam/eip-8282
from
marioevz:eips/amsterdam/eip-8282
Jun 30, 2026
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e632e9a
feat(specs): Implement EIP-8282
marioevz 0af20af
feat(test-forks): Implement EIP-8282 framework changes
marioevz fd1024a
feat(tests): Implement EIP-8282 tests
marioevz 1626b71
feat(tests): Add EIP-8282 to EIP-7685 tests
marioevz 2f4115a
fix(test-forks): Update EIP-8282 deposit contract to 537b9c1
marioevz efa416d
fix(tests): Update EIP-8282 builder deposit contract target/max to 32β¦
marioevz f945ac2
fix(tests): Failing tests after update
marioevz 88c532c
refactor(test-forks): Introduce `minimum_block_gas_limit`
marioevz 328f86b
refactor(test-forks): Update EIP-8282 `empty_block_bal_item_count`
marioevz f3aa7b7
refactor(test-forks): Use pkgutil to load contract binaries
marioevz 8929767
refactor(test-forks): Use pkgutil to load EIP-8282 contract binaries
marioevz 49baec2
refactor(test-forks): Remove pre_allocation_blockchain type: ignore cβ¦
marioevz 0205991
refactor(test-forks): Remove EIP-8282 pre_allocation_blockchain type:β¦
marioevz 4b13b2a
Update tests/amsterdam/eip8282_builder_execution_requests/__init__.py
marioevz 3c12670
Update tests/amsterdam/eip8282_builder_execution_requests/spec.py
marioevz a3dbfd7
chore(tests): Remove `dataclass` from `Spec` class EIP-8282
marioevz 5670288
chore(tests): Make test behavior more explicit
marioevz 0c4dac3
chore(spec,tests): set EIP-8282 builder addresses for glamsterdam-devβ¦
spencer-tb 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| """Helper to load predeploy contract bytecode bundled as package data.""" | ||
|
|
||
| import pkgutil | ||
|
|
||
|
|
||
| def load_contract_bytecode(module_name: str, filename: str) -> bytes: | ||
| """ | ||
| Load predeploy contract bytecode bundled as package data. | ||
|
|
||
| `module_name` is the importing module's `__name__`; the bytecode is read | ||
| from a `contracts/<filename>` resource located alongside that module. | ||
| """ | ||
| resource = f"contracts/{filename}" | ||
| bytecode = pkgutil.get_data(module_name, resource) | ||
| if bytecode is None: | ||
| raise FileNotFoundError( | ||
| f"Unable to read bytecode `{resource}` from `{module_name}`" | ||
| ) | ||
| return bytecode |
Binary file added
BIN
+568 Bytes
...ng/src/execution_testing/forks/forks/eips/amsterdam/contracts/builder_deposit_request.bin
Binary file not shown.
Binary file added
BIN
+396 Bytes
...sting/src/execution_testing/forks/forks/eips/amsterdam/contracts/builder_exit_request.bin
Binary file not shown.
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
76 changes: 76 additions & 0 deletions
76
packages/testing/src/execution_testing/forks/forks/eips/amsterdam/eip_8282.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,76 @@ | ||
| """ | ||
| EIP-8282: Builder Execution Requests. | ||
|
|
||
| Predeploy builder deposit and exit request contracts for EIP-7732 builders on | ||
| the EIP-7685 request bus. | ||
|
|
||
| https://eips.ethereum.org/EIPS/eip-8282 | ||
| """ | ||
|
|
||
| from typing import List, Mapping | ||
|
|
||
| from execution_testing.base_types import Address | ||
|
|
||
| from ....base_fork import BaseFork | ||
| from ....bytecode import load_contract_bytecode | ||
|
|
||
| BUILDER_DEPOSIT_REQUEST_PREDEPLOY_ADDRESS = ( | ||
| 0x0000884D2AA32EAA155F59A2F24EFA73D9008282 | ||
| ) | ||
| BUILDER_DEPOSIT_REQUEST_PREDEPLOY_BYTECODE = load_contract_bytecode( | ||
| __name__, "builder_deposit_request.bin" | ||
| ) | ||
|
|
||
| BUILDER_EXIT_REQUEST_PREDEPLOY_ADDRESS = ( | ||
| 0x000014574A74C805590AFF9499FC7A690F008282 | ||
| ) | ||
| BUILDER_EXIT_REQUEST_PREDEPLOY_BYTECODE = load_contract_bytecode( | ||
| __name__, "builder_exit_request.bin" | ||
| ) | ||
|
|
||
|
|
||
| class EIP8282(BaseFork): | ||
| """EIP-8282 class.""" | ||
|
|
||
| @classmethod | ||
| def max_request_type(cls) -> int: | ||
| """ | ||
| Two request types are introduced: builder deposit requests (0x03) | ||
| and builder exit requests (0x04). | ||
| """ | ||
| return super(EIP8282, cls).max_request_type() + 2 | ||
|
|
||
| @classmethod | ||
| def empty_block_bal_item_count(cls) -> int: | ||
| """Add block-level access list elements for an empty block.""" | ||
| # Builder contracts: 2 addresses + 8 reads = 10 | ||
| return super(EIP8282, cls).empty_block_bal_item_count() + 10 | ||
|
|
||
| @classmethod | ||
| def system_contracts(cls) -> List[Address]: | ||
| """Add the builder deposit and exit request predeploy contracts.""" | ||
| return [ | ||
| Address( | ||
| BUILDER_DEPOSIT_REQUEST_PREDEPLOY_ADDRESS, | ||
| label="BUILDER_DEPOSIT_REQUEST_PREDEPLOY_ADDRESS", | ||
| ), | ||
| Address( | ||
| BUILDER_EXIT_REQUEST_PREDEPLOY_ADDRESS, | ||
| label="BUILDER_EXIT_REQUEST_PREDEPLOY_ADDRESS", | ||
| ), | ||
| ] + super(EIP8282, cls).system_contracts() | ||
|
|
||
| @classmethod | ||
| def pre_allocation_blockchain(cls) -> Mapping: | ||
| """Pre-allocate the builder deposit and exit request contracts.""" | ||
| return { | ||
| BUILDER_DEPOSIT_REQUEST_PREDEPLOY_ADDRESS: { | ||
| "nonce": 1, | ||
| "code": BUILDER_DEPOSIT_REQUEST_PREDEPLOY_BYTECODE, | ||
| }, | ||
| BUILDER_EXIT_REQUEST_PREDEPLOY_ADDRESS: { | ||
| "nonce": 1, | ||
| "code": BUILDER_EXIT_REQUEST_PREDEPLOY_BYTECODE, | ||
| }, | ||
| **super(EIP8282, cls).pre_allocation_blockchain(), | ||
| } |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could we change it to GasCosts.LIMIT_MINIMUM