@aztec/aztec 0.82.3 → 0.83.0

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.
package/dest/bin/index.js CHANGED
@@ -10,6 +10,8 @@ import { injectCommands as injectMiscCommands } from '@aztec/cli/misc';
10
10
  import { injectCommands as injectPXECommands } from '@aztec/cli/pxe';
11
11
  import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
12
12
  import { Command } from 'commander';
13
+ import { NETWORK_FLAG } from '../cli/aztec_start_options.js';
14
+ import { enrichEnvironmentWithChainConfig } from '../cli/chain_l2_config.js';
13
15
  import { injectAztecCommands } from '../cli/index.js';
14
16
  import { getCliVersion } from '../cli/release_version.js';
15
17
  const userLog = createConsoleLogger();
@@ -20,6 +22,17 @@ const debugLogger = createLogger('cli');
20
22
  };
21
23
  process.once('SIGINT', shutdown);
22
24
  process.once('SIGTERM', shutdown);
25
+ // Intercept the setting of a network and enrich the environment with defaults for that network
26
+ let networkValue;
27
+ const args = process.argv.slice(2);
28
+ const networkIndex = args.findIndex((arg)=>arg.startsWith(`--${NETWORK_FLAG}=`) || arg === `--${NETWORK_FLAG}`);
29
+ if (networkIndex !== -1) {
30
+ networkValue = args[networkIndex].split('=')[1] || args[networkIndex + 1];
31
+ }
32
+ networkValue = networkValue || process.env.NETWORK;
33
+ if (networkValue !== undefined) {
34
+ await enrichEnvironmentWithChainConfig(networkValue);
35
+ }
23
36
  const cliVersion = getCliVersion();
24
37
  let program = new Command('aztec');
25
38
  program.description('Aztec command line interface').version(cliVersion);
@@ -1 +1 @@
1
- {"version":3,"file":"aztec_start_action.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_action.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAa3D,wBAAsB,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAyGjF"}
1
+ {"version":3,"file":"aztec_start_action.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_action.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAY3D,wBAAsB,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAsGjF"}
@@ -4,7 +4,6 @@ import { getVersioningMiddleware } from '@aztec/stdlib/versioning';
4
4
  import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
5
5
  import { createSandbox } from '../sandbox/index.js';
6
6
  import { github, splash } from '../splash.js';
7
- import { enrichEnvironmentWithChainConfig } from './chain_l2_config.js';
8
7
  import { getCliVersion } from './release_version.js';
9
8
  import { extractNamespacedOptions, installSignalHandlers } from './util.js';
10
9
  import { getVersions } from './versioning.js';
@@ -18,6 +17,7 @@ export async function aztecStart(options, userLog, debugLogger) {
18
17
  const cliVersion = getCliVersion();
19
18
  const sandboxOptions = extractNamespacedOptions(options, 'sandbox');
20
19
  const nodeOptions = extractNamespacedOptions(options, 'node');
20
+ sandboxOptions.testAccounts = true;
21
21
  userLog(`${splash}\n${github}\n\n`);
22
22
  userLog(`Setting up Aztec Sandbox ${cliVersion}, please stand by...`);
23
23
  const { node, pxe, stop } = await createSandbox({
@@ -43,10 +43,6 @@ export async function aztecStart(options, userLog, debugLogger) {
43
43
  userLog(`Not exposing PXE API through JSON-RPC server`);
44
44
  }
45
45
  } else {
46
- // If a network is specified, enrich the environment with the chain config
47
- if (options.network) {
48
- await enrichEnvironmentWithChainConfig(options.network);
49
- }
50
46
  if (options.node) {
51
47
  const { startNode } = await import('./cmds/start_node.js');
52
48
  ({ config } = await startNode(options, signalHandlers, services, adminServices, userLog));
@@ -9,6 +9,7 @@ export interface AztecStartOption {
9
9
  }
10
10
  export declare const getOptions: (namespace: string, configMappings: Record<string, ConfigMapping>) => AztecStartOption[];
11
11
  export declare const universalOptions: string[];
12
+ export declare const NETWORK_FLAG = "network";
12
13
  export declare const aztecStartOptions: {
13
14
  [key: string]: AztecStartOption[];
14
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"aztec_start_options.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_options.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,MAAM,EAIZ,MAAM,0BAA0B,CAAC;AAelC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,GAAG,GAAG,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC;IACpC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;CACjC;AAED,eAAO,MAAM,UAAU,cAAe,MAAM,kBAAkB,OAAO,MAAM,EAAE,aAAa,CAAC,uBAiB1F,CAAC;AAGF,eAAO,MAAM,gBAAgB,UAU5B,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;CAyWlE,CAAC"}
1
+ {"version":3,"file":"aztec_start_options.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_options.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,MAAM,EAIZ,MAAM,0BAA0B,CAAC;AAelC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,GAAG,GAAG,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC;IACpC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;CACjC;AAED,eAAO,MAAM,UAAU,cAAe,MAAM,kBAAkB,OAAO,MAAM,EAAE,aAAa,CAAC,uBAiB1F,CAAC;AAGF,eAAO,MAAM,gBAAgB,UAU5B,CAAC;AAEF,eAAO,MAAM,YAAY,YAAY,CAAC;AAGtC,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;CAgWlE,CAAC"}
@@ -31,20 +31,21 @@ export const getOptions = (namespace, configMappings)=>{
31
31
  // These are options used by multiple modules so should be inputted once
32
32
  export const universalOptions = [
33
33
  'l1RpcUrls',
34
- 'l1ConsensusHostUrl',
35
- 'l1ConsensusHostApiKey',
36
- 'l1ConsensusHostApiKeyHeader',
34
+ 'l1ConsensusHostUrls',
35
+ 'l1ConsensusHostApiKeys',
36
+ 'l1ConsensusHostApiKeyHeaders',
37
37
  'l1ChainId',
38
38
  'l1Contracts',
39
39
  'p2pEnabled',
40
40
  'dataDirectory',
41
41
  'dataStoreMapSizeKb'
42
42
  ];
43
+ export const NETWORK_FLAG = 'network';
43
44
  // Define categories and options
44
45
  export const aztecStartOptions = {
45
46
  NETWORK: [
46
47
  {
47
- flag: '--network <value>',
48
+ flag: `--${NETWORK_FLAG} <value>`,
48
49
  description: 'Network to run Aztec on',
49
50
  defaultValue: undefined,
50
51
  envVar: 'NETWORK'
@@ -58,13 +59,7 @@ export const aztecStartOptions = {
58
59
  envVar: undefined
59
60
  },
60
61
  {
61
- flag: '--sandbox.testAccounts',
62
- description: 'Deploy test accounts on sandbox start',
63
- envVar: 'TEST_ACCOUNTS',
64
- ...booleanConfigHelper(true)
65
- },
66
- {
67
- flag: '--sandbox.noPXE',
62
+ flag: '--sandbox.noPXE [value]',
68
63
  description: 'Do not expose PXE service on sandbox start',
69
64
  envVar: 'NO_PXE',
70
65
  ...booleanConfigHelper()
@@ -116,22 +111,25 @@ export const aztecStartOptions = {
116
111
  envVar: 'MNEMONIC'
117
112
  },
118
113
  {
119
- flag: '--l1-consensus-host-url <value>',
120
- description: 'URL of the Ethereum consensus node that services will connect to',
121
- defaultValue: undefined,
122
- envVar: 'L1_CONSENSUS_HOST_URL'
114
+ flag: '--l1-consensus-host-urls <value>',
115
+ description: 'List of URLs of the Ethereum consensus nodes that services will connect to (comma separated)',
116
+ defaultValue: [],
117
+ envVar: 'L1_CONSENSUS_HOST_URLS',
118
+ parseVal: (val)=>val.split(',').map((url)=>url.trim().replace(/\/$/, ''))
123
119
  },
124
120
  {
125
- flag: '--l1-consensus-host-api-key <value>',
126
- description: 'API key for the Ethereum consensus node',
127
- defaultValue: undefined,
128
- envVar: 'L1_CONSENSUS_HOST_API_KEY'
121
+ flag: '--l1-consensus-host-api-keys <value>',
122
+ description: 'List of API keys for the corresponding Ethereum consensus nodes',
123
+ defaultValue: [],
124
+ envVar: 'L1_CONSENSUS_HOST_API_KEYS',
125
+ parseVal: (val)=>val.split(',').map((url)=>url.trim())
129
126
  },
130
127
  {
131
- flag: '--l1-consensus-host-api-key-header <value>',
132
- description: 'API key header for the Ethereum consensus node. If not set, the api key will be appended to the URL as ?key=<api-key>',
133
- defaultValue: undefined,
134
- envVar: 'L1_CONSENSUS_HOST_API_KEY_HEADER'
128
+ flag: '--l1-consensus-host-api-key-headers <value>',
129
+ description: 'List of API key headers for the corresponding Ethereum consensus nodes. If not set, the api key for the corresponding node will be appended to the URL as ?key=<api-key>',
130
+ defaultValue: [],
131
+ envVar: 'L1_CONSENSUS_HOST_API_KEY_HEADERS',
132
+ parseVal: (val)=>val.split(',').map((url)=>url.trim())
135
133
  }
136
134
  ],
137
135
  STORAGE: [
@@ -240,12 +238,6 @@ export const aztecStartOptions = {
240
238
  envVar: 'WS_BLOCK_CHECK_INTERVAL_MS',
241
239
  parseVal: (val)=>parseInt(val, 10)
242
240
  },
243
- {
244
- flag: '--node.testAccounts',
245
- description: 'Populate genesis state with initial fee juice for test accounts',
246
- envVar: 'TEST_ACCOUNTS',
247
- ...booleanConfigHelper()
248
- },
249
241
  {
250
242
  flag: '--node.syncMode <value>',
251
243
  description: 'Set sync mode to `full` to always sync via L1, `snapshot` to download a snapshot if there is no local data, `force-snapshot` to download even if there is local data.',
@@ -261,7 +253,7 @@ export const aztecStartOptions = {
261
253
  ],
262
254
  'P2P SUBSYSTEM': [
263
255
  {
264
- flag: '--p2p-enabled',
256
+ flag: '--p2p-enabled [value]',
265
257
  description: 'Enable P2P subsystem',
266
258
  envVar: 'P2P_ENABLED',
267
259
  ...booleanConfigHelper()
@@ -15,6 +15,7 @@ export type L2ChainConfig = {
15
15
  seqMinTxsPerBlock: number;
16
16
  seqMaxTxsPerBlock: number;
17
17
  realProofs: boolean;
18
+ snapshotsUrl: string;
18
19
  };
19
20
  export declare const testnetIgnitionL2ChainConfig: L2ChainConfig;
20
21
  export declare const alphaTestnetL2ChainConfig: L2ChainConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/cli/chain_l2_config.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,aAgB1C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aAgBvC,CAAC;AAEF,wBAAsB,YAAY,CAAC,WAAW,EAAE,YAAY,gBAW3D;AAED,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAWpG;AAUD,wBAAsB,gCAAgC,CAAC,WAAW,EAAE,YAAY,iBAsB/E"}
1
+ {"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/cli/chain_l2_config.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,aAiB1C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aAiBvC,CAAC;AAEF,wBAAsB,YAAY,CAAC,WAAW,EAAE,YAAY,gBAW3D;AAED,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAWpG;AAmBD,wBAAsB,gCAAgC,CAAC,WAAW,EAAE,YAAY,iBAwB/E"}
@@ -1,3 +1,4 @@
1
+ import { EthAddress } from '@aztec/aztec.js';
1
2
  import path from 'path';
2
3
  export const testnetIgnitionL2ChainConfig = {
3
4
  l1ChainId: 11155111,
@@ -14,7 +15,8 @@ export const testnetIgnitionL2ChainConfig = {
14
15
  feeAssetHandlerAddress: '',
15
16
  seqMinTxsPerBlock: 0,
16
17
  seqMaxTxsPerBlock: 0,
17
- realProofs: true
18
+ realProofs: true,
19
+ snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/'
18
20
  };
19
21
  export const alphaTestnetL2ChainConfig = {
20
22
  l1ChainId: 11155111,
@@ -22,16 +24,17 @@ export const alphaTestnetL2ChainConfig = {
22
24
  aztecSlotDuration: 36,
23
25
  aztecEpochDuration: 32,
24
26
  aztecProofSubmissionWindow: 64,
25
- testAccounts: true,
27
+ testAccounts: false,
26
28
  sponsoredFPC: true,
27
29
  p2pEnabled: true,
28
30
  p2pBootstrapNodes: [],
29
31
  registryAddress: '0xad85d55a4bbef35e95396191c22903aa717edf1c',
30
- slashFactoryAddress: '0xf667f50fd68b30c38b12d29fee537fa5ea158eb8',
32
+ slashFactoryAddress: '',
31
33
  feeAssetHandlerAddress: '0xf0664fec6ac15313e18d5ad8225e46b7c6463338',
32
34
  seqMinTxsPerBlock: 0,
33
35
  seqMaxTxsPerBlock: 4,
34
- realProofs: true
36
+ realProofs: true,
37
+ snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/'
35
38
  };
36
39
  export async function getBootnodes(networkName) {
37
40
  const url = `http://static.aztec.network/${networkName}/bootnodes.json`;
@@ -65,6 +68,14 @@ function enrichVar(envVar, value) {
65
68
  }
66
69
  process.env[envVar] = value;
67
70
  }
71
+ function enrichEthAddressVar(envVar, value) {
72
+ // EthAddress doesn't like being given empty strings
73
+ if (value === '') {
74
+ enrichVar(envVar, EthAddress.ZERO.toString());
75
+ return;
76
+ }
77
+ enrichVar(envVar, value);
78
+ }
68
79
  export async function enrichEnvironmentWithChainConfig(networkName) {
69
80
  const config = await getL2ChainConfig(networkName);
70
81
  if (!config) {
@@ -79,12 +90,13 @@ export async function enrichEnvironmentWithChainConfig(networkName) {
79
90
  enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
80
91
  enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
81
92
  enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
82
- enrichVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
83
- enrichVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
84
- enrichVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
85
93
  enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
86
94
  enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
87
95
  enrichVar('DATA_DIRECTORY', path.join(process.env.HOME || '~', '.aztec', networkName, 'data'));
88
96
  enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
89
97
  enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
98
+ enrichVar('SYNC_SNAPSHOTS_URL', config.snapshotsUrl);
99
+ enrichEthAddressVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
100
+ enrichEthAddressVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
101
+ enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
90
102
  }
@@ -1 +1 @@
1
- {"version":3,"file":"start_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAA6C,MAAM,mBAAmB,CAAC;AAGpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAgBnD,wBAAsB,SAAS,CAC7B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,aAAa,EAAE,qBAAqB,EACpC,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC,CAiJtC"}
1
+ {"version":3,"file":"start_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAA6C,MAAM,mBAAmB,CAAC;AAGpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAgBnD,wBAAsB,SAAS,CAC7B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,aAAa,EAAE,qBAAqB,EACpC,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC,CAqJtC"}
@@ -33,7 +33,7 @@ export async function startNode(options, signalHandlers, services, adminServices
33
33
  ] : [];
34
34
  const initialFundedAccounts = testAccounts.concat(sponsoredFPCAccounts);
35
35
  userLog(`Initial funded accounts: ${initialFundedAccounts.map((a)=>a.toString()).join(', ')}`);
36
- const { genesisBlockHash, genesisArchiveRoot, prefilledPublicData } = await getGenesisValues(initialFundedAccounts);
36
+ const { genesisBlockHash, genesisArchiveRoot, prefilledPublicData, fundingNeeded } = await getGenesisValues(initialFundedAccounts);
37
37
  userLog(`Genesis block hash: ${genesisBlockHash.toString()}`);
38
38
  userLog(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
39
39
  // Deploy contracts if needed
@@ -51,13 +51,14 @@ export async function startNode(options, signalHandlers, services, adminServices
51
51
  assumeProvenThroughBlockNumber: nodeSpecificOptions.assumeProvenThroughBlockNumber,
52
52
  salt: nodeSpecificOptions.deployAztecContractsSalt,
53
53
  genesisBlockHash,
54
- genesisArchiveRoot
54
+ genesisArchiveRoot,
55
+ feeJuicePortalInitialBalance: fundingNeeded
55
56
  });
56
57
  } else {
57
58
  if (!nodeConfig.l1Contracts.registryAddress || nodeConfig.l1Contracts.registryAddress.isZero()) {
58
59
  throw new Error('L1 registry address is required to start Aztec Node without --deploy-aztec-contracts option');
59
60
  }
60
- const { addresses, config } = await getL1Config(nodeConfig.l1Contracts.registryAddress, nodeConfig.l1RpcUrls, nodeConfig.l1ChainId);
61
+ const { addresses, config } = await getL1Config(nodeConfig.l1Contracts.registryAddress, nodeConfig.l1RpcUrls, nodeConfig.l1ChainId, nodeConfig.rollupVersion);
61
62
  // TODO(#12272): will clean this up.
62
63
  nodeConfig = {
63
64
  ...nodeConfig,
@@ -1 +1 @@
1
- {"version":3,"file":"start_prover_broker.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_broker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAMxE,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,CAAC,CAyBnE"}
1
+ {"version":3,"file":"start_prover_broker.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_broker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAMxE,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,CAAC,CA+BnE"}
@@ -15,8 +15,9 @@ export async function startProverBroker(options, signalHandlers, services, userL
15
15
  if (!config.l1Contracts.registryAddress || config.l1Contracts.registryAddress.isZero()) {
16
16
  throw new Error('L1 registry address is required to start Aztec Node without --deploy-aztec-contracts option');
17
17
  }
18
- const { addresses } = await getL1Config(config.l1Contracts.registryAddress, config.l1RpcUrls, config.l1ChainId);
18
+ const { addresses, config: rollupConfig } = await getL1Config(config.l1Contracts.registryAddress, config.l1RpcUrls, config.l1ChainId, config.rollupVersion);
19
19
  config.l1Contracts = addresses;
20
+ config.rollupVersion = rollupConfig.rollupVersion;
20
21
  const client = initTelemetryClient(getTelemetryClientConfig());
21
22
  const broker = await createAndStartProvingBroker(config, client);
22
23
  services.proverBroker = [
@@ -1 +1 @@
1
- {"version":3,"file":"start_prover_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_node.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EACL,KAAK,gBAAgB,EAItB,MAAM,oBAAoB,CAAC;AAa5B,wBAAsB,eAAe,CACnC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAoGvC"}
1
+ {"version":3,"file":"start_prover_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_node.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EACL,KAAK,gBAAgB,EAItB,MAAM,oBAAoB,CAAC;AAY5B,wBAAsB,eAAe,CACnC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAwFvC"}
@@ -4,7 +4,6 @@ import { NULL_KEY } from '@aztec/ethereum';
4
4
  import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici';
5
5
  import { ProvingJobConsumerSchema, createProvingJobBrokerClient } from '@aztec/prover-client/broker';
6
6
  import { createProverNode, getProverNodeConfigFromEnv, proverNodeConfigMappings } from '@aztec/prover-node';
7
- import { createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
8
7
  import { P2PApiSchema, ProverNodeApiSchema } from '@aztec/stdlib/interfaces/server';
9
8
  import { initTelemetryClient, makeTracedFetch, telemetryClientConfigMappings } from '@aztec/telemetry-client';
10
9
  import { getGenesisValues } from '@aztec/world-state/testing';
@@ -35,27 +34,15 @@ export async function startProverNode(options, signalHandlers, services, userLog
35
34
  const privKey = hdAccount.getHdKey().privateKey;
36
35
  proverConfig.publisherPrivateKey = `0x${Buffer.from(privKey).toString('hex')}`;
37
36
  }
38
- // TODO(palla/prover-node) L1 contract addresses should not silently default to zero,
39
- // they should be undefined if not set and fail loudly.
40
- // Load l1 contract addresses from aztec node if not set.
41
- const isRollupAddressSet = proverConfig.l1Contracts?.rollupAddress && !proverConfig.l1Contracts.rollupAddress.isZero();
42
- const nodeUrl = proverConfig.nodeUrl ?? proverConfig.proverCoordinationNodeUrl;
43
- if (nodeUrl && !isRollupAddressSet) {
44
- userLog(`Loading L1 contract addresses from aztec node at ${nodeUrl}`);
45
- proverConfig.l1Contracts = await createAztecNodeClient(nodeUrl).getL1ContractAddresses();
46
- }
47
- // If we create an archiver here, validate the L1 config
48
- if (options.archiver) {
49
- if (!proverConfig.l1Contracts.registryAddress || proverConfig.l1Contracts.registryAddress.isZero()) {
50
- throw new Error('L1 registry address is required to start a Prover Node with --archiver option');
51
- }
52
- const { addresses, config } = await getL1Config(proverConfig.l1Contracts.registryAddress, proverConfig.l1RpcUrls, proverConfig.l1ChainId);
53
- proverConfig.l1Contracts = addresses;
54
- proverConfig = {
55
- ...proverConfig,
56
- ...config
57
- };
37
+ if (!proverConfig.l1Contracts.registryAddress || proverConfig.l1Contracts.registryAddress.isZero()) {
38
+ throw new Error('L1 registry address is required to start a Prover Node with --archiver option');
58
39
  }
40
+ const { addresses, config } = await getL1Config(proverConfig.l1Contracts.registryAddress, proverConfig.l1RpcUrls, proverConfig.l1ChainId, proverConfig.rollupVersion);
41
+ proverConfig.l1Contracts = addresses;
42
+ proverConfig = {
43
+ ...proverConfig,
44
+ ...config
45
+ };
59
46
  const telemetry = initTelemetryClient(extractRelevantOptions(options, telemetryClientConfigMappings, 'tel'));
60
47
  let broker;
61
48
  if (proverConfig.proverBrokerUrl) {
@@ -1,6 +1,6 @@
1
1
  import { type L1ContractAddresses, getL1ContractsConfig } from '@aztec/ethereum';
2
2
  import type { EthAddress } from '@aztec/foundation/eth-address';
3
- export declare function getL1Config(registryAddress: EthAddress, l1RpcUrls: string[], l1ChainId: number): Promise<{
3
+ export declare function getL1Config(registryAddress: EthAddress, l1RpcUrls: string[], l1ChainId: number, rollupVersion?: number | 'canonical'): Promise<{
4
4
  addresses: L1ContractAddresses;
5
5
  config: Awaited<ReturnType<typeof getL1ContractsConfig>>;
6
6
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"get_l1_config.d.ts","sourceRoot":"","sources":["../../src/cli/get_l1_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAoB,oBAAoB,EAAmB,MAAM,iBAAiB,CAAC;AACpH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,wBAAsB,WAAW,CAC/B,eAAe,EAAE,UAAU,EAC3B,SAAS,EAAE,MAAM,EAAE,EACnB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,SAAS,EAAE,mBAAmB,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAA;CAAE,CAAC,CAUvG"}
1
+ {"version":3,"file":"get_l1_config.d.ts","sourceRoot":"","sources":["../../src/cli/get_l1_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAoB,oBAAoB,EAAmB,MAAM,iBAAiB,CAAC;AACpH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,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"}
@@ -1,10 +1,10 @@
1
1
  import { RegistryContract, getL1ContractsConfig, getPublicClient } from '@aztec/ethereum';
2
- export async function getL1Config(registryAddress, l1RpcUrls, l1ChainId) {
2
+ export async function getL1Config(registryAddress, l1RpcUrls, l1ChainId, rollupVersion = 'canonical') {
3
3
  const publicClient = getPublicClient({
4
4
  l1RpcUrls,
5
5
  l1ChainId
6
6
  });
7
- const addresses = await RegistryContract.collectAddresses(publicClient, registryAddress, 'canonical');
7
+ const addresses = await RegistryContract.collectAddresses(publicClient, registryAddress, rollupVersion);
8
8
  const config = await getL1ContractsConfig(publicClient, addresses);
9
9
  return {
10
10
  addresses,
package/dest/cli/util.js CHANGED
@@ -173,7 +173,7 @@ export const printAztecStartHelpText = ()=>{
173
173
  if (realProofs) {
174
174
  const { Crs, GrumpkinCrs } = await import('@aztec/bb.js');
175
175
  await Promise.all([
176
- Crs.new(2 ** 25 - 1, undefined, log),
176
+ Crs.new(2 ** 25 + 1, undefined, log),
177
177
  GrumpkinCrs.new(2 ** 18 + 1, undefined, log)
178
178
  ]);
179
179
  }
@@ -18,6 +18,7 @@ export declare function deployContractsToL1(aztecNodeConfig: AztecNodeConfig, hd
18
18
  salt?: number;
19
19
  genesisArchiveRoot?: Fr;
20
20
  genesisBlockHash?: Fr;
21
+ feeJuicePortalInitialBalance?: bigint;
21
22
  }): Promise<{
22
23
  rollupAddress: import("@aztec/foundation/schemas").EthAddress;
23
24
  registryAddress: import("@aztec/foundation/schemas").EthAddress;
@@ -33,6 +34,7 @@ export declare function deployContractsToL1(aztecNodeConfig: AztecNodeConfig, hd
33
34
  } & {
34
35
  slashFactoryAddress?: import("@aztec/foundation/schemas").EthAddress | undefined;
35
36
  feeAssetHandlerAddress?: import("@aztec/foundation/schemas").EthAddress | undefined;
37
+ stakingAssetHandlerAddress?: import("@aztec/foundation/schemas").EthAddress | undefined;
36
38
  } & {
37
39
  rollupAddress: import("@aztec/foundation/schemas").EthAddress;
38
40
  } & {
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/sandbox/sandbox.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAE7F,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAU7F,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,KAAK,EAAgB,MAAM,uBAAuB,CAAC;AAGjE,OAAO,EAAE,KAAK,gBAAgB,EAAyC,MAAM,mBAAmB,CAAC;AACjG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAA2D,MAAM,MAAM,CAAC;AAavH;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GAAG,iBAAiB,EACxC,oBAAoB,yCAAS,EAC7B,IAAI,GAAE;IAAE,8BAA8B,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC;IAAC,gBAAgB,CAAC,EAAE,EAAE,CAAA;CAAO;;;;;;;;;;;;;;;;;;;GA6BtH;AAED,wBAAwB;AACxB,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC5C,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,EAAE,OAAO,CAAC;IACf,uDAAuD;IACvD,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,MAAM,oCAA6B,EAAE,OAAO,EAAE,KAAK;;;;GA4FtF;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,EACrC,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,eAAe,CAAC;IAAC,cAAc,CAAC,EAAE,uBAAuB,CAAA;CAAO,EACpF,OAAO,GAAE;IAAE,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAA;CAAO,6BAW7D;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,GAAE,OAAO,CAAC,gBAAgB,CAAM,mDAI3F"}
1
+ {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/sandbox/sandbox.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAE7F,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAU7F,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,KAAK,EAAgB,MAAM,uBAAuB,CAAC;AAGjE,OAAO,EAAE,KAAK,gBAAgB,EAAyC,MAAM,mBAAmB,CAAC;AACjG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAA2D,MAAM,MAAM,CAAC;AAavH;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GAAG,iBAAiB,EACxC,oBAAoB,yCAAS,EAC7B,IAAI,GAAE;IACJ,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,EAAE,CAAC;IACxB,gBAAgB,CAAC,EAAE,EAAE,CAAC;IACtB,4BAA4B,CAAC,EAAE,MAAM,CAAC;CAClC;;;;;;;;;;;;;;;;;;;;GA6BP;AAED,wBAAwB;AACxB,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC5C,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,EAAE,OAAO,CAAC;IACf,uDAAuD;IACvD,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,MAAM,oCAA6B,EAAE,OAAO,EAAE,KAAK;;;;GA8FtF;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,EACrC,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,eAAe,CAAC;IAAC,cAAc,CAAC,EAAE,uBAAuB,CAAA;CAAO,EACpF,OAAO,GAAE;IAAE,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAA;CAAO,6BAW7D;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,GAAE,OAAO,CAAC,gBAAgB,CAAM,mDAI3F"}
@@ -4,13 +4,13 @@ import { deployFundedSchnorrAccounts, getInitialTestAccounts } from '@aztec/acco
4
4
  import { AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
5
5
  import { AnvilTestWatcher, EthCheatCodes } from '@aztec/aztec.js/testing';
6
6
  import { createBlobSinkClient } from '@aztec/blob-sink/client';
7
- import { setupCanonicalL2FeeJuice, setupSponsoredFPC } from '@aztec/cli/cli-utils';
7
+ import { setupSponsoredFPC } from '@aztec/cli/cli-utils';
8
8
  import { GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH } from '@aztec/constants';
9
9
  import { NULL_KEY, createEthereumChain, deployL1Contracts, getL1ContractsConfigEnvVars, waitForPublicClient } from '@aztec/ethereum';
10
10
  import { Fr } from '@aztec/foundation/fields';
11
11
  import { createLogger } from '@aztec/foundation/log';
12
12
  import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
13
- import { ProtocolContractAddress, protocolContractTreeRoot } from '@aztec/protocol-contracts';
13
+ import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
14
14
  import { createPXEService, getPXEServiceConfig } from '@aztec/pxe/server';
15
15
  import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
16
16
  import { getGenesisValues } from '@aztec/world-state/testing';
@@ -35,12 +35,12 @@ const localAnvil = foundry;
35
35
  const l1Contracts = await deployL1Contracts(aztecNodeConfig.l1RpcUrls, hdAccount, chain.chainInfo, contractDeployLogger, {
36
36
  ...getL1ContractsConfigEnvVars(),
37
37
  ...aztecNodeConfig,
38
- l2FeeJuiceAddress: ProtocolContractAddress.FeeJuice.toField(),
39
38
  vkTreeRoot: getVKTreeRoot(),
40
39
  protocolContractTreeRoot,
41
40
  genesisArchiveRoot: opts.genesisArchiveRoot ?? new Fr(GENESIS_ARCHIVE_ROOT),
42
41
  genesisBlockHash: opts.genesisBlockHash ?? new Fr(GENESIS_BLOCK_HASH),
43
- salt: opts.salt
42
+ salt: opts.salt,
43
+ feeJuicePortalInitialBalance: opts.feeJuicePortalInitialBalance
44
44
  });
45
45
  aztecNodeConfig.l1Contracts = l1Contracts.l1ContractAddresses;
46
46
  return aztecNodeConfig.l1Contracts;
@@ -72,10 +72,11 @@ const localAnvil = foundry;
72
72
  aztecNodeConfig.validatorPrivateKey = `0x${Buffer.from(privKey).toString('hex')}`;
73
73
  }
74
74
  const initialAccounts = await (async ()=>{
75
- if (config.testAccounts) {
75
+ if (config.testAccounts === true || config.testAccounts === undefined) {
76
76
  if (aztecNodeConfig.p2pEnabled) {
77
77
  userLog(`Not setting up test accounts as we are connecting to a network`);
78
78
  } else {
79
+ userLog(`Setting up test accounts`);
79
80
  return await getInitialTestAccounts();
80
81
  }
81
82
  }
@@ -88,14 +89,15 @@ const localAnvil = foundry;
88
89
  bananaFPC,
89
90
  sponsoredFPC
90
91
  ] : [];
91
- const { genesisArchiveRoot, genesisBlockHash, prefilledPublicData } = await getGenesisValues(fundedAddresses);
92
+ const { genesisArchiveRoot, genesisBlockHash, prefilledPublicData, fundingNeeded } = await getGenesisValues(fundedAddresses);
92
93
  let watcher = undefined;
93
94
  if (!aztecNodeConfig.p2pEnabled) {
94
95
  const l1ContractAddresses = await deployContractsToL1(aztecNodeConfig, hdAccount, undefined, {
95
96
  assumeProvenThroughBlockNumber: Number.MAX_SAFE_INTEGER,
96
97
  genesisArchiveRoot,
97
98
  genesisBlockHash,
98
- salt: config.l1Salt ? parseInt(config.l1Salt) : undefined
99
+ salt: config.l1Salt ? parseInt(config.l1Salt) : undefined,
100
+ feeJuicePortalInitialBalance: fundingNeeded
99
101
  });
100
102
  const chain = aztecNodeConfig.l1RpcUrls.length > 0 ? createEthereumChain([
101
103
  l1RpcUrl
@@ -127,7 +129,6 @@ const localAnvil = foundry;
127
129
  proverEnabled: aztecNodeConfig.realProofs
128
130
  };
129
131
  const pxe = await createAztecPXE(node, pxeServiceConfig);
130
- await setupCanonicalL2FeeJuice(pxe, aztecNodeConfig.l1Contracts.feeJuicePortalAddress, logger.info);
131
132
  if (initialAccounts.length) {
132
133
  userLog('Setting up funded test accounts...');
133
134
  const accounts = await deployFundedSchnorrAccounts(pxe, initialAccounts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/aztec",
3
- "version": "0.82.3",
3
+ "version": "0.83.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/index.js"
@@ -29,35 +29,35 @@
29
29
  "../package.common.json"
30
30
  ],
31
31
  "dependencies": {
32
- "@aztec/accounts": "0.82.3",
33
- "@aztec/archiver": "0.82.3",
34
- "@aztec/aztec-faucet": "0.82.3",
35
- "@aztec/aztec-node": "0.82.3",
36
- "@aztec/aztec.js": "0.82.3",
37
- "@aztec/bb-prover": "0.82.3",
38
- "@aztec/bb.js": "0.82.3",
39
- "@aztec/blob-sink": "0.82.3",
40
- "@aztec/bot": "0.82.3",
41
- "@aztec/builder": "0.82.3",
42
- "@aztec/cli": "0.82.3",
43
- "@aztec/cli-wallet": "0.82.3",
44
- "@aztec/constants": "0.82.3",
45
- "@aztec/entrypoints": "0.82.3",
46
- "@aztec/ethereum": "0.82.3",
47
- "@aztec/foundation": "0.82.3",
48
- "@aztec/kv-store": "0.82.3",
49
- "@aztec/noir-contracts.js": "0.82.3",
50
- "@aztec/noir-protocol-circuits-types": "0.82.3",
51
- "@aztec/p2p": "0.82.3",
52
- "@aztec/p2p-bootstrap": "0.82.3",
53
- "@aztec/protocol-contracts": "0.82.3",
54
- "@aztec/prover-client": "0.82.3",
55
- "@aztec/prover-node": "0.82.3",
56
- "@aztec/pxe": "0.82.3",
57
- "@aztec/stdlib": "0.82.3",
58
- "@aztec/telemetry-client": "0.82.3",
59
- "@aztec/txe": "0.82.3",
60
- "@aztec/world-state": "0.82.3",
32
+ "@aztec/accounts": "0.83.0",
33
+ "@aztec/archiver": "0.83.0",
34
+ "@aztec/aztec-faucet": "0.83.0",
35
+ "@aztec/aztec-node": "0.83.0",
36
+ "@aztec/aztec.js": "0.83.0",
37
+ "@aztec/bb-prover": "0.83.0",
38
+ "@aztec/bb.js": "0.83.0",
39
+ "@aztec/blob-sink": "0.83.0",
40
+ "@aztec/bot": "0.83.0",
41
+ "@aztec/builder": "0.83.0",
42
+ "@aztec/cli": "0.83.0",
43
+ "@aztec/cli-wallet": "0.83.0",
44
+ "@aztec/constants": "0.83.0",
45
+ "@aztec/entrypoints": "0.83.0",
46
+ "@aztec/ethereum": "0.83.0",
47
+ "@aztec/foundation": "0.83.0",
48
+ "@aztec/kv-store": "0.83.0",
49
+ "@aztec/noir-contracts.js": "0.83.0",
50
+ "@aztec/noir-protocol-circuits-types": "0.83.0",
51
+ "@aztec/p2p": "0.83.0",
52
+ "@aztec/p2p-bootstrap": "0.83.0",
53
+ "@aztec/protocol-contracts": "0.83.0",
54
+ "@aztec/prover-client": "0.83.0",
55
+ "@aztec/prover-node": "0.83.0",
56
+ "@aztec/pxe": "0.83.0",
57
+ "@aztec/stdlib": "0.83.0",
58
+ "@aztec/telemetry-client": "0.83.0",
59
+ "@aztec/txe": "0.83.0",
60
+ "@aztec/world-state": "0.83.0",
61
61
  "@types/chalk": "^2.2.0",
62
62
  "abitype": "^0.8.11",
63
63
  "chalk": "^5.3.0",
package/src/bin/index.ts CHANGED
@@ -12,6 +12,8 @@ import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
12
12
 
13
13
  import { Command } from 'commander';
14
14
 
15
+ import { NETWORK_FLAG } from '../cli/aztec_start_options.js';
16
+ import { type NetworkNames, enrichEnvironmentWithChainConfig } from '../cli/chain_l2_config.js';
15
17
  import { injectAztecCommands } from '../cli/index.js';
16
18
  import { getCliVersion } from '../cli/release_version.js';
17
19
 
@@ -26,6 +28,22 @@ async function main() {
26
28
  process.once('SIGINT', shutdown);
27
29
  process.once('SIGTERM', shutdown);
28
30
 
31
+ // Intercept the setting of a network and enrich the environment with defaults for that network
32
+ let networkValue: string | undefined;
33
+
34
+ const args = process.argv.slice(2);
35
+ const networkIndex = args.findIndex(arg => arg.startsWith(`--${NETWORK_FLAG}=`) || arg === `--${NETWORK_FLAG}`);
36
+
37
+ if (networkIndex !== -1) {
38
+ networkValue = args[networkIndex].split('=')[1] || args[networkIndex + 1];
39
+ }
40
+
41
+ networkValue = networkValue || process.env.NETWORK;
42
+
43
+ if (networkValue !== undefined) {
44
+ await enrichEnvironmentWithChainConfig(networkValue as NetworkNames);
45
+ }
46
+
29
47
  const cliVersion = getCliVersion();
30
48
  let program = new Command('aztec');
31
49
  program.description('Aztec command line interface').version(cliVersion);
@@ -11,7 +11,6 @@ import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
11
11
 
12
12
  import { createSandbox } from '../sandbox/index.js';
13
13
  import { github, splash } from '../splash.js';
14
- import { enrichEnvironmentWithChainConfig } from './chain_l2_config.js';
15
14
  import { getCliVersion } from './release_version.js';
16
15
  import { extractNamespacedOptions, installSignalHandlers } from './util.js';
17
16
  import { getVersions } from './versioning.js';
@@ -27,6 +26,7 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
27
26
  const cliVersion = getCliVersion();
28
27
  const sandboxOptions = extractNamespacedOptions(options, 'sandbox');
29
28
  const nodeOptions = extractNamespacedOptions(options, 'node');
29
+ sandboxOptions.testAccounts = true;
30
30
  userLog(`${splash}\n${github}\n\n`);
31
31
  userLog(`Setting up Aztec Sandbox ${cliVersion}, please stand by...`);
32
32
 
@@ -51,10 +51,6 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
51
51
  userLog(`Not exposing PXE API through JSON-RPC server`);
52
52
  }
53
53
  } else {
54
- // If a network is specified, enrich the environment with the chain config
55
- if (options.network) {
56
- await enrichEnvironmentWithChainConfig(options.network);
57
- }
58
54
  if (options.node) {
59
55
  const { startNode } = await import('./cmds/start_node.js');
60
56
  ({ config } = await startNode(options, signalHandlers, services, adminServices, userLog));
@@ -55,9 +55,9 @@ export const getOptions = (namespace: string, configMappings: Record<string, Con
55
55
  // These are options used by multiple modules so should be inputted once
56
56
  export const universalOptions = [
57
57
  'l1RpcUrls',
58
- 'l1ConsensusHostUrl',
59
- 'l1ConsensusHostApiKey',
60
- 'l1ConsensusHostApiKeyHeader',
58
+ 'l1ConsensusHostUrls',
59
+ 'l1ConsensusHostApiKeys',
60
+ 'l1ConsensusHostApiKeyHeaders',
61
61
  'l1ChainId',
62
62
  'l1Contracts',
63
63
  'p2pEnabled',
@@ -65,11 +65,13 @@ export const universalOptions = [
65
65
  'dataStoreMapSizeKb',
66
66
  ];
67
67
 
68
+ export const NETWORK_FLAG = 'network';
69
+
68
70
  // Define categories and options
69
71
  export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
70
72
  NETWORK: [
71
73
  {
72
- flag: '--network <value>',
74
+ flag: `--${NETWORK_FLAG} <value>`,
73
75
  description: 'Network to run Aztec on',
74
76
  defaultValue: undefined,
75
77
  envVar: 'NETWORK',
@@ -83,13 +85,7 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
83
85
  envVar: undefined,
84
86
  },
85
87
  {
86
- flag: '--sandbox.testAccounts',
87
- description: 'Deploy test accounts on sandbox start',
88
- envVar: 'TEST_ACCOUNTS',
89
- ...booleanConfigHelper(true),
90
- },
91
- {
92
- flag: '--sandbox.noPXE',
88
+ flag: '--sandbox.noPXE [value]',
93
89
  description: 'Do not expose PXE service on sandbox start',
94
90
  envVar: 'NO_PXE',
95
91
  ...booleanConfigHelper(),
@@ -139,23 +135,26 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
139
135
  envVar: 'MNEMONIC',
140
136
  },
141
137
  {
142
- flag: '--l1-consensus-host-url <value>',
143
- description: 'URL of the Ethereum consensus node that services will connect to',
144
- defaultValue: undefined,
145
- envVar: 'L1_CONSENSUS_HOST_URL',
138
+ flag: '--l1-consensus-host-urls <value>',
139
+ description: 'List of URLs of the Ethereum consensus nodes that services will connect to (comma separated)',
140
+ defaultValue: [],
141
+ envVar: 'L1_CONSENSUS_HOST_URLS',
142
+ parseVal: (val: string) => val.split(',').map(url => url.trim().replace(/\/$/, '')),
146
143
  },
147
144
  {
148
- flag: '--l1-consensus-host-api-key <value>',
149
- description: 'API key for the Ethereum consensus node',
150
- defaultValue: undefined,
151
- envVar: 'L1_CONSENSUS_HOST_API_KEY',
145
+ flag: '--l1-consensus-host-api-keys <value>',
146
+ description: 'List of API keys for the corresponding Ethereum consensus nodes',
147
+ defaultValue: [],
148
+ envVar: 'L1_CONSENSUS_HOST_API_KEYS',
149
+ parseVal: (val: string) => val.split(',').map(url => url.trim()),
152
150
  },
153
151
  {
154
- flag: '--l1-consensus-host-api-key-header <value>',
152
+ flag: '--l1-consensus-host-api-key-headers <value>',
155
153
  description:
156
- 'API key header for the Ethereum consensus node. If not set, the api key will be appended to the URL as ?key=<api-key>',
157
- defaultValue: undefined,
158
- envVar: 'L1_CONSENSUS_HOST_API_KEY_HEADER',
154
+ 'List of API key headers for the corresponding Ethereum consensus nodes. If not set, the api key for the corresponding node will be appended to the URL as ?key=<api-key>',
155
+ defaultValue: [],
156
+ envVar: 'L1_CONSENSUS_HOST_API_KEY_HEADERS',
157
+ parseVal: (val: string) => val.split(',').map(url => url.trim()),
159
158
  },
160
159
  ],
161
160
  STORAGE: [
@@ -267,12 +266,6 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
267
266
  envVar: 'WS_BLOCK_CHECK_INTERVAL_MS',
268
267
  parseVal: val => parseInt(val, 10),
269
268
  },
270
- {
271
- flag: '--node.testAccounts',
272
- description: 'Populate genesis state with initial fee juice for test accounts',
273
- envVar: 'TEST_ACCOUNTS',
274
- ...booleanConfigHelper(),
275
- },
276
269
  {
277
270
  flag: '--node.syncMode <value>',
278
271
  description:
@@ -289,7 +282,7 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
289
282
  ],
290
283
  'P2P SUBSYSTEM': [
291
284
  {
292
- flag: '--p2p-enabled',
285
+ flag: '--p2p-enabled [value]',
293
286
  description: 'Enable P2P subsystem',
294
287
  envVar: 'P2P_ENABLED',
295
288
  ...booleanConfigHelper(),
@@ -1,3 +1,4 @@
1
+ import { EthAddress } from '@aztec/aztec.js';
1
2
  import type { EnvVar } from '@aztec/foundation/config';
2
3
 
3
4
  import path from 'path';
@@ -20,6 +21,7 @@ export type L2ChainConfig = {
20
21
  seqMinTxsPerBlock: number;
21
22
  seqMaxTxsPerBlock: number;
22
23
  realProofs: boolean;
24
+ snapshotsUrl: string;
23
25
  };
24
26
 
25
27
  export const testnetIgnitionL2ChainConfig: L2ChainConfig = {
@@ -38,6 +40,7 @@ export const testnetIgnitionL2ChainConfig: L2ChainConfig = {
38
40
  seqMinTxsPerBlock: 0,
39
41
  seqMaxTxsPerBlock: 0,
40
42
  realProofs: true,
43
+ snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/',
41
44
  };
42
45
 
43
46
  export const alphaTestnetL2ChainConfig: L2ChainConfig = {
@@ -46,16 +49,17 @@ export const alphaTestnetL2ChainConfig: L2ChainConfig = {
46
49
  aztecSlotDuration: 36,
47
50
  aztecEpochDuration: 32,
48
51
  aztecProofSubmissionWindow: 64,
49
- testAccounts: true,
52
+ testAccounts: false,
50
53
  sponsoredFPC: true,
51
54
  p2pEnabled: true,
52
55
  p2pBootstrapNodes: [],
53
56
  registryAddress: '0xad85d55a4bbef35e95396191c22903aa717edf1c',
54
- slashFactoryAddress: '0xf667f50fd68b30c38b12d29fee537fa5ea158eb8',
57
+ slashFactoryAddress: '',
55
58
  feeAssetHandlerAddress: '0xf0664fec6ac15313e18d5ad8225e46b7c6463338',
56
59
  seqMinTxsPerBlock: 0,
57
60
  seqMaxTxsPerBlock: 4,
58
61
  realProofs: true,
62
+ snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/',
59
63
  };
60
64
 
61
65
  export async function getBootnodes(networkName: NetworkNames) {
@@ -92,6 +96,15 @@ function enrichVar(envVar: EnvVar, value: string) {
92
96
  process.env[envVar] = value;
93
97
  }
94
98
 
99
+ function enrichEthAddressVar(envVar: EnvVar, value: string) {
100
+ // EthAddress doesn't like being given empty strings
101
+ if (value === '') {
102
+ enrichVar(envVar, EthAddress.ZERO.toString());
103
+ return;
104
+ }
105
+ enrichVar(envVar, value);
106
+ }
107
+
95
108
  export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames) {
96
109
  const config = await getL2ChainConfig(networkName);
97
110
  if (!config) {
@@ -106,12 +119,14 @@ export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames
106
119
  enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
107
120
  enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
108
121
  enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
109
- enrichVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
110
- enrichVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
111
- enrichVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
112
122
  enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
113
123
  enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
114
124
  enrichVar('DATA_DIRECTORY', path.join(process.env.HOME || '~', '.aztec', networkName, 'data'));
115
125
  enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
116
126
  enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
127
+ enrichVar('SYNC_SNAPSHOTS_URL', config.snapshotsUrl);
128
+
129
+ enrichEthAddressVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
130
+ enrichEthAddressVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
131
+ enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
117
132
  }
@@ -54,7 +54,9 @@ export async function startNode(
54
54
 
55
55
  userLog(`Initial funded accounts: ${initialFundedAccounts.map(a => a.toString()).join(', ')}`);
56
56
 
57
- const { genesisBlockHash, genesisArchiveRoot, prefilledPublicData } = await getGenesisValues(initialFundedAccounts);
57
+ const { genesisBlockHash, genesisArchiveRoot, prefilledPublicData, fundingNeeded } = await getGenesisValues(
58
+ initialFundedAccounts,
59
+ );
58
60
 
59
61
  userLog(`Genesis block hash: ${genesisBlockHash.toString()}`);
60
62
  userLog(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
@@ -75,6 +77,7 @@ export async function startNode(
75
77
  salt: nodeSpecificOptions.deployAztecContractsSalt,
76
78
  genesisBlockHash,
77
79
  genesisArchiveRoot,
80
+ feeJuicePortalInitialBalance: fundingNeeded,
78
81
  });
79
82
  }
80
83
  // If not deploying, validate that any addresses and config provided are correct.
@@ -86,6 +89,7 @@ export async function startNode(
86
89
  nodeConfig.l1Contracts.registryAddress,
87
90
  nodeConfig.l1RpcUrls,
88
91
  nodeConfig.l1ChainId,
92
+ nodeConfig.rollupVersion,
89
93
  );
90
94
 
91
95
  // TODO(#12272): will clean this up.
@@ -33,9 +33,15 @@ export async function startProverBroker(
33
33
  throw new Error('L1 registry address is required to start Aztec Node without --deploy-aztec-contracts option');
34
34
  }
35
35
 
36
- const { addresses } = await getL1Config(config.l1Contracts.registryAddress, config.l1RpcUrls, config.l1ChainId);
36
+ const { addresses, config: rollupConfig } = await getL1Config(
37
+ config.l1Contracts.registryAddress,
38
+ config.l1RpcUrls,
39
+ config.l1ChainId,
40
+ config.rollupVersion,
41
+ );
37
42
 
38
43
  config.l1Contracts = addresses;
44
+ config.rollupVersion = rollupConfig.rollupVersion;
39
45
 
40
46
  const client = initTelemetryClient(getTelemetryClientConfig());
41
47
  const broker = await createAndStartProvingBroker(config, client);
@@ -11,7 +11,6 @@ import {
11
11
  getProverNodeConfigFromEnv,
12
12
  proverNodeConfigMappings,
13
13
  } from '@aztec/prover-node';
14
- import { createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
15
14
  import { P2PApiSchema, ProverNodeApiSchema, type ProvingJobBroker } from '@aztec/stdlib/interfaces/server';
16
15
  import { initTelemetryClient, makeTracedFetch, telemetryClientConfigMappings } from '@aztec/telemetry-client';
17
16
  import { getGenesisValues } from '@aztec/world-state/testing';
@@ -54,30 +53,18 @@ export async function startProverNode(
54
53
  proverConfig.publisherPrivateKey = `0x${Buffer.from(privKey!).toString('hex')}`;
55
54
  }
56
55
 
57
- // TODO(palla/prover-node) L1 contract addresses should not silently default to zero,
58
- // they should be undefined if not set and fail loudly.
59
- // Load l1 contract addresses from aztec node if not set.
60
- const isRollupAddressSet =
61
- proverConfig.l1Contracts?.rollupAddress && !proverConfig.l1Contracts.rollupAddress.isZero();
62
- const nodeUrl = proverConfig.nodeUrl ?? proverConfig.proverCoordinationNodeUrl;
63
- if (nodeUrl && !isRollupAddressSet) {
64
- userLog(`Loading L1 contract addresses from aztec node at ${nodeUrl}`);
65
- proverConfig.l1Contracts = await createAztecNodeClient(nodeUrl).getL1ContractAddresses();
56
+ if (!proverConfig.l1Contracts.registryAddress || proverConfig.l1Contracts.registryAddress.isZero()) {
57
+ throw new Error('L1 registry address is required to start a Prover Node with --archiver option');
66
58
  }
67
59
 
68
- // If we create an archiver here, validate the L1 config
69
- if (options.archiver) {
70
- if (!proverConfig.l1Contracts.registryAddress || proverConfig.l1Contracts.registryAddress.isZero()) {
71
- throw new Error('L1 registry address is required to start a Prover Node with --archiver option');
72
- }
73
- const { addresses, config } = await getL1Config(
74
- proverConfig.l1Contracts.registryAddress,
75
- proverConfig.l1RpcUrls,
76
- proverConfig.l1ChainId,
77
- );
78
- proverConfig.l1Contracts = addresses;
79
- proverConfig = { ...proverConfig, ...config };
80
- }
60
+ const { addresses, config } = await getL1Config(
61
+ proverConfig.l1Contracts.registryAddress,
62
+ proverConfig.l1RpcUrls,
63
+ proverConfig.l1ChainId,
64
+ proverConfig.rollupVersion,
65
+ );
66
+ proverConfig.l1Contracts = addresses;
67
+ proverConfig = { ...proverConfig, ...config };
81
68
 
82
69
  const telemetry = initTelemetryClient(extractRelevantOptions(options, telemetryClientConfigMappings, 'tel'));
83
70
 
@@ -5,9 +5,10 @@ export async function getL1Config(
5
5
  registryAddress: EthAddress,
6
6
  l1RpcUrls: string[],
7
7
  l1ChainId: number,
8
+ rollupVersion: number | 'canonical' = 'canonical',
8
9
  ): Promise<{ addresses: L1ContractAddresses; config: Awaited<ReturnType<typeof getL1ContractsConfig>> }> {
9
10
  const publicClient = getPublicClient({ l1RpcUrls, l1ChainId });
10
- const addresses = await RegistryContract.collectAddresses(publicClient, registryAddress, 'canonical');
11
+ const addresses = await RegistryContract.collectAddresses(publicClient, registryAddress, rollupVersion);
11
12
 
12
13
  const config = await getL1ContractsConfig(publicClient, addresses);
13
14
 
package/src/cli/util.ts CHANGED
@@ -243,6 +243,6 @@ export async function preloadCrsDataForServerSideProving(
243
243
  ): Promise<void> {
244
244
  if (realProofs) {
245
245
  const { Crs, GrumpkinCrs } = await import('@aztec/bb.js');
246
- await Promise.all([Crs.new(2 ** 25 - 1, undefined, log), GrumpkinCrs.new(2 ** 18 + 1, undefined, log)]);
246
+ await Promise.all([Crs.new(2 ** 25 + 1, undefined, log), GrumpkinCrs.new(2 ** 18 + 1, undefined, log)]);
247
247
  }
248
248
  }
@@ -4,7 +4,7 @@ import { deployFundedSchnorrAccounts, getInitialTestAccounts } from '@aztec/acco
4
4
  import { type AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
5
5
  import { AnvilTestWatcher, EthCheatCodes } from '@aztec/aztec.js/testing';
6
6
  import { type BlobSinkClientInterface, createBlobSinkClient } from '@aztec/blob-sink/client';
7
- import { setupCanonicalL2FeeJuice, setupSponsoredFPC } from '@aztec/cli/cli-utils';
7
+ import { setupSponsoredFPC } from '@aztec/cli/cli-utils';
8
8
  import { GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH } from '@aztec/constants';
9
9
  import {
10
10
  NULL_KEY,
@@ -16,7 +16,7 @@ import {
16
16
  import { Fr } from '@aztec/foundation/fields';
17
17
  import { type LogFn, createLogger } from '@aztec/foundation/log';
18
18
  import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
19
- import { ProtocolContractAddress, protocolContractTreeRoot } from '@aztec/protocol-contracts';
19
+ import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
20
20
  import { type PXEServiceConfig, createPXEService, getPXEServiceConfig } from '@aztec/pxe/server';
21
21
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
22
22
  import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
@@ -49,7 +49,13 @@ export async function deployContractsToL1(
49
49
  aztecNodeConfig: AztecNodeConfig,
50
50
  hdAccount: HDAccount | PrivateKeyAccount,
51
51
  contractDeployLogger = logger,
52
- opts: { assumeProvenThroughBlockNumber?: number; salt?: number; genesisArchiveRoot?: Fr; genesisBlockHash?: Fr } = {},
52
+ opts: {
53
+ assumeProvenThroughBlockNumber?: number;
54
+ salt?: number;
55
+ genesisArchiveRoot?: Fr;
56
+ genesisBlockHash?: Fr;
57
+ feeJuicePortalInitialBalance?: bigint;
58
+ } = {},
53
59
  ) {
54
60
  const chain =
55
61
  aztecNodeConfig.l1RpcUrls.length > 0
@@ -66,12 +72,12 @@ export async function deployContractsToL1(
66
72
  {
67
73
  ...getL1ContractsConfigEnvVars(), // TODO: We should not need to be loading config from env again, caller should handle this
68
74
  ...aztecNodeConfig,
69
- l2FeeJuiceAddress: ProtocolContractAddress.FeeJuice.toField(),
70
75
  vkTreeRoot: getVKTreeRoot(),
71
76
  protocolContractTreeRoot,
72
77
  genesisArchiveRoot: opts.genesisArchiveRoot ?? new Fr(GENESIS_ARCHIVE_ROOT),
73
78
  genesisBlockHash: opts.genesisBlockHash ?? new Fr(GENESIS_BLOCK_HASH),
74
79
  salt: opts.salt,
80
+ feeJuicePortalInitialBalance: opts.feeJuicePortalInitialBalance,
75
81
  },
76
82
  );
77
83
 
@@ -118,10 +124,11 @@ export async function createSandbox(config: Partial<SandboxConfig> = {}, userLog
118
124
  }
119
125
 
120
126
  const initialAccounts = await (async () => {
121
- if (config.testAccounts) {
127
+ if (config.testAccounts === true || config.testAccounts === undefined) {
122
128
  if (aztecNodeConfig.p2pEnabled) {
123
129
  userLog(`Not setting up test accounts as we are connecting to a network`);
124
130
  } else {
131
+ userLog(`Setting up test accounts`);
125
132
  return await getInitialTestAccounts();
126
133
  }
127
134
  }
@@ -133,7 +140,9 @@ export async function createSandbox(config: Partial<SandboxConfig> = {}, userLog
133
140
  const fundedAddresses = initialAccounts.length
134
141
  ? [...initialAccounts.map(a => a.address), bananaFPC, sponsoredFPC]
135
142
  : [];
136
- const { genesisArchiveRoot, genesisBlockHash, prefilledPublicData } = await getGenesisValues(fundedAddresses);
143
+ const { genesisArchiveRoot, genesisBlockHash, prefilledPublicData, fundingNeeded } = await getGenesisValues(
144
+ fundedAddresses,
145
+ );
137
146
 
138
147
  let watcher: AnvilTestWatcher | undefined = undefined;
139
148
  if (!aztecNodeConfig.p2pEnabled) {
@@ -142,6 +151,7 @@ export async function createSandbox(config: Partial<SandboxConfig> = {}, userLog
142
151
  genesisArchiveRoot,
143
152
  genesisBlockHash,
144
153
  salt: config.l1Salt ? parseInt(config.l1Salt) : undefined,
154
+ feeJuicePortalInitialBalance: fundingNeeded,
145
155
  });
146
156
 
147
157
  const chain =
@@ -166,8 +176,6 @@ export async function createSandbox(config: Partial<SandboxConfig> = {}, userLog
166
176
  const pxeServiceConfig = { proverEnabled: aztecNodeConfig.realProofs };
167
177
  const pxe = await createAztecPXE(node, pxeServiceConfig);
168
178
 
169
- await setupCanonicalL2FeeJuice(pxe, aztecNodeConfig.l1Contracts.feeJuicePortalAddress, logger.info);
170
-
171
179
  if (initialAccounts.length) {
172
180
  userLog('Setting up funded test accounts...');
173
181
  const accounts = await deployFundedSchnorrAccounts(pxe, initialAccounts);