Replace deprecated elliptic key encoding#4167
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (16)
📝 WalkthroughWalkthroughThe change adds validated secp256k1 public-key marshal/unmarshal helpers and replaces deprecated elliptic serialization across TBTC, Bitcoin, Ethereum, DKG, and related test code. Invalid key decoding now propagates explicit errors in signer and scenario unmarshalling. Changessecp256k1 serialization migration
Estimated code review effort: 4 (Complex) | ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
CI note: I reran the non-required client-integration-test after its initial failure. The rerun failed for the same shared external-infrastructure reason as PR #4165: all 30 failures are fulcrum_tcp cases receiving |
The Marshal guard compared curve names, which assumes every secp256k1 implementation labels itself the way btcec does. Compare the field prime and group order instead so keys held with any secp256k1 implementation marshal correctly, and cover the relabeled-curve case with a test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AxCWMXfUdFygLaGaS2SPhg
Summary
elliptic.Marshalandelliptic.Unmarshalcalls while preserving the 65-byte uncompressed SEC 1 encodingThe affected keys use secp256k1, which is not supported by
crypto/ecdh, so this uses the repository's existing btcec implementation.Testing
go test ./pkg/crypto/secp256k1 ./pkg/bitcoin ./pkg/chain/ethereum ./pkg/protocol/inactivity ./pkg/tbtc ./pkg/tbtc/internal/test -count=1go test ./pkg/tecdsa/dkg -run 'Test(TssFinalize|TssRoundTwo_IncomingMessageMissing|TssRoundTwo_SymmetricKeyMissing)$' -count=1-checks=SA1019 ./...: 0 deprecated elliptic findings; 58 pre-existing generated-protobuf findings remainA full local
pkg/tecdsa/dkgrun hit the two timing-sensitive round-one deadline tests listed above under concurrent load; both passed when rerun in isolation with the changed finalization path.Fixes #3832
Summary by CodeRabbit
New Features
Bug Fixes
Tests