refactor(forks): pass fork overrides to clone#2769
Open
JackCC703 wants to merge 3 commits into
Open
Conversation
…ides-clone # Conflicts: # src/ethereum_spec_tools/evm_tools/t8n/__init__.py
SamWilsn
reviewed
May 13, 2026
| default_value = _override_defaults(template)[field] | ||
| changed_value = type(default_value)(int(default_value) + 1) | ||
| cloned = DummyTemporaryFork() | ||
| seen: dict[str, Any] = {} |
Contributor
There was a problem hiding this comment.
Now that Hardfork.clone has a fixed parameter list (just template and overrides), I don't think we need the dict of kwargs anymore? Could simplify the test a bit.
| assert not (fork_dir / "trie.py").exists() | ||
|
|
||
|
|
||
| def test_hardfork_clone_applies_overrides( |
Contributor
There was a problem hiding this comment.
I feel like this is covered by test_end_to_end, but I could be convinced otherwise.
Comment on lines
+189
to
+190
| finally: | ||
| fork.__exit__(None, None, None) |
Contributor
There was a problem hiding this comment.
Why use this construction instead of:
with Hardfork.clone("osaka", overrides=overrides) as fork:
...?
Contributor
Author
There was a problem hiding this comment.
This test was removed per your second comment since it overlaps with test_end_to_end.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Move the fork override dataclass from
ethereum_spec_tools.evm_tools.t8nintoethereum_spec_tools.forks, and pass it directly intoHardfork.clone.This keeps the existing
ForkCache.get(...)call surface unchanged while reducing the longHardfork.clone(...)parameter list.🔗 Related Issues or PRs
Follow-up to #2738.
✅ Checklist
just staticjustwas not installed locally, so I ran the equivalent commands from thestaticrecipe manually.type(scope):.mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_frommarker.Cute Animal Picture