Commit e719210
fix(frost): fail closed at the legacy + native backends under the no-coarse flag
Fold of a third round of Codex #4101 P2 findings - the flag's fail-closed behavior
still had two holes, both now enforced at the backend Execute (the action) so they
cannot be bypassed by a caller:
- The DEFAULT backend fails OPEN. KEEP_CORE_FROST_INTERACTIVE_SIGNING_ONLY was checked
only in nativeExecutionFallbackAllowed + the native FFI adapter. A node left at the
documented default (""/legacy) signs straight through legacyExecutionBackend.Execute
(the tECDSA/coarse signer), never touching those guards - so the safety switch failed
open under the default config. legacyExecutionBackend.Execute now refuses with a
terminal error when the flag is on.
- Outer native refusals were retryable. When the native path is unavailable before the
FFI adapter's terminal refusal can run (no FFI executor, or the bridge returns
ErrNativeCryptographyUnavailable with the fallback suppressed), the bridge/adapter
return a bare ErrNativeCryptographyUnavailable; the tBTC signingRetryLoop only aborts
on ErrTerminalSigningFailure, so it retried this deterministic failure to timeout.
nativeExecutionBackend.Execute now promotes that unavailable error to terminal when
the flag is on (and leaves it untouched when off).
Tests: legacy terminal refusal; native unavailable->terminal promotion plus a flag-off
pass-through (no regression). Builds across all tag combos; full default +
frost_native/frost_roast_retry suites pass; gofmt clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 5fae0df commit e719210
3 files changed
Lines changed: 86 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
199 | 255 | | |
200 | 256 | | |
201 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
34 | 46 | | |
35 | 47 | | |
36 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
54 | 71 | | |
55 | 72 | | |
56 | 73 | | |
| |||
0 commit comments