Skip to content

refactor(validator): narrow _sign_with_key return to Signature#980

Merged
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:audit/arch-15-narrow-sign-with-key-return
Jun 12, 2026
Merged

refactor(validator): narrow _sign_with_key return to Signature#980
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:audit/arch-15-narrow-sign-with-key-return

Conversation

@tcoratger

Copy link
Copy Markdown
Collaborator

Summary

The signing helper in the validator service returned a tuple[ValidatorEntry, Signature], but the updated entry was never used by any caller. Both call sites discarded it with _,, and the registry is already updated in place inside the helper before it returns. The wider return type was dead surface area.

This narrows the return to Signature:

  • Drop the unused tuple element from the helper; return the signature directly.
  • Update both call sites to bind the signature without the discard placeholder.
  • Update the docstring Returns: section accordingly.
  • Simplify the unit test that previously unpacked the tuple — registry persistence is already covered by a dedicated test.

The type narrowing is validated by ty; just check passes clean.

Testing

  • uv run pytest tests/node/validator/test_service.py -q — 51 passed.
  • just check — lint, format, typecheck, spell, mdformat all pass.

🤖 Generated with Claude Code

The updated validator entry returned alongside the signature was never
consumed: both call sites discarded it, and the registry is already
updated in place before returning. Drop the dead tuple element and return
the signature directly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tcoratger tcoratger merged commit ae5ae0c into leanEthereum:main Jun 12, 2026
14 checks passed
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.

1 participant