feat: allow dynamic evm fork definitions via pytest plugin #753
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.
🗒️ Description
This adds a new
fork_registry
and achain_selector
plugin (although not strictly required) that enables a pytest plugin (there's temporary and very simple example in./src/pytest_plugins/optimism.py
) to dynamically register fork class definitions. This allows evm implementations that deviate from Ethereum mainnet to use EEST.Example
Register the optimism plugin (
--chain
flag likely superfluous) and executetest_withdrawing_to_precompiles
which uses thewith_all_precompiles
test parametrizer:to additionally parametrize the test with the
secp256r1
precompile that's deployed at0x100
:The main magic is using the correct fork class definitions via
forks
plugin.TODO
This is a very rough POC and hasn't been properly tested. The
forks
plugin is probably very broken.🔗 Related Issues
✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.