Skip to content

Per-network beacon for registry beacon proxy suites - #309

Open
thedavidmeister wants to merge 46 commits into
mainfrom
registry-beacon-per-network
Open

thedavidmeister wants to merge 46 commits into
mainfrom
registry-beacon-per-network

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

What

Registry beacon proxy suites declare their beacon only as a per-chain list of RegistryBeaconOnNetwork{chainId, beacon, codeHash}, mirroring clone suites' initDataPerNetwork. A suite with one beacon lists it for each of its chains. One code path handles every suite: binding check, code-hash check, owner-key check and local simulation. Off-chain only: no contract, factory bytecode, proxy creation code or predicted address changes.

Why

A consumer (S01-Issuer/st0x.deploy#656 ) needs one token suite to cover every chain, each on its own live beacon; Base's set differs from the others'.

Breaking API change

  • New struct RegistryBeaconOnNetwork { uint256 chainId; address beacon; bytes32 codeHash; }.
  • RegistryBeaconProxyDeploy and RegistryBeaconProxyParams drop address beacon and carry RegistryBeaconOnNetwork[] beaconPerNetwork in its place. Struct literals and abi.decode of the params change shape; single-beacon declarations must list their beacon and its code hash per chain.
  • LibRainDeployRegistryBeaconProxy.beaconOnNetwork(params, chainId) returns that chain's entry, refusing RegistryBeaconProxyNoBeaconOnNetwork for none or a duplicate.
  • checkBeacon checks the binding and the beacon's code hash (RegistryBeaconProxyBeaconCodeHashMismatch) against beaconOnNetwork(params, block.chainid) for every suite. Fails closed.
  • registryBeaconProxyParams no longer checks a beacon among dependencies; the per-chain binding and code-hash check covers it.
  • The 4-arg registryBeaconProxyRuntimeCode(vm, params, implementation, implementationCode) is removed. Use registryBeaconProxyRuntimeCodeOnNetwork(vm, params, chainId, implementation, implementationCode), or registryBeaconProxyRuntimeCode(vm, params, beacon, implementation, implementationCode) for an explicit beacon.
  • checkBroadcastSeat reads the owner of that chain's beacon.

Dependency

rain-deploy is a temporary git dependency pinned to 1ae4dcd0c357748fa3b3eaa8c6abf80cca099c33 for rainlanguage/rain.deploy#415 . It returns to a versioned release once rain-deploy releases that change.

QA

  • Discriminating tests: pending - test/lib helper updated to the new shape; test/src suites still reference the removed beacon field and are the test agent's to port, with per-network binding, code hash and missing/duplicate chain id tests
  • Mutations applied: n/a - mutation runs last, after CI green and review
  • Oracle: the registry binding and extcodehash on each network, independent of the declared params
  • Category check: one representation, one path for local simulation, binding check, code check and owner-key check - all in src; tests pending

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Nov 30, 2026
thedavidmeister and others added 6 commits November 30, 2026 12:09
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oxy tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The per-network beacon array cannot be copied from memory to storage under legacy codegen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove the single beacon field and RegistryBeaconProxyBeaconAmbiguous; one path
handles every suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests read each suite's beacon from beaconPerNetwork, declare only the
factory and registry as dependencies, and cover beaconOnNetwork's
missing and duplicate chain refusals, checkBeacon's per-chain binding
and code-hash refusals, and the address ignoring the beacon list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thedavidmeister and others added 21 commits November 30, 2026 14:06
…ode (WIP)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…try beacon proxy suites

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…expose expectedBytecodeHash lookup; lock rain-deploy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…test call sites

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…roxy code hash

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…date's stored code against it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y without validating the code it generates

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l initialize

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… proxy step

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…acon proxy is read

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thedavidmeister and others added 16 commits November 30, 2026 18:27
…e and on another chain's

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fix expectRevert ordering

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
checkSuiteOnNetwork and appliedState take the resolved beacon's chain id
instead of reading block.chainid, so offline checks hold suites to the
derivation for the beacon's network.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LibRainDeployRegistryBeaconProxy.checkBeacon takes the chain id whose
declared beacon to hold the binding to; checkOnChain passes the checked
network's chain id instead of block.chainid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… tests and refuse a twice-listed chain at the candidate

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a state without its storage

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thedavidmeister and others added 2 commits November 30, 2026 19:02
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…twice

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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