feat(multichain): HyperEVM V4 authoriser clone pin plumbing (RAI-1511) - #274
Conversation
📝 WalkthroughWalkthroughThe PR adds a Safe-based additional service signer provisioning script for Base and Ethereum. It expands canonical grants, adds HyperEVM deployment support, updates workflow network selection, and adds live-fork validation. ChangesV4 signer provisioning
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
c61c4b9 to
8e010e5
Compare
0e9cc06 to
5539d12
Compare
9b894c3 to
bb342c0
Compare
5539d12 to
1a96c47
Compare
bb342c0 to
3e90fed
Compare
02d425b to
b65a13f
Compare
3e90fed to
b14ffe4
Compare
b65a13f to
943af94
Compare
b14ffe4 to
54e4482
Compare
54e4482 to
eaea4fe
Compare
eaea4fe to
bc35fb2
Compare
be1999e to
d168ee1
Compare
bc35fb2 to
860e444
Compare
b4ea3ba to
fa517d7
Compare
985dfdd to
a8356f9
Compare
fa517d7 to
b4ea3ba
Compare
a8356f9 to
5785920
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@script/20260619-deploy-v4-authoriser-clone.s.sol`:
- Line 134: The grant-slice documentation must match the 16-entry map: in
script/20260619-deploy-v4-authoriser-clone.s.sol lines 134-134, update
references from six grants and range 7..12 to nine grants and 7..15, and from 13
entries to 16 entries; in test/script/20260619-deploy-v4-authoriser-clone.t.sol
lines 335-335, update the replica description from six grants and 7..12 to nine
grants and 7..15.
In `@src/lib/LibSafeInvariants.sol`:
- Around line 197-198: Add the correct HyperEVM token-owner Safe address and
include HYPEREVM_CHAIN_ID in safeForChainId alongside the existing BASE_CHAIN_ID
and ETHEREUM_CHAIN_ID mappings. Ensure DeployV4AuthoriserClone.run() can pass
assertActiveChainTokenOwnerSafe(block.chainid) on chain 999, and add a HyperEVM
fork test covering this pre-flight deployment path.
In `@test/script/20260723-provision-additional-service-signer.t.sol`:
- Around line 59-65: Make the provisioning tests deterministic: in
test/script/20260723-provision-additional-service-signer.t.sol lines 59-65, use
fixed pre-provisioning fork blocks for the happy path or assert the
already-provisioned outcome; in lines 88-102, construct a controlled
partial-grant state so DEPOSIT and WITHDRAW are genuinely missing instead of
mocking CERTIFY alone. Update the PENDING and post-execution lifecycle text in
script/20260723-provision-additional-service-signer.s.sol lines 35-71 to match
the chosen test strategy and current deployment state.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: d54f26c1-08bc-4925-b030-082ebb88b993
⛔ Files ignored due to path filters (1)
src/generated/LibProdDeployV4.solis excluded by!**/generated/**
📒 Files selected for processing (10)
.github/workflows/run-script.yamlscript/20260619-deploy-v4-authoriser-clone.s.solscript/20260723-provision-additional-service-signer.s.solscript/BuildPointers.solsrc/lib/LibAuthoriserInvariants.solsrc/lib/LibSafeInvariants.soltest/script/20260619-deploy-v4-authoriser-clone.t.soltest/script/20260722-swap-remaining-vault-authorisers.t.soltest/script/20260722-swap-rklb-authoriser.t.soltest/script/20260723-provision-additional-service-signer.t.sol
💤 Files with no reviewable changes (2)
- test/script/20260722-swap-remaining-vault-authorisers.t.sol
- test/script/20260722-swap-rklb-authoriser.t.sol
|
|
||
| /// @notice The number of non-admin grants this script mirrors in. | ||
| uint256 internal constant MIRROR_COUNT = 6; | ||
| uint256 internal constant MIRROR_COUNT = 9; |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Keep grant-slice documentation consistent with the 16-entry map.
script/20260619-deploy-v4-authoriser-clone.s.sol#L134-L134: update six-grant,7..12, and 13-entry descriptions to nine grants,7..15, and 16 entries.test/script/20260619-deploy-v4-authoriser-clone.t.sol#L335-L335: update the replica description from six grants and7..12to nine grants and7..15.
📍 Affects 2 files
script/20260619-deploy-v4-authoriser-clone.s.sol#L134-L134(this comment)test/script/20260619-deploy-v4-authoriser-clone.t.sol#L335-L335
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@script/20260619-deploy-v4-authoriser-clone.s.sol` at line 134, The
grant-slice documentation must match the 16-entry map: in
script/20260619-deploy-v4-authoriser-clone.s.sol lines 134-134, update
references from six grants and range 7..12 to nine grants and 7..15, and from 13
entries to 16 entries; in test/script/20260619-deploy-v4-authoriser-clone.t.sol
lines 335-335, update the replica description from six grants and 7..12 to nine
grants and 7..15.
| /// @notice HyperEVM mainnet chain id. | ||
| uint256 internal constant HYPEREVM_CHAIN_ID = 999; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Add the HyperEVM Safe mapping before enabling this chain ID.
safeForChainId in this file handles only BASE_CHAIN_ID and ETHEREUM_CHAIN_ID at Lines 473-480. DeployV4AuthoriserClone.run() calls assertActiveChainTokenOwnerSafe(block.chainid) before deployment, so block.chainid == 999 always reverts with UnsupportedChainForTokenOwnerSafe. The new HyperEVM clone branch is therefore unreachable. Add the correct HyperEVM Safe address and mapping, then add a HyperEVM fork test for this pre-flight path.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/lib/LibSafeInvariants.sol` around lines 197 - 198, Add the correct
HyperEVM token-owner Safe address and include HYPEREVM_CHAIN_ID in
safeForChainId alongside the existing BASE_CHAIN_ID and ETHEREUM_CHAIN_ID
mappings. Ensure DeployV4AuthoriserClone.run() can pass
assertActiveChainTokenOwnerSafe(block.chainid) on chain 999, and add a HyperEVM
fork test covering this pre-flight deployment path.
985dfdd to
a8356f9
Compare
b4ea3ba to
fa517d7
Compare
- LibSafeInvariants.HYPEREVM_CHAIN_ID = 999. - BuildPointers emits STOX_PROD_AUTHORISER_V4_CLONE_HYPEREVM = address(0) into the generated lib — the unhydrated pin, symmetric with the Ethereum clone pin's pre-deploy state. - 20260619 clone-deploy script's activeChainClonePin() gains the HyperEVM branch, so the same broadcast (already dispatchable on `hyperevm` via manual-broadcast) deploys + configures the HyperEVM authoriser once its upstream gates land, and refuses re-deploys after the pin hydrates. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VPs1hCTxusmaSeFKvoc4Kr
a8356f9 to
90c0933
Compare
fa517d7 to
f6dee27
Compare
The 20260619 ceremony executed on HyperEVM 2026-07-24 (manual-broadcast run 30101296528): authoriser deployed at 0x66566cc91dEAf818859bD4b09B7903ac48998157 — the same address as Ethereum's (same CloneFactory, same first-nonce CREATE) — with the shared EIP-1167 codehash, the full 16-entry grant map (both service signers, verified live) landed on the HyperEVM Safe + service EOAs, and the deployer renounced. Hydrate the pin from the run's logged address. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VPs1hCTxusmaSeFKvoc4Kr
f6dee27 to
b814c8e
Compare
|
Reviewed b814c8e: pass Root of the five-PR HyperEVM stack (274 → 275 → 276 → 277 → 278), reviewed as a stack root rather than in isolation. Two findings I raised and then retracted, both verified against the chain rather than the repo. I first read I then reported that the PR adds a production pin with no prod check behind it: What remains is an 11-line pin-plumbing change: the chain id, the generated pin, the generator line that emits it, and one branch in Rulings-conformance: checked against this repo's conventions and the standing rulings for this work.
CI: all checks pass — |
Brings in #274, #275 and #276. #275's `RPC_URL_HYPEREVM_FORK` forwarding in `rainix-sol.yaml` is what lets this branch's own push run resolve the HyperEVM alias from the secret rather than the rainix preflight's public default, so the unconditional forks this branch introduces are exercised against the secret path the new comments describe.

into the generated lib — the unhydrated pin, symmetric with the Ethereum
clone pin's pre-deploy state.
branch, so the same broadcast (already dispatchable on
hyperevmviamanual-broadcast) deploys + configures the HyperEVM authoriser once its
upstream gates land, and refuses re-deploys after the pin hydrates.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01VPs1hCTxusmaSeFKvoc4Kr
Summary by CodeRabbit
New Features
Bug Fixes