Skip to content

ops(TC-1164): flip quota authority to billing - #323

Open
samgbafa wants to merge 2 commits into
mainfrom
feat/tc-1164-quota-authority-billing
Open

samgbafa wants to merge 2 commits into
mainfrom
feat/tc-1164-quota-authority-billing

Conversation

@samgbafa

Copy link
Copy Markdown
Contributor

Refs TC-1162 / TC-1164.

MERGE ORDER: merge only after the step-4 migration is verified (billing /api/quota/<space> storage_limit_bytes ≥ floors and node override_bytes null for both spaces), and before any further deploy-phala dispatch. Merging alone triggers no deploy; it only builds images.

Changes

  • ops/quota-overrides.json: authority → billing; secrets floor 268721121 → 1073741824 (Sam set 1 GiB via /storage 2026-10-17T05:36:53Z; internal D1 is the source); applications floor stays 5368709120. Comments now describe billing-mode floors.
  • scripts/ci/reconcile-quota.py: LIMITS secrets → 1073741824; the node-override success message is built from LIMITS, so it can't drift from them.
  • scripts/ci/test-quota-authority.py: fixture LIMITS updated; new test test_shipped_billing_config_reconciles_against_exact_floors.
  • docs/releasing.md: billing is now described as the current authority, with the floors and the ordering/revert rule (reverting to node-override needs a reviewed PR).

Test coverage

Tests that already covered the guards, using synthetic configs: test_billing_mode_uses_absolute_limit_and_accepts_cold_node_cache (billing passes with no PUT), test_billing_absent_inactive_or_insufficient_fails_without_mutation (comp one byte below the floor), test_stale_local_override_rejects_billing_mode, and test_active_comp_on_second_space_blocks_every_legacy_put (authority mismatch).
What the new test adds: it runs full main() against the checked-in ops/quota-overrides.json, not a synthetic copy. With comps exactly at 5368709120 / 1073741824 and node override_bytes=null, it passes with zero PUT/DELETE. With the secrets comp at 1073741823 (one byte under the new floor), it fails billing authority does not cover both reviewed quota floors. With the shipped values in a temp copy set to node-override and an active comp, it fails authority mismatch: flip to billing with no PUT.

Tests

  • python3 scripts/ci/test-quota-authority.py: 22 tests OK
  • python3 scripts/ci/test-deploy-recovery.py: 17 tests OK
  • python3 scripts/ci/reconcile-quota.py --validate-only: "Reviewed quota authority and targets validated."

@samgbafa

Copy link
Copy Markdown
Contributor Author

APPROVE: see TC-1162 (reviewed exact head 2789efc)

…thority-billing

# Conflicts:
#	docs/releasing.md
@samgbafa

Copy link
Copy Markdown
Contributor Author

APPROVE: see TC-1162 (reviewed exact head 004d9be)

This branch has not been deployed

No deployments
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