feat: resolve rollup address from Aztec Registry, drop static config#59
Merged
feat: resolve rollup address from Aztec Registry, drop static config#59
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CanonicalRollupUpdatedevents into a newrollup_versiontable, and uses Ponder's factory pattern on the same event to auto-index every canonical rollup, historical, current, and future upgrades without a config change.GET /api/rollupsreturns current canonical + full history ([{version, address, blockNumber, timestamp}, ...]). Source of truth is the indexed table; served by a trivial select.getCanonicalRollupAddressnow reads the DB table first and only falls back to live Registry RPC during the brief pre-sync window.fetch(${VITE_API_HOST}/api/rollups)at boot, no viem, no RPC dependency, no Registry ABI. Caches the full version list ingetRollupVersions().ROLLUP_ADDRESSwithREGISTRY_ADDRESS+REGISTRY_START_BLOCKon the indexer; dropsVITE_ROLLUP_ADDRESSentirely on the frontendWhy
Rollup cutovers (
Registry.addRollup()) change the canonical rollup's address. Previously that address was baked into env vars / CI secrets / Terraform, so every upgrade required a coordinated redeploy of both services. The Aztec Registry already exposes this viagetCanonicalRollup()and emitsCanonicalRollupUpdatedon every upgrade.After this change: upgrades are picked up automatically. The indexer keeps indexing events from every historical rollup forever (claims / withdrawal finalizations on old rollups continue flowing through existing handlers), and the frontend reads the current rollup on every page load.
Scope note
This PR makes the dashboard upgrade-aware for normal operation against the current canonical rollup. It does not yet let users claim rewards or finalize withdrawals against old rollups — the event data is preserved (
rollupAddressis on every event in the schema), but the UI still issues claim/finalize transactions against the current canonical rollup only. This will follow in a follow-up PR.Mainnet config values
0x35b22e09Ee0390539439E24f06Da43D83f90e298237868270xAe2001f7e21d5EcABf6234E9FDd1E76F50F74962numberOfVersions(): 2, factory backfill will replay bothDeploy checklist
REGISTRY_ADDRESS+REGISTRY_DEPLOYMENT_BLOCKas GitHub environment vars fortestnetandprod(both indexer + dashboard environments).ROLLUP_ADDRESSGH env var can be removed.REGISTRY_START_BLOCK(~ATP factory deployment).contract_addresses.jsonfiles held outside the repo needregistryAddress+registryDeploymentBlockadded androllupAddressremoved.