Commit 3af8ba2
committed
feat(frost/signing): RFC-21 Phase 5.3 -- readiness-gate env-var guard
Closes Phase 5 of RFC-21 by adding the explicit-operator-opt-in
gate. Production builds with the frost_roast_retry tag now refuse
to enter the orchestration path until the operator sets
KEEP_CORE_FROST_ROAST_RETRY_ENABLED=true, matching the precedent
set by KEEP_CORE_FROST_TBTC_SIGNER_ACCEPT_SCAFFOLD_KEY_GROUP from
PR #3960.
* pkg/frost/signing/roast_retry_readiness.go (new, untagged)
- RoastRetryReadinessOptInEnvVar constant -- the env var name.
- ErrRoastRetryReadinessOptOut sentinel for errors.Is.
- EnsureRoastRetryReadinessOptIn() returns nil if the env var
is "true" (case-insensitive, whitespace-trimmed); returns
ErrRoastRetryReadinessOptOut otherwise.
- RoastRetryReadinessOptInEnabled() bool helper for code that
needs a boolean rather than an error.
- Per-call (not cached) so operators can flip the variable
during a debugging session without restart.
* pkg/frost/signing/roast_retry_orchestration.go (extended)
- BeginOrchestrationForSession now calls
EnsureRoastRetryReadinessOptIn before consulting the
registry. The env var is the load-bearing gate; missing
opt-in short-circuits orchestration even when the registry
has a real coordinator.
Tests:
* roast_retry_readiness_test.go (7 cases, untagged)
- Accepts "true"
- Accepts true case-insensitive (true / True / TRUE / tRuE)
- Accepts trimmed whitespace
- Rejects unset (returns ErrRoastRetryReadinessOptOut; error
message names the env var)
- Rejects other values (false / 1 / yes / TRUE_ / tru /
anything)
- RoastRetryReadinessOptInEnabled mirrors the Ensure result
- Env var name matches RFC-21 specification (locks the name)
* roast_retry_orchestration_frost_roast_retry_test.go (extended)
- Existing happy-path / error tests get t.Setenv(envVar,
"true") so they reach the path under test.
- New: TestBeginOrchestrationForSession_ErrorsWhenReadinessOptInUnset --
asserts a registered coordinator alone is not enough; missing
env var still short-circuits orchestration. This is the
load-bearing safety property.
All pass under: go test ./pkg/frost/signing/..., go test -tags
'frost_roast_retry' ./pkg/frost/signing/..., go test -race -tags
'frost_native frost_tbtc_signer frost_roast_retry'
./pkg/frost/..., staticcheck -checks '-SA1019' ./pkg/frost/...,
go vet ./pkg/frost/..., gofmt -l ./pkg/frost/signing/.
Stacked on Phase 5.2 (#3978). Closes the Phase 5 surface.
Phase 6 will wire the production call sites:
* Caller invokes EnsureRoastRetryReadinessOptIn before
RegisterRoastRetryCoordinator, falling back to legacy if not
enabled.
* Three FROST/tbtc-signer receive loops migrate to
EvaluateRoastRetryForSigning in a single coordinated change.1 parent ccea33e commit 3af8ba2
4 files changed
Lines changed: 182 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| 81 | + | |
| 82 | + | |
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
| |||
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
88 | 119 | | |
| 120 | + | |
89 | 121 | | |
90 | 122 | | |
91 | 123 | | |
| |||
108 | 140 | | |
109 | 141 | | |
110 | 142 | | |
| 143 | + | |
111 | 144 | | |
112 | 145 | | |
113 | 146 | | |
| |||
213 | 246 | | |
214 | 247 | | |
215 | 248 | | |
| 249 | + | |
216 | 250 | | |
217 | 251 | | |
218 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
0 commit comments