feat(invariants): repoint STOX_PROD_AUTHORISER to the V4 clone — RED until swap - #254
Conversation
|
Warning Review limit reached
Next review available in: 25 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe changes repin authoriser invariants to the generated V4 clone, expand expected grants, remove migration-window validation, update deployment checks and mirroring indexes, and revise deployment, fork, and library tests accordingly. ChangesAuthoriser invariant alignment
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant InvariantSuite
participant LibTokenInvariants
participant LibAuthoriserInvariants
participant ProductionAuthoriser
InvariantSuite->>LibTokenInvariants: validate token state against production authoriser
InvariantSuite->>LibAuthoriserInvariants: assertAll()
LibAuthoriserInvariants->>ProductionAuthoriser: read codehash and expected roles
LibAuthoriserInvariants-->>InvariantSuite: return invariant result
Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
2564d1d to
a0a391b
Compare
a0a391b to
422a36d
Compare
d54ee0d to
3564aa6
Compare
#255) ## Summary The swap bundle previously upgraded only the receipt-vault beacon. Every live production token proxies through **three** V1 beacons — receipt (ERC-1155), receipt vault (ERC-20), wrapped token vault (ERC-4626) — whose V4 implementations assume each other's V4 behaviour, so they must move together. **New bundle shape (23 txs):** 1. receipt beacon → `STOX_RECEIPT_0_1_1` 2. receipt-vault beacon → `STOX_RECEIPT_VAULT_0_1_1` 3. wrapped-token-vault beacon → `STOX_WRAPPED_TOKEN_VAULT_0_1_1` 4. …23. `setAuthorizer(V4 clone)` × 20 production vaults Per beacon: pre-flight (Safe-owned via `LibBeaconInvariants.PROD_BEACON_OWNER` + still at V1 impl; V4 impl deployed with the audited codehash), post-state (at V4 impl, still Safe-owned), and n+1 reversibility (the Safe rolls each back to its V1 impl under the live threshold). `run()` split into `_preflightBeaconsAndImpls` / `_preflightClone` / `_buildBundle` helpers (stack-too-deep with the beacon arrays inline). **GREEN**: `testRunCompletesAndWritesArtifact` proves the 23-tx bundle authors end-to-end against unmodified live Base state — this is the exact dry-run the `run-script` dispatch executes. Merge before dispatching runbook step 5. Stack: `#252 (clone pin) → this PR → #254 (invariant repoint, red until execution)`.
422a36d to
f41b819
Compare
3564aa6 to
8cae29b
Compare
…until swap The single "current authoriser" entrypoint now points at the clone the swap script upgrades every vault onto: - LibAuthoriserInvariants.STOX_PROD_AUTHORISER aliases LibProdDeployV4.STOX_PROD_AUTHORISER_V4_CLONE (deploy lib = single source for the address; this constant = the semantic name). - One master expectedGrants() (13 entries: 7 _ADMIN roles on the Safe incl. the two corporate-action admins per RAI-731, 3 service ops, 3 Safe ops). - assertAll() = codehash-vs-deploy-pin + master map on STOX_PROD_AUTHORISER. V3 checks deleted entirely (STOX_PROD_AUTHORISER_IMPL, assertImplPinned, the V3 grant leg) — nothing references the retired clone. - LibInvariants returns to the simple strict shape: assertUniformAuthoriser(current) — no migration window on the authoriser leg. - 20260619 script slices follow the 13-map reorder (ops at 7..12); 20260623 script's inline 7-role block dropped (master map covers). - StoxProdV4PostSwap + 20260623 test assert the strict post-swap state. DELIBERATELY RED until the 20260623 swap bundle executes on Base: every vault still reports the retired V3 authoriser (ReceiptVaultAuthoriserMismatch expected=0x315b16fa actual=0x35f9fA9d). This is the pre-authored post-execution pin — merge after the swap.
f41b819 to
2ec9345
Compare
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…c form Resolves the divergence between this branch's flat Base-only 13-entry expectedGrants and main's Safe-parametric 11-entry overload. Every chain targets the 0.1.1 authoriser impl, so every chain carries the two corporate-action admins: expectedGrants(address tokenOwnerSafe) now returns 13 entries and stays the single map every consumer reads. The deploy script's post-state sweep and StoxProdV4PostSwap no longer hand-list the seven auto-granted _ADMIN roles separately — that list only existed because the 11-entry map omitted the corporate-action admins, and asserting it alongside the map made two sources of truth for one fact. Both LibInvariants.assertAll overloads now assert the V4 clone outright. The V3-or-V4 migration window is gone: the swap has executed, so the window only served to keep a retired clone in the assertion path while leaving the live authoriser's grant map unchecked. main's chain-agnostic assertProductionState is untouched. MIRROR_START_INDEX stays 7, matching the reordered map; the existing assertGrantsSliceInvariant pins that coupling. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Reviewed 634f7a7: approve Green by the rule.
The four The merge resolution unifies the grant map rather than picking a side: Both Known gap, not a blocker and not introduced here: |
…ning, post-swap test retirement Rebased onto the #254 grant-map restructure (13-entry parametric form, STOX_PROD_AUTHORISER repointed to the live authoriser upstream). GRANTEE_SERVICE_3D0C joins GRANTEE_SERVICE_1C66 as an ADDITIONAL service signer with the same three action roles: - expectedGrants() 13 -> 16; every consumer (parity authoriser leg, production-state bundle, per-chain prod pins) is red per chain until the provisioning bundle executes there, drift-guarded after. 3D0C joins the DEFAULT_ADMIN absence checks. Map docs state purpose, not contents. - 20260619 clone-deploy MIRROR_COUNT 6 -> 9 (+ suite): the ceremony runs again on future chains and its slice guard forces the constant to track the canonical map; executed chains refuse re-runs via hydrated pins. - 20260723-provision-additional-service-signer (run-script, registered): authors the per-chain grant bundle, work items derived from the map, chain-aware (base/ethereum network selector added to the dispatcher), self-scoping, n+1-proven reversible. Fork suite green on live Base + Ethereum. - Post-execution retirement: the executed swap authorings' one-shot test suites deleted; live-state coverage is carried by the standing invariants. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VPs1hCTxusmaSeFKvoc4Kr

Summary
The pre-authored post-execution pin: repoints every invariant to the state that holds after the
20260623upgrade + swap bundle executes on Base.DELIBERATELY RED until the bundle executes — every production vault still reports the retired V3 authoriser, so CI shows exactly:
Merge after runbook step 5 (the Safe ceremony); this goes green automatically at execution.
The single current-authoriser entrypoint
LibAuthoriserInvariants.STOX_PROD_AUTHORISERnow aliasesLibProdDeployV4.STOX_PROD_AUTHORISER_V4_CLONE— the deploy lib is the single source for the address; this constant is the semantic name every invariant and script reads.expectedGrants()(13 entries): 7_ADMINroles on the Safe (incl. the two corporate-action admins, per RAI-731), 3 service-EOA ops, 3 Safe ops.assertAll()= codehash-vs-deploy-pin + master map onSTOX_PROD_AUTHORISER. All V3 checks deleted (STOX_PROD_AUTHORISER_IMPL,assertImplPinned, the V3 grant leg) — nothing references the retired clone.LibInvariantsreturns to the simple strict shape:assertUniformAuthoriser(current)— the migration window on the authoriser leg is gone (superseded by this red-until-executed PR, per review).Stack:
#252 (clone pin, green) → #255 (3-beacon bundle, green) → this PR (red until execution).Summary by CodeRabbit
Enhancements
Bug Fixes
Tests