Files
giza-kmp/docs/confederation-auto-join.md
T
Kgothatso NgakoandClaude Opus 5.5 e7336d8ef1 feat: an admin's device joins the confederation's key ceremony on its own (confederation-auto-join)
Each group's signed acceptance already names the admins it puts forward, and
every admin must join for the ceremony to finish, so the tap could only say yes
or stall everyone. Once every group has accepted, each admin's device now joins
attempt 1 by itself, and follows a retry another person in the roster started,
but never starts one. Join holds a mutex so a tap and the device's own join
cannot send two different host-key messages. The accept and propose screens say
what accepting now commits each admin to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 15:51:29 +02:00

78 lines
4.2 KiB
Markdown

# The confederation's key ceremony joins itself
Until this change every admin of every group was shown **Join the key ceremony** once every group
had accepted, and the ceremony could not start its rounds until each of them had pressed it
([confederation-without-coordinator.md](./confederation-without-coordinator.md) D8, "Joining is still
the only approval"). Now each admin's device joins on its own. The button stays, for the cases the
device leaves alone.
## Why the tap was not a decision
[automatic-key-ceremony.md](./automatic-key-ceremony.md) kept the join as the one approval in a
group's own ceremony because "nothing on the device can decide that for them": joining puts a
member in a signing quorum, and nobody else agreed to that on their behalf.
A confederation is different in two ways:
- **Someone has already agreed, by signature.** Each group's acceptance (9431) is signed by the
group's own quorum and names the admins it puts forward. The admin is in the roster because their
group said so, and the proposer's own admin list is in the 9430 its quorum signed.
- **Every admin must join** ([confederation.md](./confederation.md) D11). An admin who does not tap
does not leave the roster. They stall the ceremony for every group until somebody abandons it.
So the tap had two outcomes: yes, or everyone waits.
So the tap added a stall and nothing else. Saying no happens elsewhere: in the group's answer to the
proposal, and in **Abandon** once the ceremony is running. Both are still there.
What the person used to see at the join is now said when the decision is made. The accept and
propose screens say that, once every group accepts, each admin joins the key ceremony and holds a
share (`accepting_discloses_admins`, `proposing_shows_admins_to_the_groups`).
## What the device joins
`ConfederationRitualManager.shouldJoinOnItsOwn`, for this device's owner:
| the device holds | joins on its own |
|---|---|
| no ceremony for an `ACCEPTED` proposal, and `joinable` passes | **yes**: attempt 1 |
| a running ceremony made by an older build, still waiting on its member (`approvedAt == null`) | **yes** |
| a running or complete ceremony | no |
| a failed or abandoned attempt `k` | **only once it holds a message for attempt `k + 1` signed by somebody else in the roster** |
| anything `joinable` refuses (admins changed, no inbox key yet, a roster too large) | no; the screen still says why, and the button still offers it |
**It never starts a retry itself.** Some failures repeat, such as a group that told two groups
different things. If devices started `k + 1` on their own, a failure like that would go round on
every device forever. When a person presses **Try again**, that is the decision (D10), and every
other device follows it.
## When it runs
`ConfederationRitualManager.observeAndJoin`, launched by `ChatRepository.followThroughCeremonies`
next to the confederation's other drivers, behind both `ExperimentalFeatures.confederation` and
`ExperimentalFeatures.groupInbox` (D13). It runs a pass when a statement is filed, when a ceremony
message is heard, when a ceremony ends, and once a minute. The minute pass catches a device that
becomes able to join, for example when its inbox key is announced.
**One join at a time.** `join` holds a mutex now, so the device's own join and a person's tap
cannot both make the ceremony. Each would pick its own random seed and send a 30381, and two
different signed host-key messages from one person fail the ceremony as an equivocation. The
second caller finds the ceremony running and returns it.
## Tests
`ConfederationCeremonyJvmTest`, under "joining on its own":
- every device joins on its own and the key forms; a second pass joins nothing;
- a device that does not hold every acceptance joins nothing;
- a device whose group's admins changed since it accepted joins nothing;
- a failed attempt is not retried on its own, but once one person retries, every other device
follows and attempt 2 forms;
- a tap and the device's own join at the same moment send one 30381, and the key forms.
## Not done
- No device run.
- A person who abandoned attempt `k` themselves is still brought into `k + 1` when somebody else
retries. Abandon means "this attempt stalled" (automatic-key-ceremony.md), not "I am out". They
can abandon again.