feat(forks): let development forks inherit exact-fork validity - #3289
feat(forks): let development forks inherit exact-fork validity#3289CPerezz wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## projects/binary-trie #3289 +/- ##
========================================================
- Coverage 93.01% 93.01% -0.01%
========================================================
Files 628 628
Lines 37383 37376 -7
Branches 3442 3435 -7
========================================================
- Hits 34773 34766 -7
Misses 1854 1854
Partials 756 756
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Waiting to be properly fixed after #3279 |
Filling against a development fork silently dropped every test pinned with valid_at: the marker resolves to literally the named forks, so BinaryTree, which subclasses Amsterdam and is selected by valid_from, never intersected and the tests were not parametrized — no item, no skip, no signal (ethereum#3260). A fork can now be declared with inherits_exact_fork_validity=True, meaning it keeps its parent's execution semantics and tests pinned to the parent remain meaningful. ValidAt expands each resolved fork (named directly or via an EIP name) onto declaring subclass forks, transitively. BinaryTree declares it, so the Amsterdam-pinned valid_at tests fill under --fork BinaryTree with no test edits, and the next development fork is a one-line declaration. The expansion is opt-in per fork rather than automatic subclass widening, which would silently pull BPO forks into every valid_at("Osaka")-family fill and conflict with the deliberate valid_for_bpo_forks opt-in. Tests pinned to non-ancestor forks and valid_at_transition_to tests remain excluded. Adds the first pytester coverage for plain valid_at, including the inheritance, EIP-name resolution, and non-ancestor exclusion cases.
2e48bf7 to
d7ca47b
Compare
|
Can you clarify what this is meant to be fixing? To me, the It's unclear to me, if we want to be able to test binary tries at something that can only happen in prague for example, because such a scenario is not going to happen. |
|
Do you have some examples of tests that you need to run on the binary fork that are constrained by the |
|
@marioevz concrete case: If you'd still rather not touch |
|
Hmm I still fail to understand why the solution is not to just change specific tests to be
|
|
Sure @kevaundray fine with that. Not really married to anything here. Shall we just close this then? |
|
Yeah unless I'm missing something, I would close and maybe look for tests that we can change from |
Description
Filling against a development fork silently dropped every test pinned with
valid_at: the marker resolves to literally the named forks, soBinaryTree— which subclassesAmsterdamand is selected byvalid_from— never intersected, and the tests were simply not parametrized. This PR makes those tests fill rather than merely reporting them as dropped (an earlier revision of this PR implemented reporting only; it was reverted in favor of inclusion).inherits_exact_fork_validity=True(newBaseFork.__init_subclass__class argument + accessor), meaning it keeps its parent's execution semantics, so tests pinned to the parent remain meaningful for it.ValidAtexpands each fork it resolves — named directly or via an EIP name — onto declaring subclass forks, transitively (expand_forks_with_inherited_validity).BinaryTreedeclares it, so the 14 Amsterdam-pinnedvalid_atusages fill under--fork BinaryTreewith zero test-file edits, and the next development fork is a one-line declaration.The expansion is deliberately opt-in per fork rather than automatic subclass widening (the issue's option 3): unconditional widening would silently pull BPO forks into every
valid_at("Osaka")-family fill, conflicting with the deliberatevalid_for_bpo_forksopt-in. Tests pinned to non-ancestor forks (e.g.valid_at("Prague")) andvalid_at_transition_to(...)tests remain excluded — no transition fork toBinaryTreeexists.Verified end-to-end:
just binary-trie-fork tests/amsterdam/eip7981_increase_access_list_costnow fills 357 fixtures including the previously-droppedvalid_attests (e.g.test_access_list_token_calculation[fork_BinaryTree-...]); before this change the directory filled only itsvalid_fromtests.Tests: adds the first pytester coverage for plain
valid_at(it previously had none — everyvalid_at*case wasvalid_at_transition_to), covering the positive case, parent inheritance, EIP-name resolution onto the inheriting fork, and non-ancestor exclusion.Related Issues or PRs
Fixes #3260.
Checklist
just static<type>(<area>): <title>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.Cute Animal Picture