Skip to content

fix(vulture): track the hash_tree_root handler rename - #1150

Merged
tcoratger merged 1 commit into
leanEthereum:mainfrom
lambdaclass:fix/vulture-whitelist-htr-rename
Jun 17, 2026
Merged

fix(vulture): track the hash_tree_root handler rename#1150
tcoratger merged 1 commit into
leanEthereum:mainfrom
lambdaclass:fix/vulture-whitelist-htr-rename

Conversation

@MegaRedHand

@MegaRedHand MegaRedHand commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Problem

The dead-code CI job (just deadcode) fails on main:

src/lean_spec/spec/crypto/merkleization.py:211: unused function '_hash_tree_root_packed_leaf' (60% confidence)
src/lean_spec/spec/crypto/merkleization.py:221: unused function '_hash_tree_root_bytes' (60% confidence)
... (8 handlers total)
error: recipe `deadcode` failed on line 43 with exit code 3

(see https://github.com/leanEthereum/leanSpec/actions/runs/27710866929/job/81971271367)

Cause

The single-dispatch hash_tree_root handlers are registered via @hash_tree_root.register, so their names have no direct call site and vulture cannot see the use. They were whitelisted under the _htr_ prefix.

A later refactor (#1124) renamed them to the spelled-out _hash_tree_root_ prefix but did not update vulture_whitelist.py. The old names no longer exist, so the whitelist entries match nothing and the renamed handlers are reported as unused.

Fix

Rename the eight whitelist entries to match the current handler names. No source code changes.

Verification

  • Before: just deadcode fails with the 8 reports above.
  • After: just deadcode passes.

The single-dispatch hash_tree_root handlers were renamed from the _htr_ prefix
to the spelled-out _hash_tree_root_ prefix, but the whitelist kept the old
names. With the old names no longer defined, vulture reports the renamed
handlers as unused and the dead-code check fails. Update the whitelist entries
to the current names.

@tcoratger tcoratger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tcoratger
tcoratger merged commit f92d8c0 into leanEthereum:main Jun 17, 2026
13 of 14 checks passed
@MegaRedHand
MegaRedHand deleted the fix/vulture-whitelist-htr-rename branch June 17, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants