Skip to content

v3.0.0 feat: add offline fee-policy transitions - #401

Merged
Anatolie merged 2 commits into
3.x.xfrom
offline-policy-transition
Sep 15, 2026
Merged

Anatolie merged 2 commits into
3.x.xfrom
offline-policy-transition

Conversation

@Anatolie

@Anatolie Anatolie commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Allow operators to change pool fees and CTV fee rates without hand-editing the cluster fingerprint. policy-transition --to <env-file> validates the current and target policies, requires every frontend to report stopped, and commits the new fingerprint, one payout-revision increment, candidate dispositions, and an immutable transition record under the settlement and ordering locks.

Closes #289, following its September 10 scope update: offline fee-policy changes only. Signing-key rotation, multi-epoch verification, live/draining transitions, and a force mode remain deferred.

Behavior

  • Reuse the existing configuration parser and fingerprint representation. Load target dotenv overrides before runtime threads start, restore the current environment afterward, and never execute the file as shell code.
  • Reject key, genesis, database, and unrelated policy changes. Resolve fee addresses as startup does and validate the target CTV rate against the live relay/mempool floors; an invalid old rate can still be corrected.
  • Require explicit stopped markers, including for stale instances. Serialize the scan with registrations and refuse active legacy writers or a fatal halt.
  • Abandon unoffered candidates with epoch-superseded; retain offered, reserved, and reconciliation candidates with their original bytes and policy. Fence departed claims so recovery can resume immediately without a second offer; parked candidates remain parked.
  • Reject old-policy startup with the active payout revision and record its failed startup as stopped. Preserve historical audit and CTV artifacts and document the operator procedure and uncertain-commit recovery.

Migration and security

Migration 014 adds qbit_prism_policy_transitions; migration 013 from the current parent performs the online share ledger index trim. The journal stores public policy inputs and database identity, never signing seeds or credentials. Recovery exports include the journal and its sequence, with backup/restore and missing-table checks. Existing signing keys, verifier formats, and production deployment files are unchanged. Tests use disposable local PostgreSQL instances and fake node RPCs.

Validation

  • Eleven new PostgreSQL regressions cover two frontends, stale/unknown/live refusal, both accounting locks, racing registration, CLI/env validation, fee-floor correction, unsupported changes, rollback, retries, claim fencing, as-issued landing, historical byte preservation, and fatal-state refusal.
  • Ledger (120 tests), offer-lifecycle (18), candidate-window migration (10), and migration rollback (3) suites.
  • Server library tests (344 passed, 2 ignored); workspace/all-target Clippy with warnings denied; formatting.
  • Gate-env, configuration inventory, and toolchain checks. New tests are included in CI's required integration inventory.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-15T21:51:56.121933Z 7486ff0 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Anatolie
Anatolie force-pushed the offline-policy-transition branch from c764ceb to 5fd9fc8 Compare September 15, 2026 21:29

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5fd9fc8fea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant