@aztec/ethereum 3.0.0-canary.a9708bd → 3.0.0-devnet.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/dest/client.d.ts +1 -1
  2. package/dest/client.d.ts.map +1 -1
  3. package/dest/config.d.ts +11 -6
  4. package/dest/config.d.ts.map +1 -1
  5. package/dest/config.js +124 -64
  6. package/dest/contracts/empire_base.d.ts +1 -1
  7. package/dest/contracts/empire_base.d.ts.map +1 -1
  8. package/dest/contracts/empire_slashing_proposer.d.ts +2 -2
  9. package/dest/contracts/empire_slashing_proposer.d.ts.map +1 -1
  10. package/dest/contracts/empire_slashing_proposer.js +1 -1
  11. package/dest/contracts/fee_asset_handler.d.ts +3 -3
  12. package/dest/contracts/fee_asset_handler.d.ts.map +1 -1
  13. package/dest/contracts/governance.js +7 -3
  14. package/dest/contracts/governance_proposer.d.ts +1 -2
  15. package/dest/contracts/governance_proposer.d.ts.map +1 -1
  16. package/dest/contracts/governance_proposer.js +1 -2
  17. package/dest/contracts/multicall.d.ts +3 -5
  18. package/dest/contracts/multicall.d.ts.map +1 -1
  19. package/dest/contracts/multicall.js +6 -4
  20. package/dest/contracts/rollup.d.ts +39 -19
  21. package/dest/contracts/rollup.d.ts.map +1 -1
  22. package/dest/contracts/rollup.js +84 -88
  23. package/dest/contracts/slasher_contract.d.ts +10 -0
  24. package/dest/contracts/slasher_contract.d.ts.map +1 -1
  25. package/dest/contracts/slasher_contract.js +18 -0
  26. package/dest/contracts/tally_slashing_proposer.d.ts +22 -3
  27. package/dest/contracts/tally_slashing_proposer.d.ts.map +1 -1
  28. package/dest/contracts/tally_slashing_proposer.js +55 -5
  29. package/dest/deploy_l1_contracts.d.ts +22 -7
  30. package/dest/deploy_l1_contracts.d.ts.map +1 -1
  31. package/dest/deploy_l1_contracts.js +555 -362
  32. package/dest/index.d.ts +1 -1
  33. package/dest/index.d.ts.map +1 -1
  34. package/dest/index.js +1 -1
  35. package/dest/l1_artifacts.d.ts +8729 -6014
  36. package/dest/l1_artifacts.d.ts.map +1 -1
  37. package/dest/l1_artifacts.js +10 -5
  38. package/dest/l1_contract_addresses.d.ts +5 -1
  39. package/dest/l1_contract_addresses.d.ts.map +1 -1
  40. package/dest/l1_contract_addresses.js +16 -26
  41. package/dest/l1_reader.d.ts +1 -1
  42. package/dest/l1_reader.d.ts.map +1 -1
  43. package/dest/l1_reader.js +8 -8
  44. package/dest/l1_tx_utils/config.d.ts +59 -0
  45. package/dest/l1_tx_utils/config.d.ts.map +1 -0
  46. package/dest/l1_tx_utils/config.js +73 -0
  47. package/dest/l1_tx_utils/constants.d.ts +6 -0
  48. package/dest/l1_tx_utils/constants.d.ts.map +1 -0
  49. package/dest/l1_tx_utils/constants.js +14 -0
  50. package/dest/l1_tx_utils/factory.d.ts +24 -0
  51. package/dest/l1_tx_utils/factory.d.ts.map +1 -0
  52. package/dest/l1_tx_utils/factory.js +12 -0
  53. package/dest/l1_tx_utils/index.d.ts +10 -0
  54. package/dest/l1_tx_utils/index.d.ts.map +1 -0
  55. package/dest/l1_tx_utils/index.js +10 -0
  56. package/dest/l1_tx_utils/interfaces.d.ts +76 -0
  57. package/dest/l1_tx_utils/interfaces.d.ts.map +1 -0
  58. package/dest/l1_tx_utils/interfaces.js +4 -0
  59. package/dest/l1_tx_utils/l1_tx_utils.d.ts +95 -0
  60. package/dest/l1_tx_utils/l1_tx_utils.d.ts.map +1 -0
  61. package/dest/l1_tx_utils/l1_tx_utils.js +610 -0
  62. package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts +26 -0
  63. package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts.map +1 -0
  64. package/dest/l1_tx_utils/l1_tx_utils_with_blobs.js +26 -0
  65. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts +81 -0
  66. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -0
  67. package/dest/l1_tx_utils/readonly_l1_tx_utils.js +294 -0
  68. package/dest/l1_tx_utils/signer.d.ts +4 -0
  69. package/dest/l1_tx_utils/signer.d.ts.map +1 -0
  70. package/dest/l1_tx_utils/signer.js +16 -0
  71. package/dest/l1_tx_utils/types.d.ts +67 -0
  72. package/dest/l1_tx_utils/types.d.ts.map +1 -0
  73. package/dest/l1_tx_utils/types.js +26 -0
  74. package/dest/l1_tx_utils/utils.d.ts +4 -0
  75. package/dest/l1_tx_utils/utils.d.ts.map +1 -0
  76. package/dest/l1_tx_utils/utils.js +14 -0
  77. package/dest/publisher_manager.d.ts +7 -2
  78. package/dest/publisher_manager.d.ts.map +1 -1
  79. package/dest/publisher_manager.js +36 -8
  80. package/dest/queries.d.ts.map +1 -1
  81. package/dest/queries.js +11 -12
  82. package/dest/test/chain_monitor.d.ts +11 -0
  83. package/dest/test/chain_monitor.d.ts.map +1 -1
  84. package/dest/test/chain_monitor.js +81 -12
  85. package/dest/test/delayed_tx_utils.d.ts +2 -2
  86. package/dest/test/delayed_tx_utils.d.ts.map +1 -1
  87. package/dest/test/delayed_tx_utils.js +2 -2
  88. package/dest/test/eth_cheat_codes.d.ts +32 -6
  89. package/dest/test/eth_cheat_codes.d.ts.map +1 -1
  90. package/dest/test/eth_cheat_codes.js +115 -28
  91. package/dest/test/rollup_cheat_codes.d.ts +11 -9
  92. package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
  93. package/dest/test/rollup_cheat_codes.js +38 -6
  94. package/dest/test/upgrade_utils.d.ts.map +1 -1
  95. package/dest/test/upgrade_utils.js +3 -2
  96. package/dest/utils.d.ts.map +1 -1
  97. package/dest/utils.js +10 -161
  98. package/dest/zkPassportVerifierAddress.js +1 -1
  99. package/package.json +7 -7
  100. package/src/client.ts +1 -1
  101. package/src/config.ts +136 -68
  102. package/src/contracts/empire_base.ts +1 -1
  103. package/src/contracts/empire_slashing_proposer.ts +7 -3
  104. package/src/contracts/fee_asset_handler.ts +1 -1
  105. package/src/contracts/governance.ts +3 -3
  106. package/src/contracts/governance_proposer.ts +3 -4
  107. package/src/contracts/multicall.ts +12 -10
  108. package/src/contracts/rollup.ts +104 -106
  109. package/src/contracts/slasher_contract.ts +22 -0
  110. package/src/contracts/tally_slashing_proposer.ts +54 -6
  111. package/src/deploy_l1_contracts.ts +570 -328
  112. package/src/index.ts +1 -1
  113. package/src/l1_artifacts.ts +14 -6
  114. package/src/l1_contract_addresses.ts +17 -26
  115. package/src/l1_reader.ts +9 -9
  116. package/src/l1_tx_utils/README.md +177 -0
  117. package/src/l1_tx_utils/config.ts +140 -0
  118. package/src/l1_tx_utils/constants.ts +18 -0
  119. package/src/l1_tx_utils/factory.ts +64 -0
  120. package/src/l1_tx_utils/index.ts +12 -0
  121. package/src/l1_tx_utils/interfaces.ts +86 -0
  122. package/src/l1_tx_utils/l1_tx_utils.ts +718 -0
  123. package/src/l1_tx_utils/l1_tx_utils_with_blobs.ts +77 -0
  124. package/src/l1_tx_utils/readonly_l1_tx_utils.ts +372 -0
  125. package/src/l1_tx_utils/signer.ts +28 -0
  126. package/src/l1_tx_utils/types.ts +85 -0
  127. package/src/l1_tx_utils/utils.ts +16 -0
  128. package/src/publisher_manager.ts +51 -9
  129. package/src/queries.ts +13 -8
  130. package/src/test/chain_monitor.ts +89 -9
  131. package/src/test/delayed_tx_utils.ts +2 -2
  132. package/src/test/eth_cheat_codes.ts +142 -29
  133. package/src/test/rollup_cheat_codes.ts +54 -14
  134. package/src/test/upgrade_utils.ts +3 -2
  135. package/src/utils.ts +13 -185
  136. package/src/zkPassportVerifierAddress.ts +1 -1
  137. package/dest/l1_tx_utils.d.ts +0 -250
  138. package/dest/l1_tx_utils.d.ts.map +0 -1
  139. package/dest/l1_tx_utils.js +0 -826
  140. package/dest/l1_tx_utils_with_blobs.d.ts +0 -19
  141. package/dest/l1_tx_utils_with_blobs.d.ts.map +0 -1
  142. package/dest/l1_tx_utils_with_blobs.js +0 -85
  143. package/src/l1_tx_utils.ts +0 -1105
  144. package/src/l1_tx_utils_with_blobs.ts +0 -144
@@ -2,7 +2,7 @@ import { EthAddress } from '@aztec/foundation/eth-address';
2
2
  /**
3
3
  * The address of the zk passport verifier on sepolia
4
4
  * get address from: ROOT/l1-contracts/lib/circuits/src/solidity/deployments/deployment-11155111.json
5
- */ export const ZK_PASSPORT_VERIFIER_ADDRESS = EthAddress.fromString('0x62e33cC35e29130e135341586e8Cf9C2BAbFB3eE');
5
+ */ export const ZK_PASSPORT_VERIFIER_ADDRESS = EthAddress.fromString('0x3101Bad9eA5fACadA5554844a1a88F7Fe48D4DE0');
6
6
  /**
7
7
  * The default domain of the zk passport site
8
8
  */ export const ZK_PASSPORT_DOMAIN = 'testnet.aztec.network';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/ethereum",
3
- "version": "3.0.0-canary.a9708bd",
3
+ "version": "3.0.0-devnet.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/index.js",
@@ -8,7 +8,7 @@
8
8
  "./contracts": "./dest/contracts/index.js",
9
9
  "./deploy-l1-contracts": "./dest/deploy_l1_contracts.js",
10
10
  "./l1-contract-addresses": "./dest/l1_contract_addresses.js",
11
- "./l1-tx-utils-with-blobs": "./dest/l1_tx_utils_with_blobs.js",
11
+ "./l1-tx-utils-with-blobs": "./dest/l1_tx_utils/l1_tx_utils_with_blobs.js",
12
12
  "./utils": "./dest/utils.js"
13
13
  },
14
14
  "typedocOptions": {
@@ -31,16 +31,16 @@
31
31
  "../package.common.json"
32
32
  ],
33
33
  "dependencies": {
34
- "@aztec/blob-lib": "3.0.0-canary.a9708bd",
35
- "@aztec/constants": "3.0.0-canary.a9708bd",
36
- "@aztec/foundation": "3.0.0-canary.a9708bd",
37
- "@aztec/l1-artifacts": "3.0.0-canary.a9708bd",
34
+ "@aztec/blob-lib": "3.0.0-devnet.3",
35
+ "@aztec/constants": "3.0.0-devnet.3",
36
+ "@aztec/foundation": "3.0.0-devnet.3",
37
+ "@aztec/l1-artifacts": "3.0.0-devnet.3",
38
38
  "@viem/anvil": "^0.0.10",
39
39
  "dotenv": "^16.0.3",
40
40
  "lodash.chunk": "^4.2.0",
41
41
  "lodash.pickby": "^4.5.0",
42
42
  "tslib": "^2.4.0",
43
- "viem": "2.23.7",
43
+ "viem": "npm:@spalladino/viem@2.38.2-eip7594.0",
44
44
  "zod": "^3.23.8"
45
45
  },
46
46
  "devDependencies": {
package/src/client.ts CHANGED
@@ -19,7 +19,7 @@ import { createEthereumChain } from './chain.js';
19
19
  import type { ExtendedViemWalletClient, ViemPublicClient } from './types.js';
20
20
 
21
21
  type Config = {
22
- /** The RPC Url of the ethereum host. */
22
+ /** List of URLs of Ethereum RPC nodes that services will connect to (comma separated). */
23
23
  l1RpcUrls: string[];
24
24
  /** The chain ID of the ethereum host. */
25
25
  l1ChainId: number;
package/src/config.ts CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  } from '@aztec/foundation/config';
11
11
  import { EthAddress } from '@aztec/foundation/eth-address';
12
12
 
13
- import { type L1TxUtilsConfig, l1TxUtilsConfigMappings } from './l1_tx_utils.js';
13
+ import { type L1TxUtilsConfig, l1TxUtilsConfigMappings } from './l1_tx_utils/index.js';
14
14
 
15
15
  export type GenesisStateConfig = {
16
16
  /** Whether to populate the genesis state with initial fee juice for the test accounts */
@@ -28,12 +28,16 @@ export type L1ContractsConfig = {
28
28
  aztecEpochDuration: number;
29
29
  /** The target validator committee size. */
30
30
  aztecTargetCommitteeSize: number;
31
+ /** The number of epochs to lag behind the current epoch for validator selection. */
32
+ lagInEpochs: number;
31
33
  /** The number of epochs after an epoch ends that proofs are still accepted. */
32
34
  aztecProofSubmissionEpochs: number;
33
35
  /** The deposit amount for a validator */
34
36
  activationThreshold: bigint;
35
37
  /** The minimum stake for a validator. */
36
38
  ejectionThreshold: bigint;
39
+ /** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */
40
+ localEjectionThreshold: bigint;
37
41
  /** The slashing quorum, i.e. how many slots must signal for the same payload in a round for it to be submittable to the Slasher (defaults to slashRoundSize / 2 + 1) */
38
42
  slashingQuorum?: number;
39
43
  /** The slashing round size, i.e. how many epochs are in a slashing round */
@@ -46,6 +50,8 @@ export type L1ContractsConfig = {
46
50
  slashingVetoer: EthAddress;
47
51
  /** How many slashing rounds back we slash (ie when slashing in round N, we slash for offenses committed during epochs of round N-offset) */
48
52
  slashingOffsetInRounds: number;
53
+ /** How long slashing can be disabled for in seconds when vetoer disables it */
54
+ slashingDisableDuration: number;
49
55
  /** Type of slasher proposer */
50
56
  slasherFlavor: 'empire' | 'tally' | 'none';
51
57
  /** Minimum amount that can be slashed in tally slashing */
@@ -71,12 +77,14 @@ export const DefaultL1ContractsConfig = {
71
77
  aztecSlotDuration: 36,
72
78
  aztecEpochDuration: 32,
73
79
  aztecTargetCommitteeSize: 48,
80
+ lagInEpochs: 2,
74
81
  aztecProofSubmissionEpochs: 1, // you have a full epoch to submit a proof after the epoch to prove ends
75
- activationThreshold: BigInt(100e18),
76
- ejectionThreshold: BigInt(50e18),
77
- slashAmountSmall: BigInt(10e18),
78
- slashAmountMedium: BigInt(20e18),
79
- slashAmountLarge: BigInt(50e18),
82
+ activationThreshold: 100n * 10n ** 18n,
83
+ ejectionThreshold: 50n * 10n ** 18n,
84
+ localEjectionThreshold: 98n * 10n ** 18n,
85
+ slashAmountSmall: 10n * 10n ** 18n,
86
+ slashAmountMedium: 20n * 10n ** 18n,
87
+ slashAmountLarge: 50n * 10n ** 18n,
80
88
  slashingRoundSizeInEpochs: 4,
81
89
  slashingLifetimeInRounds: 5,
82
90
  slashingExecutionDelayInRounds: 0, // round N may be submitted in round N + 1
@@ -87,6 +95,7 @@ export const DefaultL1ContractsConfig = {
87
95
  exitDelaySeconds: 2 * 24 * 60 * 60,
88
96
  slasherFlavor: 'tally' as const,
89
97
  slashingOffsetInRounds: 2,
98
+ slashingDisableDuration: 5 * 24 * 60 * 60, // 5 days in seconds
90
99
  } satisfies L1ContractsConfig;
91
100
 
92
101
  const LocalGovernanceConfiguration = {
@@ -103,113 +112,156 @@ const LocalGovernanceConfiguration = {
103
112
  minimumVotes: 400n * 10n ** 18n,
104
113
  };
105
114
 
106
- const TestnetGovernanceConfiguration = {
115
+ const StagingPublicGovernanceConfiguration = {
107
116
  proposeConfig: {
108
- lockDelay: 60n * 60n * 24n,
117
+ lockDelay: 60n * 60n * 24n * 30n,
109
118
  lockAmount: DefaultL1ContractsConfig.activationThreshold * 100n,
110
119
  },
111
120
  votingDelay: 60n,
112
121
  votingDuration: 60n * 60n,
113
- executionDelay: 60n * 60n * 24n,
122
+ executionDelay: 60n,
114
123
  gracePeriod: 60n * 60n * 24n * 7n,
115
124
  quorum: 3n * 10n ** 17n, // 30%
116
125
  requiredYeaMargin: 4n * 10n ** 16n, // 4%
117
- minimumVotes: DefaultL1ContractsConfig.ejectionThreshold * 200n,
126
+ minimumVotes: DefaultL1ContractsConfig.ejectionThreshold * 200n, // >= 200 validators must vote
118
127
  };
119
128
 
120
- export const getGovernanceConfiguration = (networkName: NetworkNames) => {
121
- if (networkName === 'alpha-testnet' || networkName === 'testnet') {
122
- return TestnetGovernanceConfiguration;
123
- }
124
- return LocalGovernanceConfiguration;
125
- };
129
+ const TestnetGovernanceConfiguration = {
130
+ proposeConfig: {
131
+ lockDelay: 10n * 365n * 24n * 60n * 60n,
132
+ lockAmount: 1250n * 200_000n * 10n ** 18n,
133
+ },
126
134
 
127
- const TestnetGSEConfiguration = {
128
- activationThreshold: BigInt(100e18),
129
- ejectionThreshold: BigInt(50e18),
135
+ votingDelay: 12n * 60n * 60n, // 12 hours
136
+ votingDuration: 1n * 24n * 60n * 60n, // 1 day
137
+ executionDelay: 12n * 60n * 60n, // 12 hours
138
+ gracePeriod: 1n * 24n * 60n * 60n, // 1 day
139
+ quorum: 2n * 10n ** 17n, // 20%
140
+ requiredYeaMargin: 1n * 10n ** 17n, // 10%
141
+ minimumVotes: 1250n * 200_000n * 10n ** 18n,
130
142
  };
131
143
 
132
- const LocalGSEConfiguration = {
133
- activationThreshold: BigInt(100e18),
134
- ejectionThreshold: BigInt(50e18),
144
+ const StagingIgnitionGovernanceConfiguration = {
145
+ proposeConfig: {
146
+ lockDelay: 10n * 365n * 24n * 60n * 60n,
147
+ lockAmount: 1250n * 200_000n * 10n ** 18n,
148
+ },
149
+
150
+ votingDelay: 7n * 24n * 60n * 60n,
151
+ votingDuration: 7n * 24n * 60n * 60n,
152
+ executionDelay: 30n * 24n * 60n * 60n,
153
+ gracePeriod: 7n * 24n * 60n * 60n,
154
+ quorum: 2n * 10n ** 17n, // 20%
155
+ requiredYeaMargin: 1n * 10n ** 17n, // 10%
156
+ minimumVotes: 1250n * 200_000n * 10n ** 18n,
135
157
  };
136
158
 
137
- export const getGSEConfiguration = (networkName: NetworkNames) => {
138
- if (networkName === 'alpha-testnet' || networkName === 'testnet') {
139
- return TestnetGSEConfiguration;
159
+ export const getGovernanceConfiguration = (networkName: NetworkNames) => {
160
+ switch (networkName) {
161
+ case 'local':
162
+ return LocalGovernanceConfiguration;
163
+ case 'next-net':
164
+ return LocalGovernanceConfiguration;
165
+ case 'devnet':
166
+ return LocalGovernanceConfiguration;
167
+ case 'staging-public':
168
+ return StagingPublicGovernanceConfiguration;
169
+ case 'testnet':
170
+ return TestnetGovernanceConfiguration;
171
+ case 'staging-ignition':
172
+ return StagingIgnitionGovernanceConfiguration;
173
+ default:
174
+ throw new Error(`Unrecognized network name: ${networkName}`);
140
175
  }
141
- return LocalGSEConfiguration;
142
176
  };
143
177
 
144
178
  // Making a default config here as we are only using it thought the deployment
145
179
  // and do not expect to be using different setups, so having environment variables
146
180
  // for it seems overkill
147
- const LocalRewardConfig = {
148
- sequencerBps: 5000,
149
- rewardDistributor: EthAddress.ZERO.toString(),
150
- booster: EthAddress.ZERO.toString(),
151
- blockReward: BigInt(50e18),
152
- };
153
181
 
154
- const TestnetRewardConfig = {
155
- sequencerBps: 5000,
182
+ const DefaultRewardConfig = {
183
+ sequencerBps: 8000,
156
184
  rewardDistributor: EthAddress.ZERO.toString(),
157
185
  booster: EthAddress.ZERO.toString(),
158
- blockReward: BigInt(50e18),
186
+ blockReward: 500n * 10n ** 18n,
159
187
  };
160
188
 
161
189
  export const getRewardConfig = (networkName: NetworkNames) => {
162
- if (networkName === 'alpha-testnet' || networkName === 'testnet') {
163
- return TestnetRewardConfig;
190
+ switch (networkName) {
191
+ case 'local':
192
+ case 'devnet':
193
+ case 'next-net':
194
+ case 'staging-public':
195
+ case 'testnet':
196
+ case 'staging-ignition':
197
+ return DefaultRewardConfig;
198
+ default:
199
+ throw new Error(`Unrecognized network name: ${networkName}`);
164
200
  }
165
- return LocalRewardConfig;
166
- };
167
-
168
- const LocalRewardBoostConfig = {
169
- increment: 200000,
170
- maxScore: 5000000,
171
- a: 5000,
172
- k: 1000000,
173
- minimum: 100000,
174
201
  };
175
202
 
176
- const TestnetRewardBoostConfig = {
177
- increment: 125000,
178
- maxScore: 15000000,
179
- a: 1000,
180
- k: 1000000,
181
- minimum: 100000,
182
- };
183
-
184
- export const getRewardBoostConfig = (networkName: NetworkNames) => {
185
- if (networkName === 'alpha-testnet' || networkName === 'testnet') {
186
- return TestnetRewardBoostConfig;
187
- }
188
- return LocalRewardBoostConfig;
203
+ export const getRewardBoostConfig = () => {
204
+ // The reward configuration is specified with a precision of 1e5, and we use the same across
205
+ // all networks.
206
+ return {
207
+ increment: 125000, // 1.25
208
+ maxScore: 15000000, // 150
209
+ a: 1000, // 0.01
210
+ k: 1000000, // 10
211
+ minimum: 100000, // 1
212
+ };
189
213
  };
190
214
 
191
215
  // Similar to the above, no need for environment variables for this.
192
216
  const LocalEntryQueueConfig = {
193
217
  bootstrapValidatorSetSize: 0n,
194
218
  bootstrapFlushSize: 0n,
195
- normalFlushSizeMin: 48n, // will effectively be bounded by maxQueueFlushSize
219
+ normalFlushSizeMin: 48n,
196
220
  normalFlushSizeQuotient: 2n,
197
221
  maxQueueFlushSize: 48n,
198
222
  };
199
223
 
200
- const TestnetEntryQueueConfig = {
201
- bootstrapValidatorSetSize: 750n,
202
- bootstrapFlushSize: 75n, // will effectively be bounded by maxQueueFlushSize
224
+ const StagingPublicEntryQueueConfig = {
225
+ bootstrapValidatorSetSize: 48n,
226
+ bootstrapFlushSize: 48n,
203
227
  normalFlushSizeMin: 1n,
204
228
  normalFlushSizeQuotient: 2475n,
205
229
  maxQueueFlushSize: 32n, // Limited to 32 so flush cost are kept below 15M gas.
206
230
  };
207
231
 
232
+ const TestnetEntryQueueConfig = {
233
+ bootstrapValidatorSetSize: 750n,
234
+ bootstrapFlushSize: 32n,
235
+ normalFlushSizeMin: 32n,
236
+ normalFlushSizeQuotient: 2475n,
237
+ maxQueueFlushSize: 32n,
238
+ };
239
+
240
+ const StagingIgnitionEntryQueueConfig = {
241
+ bootstrapValidatorSetSize: 48n,
242
+ bootstrapFlushSize: 48n,
243
+ normalFlushSizeMin: 1n,
244
+ normalFlushSizeQuotient: 2048n,
245
+ maxQueueFlushSize: 24n,
246
+ };
247
+
208
248
  export const getEntryQueueConfig = (networkName: NetworkNames) => {
209
- if (networkName === 'alpha-testnet' || networkName === 'testnet') {
210
- return TestnetEntryQueueConfig;
249
+ switch (networkName) {
250
+ case 'local':
251
+ return LocalEntryQueueConfig;
252
+ case 'next-net':
253
+ return LocalEntryQueueConfig;
254
+ case 'devnet':
255
+ return LocalEntryQueueConfig;
256
+ case 'staging-public':
257
+ return StagingPublicEntryQueueConfig;
258
+ case 'testnet':
259
+ return TestnetEntryQueueConfig;
260
+ case 'staging-ignition':
261
+ return StagingIgnitionEntryQueueConfig;
262
+ default:
263
+ throw new Error(`Unrecognized network name: ${networkName}`);
211
264
  }
212
- return LocalEntryQueueConfig;
213
265
  };
214
266
 
215
267
  export const l1ContractsConfigMappings: ConfigMappingsType<L1ContractsConfig> = {
@@ -233,6 +285,11 @@ export const l1ContractsConfigMappings: ConfigMappingsType<L1ContractsConfig> =
233
285
  description: 'The target validator committee size.',
234
286
  ...numberConfigHelper(DefaultL1ContractsConfig.aztecTargetCommitteeSize),
235
287
  },
288
+ lagInEpochs: {
289
+ env: 'AZTEC_LAG_IN_EPOCHS',
290
+ description: 'The number of epochs to lag behind the current epoch for validator selection.',
291
+ ...numberConfigHelper(DefaultL1ContractsConfig.lagInEpochs),
292
+ },
236
293
  aztecProofSubmissionEpochs: {
237
294
  env: 'AZTEC_PROOF_SUBMISSION_EPOCHS',
238
295
  description: 'The number of epochs after an epoch ends that proofs are still accepted.',
@@ -248,6 +305,12 @@ export const l1ContractsConfigMappings: ConfigMappingsType<L1ContractsConfig> =
248
305
  description: 'The minimum stake for a validator.',
249
306
  ...bigintConfigHelper(DefaultL1ContractsConfig.ejectionThreshold),
250
307
  },
308
+ localEjectionThreshold: {
309
+ env: 'AZTEC_LOCAL_EJECTION_THRESHOLD',
310
+ description:
311
+ 'The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup',
312
+ ...bigintConfigHelper(DefaultL1ContractsConfig.localEjectionThreshold),
313
+ },
251
314
  slashingOffsetInRounds: {
252
315
  env: 'AZTEC_SLASHING_OFFSET_IN_ROUNDS',
253
316
  description:
@@ -300,6 +363,11 @@ export const l1ContractsConfigMappings: ConfigMappingsType<L1ContractsConfig> =
300
363
  parseEnv: (val: string) => EthAddress.fromString(val),
301
364
  defaultValue: DefaultL1ContractsConfig.slashingVetoer,
302
365
  },
366
+ slashingDisableDuration: {
367
+ env: 'AZTEC_SLASHING_DISABLE_DURATION',
368
+ description: 'How long slashing can be disabled for in seconds when vetoer disables it',
369
+ ...numberConfigHelper(DefaultL1ContractsConfig.slashingDisableDuration),
370
+ },
303
371
  governanceProposerQuorum: {
304
372
  env: 'AZTEC_GOVERNANCE_PROPOSER_QUORUM',
305
373
  description: 'The governance proposing quorum',
@@ -373,7 +441,7 @@ export function validateConfig(config: Omit<L1ContractsConfig, keyof L1TxUtilsCo
373
441
  }
374
442
 
375
443
  // EmpireBase constructor validations for governance/slashing proposers
376
- // From: require(QUORUM_SIZE > ROUND_SIZE / 2, Errors.GovernanceProposer__InvalidQuorumAndRoundSize(QUORUM_SIZE, ROUND_SIZE));
444
+ // From: require(QUORUM_SIZE > ROUND_SIZE / 2, Errors.EmpireBase__InvalidQuorumAndRoundSize(QUORUM_SIZE, ROUND_SIZE));
377
445
  const { governanceProposerQuorum, governanceProposerRoundSize } = config;
378
446
  if (
379
447
  governanceProposerQuorum !== undefined &&
@@ -384,7 +452,7 @@ export function validateConfig(config: Omit<L1ContractsConfig, keyof L1TxUtilsCo
384
452
  );
385
453
  }
386
454
 
387
- // From: require(QUORUM_SIZE <= ROUND_SIZE, Errors.GovernanceProposer__QuorumCannotBeLargerThanRoundSize(QUORUM_SIZE, ROUND_SIZE));
455
+ // From: require(QUORUM_SIZE <= ROUND_SIZE, Errors.EmpireBase__QuorumCannotBeLargerThanRoundSize(QUORUM_SIZE, ROUND_SIZE));
388
456
  if (governanceProposerQuorum !== undefined && governanceProposerQuorum > governanceProposerRoundSize) {
389
457
  errors.push(
390
458
  `governanceProposerQuorum (${governanceProposerQuorum}) cannot be larger than governanceProposerRoundSize (${governanceProposerRoundSize})`,
@@ -4,7 +4,7 @@ import { EmpireBaseAbi } from '@aztec/l1-artifacts/EmpireBaseAbi';
4
4
 
5
5
  import { type Hex, type TypedDataDefinition, encodeFunctionData } from 'viem';
6
6
 
7
- import type { L1TxRequest } from '../l1_tx_utils.js';
7
+ import type { L1TxRequest } from '../l1_tx_utils/index.js';
8
8
 
9
9
  export interface IEmpireBase {
10
10
  get address(): EthAddress;
@@ -14,7 +14,7 @@ import {
14
14
  getContract,
15
15
  } from 'viem';
16
16
 
17
- import type { L1TxRequest, L1TxUtils } from '../l1_tx_utils.js';
17
+ import type { L1TxRequest, L1TxUtils } from '../l1_tx_utils/index.js';
18
18
  import type { ViemClient } from '../types.js';
19
19
  import { FormattedViemError, tryExtractEvent } from '../utils.js';
20
20
  import { type IEmpireBase, encodeSignal, encodeSignalWithSignature, signSignalWithSig } from './empire_base.js';
@@ -33,10 +33,14 @@ export class EmpireSlashingProposerContract extends EventEmitter implements IEmp
33
33
 
34
34
  constructor(
35
35
  public readonly client: ViemClient,
36
- address: Hex,
36
+ address: Hex | EthAddress,
37
37
  ) {
38
38
  super();
39
- this.proposer = getContract({ address, abi: EmpireSlashingProposerAbi, client });
39
+ this.proposer = getContract({
40
+ address: typeof address === 'string' ? address : address.toString(),
41
+ abi: EmpireSlashingProposerAbi,
42
+ client,
43
+ });
40
44
  }
41
45
 
42
46
  public get address() {
@@ -3,7 +3,7 @@ import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts/FeeAssetHandlerAbi';
3
3
 
4
4
  import { type Hex, encodeFunctionData, getContract } from 'viem';
5
5
 
6
- import type { L1TxUtils } from '../l1_tx_utils.js';
6
+ import type { L1TxUtils } from '../l1_tx_utils/index.js';
7
7
 
8
8
  export class FeeAssetHandlerContract {
9
9
  public address: EthAddress;
@@ -14,7 +14,7 @@ import {
14
14
  } from 'viem';
15
15
 
16
16
  import type { L1ContractAddresses } from '../l1_contract_addresses.js';
17
- import { createL1TxUtilsFromViemWallet } from '../l1_tx_utils.js';
17
+ import { createL1TxUtilsFromViemWallet } from '../l1_tx_utils/index.js';
18
18
  import { type ExtendedViemWalletClient, type ViemClient, isExtendedClient } from '../types.js';
19
19
 
20
20
  export type L1GovernanceContractAddresses = Pick<
@@ -187,7 +187,7 @@ export class GovernanceContract extends ReadOnlyGovernanceContract {
187
187
  retries: number;
188
188
  logger: Logger;
189
189
  }) {
190
- const l1TxUtils = createL1TxUtilsFromViemWallet(this.client, logger);
190
+ const l1TxUtils = createL1TxUtilsFromViemWallet(this.client, { logger });
191
191
  const retryDelaySeconds = 12;
192
192
 
193
193
  voteAmount = voteAmount ?? (await this.getPower());
@@ -244,7 +244,7 @@ export class GovernanceContract extends ReadOnlyGovernanceContract {
244
244
  retries: number;
245
245
  logger: Logger;
246
246
  }) {
247
- const l1TxUtils = createL1TxUtilsFromViemWallet(this.client, logger);
247
+ const l1TxUtils = createL1TxUtilsFromViemWallet(this.client, { logger });
248
248
  const retryDelaySeconds = 12;
249
249
  let success = false;
250
250
  for (let i = 0; i < retries; i++) {
@@ -11,7 +11,7 @@ import {
11
11
  getContract,
12
12
  } from 'viem';
13
13
 
14
- import type { GasPrice, L1TxRequest, L1TxUtils } from '../l1_tx_utils.js';
14
+ import type { L1TxRequest, L1TxUtils } from '../l1_tx_utils/index.js';
15
15
  import type { ViemClient } from '../types.js';
16
16
  import { type IEmpireBase, encodeSignal, encodeSignalWithSignature, signSignalWithSig } from './empire_base.js';
17
17
  import { extractProposalIdFromLogs } from './governance.js';
@@ -102,10 +102,9 @@ export class GovernanceProposerContract implements IEmpireBase {
102
102
  l1TxUtils: L1TxUtils,
103
103
  ): Promise<{
104
104
  receipt: TransactionReceipt;
105
- gasPrice: GasPrice;
106
105
  proposalId: bigint;
107
106
  }> {
108
- const { receipt, gasPrice } = await l1TxUtils.sendAndMonitorTransaction({
107
+ const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
109
108
  to: this.address.toString(),
110
109
  data: encodeFunctionData({
111
110
  abi: this.proposer.abi,
@@ -114,6 +113,6 @@ export class GovernanceProposerContract implements IEmpireBase {
114
113
  }),
115
114
  });
116
115
  const proposalId = extractProposalIdFromLogs(receipt.logs);
117
- return { receipt, gasPrice, proposalId };
116
+ return { receipt, proposalId };
118
117
  }
119
118
  }
@@ -1,9 +1,10 @@
1
1
  import { toHex as toPaddedHex } from '@aztec/foundation/bigint-buffer';
2
+ import { TimeoutError } from '@aztec/foundation/error';
2
3
  import type { Logger } from '@aztec/foundation/log';
3
4
 
4
5
  import { type EncodeFunctionDataParameters, type Hex, encodeFunctionData, multicall3Abi } from 'viem';
5
6
 
6
- import type { L1BlobInputs, L1GasConfig, L1TxRequest, L1TxUtils } from '../l1_tx_utils.js';
7
+ import type { L1BlobInputs, L1TxConfig, L1TxRequest, L1TxUtils } from '../l1_tx_utils/index.js';
7
8
  import type { ExtendedViemWalletClient } from '../types.js';
8
9
  import { FormattedViemError, formatViemError } from '../utils.js';
9
10
  import { RollupContract } from './rollup.js';
@@ -14,7 +15,7 @@ export class Multicall3 {
14
15
  static async forward(
15
16
  requests: L1TxRequest[],
16
17
  l1TxUtils: L1TxUtils,
17
- gasConfig: L1GasConfig | undefined,
18
+ gasConfig: L1TxConfig | undefined,
18
19
  blobConfig: L1BlobInputs | undefined,
19
20
  rollupAddress: Hex,
20
21
  logger: Logger,
@@ -35,18 +36,15 @@ export class Multicall3 {
35
36
  const encodedForwarderData = encodeFunctionData(forwarderFunctionData);
36
37
 
37
38
  try {
38
- const { receipt, gasPrice } = await l1TxUtils.sendAndMonitorTransaction(
39
- {
40
- to: MULTI_CALL_3_ADDRESS,
41
- data: encodedForwarderData,
42
- },
39
+ const { receipt, state } = await l1TxUtils.sendAndMonitorTransaction(
40
+ { to: MULTI_CALL_3_ADDRESS, data: encodedForwarderData },
43
41
  gasConfig,
44
42
  blobConfig,
45
43
  );
46
44
 
47
45
  if (receipt.status === 'success') {
48
46
  const stats = await l1TxUtils.getTransactionStats(receipt.transactionHash);
49
- return { receipt, gasPrice, stats };
47
+ return { receipt, stats };
50
48
  } else {
51
49
  logger.error('Forwarder transaction failed', undefined, { receipt });
52
50
 
@@ -58,7 +56,7 @@ export class Multicall3 {
58
56
  let errorMsg: string | undefined;
59
57
 
60
58
  if (blobConfig) {
61
- const maxFeePerBlobGas = blobConfig.maxFeePerBlobGas ?? gasPrice.maxFeePerBlobGas;
59
+ const maxFeePerBlobGas = blobConfig.maxFeePerBlobGas ?? state.gasPrice.maxFeePerBlobGas;
62
60
  if (maxFeePerBlobGas === undefined) {
63
61
  errorMsg = 'maxFeePerBlobGas is required to get the error message';
64
62
  } else {
@@ -89,9 +87,13 @@ export class Multicall3 {
89
87
  errorMsg = await l1TxUtils.tryGetErrorFromRevertedTx(encodedForwarderData, args, undefined, []);
90
88
  }
91
89
 
92
- return { receipt, gasPrice, errorMsg };
90
+ return { receipt, errorMsg };
93
91
  }
94
92
  } catch (err) {
93
+ if (err instanceof TimeoutError) {
94
+ throw err;
95
+ }
96
+
95
97
  for (const request of requests) {
96
98
  logger.debug('Simulating request', { request });
97
99
  const result = await l1TxUtils