refactor: remove V2Secp256k1 variant#3115
Conversation
3d70e72 to
9652a4b
Compare
9652a4b to
3f0649d
Compare
|
PR title type suggestion: This PR removes a variant from the codebase, which is code restructuring/cleanup rather than adding new functionality. The type prefix should probably be |
Code ReviewCRITICAL: Missing deserialization compat for KeyshareData V2Secp256k1 File: crates/node/src/keyshare.rs The V2Secp256k1 variant was removed from KeyshareData, which derives Serialize, Deserialize. Existing MPC nodes that have a DamgardEtAl (robust ECDSA) domain will have keyshares persisted in both permanent storage (JSON) and temporary storage with the serde tag V2Secp256k1. After upgrading to this binary, deserializing those keyshares will fail because the variant no longer exists. This affects permanent key storage (PermanentKeyshareData loaded via serde_json from_slice) and temporary key storage (individual keyshare files). Suggested fix: Add a serde(alias = V2Secp256k1) attribute to the Secp256k1 variant so existing persisted V2Secp256k1 data deserializes into Secp256k1. This works because both variants stored the same inner type (ecdsa KeygenOutput), making the alias a safe lossless migration. Without this, any node with a DamgardEtAl domain will fail to start after upgrade. One merge-blocking issue: the missing serde deserialization compat for KeyshareData V2Secp256k1 will break all existing nodes with robust ECDSA domains on upgrade. |
|
@claude review please check again, we know no node in testnet or devnet has the |
Code ReviewReviewed the full diff. The V2Secp256k1 removal is well-handled: contract Borsh migration uses One item worth noting (not blocking given the author's confirmation that no deployed node has V2Secp256k1 keyshares): KeyshareData serde compat (acknowledged non-issue): The No critical issues found. The changes are consistent and well-structured:
✅ Approved |
kevindeforth
left a comment
There was a problem hiding this comment.
compared it against #2442 (comment)
These refactors are pretty hard to follow and considering #2970 is still open, I just hope we don't miss anything.
Indeed I think I should tackle #2970 asap, I was thinking on it yesterday :) Thanks for the reminder! |
…aration-in-the-smart-contract
|
@claude review (I want to see if we get better reviews now) |
|
@claude review (lets see how the new model compares to the old one) |
Pull request overviewThis PR removes the Changes:
Reviewed changesPer-file summary
FindingsNo blocking issues found. The serde-compat concern for persisted Non-blocking (suggestions / follow-ups):
✅ Approved |
anodar
left a comment
There was a problem hiding this comment.
Looks like docs/foreign-chain-transactions.md and docs/design/domain-separation.md still mention V2Secp256k1.
for the latter it makes sense to keep it, for the former we need to check, but given that it is anyway not used there we can solve that later when that doc is updated after the latest design changes |
Closes #2442
The
curvewill be removed fromDomainConfigin a follow-up #3113