@aztec/aztec 0.82.2 → 0.82.3-nightly.20250403
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 +13 -0
- package/dest/cli/aztec_start_action.d.ts.map +1 -1
- package/dest/cli/aztec_start_action.js +1 -5
- package/dest/cli/aztec_start_options.d.ts +1 -0
- package/dest/cli/aztec_start_options.d.ts.map +1 -1
- package/dest/cli/aztec_start_options.js +32 -28
- package/dest/cli/chain_l2_config.d.ts +4 -0
- package/dest/cli/chain_l2_config.d.ts.map +1 -1
- package/dest/cli/chain_l2_config.js +25 -4
- package/dest/cli/cmds/start_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_node.js +13 -4
- package/dest/cli/cmds/start_p2p_bootstrap.d.ts.map +1 -1
- package/dest/cli/cmds/start_p2p_bootstrap.js +5 -1
- package/dest/cli/cmds/start_prover_broker.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_broker.js +2 -1
- package/dest/cli/cmds/start_prover_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_node.js +18 -23
- package/dest/cli/get_l1_config.d.ts +1 -1
- package/dest/cli/get_l1_config.d.ts.map +1 -1
- package/dest/cli/get_l1_config.js +2 -2
- package/dest/cli/util.js +1 -1
- package/dest/sandbox/sandbox.d.ts +2 -0
- package/dest/sandbox/sandbox.d.ts.map +1 -1
- package/dest/sandbox/sandbox.js +9 -10
- package/package.json +30 -30
- package/src/bin/index.ts +18 -0
- package/src/cli/aztec_start_action.ts +1 -5
- package/src/cli/aztec_start_options.ts +34 -28
- package/src/cli/chain_l2_config.ts +29 -2
- package/src/cli/cmds/start_node.ts +14 -3
- package/src/cli/cmds/start_p2p_bootstrap.ts +2 -1
- package/src/cli/cmds/start_prover_broker.ts +7 -1
- package/src/cli/cmds/start_prover_node.ts +20 -25
- package/src/cli/get_l1_config.ts +2 -1
- package/src/cli/util.ts +1 -1
- package/src/sandbox/sandbox.ts +16 -10
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;
|
|
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;
|
|
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
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
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:
|
|
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.
|
|
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-
|
|
120
|
-
description: '
|
|
121
|
-
defaultValue:
|
|
122
|
-
envVar: '
|
|
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-
|
|
126
|
-
description: 'API
|
|
127
|
-
defaultValue:
|
|
128
|
-
envVar: '
|
|
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-
|
|
132
|
-
description: 'API key
|
|
133
|
-
defaultValue:
|
|
134
|
-
envVar: '
|
|
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: [
|
|
@@ -241,15 +239,21 @@ export const aztecStartOptions = {
|
|
|
241
239
|
parseVal: (val)=>parseInt(val, 10)
|
|
242
240
|
},
|
|
243
241
|
{
|
|
244
|
-
flag: '--node.
|
|
245
|
-
description: '
|
|
246
|
-
|
|
247
|
-
|
|
242
|
+
flag: '--node.syncMode <value>',
|
|
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.',
|
|
244
|
+
defaultValue: 'snapshot',
|
|
245
|
+
envVar: 'SYNC_MODE'
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
flag: '--node.snapshotsUrl <value>',
|
|
249
|
+
description: 'Base URL for downloading snapshots for snapshot sync.',
|
|
250
|
+
defaultValue: undefined,
|
|
251
|
+
envVar: 'SYNC_SNAPSHOTS_URL'
|
|
248
252
|
}
|
|
249
253
|
],
|
|
250
254
|
'P2P SUBSYSTEM': [
|
|
251
255
|
{
|
|
252
|
-
flag: '--p2p-enabled',
|
|
256
|
+
flag: '--p2p-enabled [value]',
|
|
253
257
|
description: 'Enable P2P subsystem',
|
|
254
258
|
envVar: 'P2P_ENABLED',
|
|
255
259
|
...booleanConfigHelper()
|
|
@@ -6,12 +6,16 @@ export type L2ChainConfig = {
|
|
|
6
6
|
aztecEpochDuration: number;
|
|
7
7
|
aztecProofSubmissionWindow: number;
|
|
8
8
|
testAccounts: boolean;
|
|
9
|
+
sponsoredFPC: boolean;
|
|
9
10
|
p2pEnabled: boolean;
|
|
10
11
|
p2pBootstrapNodes: string[];
|
|
11
12
|
registryAddress: string;
|
|
13
|
+
slashFactoryAddress: string;
|
|
14
|
+
feeAssetHandlerAddress: string;
|
|
12
15
|
seqMinTxsPerBlock: number;
|
|
13
16
|
seqMaxTxsPerBlock: number;
|
|
14
17
|
realProofs: boolean;
|
|
18
|
+
snapshotsUrl: string;
|
|
15
19
|
};
|
|
16
20
|
export declare const testnetIgnitionL2ChainConfig: L2ChainConfig;
|
|
17
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":"
|
|
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,
|
|
@@ -6,12 +7,16 @@ export const testnetIgnitionL2ChainConfig = {
|
|
|
6
7
|
aztecEpochDuration: 32,
|
|
7
8
|
aztecProofSubmissionWindow: 64,
|
|
8
9
|
testAccounts: true,
|
|
10
|
+
sponsoredFPC: false,
|
|
9
11
|
p2pEnabled: true,
|
|
10
12
|
p2pBootstrapNodes: [],
|
|
11
13
|
registryAddress: '0x12b3ebc176a1646b911391eab3760764f2e05fe3',
|
|
14
|
+
slashFactoryAddress: '',
|
|
15
|
+
feeAssetHandlerAddress: '',
|
|
12
16
|
seqMinTxsPerBlock: 0,
|
|
13
17
|
seqMaxTxsPerBlock: 0,
|
|
14
|
-
realProofs: true
|
|
18
|
+
realProofs: true,
|
|
19
|
+
snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/'
|
|
15
20
|
};
|
|
16
21
|
export const alphaTestnetL2ChainConfig = {
|
|
17
22
|
l1ChainId: 11155111,
|
|
@@ -20,12 +25,16 @@ export const alphaTestnetL2ChainConfig = {
|
|
|
20
25
|
aztecEpochDuration: 32,
|
|
21
26
|
aztecProofSubmissionWindow: 64,
|
|
22
27
|
testAccounts: false,
|
|
28
|
+
sponsoredFPC: true,
|
|
23
29
|
p2pEnabled: true,
|
|
24
30
|
p2pBootstrapNodes: [],
|
|
25
|
-
registryAddress: '',
|
|
31
|
+
registryAddress: '0xad85d55a4bbef35e95396191c22903aa717edf1c',
|
|
32
|
+
slashFactoryAddress: '',
|
|
33
|
+
feeAssetHandlerAddress: '0xf0664fec6ac15313e18d5ad8225e46b7c6463338',
|
|
26
34
|
seqMinTxsPerBlock: 0,
|
|
27
35
|
seqMaxTxsPerBlock: 4,
|
|
28
|
-
realProofs: true
|
|
36
|
+
realProofs: true,
|
|
37
|
+
snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/'
|
|
29
38
|
};
|
|
30
39
|
export async function getBootnodes(networkName) {
|
|
31
40
|
const url = `http://static.aztec.network/${networkName}/bootnodes.json`;
|
|
@@ -59,6 +68,14 @@ function enrichVar(envVar, value) {
|
|
|
59
68
|
}
|
|
60
69
|
process.env[envVar] = value;
|
|
61
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
|
+
}
|
|
62
79
|
export async function enrichEnvironmentWithChainConfig(networkName) {
|
|
63
80
|
const config = await getL2ChainConfig(networkName);
|
|
64
81
|
if (!config) {
|
|
@@ -70,12 +87,16 @@ export async function enrichEnvironmentWithChainConfig(networkName) {
|
|
|
70
87
|
enrichVar('AZTEC_PROOF_SUBMISSION_WINDOW', config.aztecProofSubmissionWindow.toString());
|
|
71
88
|
enrichVar('BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
|
|
72
89
|
enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
|
|
90
|
+
enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
|
|
73
91
|
enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
|
|
74
92
|
enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
|
|
75
|
-
enrichVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
|
|
76
93
|
enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
|
|
77
94
|
enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
|
|
78
95
|
enrichVar('DATA_DIRECTORY', path.join(process.env.HOME || '~', '.aztec', networkName, 'data'));
|
|
79
96
|
enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
|
|
80
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);
|
|
81
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;
|
|
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"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getInitialTestAccounts } from '@aztec/accounts/testing';
|
|
2
2
|
import { aztecNodeConfigMappings, getConfigEnvVars } from '@aztec/aztec-node';
|
|
3
|
+
import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
|
|
3
4
|
import { NULL_KEY } from '@aztec/ethereum';
|
|
4
5
|
import { AztecNodeAdminApiSchema, AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
5
6
|
import { P2PApiSchema } from '@aztec/stdlib/interfaces/server';
|
|
@@ -26,8 +27,15 @@ export async function startNode(options, signalHandlers, services, adminServices
|
|
|
26
27
|
process.exit(1);
|
|
27
28
|
}
|
|
28
29
|
await preloadCrsDataForVerifying(nodeConfig, userLog);
|
|
29
|
-
const
|
|
30
|
-
const
|
|
30
|
+
const testAccounts = nodeConfig.testAccounts ? (await getInitialTestAccounts()).map((a)=>a.address) : [];
|
|
31
|
+
const sponsoredFPCAccounts = nodeConfig.sponsoredFPC ? [
|
|
32
|
+
await getSponsoredFPCAddress()
|
|
33
|
+
] : [];
|
|
34
|
+
const initialFundedAccounts = testAccounts.concat(sponsoredFPCAccounts);
|
|
35
|
+
userLog(`Initial funded accounts: ${initialFundedAccounts.map((a)=>a.toString()).join(', ')}`);
|
|
36
|
+
const { genesisBlockHash, genesisArchiveRoot, prefilledPublicData, fundingNeeded } = await getGenesisValues(initialFundedAccounts);
|
|
37
|
+
userLog(`Genesis block hash: ${genesisBlockHash.toString()}`);
|
|
38
|
+
userLog(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
|
|
31
39
|
// Deploy contracts if needed
|
|
32
40
|
if (nodeSpecificOptions.deployAztecContracts || nodeSpecificOptions.deployAztecContractsSalt) {
|
|
33
41
|
let account;
|
|
@@ -43,13 +51,14 @@ export async function startNode(options, signalHandlers, services, adminServices
|
|
|
43
51
|
assumeProvenThroughBlockNumber: nodeSpecificOptions.assumeProvenThroughBlockNumber,
|
|
44
52
|
salt: nodeSpecificOptions.deployAztecContractsSalt,
|
|
45
53
|
genesisBlockHash,
|
|
46
|
-
genesisArchiveRoot
|
|
54
|
+
genesisArchiveRoot,
|
|
55
|
+
feeJuicePortalInitialBalance: fundingNeeded
|
|
47
56
|
});
|
|
48
57
|
} else {
|
|
49
58
|
if (!nodeConfig.l1Contracts.registryAddress || nodeConfig.l1Contracts.registryAddress.isZero()) {
|
|
50
59
|
throw new Error('L1 registry address is required to start Aztec Node without --deploy-aztec-contracts option');
|
|
51
60
|
}
|
|
52
|
-
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);
|
|
53
62
|
// TODO(#12272): will clean this up.
|
|
54
63
|
nodeConfig = {
|
|
55
64
|
...nodeConfig,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_p2p_bootstrap.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_p2p_bootstrap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,KAAK,KAAK,EAAgB,MAAM,uBAAuB,CAAC;AASjE,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;;
|
|
1
|
+
{"version":3,"file":"start_p2p_bootstrap.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_p2p_bootstrap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,KAAK,KAAK,EAAgB,MAAM,uBAAuB,CAAC;AASjE,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;;GAcf"}
|
|
@@ -9,7 +9,11 @@ import { extractRelevantOptions } from '../util.js';
|
|
|
9
9
|
export async function startP2PBootstrap(options, signalHandlers, services, userLog) {
|
|
10
10
|
// Start a P2P bootstrap node.
|
|
11
11
|
const config = extractRelevantOptions(options, bootnodeConfigMappings, 'p2p');
|
|
12
|
-
|
|
12
|
+
const safeConfig = {
|
|
13
|
+
...config,
|
|
14
|
+
peerIdPrivateKey: '<redacted>'
|
|
15
|
+
};
|
|
16
|
+
userLog(`Starting P2P bootstrap node with config: ${jsonStringify(safeConfig)}`);
|
|
13
17
|
const telemetryClient = initTelemetryClient(getTelemetryClientConfig());
|
|
14
18
|
const store = await createStore('p2p-bootstrap', 1, config, createLogger('p2p:bootstrap:store'));
|
|
15
19
|
const node = new BootstrapNode(store, telemetryClient);
|
|
@@ -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,
|
|
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":"
|
|
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"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getInitialTestAccounts } from '@aztec/accounts/testing';
|
|
2
|
+
import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
|
|
2
3
|
import { NULL_KEY } from '@aztec/ethereum';
|
|
3
4
|
import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici';
|
|
4
5
|
import { ProvingJobConsumerSchema, createProvingJobBrokerClient } from '@aztec/prover-client/broker';
|
|
5
6
|
import { createProverNode, getProverNodeConfigFromEnv, proverNodeConfigMappings } from '@aztec/prover-node';
|
|
6
|
-
import { createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
|
|
7
7
|
import { P2PApiSchema, ProverNodeApiSchema } from '@aztec/stdlib/interfaces/server';
|
|
8
8
|
import { initTelemetryClient, makeTracedFetch, telemetryClientConfigMappings } from '@aztec/telemetry-client';
|
|
9
9
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
@@ -34,27 +34,15 @@ export async function startProverNode(options, signalHandlers, services, userLog
|
|
|
34
34
|
const privKey = hdAccount.getHdKey().privateKey;
|
|
35
35
|
proverConfig.publisherPrivateKey = `0x${Buffer.from(privKey).toString('hex')}`;
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// Load l1 contract addresses from aztec node if not set.
|
|
40
|
-
const isRollupAddressSet = proverConfig.l1Contracts?.rollupAddress && !proverConfig.l1Contracts.rollupAddress.isZero();
|
|
41
|
-
const nodeUrl = proverConfig.nodeUrl ?? proverConfig.proverCoordinationNodeUrl;
|
|
42
|
-
if (nodeUrl && !isRollupAddressSet) {
|
|
43
|
-
userLog(`Loading L1 contract addresses from aztec node at ${nodeUrl}`);
|
|
44
|
-
proverConfig.l1Contracts = await createAztecNodeClient(nodeUrl).getL1ContractAddresses();
|
|
45
|
-
}
|
|
46
|
-
// If we create an archiver here, validate the L1 config
|
|
47
|
-
if (options.archiver) {
|
|
48
|
-
if (!proverConfig.l1Contracts.registryAddress || proverConfig.l1Contracts.registryAddress.isZero()) {
|
|
49
|
-
throw new Error('L1 registry address is required to start a Prover Node with --archiver option');
|
|
50
|
-
}
|
|
51
|
-
const { addresses, config } = await getL1Config(proverConfig.l1Contracts.registryAddress, proverConfig.l1RpcUrls, proverConfig.l1ChainId);
|
|
52
|
-
proverConfig.l1Contracts = addresses;
|
|
53
|
-
proverConfig = {
|
|
54
|
-
...proverConfig,
|
|
55
|
-
...config
|
|
56
|
-
};
|
|
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');
|
|
57
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
|
+
};
|
|
58
46
|
const telemetry = initTelemetryClient(extractRelevantOptions(options, telemetryClientConfigMappings, 'tel'));
|
|
59
47
|
let broker;
|
|
60
48
|
if (proverConfig.proverBrokerUrl) {
|
|
@@ -78,8 +66,15 @@ export async function startProverNode(options, signalHandlers, services, userLog
|
|
|
78
66
|
userLog(`Running prover node without local prover agent. Connect one or more prover agents to this node or pass --proverAgent.proverAgentCount`);
|
|
79
67
|
}
|
|
80
68
|
await preloadCrsDataForVerifying(proverConfig, userLog);
|
|
81
|
-
const
|
|
82
|
-
const
|
|
69
|
+
const testAccounts = proverConfig.testAccounts ? (await getInitialTestAccounts()).map((a)=>a.address) : [];
|
|
70
|
+
const sponsoredFPCAccounts = proverConfig.sponsoredFPC ? [
|
|
71
|
+
await getSponsoredFPCAddress()
|
|
72
|
+
] : [];
|
|
73
|
+
const initialFundedAccounts = testAccounts.concat(sponsoredFPCAccounts);
|
|
74
|
+
userLog(`Initial funded accounts: ${initialFundedAccounts.map((a)=>a.toString()).join(', ')}`);
|
|
75
|
+
const { genesisArchiveRoot, genesisBlockHash, prefilledPublicData } = await getGenesisValues(initialFundedAccounts);
|
|
76
|
+
userLog(`Genesis block hash: ${genesisBlockHash.toString()}`);
|
|
77
|
+
userLog(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
|
|
83
78
|
const proverNode = await createProverNode(proverConfig, {
|
|
84
79
|
telemetry,
|
|
85
80
|
broker
|
|
@@ -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,
|
|
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,
|
|
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
|
|
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;
|
|
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"}
|
package/dest/sandbox/sandbox.js
CHANGED
|
@@ -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 {
|
|
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 {
|
|
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,12 +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
|
-
} else if (config.noPXE) {
|
|
79
|
-
userLog(`Not setting up test accounts as we are not exposing a PXE`);
|
|
80
78
|
} else {
|
|
79
|
+
userLog(`Setting up test accounts`);
|
|
81
80
|
return await getInitialTestAccounts();
|
|
82
81
|
}
|
|
83
82
|
}
|
|
@@ -90,14 +89,15 @@ const localAnvil = foundry;
|
|
|
90
89
|
bananaFPC,
|
|
91
90
|
sponsoredFPC
|
|
92
91
|
] : [];
|
|
93
|
-
const { genesisArchiveRoot, genesisBlockHash, prefilledPublicData } = await getGenesisValues(fundedAddresses);
|
|
92
|
+
const { genesisArchiveRoot, genesisBlockHash, prefilledPublicData, fundingNeeded } = await getGenesisValues(fundedAddresses);
|
|
94
93
|
let watcher = undefined;
|
|
95
94
|
if (!aztecNodeConfig.p2pEnabled) {
|
|
96
95
|
const l1ContractAddresses = await deployContractsToL1(aztecNodeConfig, hdAccount, undefined, {
|
|
97
96
|
assumeProvenThroughBlockNumber: Number.MAX_SAFE_INTEGER,
|
|
98
97
|
genesisArchiveRoot,
|
|
99
98
|
genesisBlockHash,
|
|
100
|
-
salt: config.l1Salt ? parseInt(config.l1Salt) : undefined
|
|
99
|
+
salt: config.l1Salt ? parseInt(config.l1Salt) : undefined,
|
|
100
|
+
feeJuicePortalInitialBalance: fundingNeeded
|
|
101
101
|
});
|
|
102
102
|
const chain = aztecNodeConfig.l1RpcUrls.length > 0 ? createEthereumChain([
|
|
103
103
|
l1RpcUrl
|
|
@@ -129,7 +129,6 @@ const localAnvil = foundry;
|
|
|
129
129
|
proverEnabled: aztecNodeConfig.realProofs
|
|
130
130
|
};
|
|
131
131
|
const pxe = await createAztecPXE(node, pxeServiceConfig);
|
|
132
|
-
await setupCanonicalL2FeeJuice(pxe, aztecNodeConfig.l1Contracts.feeJuicePortalAddress, logger.info);
|
|
133
132
|
if (initialAccounts.length) {
|
|
134
133
|
userLog('Setting up funded test accounts...');
|
|
135
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
|
+
"version": "0.82.3-nightly.20250403",
|
|
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.
|
|
33
|
-
"@aztec/archiver": "0.82.
|
|
34
|
-
"@aztec/aztec-faucet": "0.82.
|
|
35
|
-
"@aztec/aztec-node": "0.82.
|
|
36
|
-
"@aztec/aztec.js": "0.82.
|
|
37
|
-
"@aztec/bb-prover": "0.82.
|
|
38
|
-
"@aztec/bb.js": "0.82.
|
|
39
|
-
"@aztec/blob-sink": "0.82.
|
|
40
|
-
"@aztec/bot": "0.82.
|
|
41
|
-
"@aztec/builder": "0.82.
|
|
42
|
-
"@aztec/cli": "0.82.
|
|
43
|
-
"@aztec/cli-wallet": "0.82.
|
|
44
|
-
"@aztec/constants": "0.82.
|
|
45
|
-
"@aztec/entrypoints": "0.82.
|
|
46
|
-
"@aztec/ethereum": "0.82.
|
|
47
|
-
"@aztec/foundation": "0.82.
|
|
48
|
-
"@aztec/kv-store": "0.82.
|
|
49
|
-
"@aztec/noir-contracts.js": "0.82.
|
|
50
|
-
"@aztec/noir-protocol-circuits-types": "0.82.
|
|
51
|
-
"@aztec/p2p": "0.82.
|
|
52
|
-
"@aztec/p2p-bootstrap": "0.82.
|
|
53
|
-
"@aztec/protocol-contracts": "0.82.
|
|
54
|
-
"@aztec/prover-client": "0.82.
|
|
55
|
-
"@aztec/prover-node": "0.82.
|
|
56
|
-
"@aztec/pxe": "0.82.
|
|
57
|
-
"@aztec/stdlib": "0.82.
|
|
58
|
-
"@aztec/telemetry-client": "0.82.
|
|
59
|
-
"@aztec/txe": "0.82.
|
|
60
|
-
"@aztec/world-state": "0.82.
|
|
32
|
+
"@aztec/accounts": "0.82.3-nightly.20250403",
|
|
33
|
+
"@aztec/archiver": "0.82.3-nightly.20250403",
|
|
34
|
+
"@aztec/aztec-faucet": "0.82.3-nightly.20250403",
|
|
35
|
+
"@aztec/aztec-node": "0.82.3-nightly.20250403",
|
|
36
|
+
"@aztec/aztec.js": "0.82.3-nightly.20250403",
|
|
37
|
+
"@aztec/bb-prover": "0.82.3-nightly.20250403",
|
|
38
|
+
"@aztec/bb.js": "0.82.3-nightly.20250403",
|
|
39
|
+
"@aztec/blob-sink": "0.82.3-nightly.20250403",
|
|
40
|
+
"@aztec/bot": "0.82.3-nightly.20250403",
|
|
41
|
+
"@aztec/builder": "0.82.3-nightly.20250403",
|
|
42
|
+
"@aztec/cli": "0.82.3-nightly.20250403",
|
|
43
|
+
"@aztec/cli-wallet": "0.82.3-nightly.20250403",
|
|
44
|
+
"@aztec/constants": "0.82.3-nightly.20250403",
|
|
45
|
+
"@aztec/entrypoints": "0.82.3-nightly.20250403",
|
|
46
|
+
"@aztec/ethereum": "0.82.3-nightly.20250403",
|
|
47
|
+
"@aztec/foundation": "0.82.3-nightly.20250403",
|
|
48
|
+
"@aztec/kv-store": "0.82.3-nightly.20250403",
|
|
49
|
+
"@aztec/noir-contracts.js": "0.82.3-nightly.20250403",
|
|
50
|
+
"@aztec/noir-protocol-circuits-types": "0.82.3-nightly.20250403",
|
|
51
|
+
"@aztec/p2p": "0.82.3-nightly.20250403",
|
|
52
|
+
"@aztec/p2p-bootstrap": "0.82.3-nightly.20250403",
|
|
53
|
+
"@aztec/protocol-contracts": "0.82.3-nightly.20250403",
|
|
54
|
+
"@aztec/prover-client": "0.82.3-nightly.20250403",
|
|
55
|
+
"@aztec/prover-node": "0.82.3-nightly.20250403",
|
|
56
|
+
"@aztec/pxe": "0.82.3-nightly.20250403",
|
|
57
|
+
"@aztec/stdlib": "0.82.3-nightly.20250403",
|
|
58
|
+
"@aztec/telemetry-client": "0.82.3-nightly.20250403",
|
|
59
|
+
"@aztec/txe": "0.82.3-nightly.20250403",
|
|
60
|
+
"@aztec/world-state": "0.82.3-nightly.20250403",
|
|
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
|
-
'
|
|
59
|
-
'
|
|
60
|
-
'
|
|
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:
|
|
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.
|
|
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-
|
|
143
|
-
description: '
|
|
144
|
-
defaultValue:
|
|
145
|
-
envVar: '
|
|
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-
|
|
149
|
-
description: 'API
|
|
150
|
-
defaultValue:
|
|
151
|
-
envVar: '
|
|
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-
|
|
152
|
+
flag: '--l1-consensus-host-api-key-headers <value>',
|
|
155
153
|
description:
|
|
156
|
-
'API key
|
|
157
|
-
defaultValue:
|
|
158
|
-
envVar: '
|
|
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: [
|
|
@@ -268,15 +267,22 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
268
267
|
parseVal: val => parseInt(val, 10),
|
|
269
268
|
},
|
|
270
269
|
{
|
|
271
|
-
flag: '--node.
|
|
272
|
-
description:
|
|
273
|
-
|
|
274
|
-
|
|
270
|
+
flag: '--node.syncMode <value>',
|
|
271
|
+
description:
|
|
272
|
+
'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.',
|
|
273
|
+
defaultValue: 'snapshot',
|
|
274
|
+
envVar: 'SYNC_MODE',
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
flag: '--node.snapshotsUrl <value>',
|
|
278
|
+
description: 'Base URL for downloading snapshots for snapshot sync.',
|
|
279
|
+
defaultValue: undefined,
|
|
280
|
+
envVar: 'SYNC_SNAPSHOTS_URL',
|
|
275
281
|
},
|
|
276
282
|
],
|
|
277
283
|
'P2P SUBSYSTEM': [
|
|
278
284
|
{
|
|
279
|
-
flag: '--p2p-enabled',
|
|
285
|
+
flag: '--p2p-enabled [value]',
|
|
280
286
|
description: 'Enable P2P subsystem',
|
|
281
287
|
envVar: 'P2P_ENABLED',
|
|
282
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';
|
|
@@ -11,12 +12,16 @@ export type L2ChainConfig = {
|
|
|
11
12
|
aztecEpochDuration: number;
|
|
12
13
|
aztecProofSubmissionWindow: number;
|
|
13
14
|
testAccounts: boolean;
|
|
15
|
+
sponsoredFPC: boolean;
|
|
14
16
|
p2pEnabled: boolean;
|
|
15
17
|
p2pBootstrapNodes: string[];
|
|
16
18
|
registryAddress: string;
|
|
19
|
+
slashFactoryAddress: string;
|
|
20
|
+
feeAssetHandlerAddress: string;
|
|
17
21
|
seqMinTxsPerBlock: number;
|
|
18
22
|
seqMaxTxsPerBlock: number;
|
|
19
23
|
realProofs: boolean;
|
|
24
|
+
snapshotsUrl: string;
|
|
20
25
|
};
|
|
21
26
|
|
|
22
27
|
export const testnetIgnitionL2ChainConfig: L2ChainConfig = {
|
|
@@ -26,12 +31,16 @@ export const testnetIgnitionL2ChainConfig: L2ChainConfig = {
|
|
|
26
31
|
aztecEpochDuration: 32,
|
|
27
32
|
aztecProofSubmissionWindow: 64,
|
|
28
33
|
testAccounts: true,
|
|
34
|
+
sponsoredFPC: false,
|
|
29
35
|
p2pEnabled: true,
|
|
30
36
|
p2pBootstrapNodes: [],
|
|
31
37
|
registryAddress: '0x12b3ebc176a1646b911391eab3760764f2e05fe3',
|
|
38
|
+
slashFactoryAddress: '',
|
|
39
|
+
feeAssetHandlerAddress: '',
|
|
32
40
|
seqMinTxsPerBlock: 0,
|
|
33
41
|
seqMaxTxsPerBlock: 0,
|
|
34
42
|
realProofs: true,
|
|
43
|
+
snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/',
|
|
35
44
|
};
|
|
36
45
|
|
|
37
46
|
export const alphaTestnetL2ChainConfig: L2ChainConfig = {
|
|
@@ -41,12 +50,16 @@ export const alphaTestnetL2ChainConfig: L2ChainConfig = {
|
|
|
41
50
|
aztecEpochDuration: 32,
|
|
42
51
|
aztecProofSubmissionWindow: 64,
|
|
43
52
|
testAccounts: false,
|
|
53
|
+
sponsoredFPC: true,
|
|
44
54
|
p2pEnabled: true,
|
|
45
55
|
p2pBootstrapNodes: [],
|
|
46
|
-
registryAddress: '',
|
|
56
|
+
registryAddress: '0xad85d55a4bbef35e95396191c22903aa717edf1c',
|
|
57
|
+
slashFactoryAddress: '',
|
|
58
|
+
feeAssetHandlerAddress: '0xf0664fec6ac15313e18d5ad8225e46b7c6463338',
|
|
47
59
|
seqMinTxsPerBlock: 0,
|
|
48
60
|
seqMaxTxsPerBlock: 4,
|
|
49
61
|
realProofs: true,
|
|
62
|
+
snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/',
|
|
50
63
|
};
|
|
51
64
|
|
|
52
65
|
export async function getBootnodes(networkName: NetworkNames) {
|
|
@@ -83,6 +96,15 @@ function enrichVar(envVar: EnvVar, value: string) {
|
|
|
83
96
|
process.env[envVar] = value;
|
|
84
97
|
}
|
|
85
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
|
+
|
|
86
108
|
export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames) {
|
|
87
109
|
const config = await getL2ChainConfig(networkName);
|
|
88
110
|
if (!config) {
|
|
@@ -94,12 +116,17 @@ export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames
|
|
|
94
116
|
enrichVar('AZTEC_PROOF_SUBMISSION_WINDOW', config.aztecProofSubmissionWindow.toString());
|
|
95
117
|
enrichVar('BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
|
|
96
118
|
enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
|
|
119
|
+
enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
|
|
97
120
|
enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
|
|
98
121
|
enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
|
|
99
|
-
enrichVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
|
|
100
122
|
enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
|
|
101
123
|
enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
|
|
102
124
|
enrichVar('DATA_DIRECTORY', path.join(process.env.HOME || '~', '.aztec', networkName, 'data'));
|
|
103
125
|
enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
|
|
104
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);
|
|
105
132
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getInitialTestAccounts } from '@aztec/accounts/testing';
|
|
2
2
|
import { type AztecNodeConfig, aztecNodeConfigMappings, getConfigEnvVars } from '@aztec/aztec-node';
|
|
3
|
+
import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
|
|
3
4
|
import { NULL_KEY } from '@aztec/ethereum';
|
|
4
5
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
5
6
|
import type { LogFn } from '@aztec/foundation/log';
|
|
@@ -47,11 +48,19 @@ export async function startNode(
|
|
|
47
48
|
|
|
48
49
|
await preloadCrsDataForVerifying(nodeConfig, userLog);
|
|
49
50
|
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
|
|
51
|
+
const testAccounts = nodeConfig.testAccounts ? (await getInitialTestAccounts()).map(a => a.address) : [];
|
|
52
|
+
const sponsoredFPCAccounts = nodeConfig.sponsoredFPC ? [await getSponsoredFPCAddress()] : [];
|
|
53
|
+
const initialFundedAccounts = testAccounts.concat(sponsoredFPCAccounts);
|
|
54
|
+
|
|
55
|
+
userLog(`Initial funded accounts: ${initialFundedAccounts.map(a => a.toString()).join(', ')}`);
|
|
56
|
+
|
|
57
|
+
const { genesisBlockHash, genesisArchiveRoot, prefilledPublicData, fundingNeeded } = await getGenesisValues(
|
|
58
|
+
initialFundedAccounts,
|
|
53
59
|
);
|
|
54
60
|
|
|
61
|
+
userLog(`Genesis block hash: ${genesisBlockHash.toString()}`);
|
|
62
|
+
userLog(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
|
|
63
|
+
|
|
55
64
|
// Deploy contracts if needed
|
|
56
65
|
if (nodeSpecificOptions.deployAztecContracts || nodeSpecificOptions.deployAztecContractsSalt) {
|
|
57
66
|
let account;
|
|
@@ -68,6 +77,7 @@ export async function startNode(
|
|
|
68
77
|
salt: nodeSpecificOptions.deployAztecContractsSalt,
|
|
69
78
|
genesisBlockHash,
|
|
70
79
|
genesisArchiveRoot,
|
|
80
|
+
feeJuicePortalInitialBalance: fundingNeeded,
|
|
71
81
|
});
|
|
72
82
|
}
|
|
73
83
|
// If not deploying, validate that any addresses and config provided are correct.
|
|
@@ -79,6 +89,7 @@ export async function startNode(
|
|
|
79
89
|
nodeConfig.l1Contracts.registryAddress,
|
|
80
90
|
nodeConfig.l1RpcUrls,
|
|
81
91
|
nodeConfig.l1ChainId,
|
|
92
|
+
nodeConfig.rollupVersion,
|
|
82
93
|
);
|
|
83
94
|
|
|
84
95
|
// TODO(#12272): will clean this up.
|
|
@@ -17,7 +17,8 @@ export async function startP2PBootstrap(
|
|
|
17
17
|
) {
|
|
18
18
|
// Start a P2P bootstrap node.
|
|
19
19
|
const config = extractRelevantOptions<BootnodeConfig>(options, bootnodeConfigMappings, 'p2p');
|
|
20
|
-
|
|
20
|
+
const safeConfig = { ...config, peerIdPrivateKey: '<redacted>' };
|
|
21
|
+
userLog(`Starting P2P bootstrap node with config: ${jsonStringify(safeConfig)}`);
|
|
21
22
|
const telemetryClient = initTelemetryClient(getTelemetryClientConfig());
|
|
22
23
|
const store = await createStore('p2p-bootstrap', 1, config, createLogger('p2p:bootstrap:store'));
|
|
23
24
|
const node = new BootstrapNode(store, telemetryClient);
|
|
@@ -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(
|
|
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);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getInitialTestAccounts } from '@aztec/accounts/testing';
|
|
2
|
+
import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
|
|
2
3
|
import { NULL_KEY } from '@aztec/ethereum';
|
|
3
4
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
4
5
|
import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici';
|
|
@@ -10,7 +11,6 @@ import {
|
|
|
10
11
|
getProverNodeConfigFromEnv,
|
|
11
12
|
proverNodeConfigMappings,
|
|
12
13
|
} from '@aztec/prover-node';
|
|
13
|
-
import { createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
|
|
14
14
|
import { P2PApiSchema, ProverNodeApiSchema, type ProvingJobBroker } from '@aztec/stdlib/interfaces/server';
|
|
15
15
|
import { initTelemetryClient, makeTracedFetch, telemetryClientConfigMappings } from '@aztec/telemetry-client';
|
|
16
16
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
@@ -53,30 +53,18 @@ export async function startProverNode(
|
|
|
53
53
|
proverConfig.publisherPrivateKey = `0x${Buffer.from(privKey!).toString('hex')}`;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
// Load l1 contract addresses from aztec node if not set.
|
|
59
|
-
const isRollupAddressSet =
|
|
60
|
-
proverConfig.l1Contracts?.rollupAddress && !proverConfig.l1Contracts.rollupAddress.isZero();
|
|
61
|
-
const nodeUrl = proverConfig.nodeUrl ?? proverConfig.proverCoordinationNodeUrl;
|
|
62
|
-
if (nodeUrl && !isRollupAddressSet) {
|
|
63
|
-
userLog(`Loading L1 contract addresses from aztec node at ${nodeUrl}`);
|
|
64
|
-
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');
|
|
65
58
|
}
|
|
66
59
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
proverConfig.l1ChainId,
|
|
76
|
-
);
|
|
77
|
-
proverConfig.l1Contracts = addresses;
|
|
78
|
-
proverConfig = { ...proverConfig, ...config };
|
|
79
|
-
}
|
|
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 };
|
|
80
68
|
|
|
81
69
|
const telemetry = initTelemetryClient(extractRelevantOptions(options, telemetryClientConfigMappings, 'tel'));
|
|
82
70
|
|
|
@@ -101,8 +89,15 @@ export async function startProverNode(
|
|
|
101
89
|
|
|
102
90
|
await preloadCrsDataForVerifying(proverConfig, userLog);
|
|
103
91
|
|
|
104
|
-
const
|
|
105
|
-
const
|
|
92
|
+
const testAccounts = proverConfig.testAccounts ? (await getInitialTestAccounts()).map(a => a.address) : [];
|
|
93
|
+
const sponsoredFPCAccounts = proverConfig.sponsoredFPC ? [await getSponsoredFPCAddress()] : [];
|
|
94
|
+
const initialFundedAccounts = testAccounts.concat(sponsoredFPCAccounts);
|
|
95
|
+
|
|
96
|
+
userLog(`Initial funded accounts: ${initialFundedAccounts.map(a => a.toString()).join(', ')}`);
|
|
97
|
+
const { genesisArchiveRoot, genesisBlockHash, prefilledPublicData } = await getGenesisValues(initialFundedAccounts);
|
|
98
|
+
|
|
99
|
+
userLog(`Genesis block hash: ${genesisBlockHash.toString()}`);
|
|
100
|
+
userLog(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
|
|
106
101
|
|
|
107
102
|
const proverNode = await createProverNode(proverConfig, { telemetry, broker }, { prefilledPublicData });
|
|
108
103
|
services.proverNode = [proverNode, ProverNodeApiSchema];
|
package/src/cli/get_l1_config.ts
CHANGED
|
@@ -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,
|
|
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
|
|
246
|
+
await Promise.all([Crs.new(2 ** 25 + 1, undefined, log), GrumpkinCrs.new(2 ** 18 + 1, undefined, log)]);
|
|
247
247
|
}
|
|
248
248
|
}
|
package/src/sandbox/sandbox.ts
CHANGED
|
@@ -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 {
|
|
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 {
|
|
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: {
|
|
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,12 +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
|
-
} else if (config.noPXE) {
|
|
125
|
-
userLog(`Not setting up test accounts as we are not exposing a PXE`);
|
|
126
130
|
} else {
|
|
131
|
+
userLog(`Setting up test accounts`);
|
|
127
132
|
return await getInitialTestAccounts();
|
|
128
133
|
}
|
|
129
134
|
}
|
|
@@ -135,7 +140,9 @@ export async function createSandbox(config: Partial<SandboxConfig> = {}, userLog
|
|
|
135
140
|
const fundedAddresses = initialAccounts.length
|
|
136
141
|
? [...initialAccounts.map(a => a.address), bananaFPC, sponsoredFPC]
|
|
137
142
|
: [];
|
|
138
|
-
const { genesisArchiveRoot, genesisBlockHash, prefilledPublicData } = await getGenesisValues(
|
|
143
|
+
const { genesisArchiveRoot, genesisBlockHash, prefilledPublicData, fundingNeeded } = await getGenesisValues(
|
|
144
|
+
fundedAddresses,
|
|
145
|
+
);
|
|
139
146
|
|
|
140
147
|
let watcher: AnvilTestWatcher | undefined = undefined;
|
|
141
148
|
if (!aztecNodeConfig.p2pEnabled) {
|
|
@@ -144,6 +151,7 @@ export async function createSandbox(config: Partial<SandboxConfig> = {}, userLog
|
|
|
144
151
|
genesisArchiveRoot,
|
|
145
152
|
genesisBlockHash,
|
|
146
153
|
salt: config.l1Salt ? parseInt(config.l1Salt) : undefined,
|
|
154
|
+
feeJuicePortalInitialBalance: fundingNeeded,
|
|
147
155
|
});
|
|
148
156
|
|
|
149
157
|
const chain =
|
|
@@ -168,8 +176,6 @@ export async function createSandbox(config: Partial<SandboxConfig> = {}, userLog
|
|
|
168
176
|
const pxeServiceConfig = { proverEnabled: aztecNodeConfig.realProofs };
|
|
169
177
|
const pxe = await createAztecPXE(node, pxeServiceConfig);
|
|
170
178
|
|
|
171
|
-
await setupCanonicalL2FeeJuice(pxe, aztecNodeConfig.l1Contracts.feeJuicePortalAddress, logger.info);
|
|
172
|
-
|
|
173
179
|
if (initialAccounts.length) {
|
|
174
180
|
userLog('Setting up funded test accounts...');
|
|
175
181
|
const accounts = await deployFundedSchnorrAccounts(pxe, initialAccounts);
|