refactor(node): make fork required in _try_load_store_from_database#987
Open
tcoratger wants to merge 2 commits into
Open
refactor(node): make fork required in _try_load_store_from_database#987tcoratger wants to merge 2 commits into
tcoratger wants to merge 2 commits into
Conversation
The store loader always receives a concrete fork from its only production caller, which asserts the fork is an LstarSpec before calling. The optional, defaulted fork parameter and its None branch were dead: nothing ever fell back to the base Store class. Make fork a required positional parameter, drop the None default, and remove the None-handling branch so the store class always comes from the fork. Update all test callers to pass the fork explicitly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts: # tests/node/test_node.py
c96aa6a to
835a595
Compare
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.
Summary
The forkchoice store loader on the node took an optional, defaulted
forkparameter and branched onfork is not Noneto choose between the fork's store class and the baseStore. That branch was dead code: the only production caller already narrows the configured fork to a concreteLstarSpec(via an assertion) and always passes it, so the base-Storefallback was never reached.This makes
forka required parameter:ForkProtocol | None = Nonedefault; the parameter is now a non-optionalForkProtocol, positioned right aftervalidator_indexand before the still-defaultedgenesis_time/time_fn.Argsto mirror the new signature.No backward-compatibility shims; all call sites updated directly.
Testing
uv run pytest tests/node/test_node.py(42 passed)just check(lint, format, ty type check, codespell, mdformat) all pass🤖 Generated with Claude Code