fix: resolve vulture dead-code findings on main#999
Merged
tcoratger merged 1 commit intoJun 13, 2026
Conversation
Rename four unused mock self parameters to _self (the patched method still receives the instance positionally) and whitelist symbols vulture cannot see are live: the pydantic Signature and genesis-config validators invoked via decorators, the route access-tier flag set at every call site, and the slotted-class test attribute assignment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dc24b56 to
7717544
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
Dead code detectionCI job (vulture, viajust deadcode) is failing onmain. Several recently-merged PRs introduced symbols vulture reports, because they were verified withjust check(which does not run vulture) rather thanjust deadcode. This PR makes the dead-code job green again.Findings and how each is handled
Genuinely unused — fixed in code:
self_inner(×4, 100% confidence) intests/node/validator/test_service.py: mock functions replacing_maybe_produce_block/_produce_attestationsviapatch.objectreceive the instance positionally but never use it. Renamed to_self, the idiomatic intentionally-unused marker vulture respects. The parameter cannot be dropped (the patched method is still called with the instance first).Live code vulture cannot see — added to
vulture_whitelist.py(its stated purpose: name the indirectly-used symbols):_check_list_lengths(spec/crypto/xmss/containers.py): a@model_validatorinvoked by pydantic. Removing it would disable the XMSS signature length validation._reject_oversized_validator_set(node/genesis/config.py): a@field_validatorinvoked by pydantic. Removing it would disable the genesis validator-count bound.is_admin(node/api/routes.py): access-tier flag set on every route entry to document the route; not yet read by the registration path.extra_field(tests/node/networking/test_types.py): the attribute assignment is the action under test (slotted classes must reject new attributes), never read back.Not addressed (out of scope): the
packages/testing/build/lib/*hits are a gitignored local build artifact that CI never checks out.Verification
just deadcodeexits 0 against a tree without the localbuild/artifact (mirroring CI's fresh checkout).just checkis fully green.uv run pytest tests/node/validator/test_service.py— 51 passed.🤖 Generated with Claude Code