Skip to content

refactor(quic/tls): drop KEY_TYPE_SECP256K1 duplicate, use KeyType.SECP256K1#762

Merged
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:worktree-refactor+drop-duplicate-secp256k1-const
May 23, 2026
Merged

refactor(quic/tls): drop KEY_TYPE_SECP256K1 duplicate, use KeyType.SECP256K1#762
tcoratger merged 1 commit into
leanEthereum:mainfrom
tcoratger:worktree-refactor+drop-duplicate-secp256k1-const

Conversation

@tcoratger
Copy link
Copy Markdown
Collaborator

Summary

`KEY_TYPE_SECP256K1: Final = 2` in `subspecs/networking/transport/quic/tls.py` duplicated `KeyType.SECP256K1` from `subspecs/networking/transport/peer_id.py` (the libp2p crypto.proto KeyType enum). Both encode the same libp2p protobuf key-type code; carrying two names for the same value risks drift if the enum gains entries.

Drops the constant and switches the single production caller (in `_encode_asn1_signed_key`) and three test sites to use `KeyType.SECP256K1` directly.

Test plan

  • `uv run --group lint ruff check` on changed files — clean
  • `uv run --group lint ruff format --check` — clean
  • `uv run --group lint ty check` on changed files — clean
  • `uv run pytest tests/lean_spec/subspecs/networking/transport/quic/test_tls.py` — 32 passed

🤖 Generated with Claude Code

…CP256K1

The KEY_TYPE_SECP256K1 = 2 constant in quic/tls.py duplicated
KeyType.SECP256K1 from transport/peer_id.py. Both encode the same
libp2p protobuf key-type code; carrying two names for the same value
risks drift if the enum gains entries.

Drops the constant and switches the single production caller and three
test sites to the enum.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tcoratger tcoratger merged commit 361e3d6 into leanEthereum:main May 23, 2026
13 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