feat(frost/signing): RFC-21 Phase 5.3 -- readiness-gate env-var guard#3979
Merged
mswilkison merged 1 commit intoMay 23, 2026
Conversation
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.
Base automatically changed from
feat/frost-roast-retry-orchestration-2026-05-23
to
feat/frost-schnorr-migration-scaffold
May 23, 2026 02:15
f8c5d7b
into
feat/frost-schnorr-migration-scaffold
15 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes Phase 5 of RFC-21. Adds the explicit-operator-opt-in
gate that protects production builds with the
`frost_roast_retry` tag from entering the orchestration path
without an explicit operator decision.
Production builds with the build tag enabled now refuse to wire
orchestration unless the operator sets
`KEEP_CORE_FROST_ROAST_RETRY_ENABLED=true`. The pattern matches
the existing
`KEEP_CORE_FROST_TBTC_SIGNER_ACCEPT_SCAFFOLD_KEY_GROUP` env var
from PR #3960: a build tag enables the code path, an env var
enables the wiring, both must agree for the feature to be live.
Stacked on #3978 (Phase 5.2).
What lands
New file: `pkg/frost/signing/roast_retry_readiness.go` (untagged)
`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.
Why per-call rather than init-time
The scaffold-opt-in env var from PR #3960 is also evaluated per
call. Operators can flip it during a debugging session without
restart. Same reasoning here -- the readiness env var is a kill
switch, not a build constant.
Test coverage
Verification
Phase 5 complete
Phase 6 will wire the production call sites and migrate the three
FROST/tbtc-signer receive loops onto the adapter in a single
coordinated change.
Test plan