Skip to content

fix(sdk-lib-mpc): handle WaitMsg4 round in _deserializeState#8467

Merged
zahin-mohammad merged 1 commit intomasterfrom
zahinmohammad/wal-384-security-_deserializestate-missing-waitmsg4-case
Apr 10, 2026
Merged

fix(sdk-lib-mpc): handle WaitMsg4 round in _deserializeState#8467
zahin-mohammad merged 1 commit intomasterfrom
zahinmohammad/wal-384-security-_deserializestate-missing-waitmsg4-case

Conversation

@zahin-mohammad
Copy link
Copy Markdown
Contributor

Summary

  • Fix _deserializeState() missing WaitMsg4 case in DKLS DSG — at Round 4 the CBOR-decoded round is an object { WaitMsg4: { r: ... } }, not a string, causing InvalidState to be thrown
  • Convert the switch to if/else if to support the mixed string/object round type, consistent with how setSession() already handles it
  • Add test verifying _deserializeState() correctly handles the WaitMsg4 round state

Test plan

  • Existing DKLS DSG tests pass (83 passing)
  • New test exercises _deserializeState() at WaitMsg4 state and verifies DsgState.Round4 is set without throwing

Ticket: WAL-384

🤖 Generated with Claude Code

_deserializeState() used a switch on string cases but at Round 4 the
CBOR-decoded round is an object { WaitMsg4: { r: ... } }, not a string.
This made it always throw InvalidState at Round 4, inconsistent with
setSession() which correctly handles it. Convert the switch to if/else if
to support the mixed string/object round type.

WAL-384

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear bot commented Apr 9, 2026

Comment thread modules/sdk-lib-mpc/test/unit/tss/ecdsa/dklsDsg.ts
@zahin-mohammad zahin-mohammad marked this pull request as ready for review April 9, 2026 21:14
@zahin-mohammad zahin-mohammad requested review from a team as code owners April 9, 2026 21:14
@zahin-mohammad zahin-mohammad merged commit a9171d3 into master Apr 10, 2026
22 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.

3 participants