Commit 8c369c3
authored
feat(frost): member-key the ROAST session-handle binding (7.3 PR2b-2 step 1) (#4087)
## What
RFC-21 Phase 7.3 PR2b-2 **step 1**: member-key the ROAST session-handle
binding.
Re-keys `sessionAttemptBindings` in `pkg/frost/signing` from `sessionID`
alone to `(sessionID, member)`, threading the local member
(`request.MemberIndex`) through the receive-loop validators and the
evidence-submission path.
## Why
A multi-seat operator runs one receive loop per local seat. With the
binding keyed by `sessionID` alone, sibling seats collided:
- the later seat's `Set` **overwrote** the earlier seat's binding, so
evidence submission used the wrong handle (mis-attribution);
- one seat's cleanup `Clear(sessionID)` deleted the **shared** binding,
silently disabling the surviving seat's inbound attempt-context-hash
enforcement (a security regression).
PR2b-1.5 papered over this with multi-seat fail-closed guards; this PR
makes the path actually member-safe and retires those guards.
## Changes
- **Registry** (both build flavors): `sessionMemberKey{sessionID,
member}` key;
`Set`/`Clear`/`currentAttemptHandleForCollect`/`CurrentAttemptHandleForSession`
take `group.MemberIndex`.
- **Read path**: `verifyMessageAttemptContextHash` /
`setMessageAttemptContextHashIfBound` take `member`; the 3 receive-loop
callers pass `request.MemberIndex` (the local receiver, **never** the
inbound sender).
- **Write path**: `BeginOrchestrationForSession` /
`EndOrchestrationForSession` / cleanup bind & clear per `(sessionID,
member)`.
- **Submit**: `submitSnapshotIfActive` becomes member-aware
(`RegisteredRoastRetryCoordinatorForMember`).
- **Guards retired**: `count>1` terminal in `Begin`; `count>1` no-op in
submit. A fully-registered multi-seat operator now proceeds per-seat
with isolated bindings.
- **Guard kept**: partial-registration fail-closed.
## Design note — partial-registration fail-closed is kept deliberately
Member-keying isolates *registered* seats; it does nothing for a seat
with **no** coordinator. The ROAST-vs-legacy selector is
process-uniform, so an unregistered sibling running legacy while
siblings drive bound ROAST would fracture the attempt. So `!ok &&
count>0 → ErrTerminalSigningFailure` (fail closed); only `count==0` (no
seat registered anywhere) → the static legacy sentinel. Design locked
via Codex + Gemini consult (both ratified).
## Why it's safe
`AttemptContext` has no per-seat fields, so `ctx.Hash()` is identical
across sibling seats — member-keying does **not** change validation
semantics; it only isolates handles and prevents cross-seat cleanup.
## Tests / verification
- New: `_MultiSeatProceedsPerSeat` (isolation via
survival-after-sibling-cleanup; sibling handles are equal so
cleanup-survival is the proof), `_IsolatesByMember` (registry, distinct
handles), `_MultiSeatSubmitsPerSeat`, `_BindingIsMemberScoped`. Flipped
the old full-multi-seat fail-closed test; kept the partial one.
- All 5 tag combos build+vet+test green; `-race` green on the combined
combo; gofmt clean; `pkg/tbtc` signing-loop tests green (tagged +
default).
🤖 Generated with [Claude Code](https://claude.com/claude-code)16 files changed
Lines changed: 507 additions & 187 deletions
File tree
- pkg/frost/signing
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
Lines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
52 | | - | |
53 | | - | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
58 | 66 | | |
59 | 67 | | |
60 | 68 | | |
| |||
64 | 72 | | |
65 | 73 | | |
66 | 74 | | |
| 75 | + | |
67 | 76 | | |
68 | | - | |
| 77 | + | |
69 | 78 | | |
70 | 79 | | |
71 | 80 | | |
| |||
91 | 100 | | |
92 | 101 | | |
93 | 102 | | |
94 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
95 | 107 | | |
96 | 108 | | |
97 | 109 | | |
| 110 | + | |
98 | 111 | | |
99 | | - | |
| 112 | + | |
100 | 113 | | |
101 | 114 | | |
102 | 115 | | |
| |||
Lines changed: 47 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
126 | 157 | | |
127 | 158 | | |
128 | 159 | | |
| |||
132 | 163 | | |
133 | 164 | | |
134 | 165 | | |
135 | | - | |
| 166 | + | |
136 | 167 | | |
137 | 168 | | |
138 | 169 | | |
| |||
143 | 174 | | |
144 | 175 | | |
145 | 176 | | |
146 | | - | |
| 177 | + | |
147 | 178 | | |
148 | 179 | | |
149 | 180 | | |
| |||
157 | 188 | | |
158 | 189 | | |
159 | 190 | | |
160 | | - | |
| 191 | + | |
161 | 192 | | |
162 | | - | |
| 193 | + | |
163 | 194 | | |
164 | 195 | | |
165 | 196 | | |
| |||
170 | 201 | | |
171 | 202 | | |
172 | 203 | | |
173 | | - | |
| 204 | + | |
174 | 205 | | |
175 | 206 | | |
176 | | - | |
| 207 | + | |
177 | 208 | | |
178 | 209 | | |
179 | 210 | | |
| |||
189 | 220 | | |
190 | 221 | | |
191 | 222 | | |
192 | | - | |
| 223 | + | |
193 | 224 | | |
194 | 225 | | |
195 | 226 | | |
| |||
201 | 232 | | |
202 | 233 | | |
203 | 234 | | |
204 | | - | |
| 235 | + | |
205 | 236 | | |
206 | 237 | | |
207 | 238 | | |
| |||
214 | 245 | | |
215 | 246 | | |
216 | 247 | | |
217 | | - | |
| 248 | + | |
218 | 249 | | |
219 | 250 | | |
220 | 251 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1086 | 1086 | | |
1087 | 1087 | | |
1088 | 1088 | | |
1089 | | - | |
| 1089 | + | |
1090 | 1090 | | |
1091 | 1091 | | |
1092 | 1092 | | |
| |||
1102 | 1102 | | |
1103 | 1103 | | |
1104 | 1104 | | |
1105 | | - | |
| 1105 | + | |
1106 | 1106 | | |
1107 | 1107 | | |
1108 | 1108 | | |
| |||
1237 | 1237 | | |
1238 | 1238 | | |
1239 | 1239 | | |
1240 | | - | |
| 1240 | + | |
1241 | 1241 | | |
1242 | 1242 | | |
1243 | 1243 | | |
| |||
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
12 | | - | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| 40 | + | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| |||
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| 51 | + | |
48 | 52 | | |
49 | | - | |
| 53 | + | |
50 | 54 | | |
0 commit comments