@aztec/cli 3.0.0-nightly.20250908 → 3.0.0-nightly.20250911

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 (38) hide show
  1. package/dest/cmds/devnet/bootstrap_network.d.ts.map +1 -1
  2. package/dest/cmds/devnet/bootstrap_network.js +11 -10
  3. package/dest/cmds/infrastructure/index.d.ts.map +1 -1
  4. package/dest/cmds/infrastructure/index.js +2 -2
  5. package/dest/cmds/infrastructure/setup_l2_contract.d.ts +1 -1
  6. package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
  7. package/dest/cmds/infrastructure/setup_l2_contract.js +10 -14
  8. package/dest/cmds/l1/deploy_l1_contracts.js +2 -2
  9. package/dest/cmds/l1/deploy_new_rollup.js +2 -2
  10. package/dest/cmds/l1/index.d.ts.map +1 -1
  11. package/dest/cmds/l1/index.js +9 -7
  12. package/dest/cmds/l1/update_l1_validators.d.ts +5 -0
  13. package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
  14. package/dest/cmds/l1/update_l1_validators.js +52 -0
  15. package/dest/config/chain_l2_config.d.ts +32 -0
  16. package/dest/config/chain_l2_config.d.ts.map +1 -0
  17. package/dest/config/chain_l2_config.js +291 -0
  18. package/dest/config/get_l1_config.d.ts +8 -0
  19. package/dest/config/get_l1_config.d.ts.map +1 -0
  20. package/dest/config/get_l1_config.js +22 -0
  21. package/dest/config/index.d.ts +3 -0
  22. package/dest/config/index.d.ts.map +1 -0
  23. package/dest/config/index.js +2 -0
  24. package/dest/utils/setup_contracts.d.ts +3 -3
  25. package/dest/utils/setup_contracts.d.ts.map +1 -1
  26. package/dest/utils/setup_contracts.js +9 -19
  27. package/package.json +26 -23
  28. package/src/cmds/devnet/bootstrap_network.ts +15 -10
  29. package/src/cmds/infrastructure/index.ts +1 -9
  30. package/src/cmds/infrastructure/setup_l2_contract.ts +10 -17
  31. package/src/cmds/l1/deploy_l1_contracts.ts +2 -2
  32. package/src/cmds/l1/deploy_new_rollup.ts +2 -2
  33. package/src/cmds/l1/index.ts +16 -16
  34. package/src/cmds/l1/update_l1_validators.ts +74 -0
  35. package/src/config/chain_l2_config.ts +382 -0
  36. package/src/config/get_l1_config.ts +28 -0
  37. package/src/config/index.ts +2 -0
  38. package/src/utils/setup_contracts.ts +6 -36
@@ -0,0 +1,291 @@
1
+ import { DefaultL1ContractsConfig } from '@aztec/ethereum';
2
+ import { EthAddress } from '@aztec/foundation/eth-address';
3
+ import { mkdir, readFile, stat, writeFile } from 'fs/promises';
4
+ import path, { dirname, join } from 'path';
5
+ import publicIncludeMetrics from '../../public_include_metric_prefixes.json' with {
6
+ type: 'json'
7
+ };
8
+ const DefaultSlashConfig = {
9
+ /** Tally-style slashing */ slasherFlavor: 'tally',
10
+ /** Allow one round for vetoing */ slashingExecutionDelayInRounds: 1,
11
+ /** How long for a slash payload to be executed */ slashingLifetimeInRounds: 5,
12
+ /** Allow 2 rounds to discover faults */ slashingOffsetInRounds: 2,
13
+ /** No slash vetoer */ slashingVetoer: EthAddress.ZERO,
14
+ /** Use default slash amounts */ slashAmountSmall: DefaultL1ContractsConfig.slashAmountSmall,
15
+ slashAmountMedium: DefaultL1ContractsConfig.slashAmountMedium,
16
+ slashAmountLarge: DefaultL1ContractsConfig.slashAmountLarge,
17
+ // Slashing stuff
18
+ slashMinPenaltyPercentage: 0.5,
19
+ slashMaxPenaltyPercentage: 2.0,
20
+ slashInactivityTargetPercentage: 0.7,
21
+ slashInactivityConsecutiveEpochThreshold: 1,
22
+ slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountSmall,
23
+ slashPrunePenalty: DefaultL1ContractsConfig.slashAmountSmall,
24
+ slashDataWithholdingPenalty: DefaultL1ContractsConfig.slashAmountSmall,
25
+ slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountLarge,
26
+ slashAttestDescendantOfInvalidPenalty: DefaultL1ContractsConfig.slashAmountLarge,
27
+ slashUnknownPenalty: DefaultL1ContractsConfig.slashAmountSmall,
28
+ slashBroadcastedInvalidBlockPenalty: DefaultL1ContractsConfig.slashAmountMedium,
29
+ slashMaxPayloadSize: 50,
30
+ slashGracePeriodL2Slots: 32 * 2,
31
+ slashOffenseExpirationRounds: 8,
32
+ sentinelEnabled: true
33
+ };
34
+ export const stagingIgnitionL2ChainConfig = {
35
+ l1ChainId: 11155111,
36
+ testAccounts: true,
37
+ sponsoredFPC: false,
38
+ p2pEnabled: true,
39
+ p2pBootstrapNodes: [],
40
+ registryAddress: '0xf299347e765cfb27f913bde8e4983fd0f195676f',
41
+ slashFactoryAddress: '',
42
+ feeAssetHandlerAddress: '',
43
+ seqMinTxsPerBlock: 0,
44
+ seqMaxTxsPerBlock: 0,
45
+ realProofs: true,
46
+ snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/staging-ignition/',
47
+ autoUpdate: 'config-and-version',
48
+ autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/staging-ignition.json',
49
+ maxTxPoolSize: 100_000_000,
50
+ publicIncludeMetrics,
51
+ publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
52
+ publicMetricsCollectFrom: [
53
+ 'sequencer'
54
+ ],
55
+ ...DefaultL1ContractsConfig,
56
+ ...DefaultSlashConfig,
57
+ /** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
58
+ /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
59
+ /** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
60
+ /** The target validator committee size. */ aztecTargetCommitteeSize: 48,
61
+ /** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
62
+ /** The mana target for the rollup */ manaTarget: 0n,
63
+ /** The proving cost per mana */ provingCostPerMana: 0n
64
+ };
65
+ export const stagingPublicL2ChainConfig = {
66
+ l1ChainId: 11155111,
67
+ testAccounts: false,
68
+ sponsoredFPC: true,
69
+ p2pEnabled: true,
70
+ p2pBootstrapNodes: [],
71
+ registryAddress: '0x2e48addca360da61e4d6c21ff2b1961af56eb83b',
72
+ slashFactoryAddress: '0xe19410632fd00695bc5a08dd82044b7b26317742',
73
+ feeAssetHandlerAddress: '0xb46dc3d91f849999330b6dd93473fa29fc45b076',
74
+ seqMinTxsPerBlock: 0,
75
+ seqMaxTxsPerBlock: 20,
76
+ realProofs: true,
77
+ snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/staging-public/',
78
+ autoUpdate: 'config-and-version',
79
+ autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/staging-public.json',
80
+ publicIncludeMetrics,
81
+ publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
82
+ publicMetricsCollectFrom: [
83
+ 'sequencer'
84
+ ],
85
+ maxTxPoolSize: 100_000_000,
86
+ // Deployment stuff
87
+ /** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
88
+ /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
89
+ /** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
90
+ /** The target validator committee size. */ aztecTargetCommitteeSize: 48,
91
+ /** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
92
+ /** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
93
+ /** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
94
+ /** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
95
+ /** The slashing round size */ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
96
+ /** Governance proposing round size */ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
97
+ /** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
98
+ /** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
99
+ /** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
100
+ ...DefaultSlashConfig
101
+ };
102
+ export const testnetL2ChainConfig = {
103
+ l1ChainId: 11155111,
104
+ testAccounts: false,
105
+ sponsoredFPC: true,
106
+ p2pEnabled: true,
107
+ p2pBootstrapNodes: [],
108
+ registryAddress: '0xcfe61b2574984326679cd15c6566fbd4a724f3b4',
109
+ slashFactoryAddress: '0x58dc5b14f9d3085c9106f5b8208a1026f94614f0',
110
+ feeAssetHandlerAddress: '0x7abdec6e68ae27c37feb6a77371382a109ec4763',
111
+ seqMinTxsPerBlock: 0,
112
+ seqMaxTxsPerBlock: 20,
113
+ realProofs: true,
114
+ snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/testnet/',
115
+ autoUpdate: 'config-and-version',
116
+ autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/testnet.json',
117
+ maxTxPoolSize: 100_000_000,
118
+ publicIncludeMetrics,
119
+ publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
120
+ publicMetricsCollectFrom: [
121
+ 'sequencer'
122
+ ],
123
+ // Deployment stuff
124
+ /** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
125
+ /** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
126
+ /** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
127
+ /** The target validator committee size. */ aztecTargetCommitteeSize: 48,
128
+ /** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
129
+ /** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
130
+ /** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
131
+ /** The local ejection threshold for a validator. Stricter than ejectionThreshold but local to a specific rollup */ localEjectionThreshold: DefaultL1ContractsConfig.localEjectionThreshold,
132
+ /** The slashing round size */ slashingRoundSizeInEpochs: DefaultL1ContractsConfig.slashingRoundSizeInEpochs,
133
+ /** Governance proposing round size */ governanceProposerRoundSize: DefaultL1ContractsConfig.governanceProposerRoundSize,
134
+ /** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
135
+ /** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
136
+ /** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
137
+ ...DefaultSlashConfig
138
+ };
139
+ const BOOTNODE_CACHE_DURATION_MS = 60 * 60 * 1000; // 1 hour;
140
+ export async function getBootnodes(networkName, cacheDir) {
141
+ const cacheFile = cacheDir ? join(cacheDir, networkName, 'bootnodes.json') : undefined;
142
+ try {
143
+ if (cacheFile) {
144
+ const info = await stat(cacheFile);
145
+ if (info.mtimeMs + BOOTNODE_CACHE_DURATION_MS > Date.now()) {
146
+ return JSON.parse(await readFile(cacheFile, 'utf-8'))['bootnodes'];
147
+ }
148
+ }
149
+ } catch {
150
+ // no-op. Get the remote-file
151
+ }
152
+ const url = `http://static.aztec.network/${networkName}/bootnodes.json`;
153
+ const response = await fetch(url);
154
+ if (!response.ok) {
155
+ throw new Error(`Failed to fetch basic contract addresses from ${url}. Check you are using a correct network name.`);
156
+ }
157
+ const json = await response.json();
158
+ try {
159
+ if (cacheFile) {
160
+ await mkdir(dirname(cacheFile), {
161
+ recursive: true
162
+ });
163
+ await writeFile(cacheFile, JSON.stringify(json), 'utf-8');
164
+ }
165
+ } catch {
166
+ // no-op
167
+ }
168
+ return json['bootnodes'];
169
+ }
170
+ export async function getL2ChainConfig(networkName, cacheDir) {
171
+ let config;
172
+ if (networkName === 'staging-public') {
173
+ config = {
174
+ ...stagingPublicL2ChainConfig
175
+ };
176
+ } else if (networkName === 'testnet') {
177
+ config = {
178
+ ...testnetL2ChainConfig
179
+ };
180
+ } else if (networkName === 'staging-ignition') {
181
+ config = {
182
+ ...stagingIgnitionL2ChainConfig
183
+ };
184
+ }
185
+ if (!config) {
186
+ return undefined;
187
+ }
188
+ // If the bootnodes are not set, get them from the network
189
+ const bootnodeKey = 'BOOTSTRAP_NODES';
190
+ if (!process.env[bootnodeKey]) {
191
+ config.p2pBootstrapNodes = await getBootnodes(networkName, cacheDir);
192
+ }
193
+ return config;
194
+ }
195
+ function enrichVar(envVar, value) {
196
+ // Don't override
197
+ if (process.env[envVar] || value === undefined) {
198
+ return;
199
+ }
200
+ process.env[envVar] = value;
201
+ }
202
+ function enrichEthAddressVar(envVar, value) {
203
+ // EthAddress doesn't like being given empty strings
204
+ if (value === '') {
205
+ enrichVar(envVar, EthAddress.ZERO.toString());
206
+ return;
207
+ }
208
+ enrichVar(envVar, value);
209
+ }
210
+ function getDefaultDataDir(networkName) {
211
+ return path.join(process.env.HOME || '~', '.aztec', networkName, 'data');
212
+ }
213
+ export async function enrichEnvironmentWithChainConfig(networkName) {
214
+ if (networkName === 'local') {
215
+ return;
216
+ }
217
+ enrichVar('DATA_DIRECTORY', getDefaultDataDir(networkName));
218
+ const cacheDir = process.env.DATA_DIRECTORY ? join(process.env.DATA_DIRECTORY, 'cache') : undefined;
219
+ const config = await getL2ChainConfig(networkName, cacheDir);
220
+ if (!config) {
221
+ throw new Error(`Unknown network name: ${networkName}`);
222
+ }
223
+ enrichVar('BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
224
+ enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
225
+ enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
226
+ enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
227
+ enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
228
+ enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
229
+ enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
230
+ enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
231
+ enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
232
+ enrichVar('SYNC_SNAPSHOTS_URL', config.snapshotsUrl);
233
+ enrichVar('P2P_MAX_TX_POOL_SIZE', config.maxTxPoolSize.toString());
234
+ if (config.autoUpdate) {
235
+ enrichVar('AUTO_UPDATE', config.autoUpdate?.toString());
236
+ }
237
+ if (config.autoUpdateUrl) {
238
+ enrichVar('AUTO_UPDATE_URL', config.autoUpdateUrl);
239
+ }
240
+ if (config.publicIncludeMetrics) {
241
+ enrichVar('PUBLIC_OTEL_INCLUDE_METRICS', config.publicIncludeMetrics.join(','));
242
+ }
243
+ if (config.publicMetricsCollectorUrl) {
244
+ enrichVar('PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT', config.publicMetricsCollectorUrl);
245
+ }
246
+ if (config.publicMetricsCollectFrom) {
247
+ enrichVar('PUBLIC_OTEL_COLLECT_FROM', config.publicMetricsCollectFrom.join(','));
248
+ }
249
+ enrichEthAddressVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
250
+ enrichEthAddressVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
251
+ enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
252
+ // Deployment stuff
253
+ enrichVar('ETHEREUM_SLOT_DURATION', config.ethereumSlotDuration.toString());
254
+ enrichVar('AZTEC_SLOT_DURATION', config.aztecSlotDuration.toString());
255
+ enrichVar('AZTEC_EPOCH_DURATION', config.aztecEpochDuration.toString());
256
+ enrichVar('AZTEC_TARGET_COMMITTEE_SIZE', config.aztecTargetCommitteeSize.toString());
257
+ enrichVar('AZTEC_PROOF_SUBMISSION_EPOCHS', config.aztecProofSubmissionEpochs.toString());
258
+ enrichVar('AZTEC_ACTIVATION_THRESHOLD', config.activationThreshold.toString());
259
+ enrichVar('AZTEC_EJECTION_THRESHOLD', config.ejectionThreshold.toString());
260
+ enrichVar('AZTEC_LOCAL_EJECTION_THRESHOLD', config.localEjectionThreshold.toString());
261
+ enrichVar('AZTEC_SLASHING_QUORUM', config.slashingQuorum?.toString());
262
+ enrichVar('AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS', config.slashingRoundSizeInEpochs.toString());
263
+ enrichVar('AZTEC_GOVERNANCE_PROPOSER_QUORUM', config.governanceProposerQuorum?.toString());
264
+ enrichVar('AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE', config.governanceProposerRoundSize.toString());
265
+ enrichVar('AZTEC_MANA_TARGET', config.manaTarget.toString());
266
+ enrichVar('AZTEC_PROVING_COST_PER_MANA', config.provingCostPerMana.toString());
267
+ enrichVar('AZTEC_SLASH_AMOUNT_SMALL', config.slashAmountSmall.toString());
268
+ enrichVar('AZTEC_SLASH_AMOUNT_MEDIUM', config.slashAmountMedium.toString());
269
+ enrichVar('AZTEC_SLASH_AMOUNT_LARGE', config.slashAmountLarge.toString());
270
+ enrichVar('AZTEC_SLASHING_LIFETIME_IN_ROUNDS', config.slashingLifetimeInRounds.toString());
271
+ enrichVar('AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS', config.slashingExecutionDelayInRounds.toString());
272
+ enrichVar('AZTEC_SLASHING_OFFSET_IN_ROUNDS', config.slashingOffsetInRounds.toString());
273
+ enrichVar('AZTEC_SLASHER_FLAVOR', config.slasherFlavor);
274
+ enrichVar('AZTEC_EXIT_DELAY_SECONDS', config.exitDelaySeconds.toString());
275
+ enrichEthAddressVar('AZTEC_SLASHING_VETOER', config.slashingVetoer.toString());
276
+ // Slashing
277
+ enrichVar('SLASH_MIN_PENALTY_PERCENTAGE', config.slashMinPenaltyPercentage.toString());
278
+ enrichVar('SLASH_MAX_PENALTY_PERCENTAGE', config.slashMaxPenaltyPercentage.toString());
279
+ enrichVar('SLASH_PRUNE_PENALTY', config.slashPrunePenalty.toString());
280
+ enrichVar('SLASH_DATA_WITHHOLDING_PENALTY', config.slashDataWithholdingPenalty.toString());
281
+ enrichVar('SLASH_INACTIVITY_TARGET_PERCENTAGE', config.slashInactivityTargetPercentage.toString());
282
+ enrichVar('SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD', config.slashInactivityConsecutiveEpochThreshold.toString());
283
+ enrichVar('SLASH_INACTIVITY_PENALTY', config.slashInactivityPenalty.toString());
284
+ enrichVar('SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY', config.slashProposeInvalidAttestationsPenalty.toString());
285
+ enrichVar('SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY', config.slashAttestDescendantOfInvalidPenalty.toString());
286
+ enrichVar('SLASH_UNKNOWN_PENALTY', config.slashUnknownPenalty.toString());
287
+ enrichVar('SLASH_INVALID_BLOCK_PENALTY', config.slashBroadcastedInvalidBlockPenalty.toString());
288
+ enrichVar('SLASH_OFFENSE_EXPIRATION_ROUNDS', config.slashOffenseExpirationRounds.toString());
289
+ enrichVar('SLASH_MAX_PAYLOAD_SIZE', config.slashMaxPayloadSize.toString());
290
+ enrichVar('SENTINEL_ENABLED', config.sentinelEnabled.toString());
291
+ }
@@ -0,0 +1,8 @@
1
+ import { type L1ContractAddresses, getL1ContractsConfig } from '@aztec/ethereum';
2
+ import { EthAddress } from '@aztec/foundation/eth-address';
3
+ export declare function getL1Config(registryAddress: EthAddress, l1RpcUrls: string[], l1ChainId: number, rollupVersion?: number | 'canonical'): Promise<{
4
+ addresses: L1ContractAddresses;
5
+ config: Awaited<ReturnType<typeof getL1ContractsConfig>>;
6
+ }>;
7
+ export declare function getL1RollupAddressFromEnv(l1RpcUrls: string[], l1ChainId: number): Promise<EthAddress>;
8
+ //# sourceMappingURL=get_l1_config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_l1_config.d.ts","sourceRoot":"","sources":["../../src/config/get_l1_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAoB,oBAAoB,EAAmB,MAAM,iBAAiB,CAAC;AACpH,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,wBAAsB,WAAW,CAC/B,eAAe,EAAE,UAAU,EAC3B,SAAS,EAAE,MAAM,EAAE,EACnB,SAAS,EAAE,MAAM,EACjB,aAAa,GAAE,MAAM,GAAG,WAAyB,GAChD,OAAO,CAAC;IAAE,SAAS,EAAE,mBAAmB,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAA;CAAE,CAAC,CAUvG;AAED,wBAAsB,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,uBAOrF"}
@@ -0,0 +1,22 @@
1
+ import { RegistryContract, getL1ContractsConfig, getPublicClient } from '@aztec/ethereum';
2
+ import { EthAddress } from '@aztec/foundation/eth-address';
3
+ export async function getL1Config(registryAddress, l1RpcUrls, l1ChainId, rollupVersion = 'canonical') {
4
+ const publicClient = getPublicClient({
5
+ l1RpcUrls,
6
+ l1ChainId
7
+ });
8
+ const addresses = await RegistryContract.collectAddresses(publicClient, registryAddress, rollupVersion);
9
+ const config = await getL1ContractsConfig(publicClient, addresses);
10
+ return {
11
+ addresses,
12
+ config
13
+ };
14
+ }
15
+ export async function getL1RollupAddressFromEnv(l1RpcUrls, l1ChainId) {
16
+ const registryAddress = process.env.REGISTRY_CONTRACT_ADDRESS;
17
+ if (!registryAddress || !EthAddress.isAddress(registryAddress)) {
18
+ throw new Error(`Failed to extract registry address`);
19
+ }
20
+ const { addresses } = await getL1Config(EthAddress.fromString(registryAddress), l1RpcUrls, l1ChainId);
21
+ return addresses.rollupAddress;
22
+ }
@@ -0,0 +1,3 @@
1
+ export * from './chain_l2_config.js';
2
+ export * from './get_l1_config.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './chain_l2_config.js';
2
+ export * from './get_l1_config.js';
@@ -1,5 +1,5 @@
1
- import { AztecAddress, type PXE, type WaitForProvenOpts } from '@aztec/aztec.js';
1
+ import { type PXE } from '@aztec/aztec.js';
2
2
  import type { LogFn } from '@aztec/foundation/log';
3
- export declare function getSponsoredFPCAddress(): Promise<AztecAddress>;
4
- export declare function setupSponsoredFPC(pxe: PXE, log: LogFn, waitOpts?: import("@aztec/aztec.js").WaitOpts, waitForProvenOptions?: WaitForProvenOpts): Promise<void>;
3
+ export declare function getSponsoredFPCAddress(): Promise<import("@aztec/aztec.js").AztecAddress>;
4
+ export declare function setupSponsoredFPC(pxe: PXE, log: LogFn): Promise<void>;
5
5
  //# sourceMappingURL=setup_contracts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup_contracts.d.ts","sourceRoot":"","sources":["../../src/utils/setup_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGZ,KAAK,GAAG,EAGR,KAAK,iBAAiB,EAGvB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AASnD,wBAAsB,sBAAsB,0BAM3C;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,KAAK,EACV,QAAQ,qCAAkB,EAC1B,oBAAoB,CAAC,EAAE,iBAAiB,iBAuBzC"}
1
+ {"version":3,"file":"setup_contracts.d.ts","sourceRoot":"","sources":["../../src/utils/setup_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,GAAG,EAA8C,MAAM,iBAAiB,CAAC;AAE3F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AASnD,wBAAsB,sBAAsB,oDAM3C;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,iBAQ3D"}
@@ -1,6 +1,5 @@
1
- import { AztecAddress, DefaultWaitOpts, Fr, SignerlessWallet, SponsoredFeePaymentMethod, getContractInstanceFromInstantiationParams, waitForProven } from '@aztec/aztec.js';
1
+ import { Fr, getContractInstanceFromInstantiationParams } from '@aztec/aztec.js';
2
2
  import { SPONSORED_FPC_SALT } from '@aztec/constants';
3
- import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
4
3
  async function getSponsoredFPCContract() {
5
4
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6
5
  // @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment
@@ -14,23 +13,14 @@ export async function getSponsoredFPCAddress() {
14
13
  });
15
14
  return sponsoredFPCInstance.address;
16
15
  }
17
- export async function setupSponsoredFPC(pxe, log, waitOpts = DefaultWaitOpts, waitForProvenOptions) {
16
+ export async function setupSponsoredFPC(pxe, log) {
18
17
  const SponsoredFPCContract = await getSponsoredFPCContract();
19
- const address = await getSponsoredFPCAddress();
20
- const paymentMethod = new SponsoredFeePaymentMethod(address);
21
- const { l1ChainId: chainId, rollupVersion } = await pxe.getNodeInfo();
22
- const deployer = new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(chainId, rollupVersion));
23
- const deployTx = SponsoredFPCContract.deploy(deployer).send({
24
- from: AztecAddress.ZERO,
25
- contractAddressSalt: new Fr(SPONSORED_FPC_SALT),
26
- universalDeploy: true,
27
- fee: {
28
- paymentMethod
29
- }
18
+ const sponsoredFPCInstance = await getContractInstanceFromInstantiationParams(SponsoredFPCContract.artifact, {
19
+ salt: new Fr(SPONSORED_FPC_SALT)
20
+ });
21
+ await pxe.registerContract({
22
+ instance: sponsoredFPCInstance,
23
+ artifact: SponsoredFPCContract.artifact
30
24
  });
31
- const deployed = await deployTx.deployed(waitOpts);
32
- if (waitForProvenOptions !== undefined) {
33
- await waitForProven(pxe, await deployTx.getReceipt(), waitForProvenOptions);
34
- }
35
- log(`SponsoredFPC: ${deployed.address}`);
25
+ log(`SponsoredFPC: ${sponsoredFPCInstance.address}`);
36
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/cli",
3
- "version": "3.0.0-nightly.20250908",
3
+ "version": "3.0.0-nightly.20250911",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./contracts": "./dest/cmds/contracts/index.js",
@@ -12,7 +12,8 @@
12
12
  "./misc": "./dest/cmds/misc/index.js",
13
13
  "./setup-contracts": "./dest/cmds/misc/setup_contracts.js",
14
14
  "./utils": "./dest/utils/index.js",
15
- "./inspect": "./dest/utils/inspect.js"
15
+ "./inspect": "./dest/utils/inspect.js",
16
+ "./config": "./dest/config/index.js"
16
17
  },
17
18
  "typedocOptions": {
18
19
  "entryPoints": [
@@ -69,16 +70,20 @@
69
70
  ]
70
71
  },
71
72
  "dependencies": {
72
- "@aztec/archiver": "3.0.0-nightly.20250908",
73
- "@aztec/aztec.js": "3.0.0-nightly.20250908",
74
- "@aztec/constants": "3.0.0-nightly.20250908",
75
- "@aztec/entrypoints": "3.0.0-nightly.20250908",
76
- "@aztec/ethereum": "3.0.0-nightly.20250908",
77
- "@aztec/foundation": "3.0.0-nightly.20250908",
78
- "@aztec/l1-artifacts": "3.0.0-nightly.20250908",
79
- "@aztec/p2p": "3.0.0-nightly.20250908",
80
- "@aztec/stdlib": "3.0.0-nightly.20250908",
81
- "@aztec/world-state": "3.0.0-nightly.20250908",
73
+ "@aztec/accounts": "3.0.0-nightly.20250911",
74
+ "@aztec/archiver": "3.0.0-nightly.20250911",
75
+ "@aztec/aztec.js": "3.0.0-nightly.20250911",
76
+ "@aztec/constants": "3.0.0-nightly.20250911",
77
+ "@aztec/entrypoints": "3.0.0-nightly.20250911",
78
+ "@aztec/ethereum": "3.0.0-nightly.20250911",
79
+ "@aztec/foundation": "3.0.0-nightly.20250911",
80
+ "@aztec/l1-artifacts": "3.0.0-nightly.20250911",
81
+ "@aztec/node-lib": "3.0.0-nightly.20250911",
82
+ "@aztec/p2p": "3.0.0-nightly.20250911",
83
+ "@aztec/protocol-contracts": "3.0.0-nightly.20250911",
84
+ "@aztec/stdlib": "3.0.0-nightly.20250911",
85
+ "@aztec/test-wallet": "3.0.0-nightly.20250911",
86
+ "@aztec/world-state": "3.0.0-nightly.20250911",
82
87
  "@iarna/toml": "^2.2.5",
83
88
  "@libp2p/peer-id-factory": "^3.0.4",
84
89
  "commander": "^12.1.0",
@@ -90,8 +95,6 @@
90
95
  "viem": "2.23.7"
91
96
  },
92
97
  "devDependencies": {
93
- "@aztec/accounts": "3.0.0-nightly.20250908",
94
- "@aztec/protocol-contracts": "3.0.0-nightly.20250908",
95
98
  "@jest/globals": "^30.0.0",
96
99
  "@types/jest": "^30.0.0",
97
100
  "@types/lodash.chunk": "^4.2.9",
@@ -107,15 +110,15 @@
107
110
  "typescript": "^5.3.3"
108
111
  },
109
112
  "peerDependencies": {
110
- "@aztec/accounts": "3.0.0-nightly.20250908",
111
- "@aztec/bb-prover": "3.0.0-nightly.20250908",
112
- "@aztec/ethereum": "3.0.0-nightly.20250908",
113
- "@aztec/l1-artifacts": "3.0.0-nightly.20250908",
114
- "@aztec/noir-contracts.js": "3.0.0-nightly.20250908",
115
- "@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250908",
116
- "@aztec/noir-test-contracts.js": "3.0.0-nightly.20250908",
117
- "@aztec/protocol-contracts": "3.0.0-nightly.20250908",
118
- "@aztec/stdlib": "3.0.0-nightly.20250908"
113
+ "@aztec/accounts": "3.0.0-nightly.20250911",
114
+ "@aztec/bb-prover": "3.0.0-nightly.20250911",
115
+ "@aztec/ethereum": "3.0.0-nightly.20250911",
116
+ "@aztec/l1-artifacts": "3.0.0-nightly.20250911",
117
+ "@aztec/noir-contracts.js": "3.0.0-nightly.20250911",
118
+ "@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250911",
119
+ "@aztec/noir-test-contracts.js": "3.0.0-nightly.20250911",
120
+ "@aztec/protocol-contracts": "3.0.0-nightly.20250911",
121
+ "@aztec/stdlib": "3.0.0-nightly.20250911"
119
122
  },
120
123
  "files": [
121
124
  "dest",
@@ -1,4 +1,4 @@
1
- import { getInitialTestAccountsManagers } from '@aztec/accounts/testing';
1
+ import { getInitialTestAccountsData } from '@aztec/accounts/testing';
2
2
  import {
3
3
  AztecAddress,
4
4
  BatchCall,
@@ -21,6 +21,7 @@ import {
21
21
  deployL1Contract,
22
22
  } from '@aztec/ethereum';
23
23
  import type { LogFn, Logger } from '@aztec/foundation/log';
24
+ import { TestWallet } from '@aztec/test-wallet';
24
25
 
25
26
  import { getContract } from 'viem';
26
27
  import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
@@ -53,14 +54,18 @@ export async function bootstrapNetwork(
53
54
  debugLog: Logger,
54
55
  ) {
55
56
  const pxe = await createCompatibleClient(pxeUrl, debugLog);
57
+ const wallet = new TestWallet(pxe);
56
58
 
57
59
  // We assume here that the initial test accounts were prefunded with deploy-l1-contracts, and deployed with setup-l2-contracts
58
60
  // so all we need to do is register them to our pxe.
59
- const [accountManager] = await getInitialTestAccountsManagers(pxe);
60
- await accountManager.register();
61
+ const [accountData] = await getInitialTestAccountsData();
62
+ const accountManager = await wallet.createSchnorrAccount(
63
+ accountData.secret,
64
+ accountData.salt,
65
+ accountData.signingKey,
66
+ );
61
67
 
62
- const wallet = await accountManager.getWallet();
63
- const defaultAccountAddress = wallet.getAddress();
68
+ const defaultAccountAddress = accountManager.getAddress();
64
69
 
65
70
  const l1Client = createExtendedL1Client(
66
71
  l1Urls,
@@ -78,7 +83,7 @@ export async function bootstrapNetwork(
78
83
 
79
84
  await initPortal(pxe, l1Client, erc20Address, portalAddress, bridge.address);
80
85
 
81
- const fpcAdmin = wallet.getAddress();
86
+ const fpcAdmin = defaultAccountAddress;
82
87
  const fpc = await deployFPC(wallet, defaultAccountAddress, token.address, fpcAdmin);
83
88
 
84
89
  const counter = await deployCounter(wallet, defaultAccountAddress);
@@ -285,11 +290,11 @@ async function fundFPC(
285
290
  const { CounterContract } = await import('@aztec/noir-test-contracts.js/Counter');
286
291
  const {
287
292
  protocolContractAddresses: { feeJuice },
288
- } = await wallet.getPXEInfo();
293
+ } = await pxe.getNodeInfo();
289
294
 
290
295
  const feeJuiceContract = await FeeJuiceContract.at(feeJuice, wallet);
291
296
 
292
- const feeJuicePortal = await L1FeeJuicePortalManager.new(wallet, l1Client, debugLog);
297
+ const feeJuicePortal = await L1FeeJuicePortalManager.new(pxe, l1Client, debugLog);
293
298
 
294
299
  const { claimAmount, claimSecret, messageLeafIndex, messageHash } = await feeJuicePortal.bridgeTokensPublic(
295
300
  fpcAddress,
@@ -305,8 +310,8 @@ async function fundFPC(
305
310
 
306
311
  // TODO (alexg) remove this once sequencer builds blocks continuously
307
312
  // advance the chain
308
- await counter.methods.increment(wallet.getAddress()).send({ from: defaultAccountAddress }).wait(waitOpts);
309
- await counter.methods.increment(wallet.getAddress()).send({ from: defaultAccountAddress }).wait(waitOpts);
313
+ await counter.methods.increment(defaultAccountAddress).send({ from: defaultAccountAddress }).wait(waitOpts);
314
+ await counter.methods.increment(defaultAccountAddress).send({ from: defaultAccountAddress }).wait(waitOpts);
310
315
 
311
316
  debugLog.info('Claiming FPC');
312
317
 
@@ -12,17 +12,9 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
12
12
  .option('--testAccounts', 'Deploy funded test accounts.')
13
13
  .option('--sponsoredFPC', 'Deploy a sponsored FPC.')
14
14
  .option('--json', 'Output the contract addresses in JSON format')
15
- .option('--skipProofWait', "Don't wait for proofs to land.")
16
15
  .action(async options => {
17
16
  const { setupL2Contracts } = await import('./setup_l2_contract.js');
18
- await setupL2Contracts(
19
- options.rpcUrl,
20
- options.testAccounts,
21
- options.sponsoredFPC,
22
- options.json,
23
- options.skipProofWait,
24
- log,
25
- );
17
+ await setupL2Contracts(options.rpcUrl, options.testAccounts, options.sponsoredFPC, options.json, log);
26
18
  });
27
19
 
28
20
  program
@@ -1,8 +1,9 @@
1
- import { type InitialAccountData, deployFundedSchnorrAccounts, getInitialTestAccounts } from '@aztec/accounts/testing';
2
- import { type AztecAddress, type WaitForProvenOpts, type WaitOpts, createPXEClient, makeFetch } from '@aztec/aztec.js';
1
+ import { getInitialTestAccountsData } from '@aztec/accounts/testing';
2
+ import { AccountManager, type AztecAddress, type WaitOpts, createPXEClient, makeFetch } from '@aztec/aztec.js';
3
3
  import { jsonStringify } from '@aztec/foundation/json-rpc';
4
4
  import type { LogFn } from '@aztec/foundation/log';
5
5
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
6
+ import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet';
6
7
 
7
8
  import { setupSponsoredFPC } from '../../utils/setup_contracts.js';
8
9
 
@@ -11,41 +12,33 @@ export async function setupL2Contracts(
11
12
  testAccounts: boolean,
12
13
  sponsoredFPC: boolean,
13
14
  json: boolean,
14
- skipProofWait: boolean,
15
15
  log: LogFn,
16
16
  ) {
17
17
  const waitOpts: WaitOpts = {
18
18
  timeout: 180,
19
19
  interval: 1,
20
20
  };
21
- const waitForProvenOptions: WaitForProvenOpts | undefined = !skipProofWait
22
- ? {
23
- provenTimeout: 600,
24
- }
25
- : undefined;
26
21
  log('setupL2Contracts: Wait options' + jsonStringify(waitOpts));
27
- if (waitForProvenOptions) {
28
- log('setupL2Contracts: Wait for proven options' + jsonStringify(waitForProvenOptions));
29
- }
30
22
  log('setupL2Contracts: Creating PXE client...');
31
23
  const pxe = createPXEClient(rpcUrl, {}, makeFetch([1, 1, 1, 1, 1], false));
24
+ const wallet = new TestWallet(pxe);
32
25
 
33
- let deployedAccounts: InitialAccountData[] = [];
26
+ let deployedAccountManagers: AccountManager[] = [];
34
27
  if (testAccounts) {
35
28
  log('setupL2Contracts: Deploying test accounts...');
36
- deployedAccounts = await getInitialTestAccounts();
37
- await deployFundedSchnorrAccounts(pxe, deployedAccounts, waitOpts);
29
+ const initialAccountsData = await getInitialTestAccountsData();
30
+ deployedAccountManagers = await deployFundedSchnorrAccounts(wallet, initialAccountsData, waitOpts);
38
31
  }
39
32
 
40
33
  if (sponsoredFPC) {
41
34
  log('setupL2Contracts: Setting up sponsored FPC...');
42
- await setupSponsoredFPC(pxe, log, waitOpts, waitForProvenOptions);
35
+ await setupSponsoredFPC(pxe, log);
43
36
  }
44
37
 
45
38
  if (json) {
46
39
  const toPrint: Record<string, AztecAddress> = { ...ProtocolContractAddress };
47
- deployedAccounts.forEach((a, i) => {
48
- toPrint[`testAccount${i}`] = a.address;
40
+ deployedAccountManagers.forEach((a, i) => {
41
+ toPrint[`testAccount${i}`] = a.getAddress();
49
42
  });
50
43
  log(JSON.stringify(toPrint, null, 2));
51
44
  }
@@ -1,4 +1,4 @@
1
- import { getInitialTestAccounts } from '@aztec/accounts/testing';
1
+ import { getInitialTestAccountsData } from '@aztec/accounts/testing';
2
2
  import { type EthAddress, Fr } from '@aztec/aztec.js';
3
3
  import { getL1ContractsConfigEnvVars } from '@aztec/ethereum';
4
4
  import { SecretValue } from '@aztec/foundation/config';
@@ -27,7 +27,7 @@ export async function deployL1Contracts(
27
27
  ) {
28
28
  const config = getL1ContractsConfigEnvVars();
29
29
 
30
- const initialAccounts = testAccounts ? await getInitialTestAccounts() : [];
30
+ const initialAccounts = testAccounts ? await getInitialTestAccountsData() : [];
31
31
  const sponsoredFPCAddress = sponsoredFPC ? await getSponsoredFPCAddress() : [];
32
32
  const initialFundedAccounts = initialAccounts.map(a => a.address).concat(sponsoredFPCAddress);
33
33
  const { genesisArchiveRoot, fundingNeeded } = await getGenesisValues(initialFundedAccounts);