Skip to content
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

[WIP] feat(forks): refactor ethereum_test_forks and add eip definitions #1191

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

spencer-tb
Copy link
Collaborator

@spencer-tb spencer-tb commented Feb 7, 2025

πŸ—’οΈ Description

WIP. The start of the refactor of ethereum_test_forks with eip definitions for each fork.

Tree of the directory:

src/ethereum_test_forks/
β”œβ”€β”€ __init__.py
β”œβ”€β”€ base_decorators.py
β”œβ”€β”€ base_eip.py
β”œβ”€β”€ base_fork.py
β”œβ”€β”€ compose_fork.py
β”œβ”€β”€ forks
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ arrow_glacier
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   └── fork.py
...
β”‚   β”œβ”€β”€ prague
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ contracts
β”‚   β”‚   β”‚   β”œβ”€β”€ consolidation_request.bin
β”‚   β”‚   β”‚   β”œβ”€β”€ deposit_contract.bin
β”‚   β”‚   β”‚   β”œβ”€β”€ history_contract.bin
β”‚   β”‚   β”‚   └── withdrawal_request.bin
β”‚   β”‚   β”œβ”€β”€ eips
β”‚   β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”‚   β”œβ”€β”€ eip2537.py
...
β”‚   β”‚   β”‚   β”œβ”€β”€ eip7702.py
β”‚   β”‚   β”‚   └── eip7840.py
β”‚   β”‚   └── fork.py
β”‚   β”œβ”€β”€ shanghai
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ eips
β”‚   β”‚   β”‚   └── __init__.py
β”‚   β”‚   └── fork.py
β”‚   └── transition.py
β”œβ”€β”€ gas_costs.py
β”œβ”€β”€ helpers.py
β”œβ”€β”€ py.typed
β”œβ”€β”€ tests
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── test_forks.py
└── transition_base_fork.py

compose_fork

To account for eip specific definitions a fork composition decorator is added, that allows eip specific function that are copies to those in base_fork.py. These allow us to override these functions on a per eip basis per fork.

TODO: cnt.

πŸ”— Related Issues

#1164

βœ… Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: All converted JSON/YML tests from ethereum/tests have been added to converted-ethereum-tests.txt.
  • Tests: A PR with removal of converted JSON/YML tests from ethereum/tests have been opened.
  • 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.

@spencer-tb spencer-tb force-pushed the feat/refactor-ethereum-test-forks branch from af577cd to 233c697 Compare February 26, 2025 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant