The signing counterpart to the DKG coverage, and it differs in the way the DAO's
own comment gives: "unlike a DKG a group signs repeatedly, so there is no single
current one to observe". Sessions accumulate rather than replacing each other,
which makes room scoping and ordering load-bearing rather than incidental.
The duplicate-suppression property is the same and matters for the same reason.
The composite key (sessionId, signerPublicKey, kind) is what makes a redelivered
nonce or partial signature replace its predecessor rather than add a row, and
countMessagesByKind is what decides that enough signers have answered. A second
row for one signer lets a session cross its threshold while short a real
participant, and the aggregation then runs over a signer set that was never
assembled. Covered by resending a nonce with a different payload, and separately
by giving one signer both a nonce and a partial signature and asserting the
second does not overwrite the first -- the kind in the key is the only thing
keeping those apart.
Also covered: a session reads back by id with its stage intact and a missing id
gives null; a room's sessions accumulate newest first, with the latest reachable
on its own; sessions are scoped to their room, which matters because signing
happens in the #admins room and a device can be in more than one -- a session
leaking across would have a signer answering a request its group never made;
counts are per session and per round; and a completed session keeps its
signature, which is what a resume reads to avoid signing the same event twice.
One test records a difference rather than a guarantee. FROST orders a round's
messages by createdAt where the DKG orders the same query by participant public
key. Arrival order is per-device, so this ordering is not canonical across the
group the way the DKG's is. It is pinned as it stands rather than asserted to be
right: whether it is deliberate is not something this change can settle, and a
caller that needs a canonical signer order has to impose one itself. Worth
looking at separately.
8 tests.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>