You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 60a74b6
Browse filesBrowse the repository at this point in the historyBrowse files
fix: cache contract start blocks and fail over between L1 endpoints
The previous commit made discovery derive a deployment block per contract, which
turned one ~25-call binary search into seven. Against Sepolia's public Tenderly
gateway that exhausted the rate limit outright and the deploy failed at
`aztec_node : Discover` — mainnet succeeded, testnet did not. Retrying does not
help once an endpoint's budget is gone; that endpoint is currently answering 429
to a single eth_blockNumber.
Two changes so routine deploys stop paying for information that cannot change.
Cache the searches. A contract's deployment block is immutable, so it now lives
in the committed config.json and is only re-derived when that contract's address
actually changes — i.e. on an upgrade, for the one or two contracts that were
redeployed. Verified against a mock: a steady-state run issues zero eth_getCode
calls, and a simulated upgrade re-derives exactly the two changed contracts while
the five survivors stay cached.
This reverses the earlier decision to commit zeroed addresses. Discovery still
verifies every address against the node on each deploy and rewrites any that
disagree, so a stale value self-corrects; an absent one costs ~175 RPC calls. The
zero-address guard in scripts/env/utils.js still blocks propagation if discovery
has not run.
Fail over between endpoints. Discovery used only rpc.ethereumUrls[0]. Calls at
`latest` now try each configured endpoint in turn, which matters on testnet where
the second is a pruning node: pruning only affects historical state, so it serves
eth_call and eth_blockNumber fine. The deployment-block search opts out and stays
on the primary, since it is the one caller that needs history.
Testnet start blocks are seeded from the 9500000 floor this repo used before
per-contract blocks existed (commit 6ed974f) rather than measured, because its L1
endpoint cannot currently sustain the search. Correct but wasteful — worth
replacing with measured values once testnet has an endpoint that can.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
"_comment": "Discovered by `pnpm env:discover mainnet` from the Aztec node (node_getL1ContractAddresses) plus Rollup.getSlasher()/Slasher.PROPOSER(). stakingRegistryAddress is not part of the Aztec core deployment and must be set by hand."
"_comment": "Verified against the Aztec node on every deploy by `pnpm env:discover mainnet` and rewritten if the chain disagrees. Committed rather than zeroed so the deploy can skip the ~25-call deployment-block search per contract; a wrong value here is corrected automatically, an absent one costs ~175 RPC calls. stakingRegistryAddress is not part of the Aztec core deployment and is not discovered."
37
37
},
38
38
"collectors": {
39
39
"validatorStats": {
@@ -69,8 +69,16 @@
69
69
"ponder": {
70
70
"port": 42069,
71
71
"maxHealthcheckDuration": 240,
72
-
"startBlock": 0,
73
-
"startBlocks": {},
72
+
"startBlock": 25428902,
73
+
"startBlocks": {
74
+
"governance": 23786829,
75
+
"governanceProposer": 23786828,
76
+
"gse": 23786826,
77
+
"registry": 23786827,
78
+
"rollup": 25428902,
79
+
"slashingProposer": 25428902,
80
+
"stakingRegistry": 23786843
81
+
},
74
82
"_comment": "startBlock and startBlocks are set by `pnpm env:discover mainnet`. A rollup upgrade redeploys only the rollup and its slashing proposer; the GSE, registry, governance, governance proposer and staking registry keep their addresses, so each is indexed from its own deployment block. Indexing them all from the new rollup discards their earlier events."
"_comment": "Verified against the Aztec node on every deploy by `pnpm env:discover mainnet` and rewritten if the chain disagrees. Committed rather than zeroed so the deploy can skip the ~25-call deployment-block search per contract; a wrong value here is corrected automatically, an absent one costs ~175 RPC calls. stakingRegistryAddress is not part of the Aztec core deployment and is not discovered."
36
37
},
37
38
"collectors": {
38
39
"validatorStats": {
@@ -68,8 +69,16 @@
68
69
"ponder": {
69
70
"port": 42069,
70
71
"maxHealthcheckDuration": 240,
71
-
"startBlock": 0,
72
-
"startBlocks": {},
72
+
"startBlock": 25428902,
73
+
"startBlocks": {
74
+
"governance": 23786829,
75
+
"governanceProposer": 23786828,
76
+
"gse": 23786826,
77
+
"registry": 23786827,
78
+
"rollup": 25428902,
79
+
"slashingProposer": 25428902,
80
+
"stakingRegistry": 23786843
81
+
},
73
82
"_comment": "startBlock and startBlocks are set by `pnpm env:discover mainnet`. A rollup upgrade redeploys only the rollup and its slashing proposer; the GSE, registry, governance, governance proposer and staking registry keep their addresses, so each is indexed from its own deployment block. Indexing them all from the new rollup discards their earlier events."
"_comment": "Discovered by `pnpm env:discover testnet` from the Aztec node (node_getL1ContractAddresses) plus Rollup.getSlasher()/Slasher.PROPOSER(). stakingRegistryAddress is not part of the Aztec core deployment and must be set by hand."
"_comment": "Verified against the Aztec node on every deploy by `pnpm env:discover testnet` and rewritten if the chain disagrees. Committed rather than zeroed so the deploy can skip the ~25-call deployment-block search per contract. slashingProposerAddress is derived on-chain each run (Rollup.getSlasher -> Slasher.PROPOSER). stakingRegistryAddress is not part of the Aztec core deployment and is not discovered."
37
37
},
38
38
"collectors": {
39
39
"validatorStats": {
@@ -69,9 +69,17 @@
69
69
"ponder": {
70
70
"port": 42069,
71
71
"maxHealthcheckDuration": 240,
72
-
"startBlock": 0,
73
-
"startBlocks": {},
74
-
"_comment": "startBlock and startBlocks are set by `pnpm env:discover testnet`. A rollup upgrade redeploys only the rollup and its slashing proposer; the GSE, registry, governance, governance proposer and staking registry keep their addresses, so each is indexed from its own deployment block. Indexing them all from the new rollup discards their earlier events."
72
+
"startBlock": 11250166,
73
+
"startBlocks": {
74
+
"governance": 9500000,
75
+
"governanceProposer": 9500000,
76
+
"gse": 9500000,
77
+
"registry": 9500000,
78
+
"rollup": 11250166,
79
+
"slashingProposer": 11250166,
80
+
"stakingRegistry": 9500000
81
+
},
82
+
"_comment": "startBlock/startBlocks are verified by `pnpm env:discover testnet` and only re-derived when a contract address changes. Survivor blocks are the historical 9500000 floor rather than measured deployments \u2014 correct but wasteful; see contracts._comment."
"_comment": "Verified against the Aztec node on every deploy by `pnpm env:discover testnet` and rewritten if the chain disagrees. Committed rather than zeroed so the deploy can skip the ~25-call deployment-block search per contract. slashingProposerAddress is derived on-chain each run (Rollup.getSlasher -> Slasher.PROPOSER). stakingRegistryAddress is not part of the Aztec core deployment and is not discovered."
36
37
},
37
38
"collectors": {
38
39
"validatorStats": {
@@ -68,9 +69,17 @@
68
69
"ponder": {
69
70
"port": 42069,
70
71
"maxHealthcheckDuration": 240,
71
-
"startBlock": 0,
72
-
"startBlocks": {},
73
-
"_comment": "startBlock and startBlocks are set by `pnpm env:discover testnet`. A rollup upgrade redeploys only the rollup and its slashing proposer; the GSE, registry, governance, governance proposer and staking registry keep their addresses, so each is indexed from its own deployment block. Indexing them all from the new rollup discards their earlier events."
72
+
"startBlock": 11250166,
73
+
"startBlocks": {
74
+
"governance": 9500000,
75
+
"governanceProposer": 9500000,
76
+
"gse": 9500000,
77
+
"registry": 9500000,
78
+
"rollup": 11250166,
79
+
"slashingProposer": 11250166,
80
+
"stakingRegistry": 9500000
81
+
},
82
+
"_comment": "startBlock/startBlocks are verified by `pnpm env:discover testnet` and only re-derived when a contract address changes. Survivor blocks are the historical 9500000 floor rather than measured deployments \u2014 correct but wasteful; see contracts._comment."
0 commit comments