Files
giza-kmp/composeApp/schemas/to.curare.compose.database.CurareDatabase
Kgothatso NgakoandClaude Opus 5 01e022fdcc feat(frost): a proposer can resend a signing session
A session can sit in COLLECTING_NONCES forever waiting on a member who would
have agreed, because the message asking them never arrived. MLS moved its
ratchet past the generation it came in at, which is terminal at the receiver and
invisible to the sender (docs/mls-skipped-keys.md); or a disappearing-message
group expired it off the relay; or the member joined the room after the proposal
was made, holding a share from an earlier ceremony. None of them heals on its
own, and nothing asked the sender to resend.

`FrostSigningManager.resend` repeats what the coordinator wrote -- the proposal,
and whichever of the signer set or the signature the stage has reached. A resent
message is a *new* message: new created_at, new id, encrypted at a generation
the receiver has not passed, carrying a fresh expiry. That is why it works where
the first copy did not.

Two and never three. Publishing in bursts is what the skipped-keys bug feeds on,
and a recovery for it that re-creates it is no recovery, so the stage table is a
minimum rather than "send everything".

The resent proposal names the members the coordinator has heard nothing from, and
a named device republishes what *it* already sent -- the stored bytes, under its
own key. That is the only half that can repair a nonce lost on the way *to* the
coordinator: `advance` republishes a message it has no local copy of, so a device
that published and recorded its nonce would never send it again. It publishes
nothing new, so a nudge cannot talk a device into putting its share behind events
its owner has not approved.

Coordinator-only, both halves, and that is correctness rather than etiquette:
`acceptProposal` takes coordinatorPublicKey from the proposal's author, so a
non-coordinator resending to a member with no session row would have that member
drop the real coordinator's signer set.

Also fixes a bug `broadcast` had all along. An outbound row's primary key is a
hash over its created_at, stored to the second, so a message re-published inside
that second hashes to the id of the copy it repeats -- and the upsert put an
already-sent row back on the queue with marmotGroupEventId cleared, double-sending
it and losing its mapping to the group event it became. It now steps past a taken
id rather than writing over it, and refuses after four tries.

Schema 24 -> 25 for FrostSigningSession.resentAt, which is the cooldown and the
second line of defence on that collision. Phase 4's column, pulled forward
because Phase 2 needs it.

Plan: docs/frost-session-resend.md, Phases 2-4.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-06 14:56:15 -05:00
..