@aztec/aztec 0.0.1-commit.181e2d196 → 0.0.1-commit.189eedb3
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 +2 -2
- package/dest/cli/aztec_start_action.d.ts +1 -1
- package/dest/cli/aztec_start_action.d.ts.map +1 -1
- package/dest/cli/aztec_start_action.js +36 -14
- package/dest/cli/aztec_start_options.d.ts +2 -2
- package/dest/cli/aztec_start_options.d.ts.map +1 -1
- package/dest/cli/aztec_start_options.js +16 -17
- package/dest/cli/cli.js +3 -3
- package/dest/cli/cmds/compile.d.ts +1 -1
- package/dest/cli/cmds/compile.d.ts.map +1 -1
- package/dest/cli/cmds/compile.js +15 -9
- package/dest/cli/cmds/profile.d.ts +1 -1
- package/dest/cli/cmds/profile.d.ts.map +1 -1
- package/dest/cli/cmds/profile.js +1 -1
- package/dest/cli/cmds/profile_flamegraph.d.ts +1 -1
- package/dest/cli/cmds/profile_flamegraph.d.ts.map +1 -1
- package/dest/cli/cmds/profile_flamegraph.js +2 -1
- package/dest/cli/cmds/profile_gates.d.ts +2 -2
- package/dest/cli/cmds/profile_gates.d.ts.map +1 -1
- package/dest/cli/cmds/profile_gates.js +23 -4
- package/dest/cli/cmds/standby.d.ts +30 -0
- package/dest/cli/cmds/standby.d.ts.map +1 -0
- package/dest/cli/cmds/standby.js +97 -0
- package/dest/cli/cmds/start_bot.d.ts +1 -1
- package/dest/cli/cmds/start_bot.d.ts.map +1 -1
- package/dest/cli/cmds/start_bot.js +3 -3
- package/dest/cli/cmds/start_node.d.ts +3 -2
- package/dest/cli/cmds/start_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_node.js +26 -96
- package/dest/cli/cmds/start_prover_agent.d.ts +1 -1
- package/dest/cli/cmds/start_prover_agent.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_agent.js +5 -17
- package/dest/cli/cmds/start_prover_broker.d.ts +1 -1
- package/dest/cli/cmds/start_prover_broker.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_broker.js +22 -13
- package/dest/cli/cmds/start_txe.d.ts +2 -2
- package/dest/cli/cmds/start_txe.d.ts.map +1 -1
- package/dest/cli/cmds/start_txe.js +6 -5
- package/dest/cli/cmds/utils/collect_crate_dirs.d.ts +21 -0
- package/dest/cli/cmds/utils/collect_crate_dirs.d.ts.map +1 -0
- package/dest/cli/cmds/utils/collect_crate_dirs.js +114 -0
- package/dest/cli/cmds/utils/needs_recompile.d.ts +10 -0
- package/dest/cli/cmds/utils/needs_recompile.d.ts.map +1 -0
- package/dest/cli/cmds/utils/needs_recompile.js +90 -0
- package/dest/cli/cmds/utils/warn_if_aztec_version_mismatch.d.ts +4 -0
- package/dest/cli/cmds/utils/warn_if_aztec_version_mismatch.d.ts.map +1 -0
- package/dest/cli/cmds/utils/warn_if_aztec_version_mismatch.js +61 -0
- package/dest/cli/util.d.ts +3 -5
- package/dest/cli/util.d.ts.map +1 -1
- package/dest/cli/util.js +43 -82
- package/dest/examples/token.js +4 -4
- package/dest/local-network/auth_registry.d.ts +5 -0
- package/dest/local-network/auth_registry.d.ts.map +1 -0
- package/dest/local-network/auth_registry.js +17 -0
- package/dest/local-network/banana_fpc.d.ts +3 -2
- package/dest/local-network/banana_fpc.d.ts.map +1 -1
- package/dest/local-network/banana_fpc.js +12 -8
- package/dest/local-network/local-network.d.ts +5 -28
- package/dest/local-network/local-network.d.ts.map +1 -1
- package/dest/local-network/local-network.js +45 -15
- package/dest/testing/anvil_test_watcher.d.ts +15 -3
- package/dest/testing/anvil_test_watcher.d.ts.map +1 -1
- package/dest/testing/anvil_test_watcher.js +68 -14
- package/dest/testing/cheat_codes.d.ts +18 -17
- package/dest/testing/cheat_codes.d.ts.map +1 -1
- package/dest/testing/cheat_codes.js +72 -36
- package/dest/testing/epoch_test_settler.d.ts +1 -1
- package/dest/testing/epoch_test_settler.d.ts.map +1 -1
- package/dest/testing/epoch_test_settler.js +9 -8
- package/dest/testing/index.d.ts +3 -2
- package/dest/testing/index.d.ts.map +1 -1
- package/dest/testing/index.js +1 -0
- package/dest/testing/token_allowed_setup.d.ts +7 -0
- package/dest/testing/token_allowed_setup.d.ts.map +1 -0
- package/dest/testing/token_allowed_setup.js +20 -0
- package/package.json +35 -34
- package/scripts/add_crate.sh +53 -0
- package/scripts/aztec.sh +9 -2
- package/scripts/init.sh +18 -24
- package/scripts/new.sh +45 -22
- package/scripts/setup_workspace.sh +12 -67
- package/scripts/templates/blank/contract/Nargo.toml +6 -0
- package/scripts/templates/blank/contract/src/main.nr +10 -0
- package/scripts/templates/blank/test/Nargo.toml +7 -0
- package/scripts/templates/blank/test/src/lib.nr +11 -0
- package/scripts/templates/counter/contract/Nargo.toml +7 -0
- package/scripts/templates/counter/contract/src/main.nr +48 -0
- package/scripts/templates/counter/test/Nargo.toml +7 -0
- package/scripts/templates/counter/test/src/lib.nr +32 -0
- package/src/bin/index.ts +2 -2
- package/src/cli/aztec_start_action.ts +26 -14
- package/src/cli/aztec_start_options.ts +23 -25
- package/src/cli/cli.ts +3 -3
- package/src/cli/cmds/compile.ts +18 -10
- package/src/cli/cmds/profile.ts +2 -1
- package/src/cli/cmds/profile_flamegraph.ts +2 -1
- package/src/cli/cmds/profile_gates.ts +22 -5
- package/src/cli/cmds/standby.ts +132 -0
- package/src/cli/cmds/start_bot.ts +3 -5
- package/src/cli/cmds/start_node.ts +35 -119
- package/src/cli/cmds/start_prover_agent.ts +5 -8
- package/src/cli/cmds/start_prover_broker.ts +23 -24
- package/src/cli/cmds/start_txe.ts +7 -5
- package/src/cli/cmds/utils/collect_crate_dirs.ts +118 -0
- package/src/cli/cmds/utils/needs_recompile.ts +98 -0
- package/src/cli/cmds/utils/warn_if_aztec_version_mismatch.ts +76 -0
- package/src/cli/util.ts +47 -80
- package/src/examples/token.ts +6 -4
- package/src/local-network/auth_registry.ts +19 -0
- package/src/local-network/banana_fpc.ts +13 -9
- package/src/local-network/local-network.ts +45 -13
- package/src/testing/anvil_test_watcher.ts +76 -13
- package/src/testing/cheat_codes.ts +92 -39
- package/src/testing/epoch_test_settler.ts +6 -8
- package/src/testing/index.ts +2 -1
- package/src/testing/token_allowed_setup.ts +19 -0
- package/dest/cli/cmds/start_archiver.d.ts +0 -9
- package/dest/cli/cmds/start_archiver.d.ts.map +0 -1
- package/dest/cli/cmds/start_archiver.js +0 -48
- package/dest/cli/release_version.d.ts +0 -2
- package/dest/cli/release_version.d.ts.map +0 -1
- package/dest/cli/release_version.js +0 -14
- package/src/cli/cmds/start_archiver.ts +0 -50
- package/src/cli/release_version.ts +0 -21
package/dest/bin/index.js
CHANGED
|
@@ -11,12 +11,12 @@ import { injectCommands as injectMiscCommands } from '@aztec/cli/misc';
|
|
|
11
11
|
import { injectCommands as injectValidatorKeysCommands } from '@aztec/cli/validator_keys';
|
|
12
12
|
import { getActiveNetworkName } from '@aztec/foundation/config';
|
|
13
13
|
import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
|
|
14
|
+
import { getPackageVersion } from '@aztec/stdlib/update-checker';
|
|
14
15
|
import { Command } from 'commander';
|
|
15
16
|
import { injectCompileCommand } from '../cli/cmds/compile.js';
|
|
16
17
|
import { injectMigrateCommand } from '../cli/cmds/migrate_ha_db.js';
|
|
17
18
|
import { injectProfileCommand } from '../cli/cmds/profile.js';
|
|
18
19
|
import { injectAztecCommands } from '../cli/index.js';
|
|
19
|
-
import { getCliVersion } from '../cli/release_version.js';
|
|
20
20
|
const NETWORK_FLAG = 'network';
|
|
21
21
|
const userLog = createConsoleLogger();
|
|
22
22
|
const debugLogger = createLogger('cli');
|
|
@@ -36,7 +36,7 @@ const debugLogger = createLogger('cli');
|
|
|
36
36
|
const networkName = getActiveNetworkName(networkValue);
|
|
37
37
|
await enrichEnvironmentWithNetworkConfig(networkName);
|
|
38
38
|
enrichEnvironmentWithChainName(networkName);
|
|
39
|
-
const cliVersion =
|
|
39
|
+
const cliVersion = getPackageVersion();
|
|
40
40
|
let program = new Command('aztec');
|
|
41
41
|
program.description('Aztec command line interface').version(cliVersion).enablePositionalOptions();
|
|
42
42
|
program = injectAztecCommands(program, userLog, debugLogger);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
2
|
export declare function aztecStart(options: any, userLog: LogFn, debugLogger: Logger): Promise<void>;
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXp0ZWNfc3RhcnRfYWN0aW9uLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY2xpL2F6dGVjX3N0YXJ0X2FjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPQSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFhM0Qsd0JBQXNCLFVBQVUsQ0FBQyxPQUFPLEVBQUUsR0FBRyxFQUFFLE9BQU8sRUFBRSxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0saUJBbUpqRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aztec_start_action.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_action.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aztec_start_action.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_action.ts"],"names":[],"mappings":"AAOA,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,iBAmJjF"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { getActiveNetworkName } from '@aztec/foundation/config';
|
|
1
2
|
import { createNamespacedSafeJsonRpcServer, getApiKeyAuthMiddleware, startHttpRpcServer } from '@aztec/foundation/json-rpc/server';
|
|
2
|
-
import { AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
3
|
+
import { AztecNodeAdminApiSchema, AztecNodeApiSchema, AztecNodeDebugApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
4
|
+
import { getPackageVersion } from '@aztec/stdlib/update-checker';
|
|
3
5
|
import { getVersioningMiddleware } from '@aztec/stdlib/versioning';
|
|
4
|
-
import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
|
|
6
|
+
import { getOtelJsonRpcDiagnosticsMiddleware, getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
|
|
5
7
|
import { createLocalNetwork } from '../local-network/index.js';
|
|
6
8
|
import { github, splash } from '../splash.js';
|
|
7
9
|
import { resolveAdminApiKey } from './admin_api_key_store.js';
|
|
8
|
-
import { getCliVersion } from './release_version.js';
|
|
9
10
|
import { extractNamespacedOptions, installSignalHandlers } from './util.js';
|
|
10
11
|
import { getVersions } from './versioning.js';
|
|
11
12
|
export async function aztecStart(options, userLog, debugLogger) {
|
|
@@ -13,13 +14,12 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
13
14
|
const signalHandlers = [];
|
|
14
15
|
const services = {};
|
|
15
16
|
const adminServices = {};
|
|
17
|
+
const packageVersion = getPackageVersion();
|
|
16
18
|
let config = undefined;
|
|
17
19
|
if (options.localNetwork) {
|
|
18
|
-
const
|
|
19
|
-
const localNetwork = extractNamespacedOptions(options, 'local-network');
|
|
20
|
-
localNetwork.testAccounts = true;
|
|
20
|
+
const localNetwork = extractNamespacedOptions(options, 'localNetwork');
|
|
21
21
|
userLog(`${splash}\n${github}\n\n`);
|
|
22
|
-
userLog(`Setting up Aztec local network ${
|
|
22
|
+
userLog(`Setting up Aztec local network ${packageVersion}, please stand by...`);
|
|
23
23
|
const { node, stop } = await createLocalNetwork({
|
|
24
24
|
l1Mnemonic: localNetwork.l1Mnemonic,
|
|
25
25
|
l1RpcUrls: options.l1RpcUrls,
|
|
@@ -37,6 +37,14 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
37
37
|
node,
|
|
38
38
|
AztecNodeApiSchema
|
|
39
39
|
];
|
|
40
|
+
adminServices.node = [
|
|
41
|
+
node,
|
|
42
|
+
AztecNodeAdminApiSchema
|
|
43
|
+
];
|
|
44
|
+
services.nodeDebug = [
|
|
45
|
+
node,
|
|
46
|
+
AztecNodeDebugApiSchema
|
|
47
|
+
];
|
|
40
48
|
} else {
|
|
41
49
|
// Route --prover-node through startNode
|
|
42
50
|
if (options.proverNode && !options.node) {
|
|
@@ -44,13 +52,17 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
44
52
|
}
|
|
45
53
|
if (options.node) {
|
|
46
54
|
const { startNode } = await import('./cmds/start_node.js');
|
|
47
|
-
|
|
55
|
+
const networkName = getActiveNetworkName(options.network);
|
|
56
|
+
({ config } = await startNode(options, signalHandlers, services, adminServices, userLog, networkName));
|
|
57
|
+
if (options.nodeDebug && services.node) {
|
|
58
|
+
services.nodeDebug = [
|
|
59
|
+
services.node[0],
|
|
60
|
+
AztecNodeDebugApiSchema
|
|
61
|
+
];
|
|
62
|
+
}
|
|
48
63
|
} else if (options.bot) {
|
|
49
64
|
const { startBot } = await import('./cmds/start_bot.js');
|
|
50
65
|
await startBot(options, signalHandlers, services, userLog);
|
|
51
|
-
} else if (options.archiver) {
|
|
52
|
-
const { startArchiver } = await import('./cmds/start_archiver.js');
|
|
53
|
-
({ config } = await startArchiver(options, signalHandlers, services));
|
|
54
66
|
} else if (options.p2pBootstrap) {
|
|
55
67
|
const { startP2PBootstrap } = await import('./cmds/start_p2p_bootstrap.js');
|
|
56
68
|
({ config } = await startP2PBootstrap(options, signalHandlers, services, userLog));
|
|
@@ -62,7 +74,7 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
62
74
|
await startProverBroker(options, signalHandlers, services, userLog);
|
|
63
75
|
} else if (options.txe) {
|
|
64
76
|
const { startTXE } = await import('./cmds/start_txe.js');
|
|
65
|
-
await startTXE(options, debugLogger);
|
|
77
|
+
await startTXE(options, signalHandlers, debugLogger);
|
|
66
78
|
} else if (options.sequencer) {
|
|
67
79
|
userLog(`Cannot run a standalone sequencer without a node`);
|
|
68
80
|
process.exit(1);
|
|
@@ -73,14 +85,23 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
73
85
|
}
|
|
74
86
|
installSignalHandlers(debugLogger.info, signalHandlers);
|
|
75
87
|
const versions = getVersions(config);
|
|
88
|
+
const versioningOpts = {
|
|
89
|
+
packageVersion
|
|
90
|
+
};
|
|
76
91
|
// Start the main JSON-RPC server
|
|
77
92
|
if (Object.entries(services).length > 0) {
|
|
93
|
+
if (services.node) {
|
|
94
|
+
const { BarretenbergSync } = await import('@aztec/bb.js');
|
|
95
|
+
// JSON-RPC schema parsing may decompress compressed Chonk proofs before the node handler runs.
|
|
96
|
+
await BarretenbergSync.initSingleton();
|
|
97
|
+
}
|
|
78
98
|
const rpcServer = createNamespacedSafeJsonRpcServer(services, {
|
|
99
|
+
diagnostic: getOtelJsonRpcDiagnosticsMiddleware(),
|
|
79
100
|
http200OnError: false,
|
|
80
101
|
log: debugLogger,
|
|
81
102
|
middlewares: [
|
|
82
103
|
getOtelJsonRpcPropagationMiddleware(),
|
|
83
|
-
getVersioningMiddleware(versions)
|
|
104
|
+
getVersioningMiddleware(versions, versioningOpts)
|
|
84
105
|
],
|
|
85
106
|
maxBatchSize: options.rpcMaxBatchSize,
|
|
86
107
|
maxBodySizeBytes: options.rpcMaxBodySize
|
|
@@ -94,7 +115,7 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
94
115
|
if (Object.entries(adminServices).length > 0) {
|
|
95
116
|
const adminMiddlewares = [
|
|
96
117
|
getOtelJsonRpcPropagationMiddleware(),
|
|
97
|
-
getVersioningMiddleware(versions)
|
|
118
|
+
getVersioningMiddleware(versions, versioningOpts)
|
|
98
119
|
];
|
|
99
120
|
// Resolve the admin API key (auto-generated and persisted, or opt-out)
|
|
100
121
|
const apiKeyResolution = await resolveAdminApiKey({
|
|
@@ -109,6 +130,7 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
109
130
|
debugLogger.warn('No admin API key set — admin endpoint is unauthenticated');
|
|
110
131
|
}
|
|
111
132
|
const rpcServer = createNamespacedSafeJsonRpcServer(adminServices, {
|
|
133
|
+
diagnostic: getOtelJsonRpcDiagnosticsMiddleware(),
|
|
112
134
|
http200OnError: false,
|
|
113
135
|
log: debugLogger,
|
|
114
136
|
middlewares: adminMiddlewares,
|
|
@@ -8,10 +8,10 @@ export interface AztecStartOption {
|
|
|
8
8
|
fallback?: EnvVar[];
|
|
9
9
|
parseVal?: (val: string) => any;
|
|
10
10
|
}
|
|
11
|
-
export declare const getOptions: (namespace: string, configMappings: Record<string, ConfigMapping
|
|
11
|
+
export declare const getOptions: (namespace: string, configMappings: Record<string, ConfigMapping<unknown>>) => AztecStartOption[];
|
|
12
12
|
export declare const universalOptions: string[];
|
|
13
13
|
export declare const NETWORK_FLAG = "network";
|
|
14
14
|
export declare const aztecStartOptions: {
|
|
15
15
|
[key: string]: AztecStartOption[];
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXp0ZWNfc3RhcnRfb3B0aW9ucy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NsaS9henRlY19zdGFydF9vcHRpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9BLE9BQU8sRUFDTCxLQUFLLGFBQWEsRUFDbEIsS0FBSyxNQUFNLEVBSVosTUFBTSwwQkFBMEIsQ0FBQztBQWVsQyxNQUFNLFdBQVcsZ0JBQWdCO0lBQy9CLElBQUksRUFBRSxNQUFNLENBQUM7SUFDYixXQUFXLEVBQUUsTUFBTSxDQUFDO0lBQ3BCLFlBQVksRUFBRSxHQUFHLENBQUM7SUFDbEIsWUFBWSxDQUFDLEVBQUUsQ0FBQyxHQUFHLEVBQUUsR0FBRyxLQUFLLE1BQU0sQ0FBQztJQUNwQyxHQUFHLEVBQUUsTUFBTSxHQUFHLFNBQVMsQ0FBQztJQUN4QixRQUFRLENBQUMsRUFBRSxNQUFNLEVBQUUsQ0FBQztJQUNwQixRQUFRLENBQUMsRUFBRSxDQUFDLEdBQUcsRUFBRSxNQUFNLEtBQUssR0FBRyxDQUFDO0NBQ2pDO0FBRUQsZUFBTyxNQUFNLFVBQVUsbUdBb0J0QixDQUFDO0FBMkJGLGVBQU8sTUFBTSxnQkFBZ0IsVUFZNUIsQ0FBQztBQUVGLGVBQU8sTUFBTSxZQUFZLFlBQVksQ0FBQztBQUd0QyxlQUFPLE1BQU0saUJBQWlCLEVBQUU7SUFBRSxDQUFDLEdBQUcsRUFBRSxNQUFNLEdBQUcsZ0JBQWdCLEVBQUUsQ0FBQTtDQWlPbEUsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aztec_start_options.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_options.ts"],"names":[],"mappings":"AAOA,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,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC;IACpC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;CACjC;AAED,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"aztec_start_options.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_options.ts"],"names":[],"mappings":"AAOA,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,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC;IACpC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;CACjC;AAED,eAAO,MAAM,UAAU,mGAoBtB,CAAC;AA2BF,eAAO,MAAM,gBAAgB,UAY5B,CAAC;AAEF,eAAO,MAAM,YAAY,YAAY,CAAC;AAGtC,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;CAiOlE,CAAC"}
|
|
@@ -6,7 +6,6 @@ import { l1ContractAddressesMapping } from '@aztec/ethereum/l1-contract-addresse
|
|
|
6
6
|
import { l1ReaderConfigMappings } from '@aztec/ethereum/l1-reader';
|
|
7
7
|
import { getKeys } from '@aztec/foundation/collection';
|
|
8
8
|
import { booleanConfigHelper, isBooleanConfigValue, omitConfigMappings } from '@aztec/foundation/config';
|
|
9
|
-
import { dataConfigMappings } from '@aztec/kv-store/config';
|
|
10
9
|
import { sharedNodeConfigMappings } from '@aztec/node-lib/config';
|
|
11
10
|
import { bootnodeConfigMappings, p2pConfigMappings } from '@aztec/p2p/config';
|
|
12
11
|
import { proverAgentConfigMappings, proverBrokerConfigMappings } from '@aztec/prover-client/broker/config';
|
|
@@ -14,6 +13,7 @@ import { proverNodeConfigMappings } from '@aztec/prover-node/config';
|
|
|
14
13
|
import { allPxeConfigMappings } from '@aztec/pxe/config';
|
|
15
14
|
import { sequencerClientConfigMappings } from '@aztec/sequencer-client/config';
|
|
16
15
|
import { chainConfigMappings, nodeRpcConfigMappings } from '@aztec/stdlib/config';
|
|
16
|
+
import { dataConfigMappings } from '@aztec/stdlib/kv-store';
|
|
17
17
|
import { telemetryClientConfigMappings } from '@aztec/telemetry-client/config';
|
|
18
18
|
import { worldStateConfigMappings } from '@aztec/world-state/config';
|
|
19
19
|
import { DefaultMnemonic } from '../mnemonic.js';
|
|
@@ -76,8 +76,7 @@ export const aztecStartOptions = {
|
|
|
76
76
|
defaultValue: undefined,
|
|
77
77
|
env: 'NETWORK'
|
|
78
78
|
},
|
|
79
|
-
configToFlag('--
|
|
80
|
-
configToFlag('--auto-update-url', sharedNodeConfigMappings.autoUpdateUrl),
|
|
79
|
+
configToFlag('--enable-version-check', sharedNodeConfigMappings.enableVersionCheck),
|
|
81
80
|
configToFlag('--sync-mode', sharedNodeConfigMappings.syncMode),
|
|
82
81
|
configToFlag('--snapshots-urls', sharedNodeConfigMappings.snapshotsUrls),
|
|
83
82
|
configToFlag('--fisherman-mode', sharedNodeConfigMappings.fishermanMode)
|
|
@@ -94,6 +93,12 @@ export const aztecStartOptions = {
|
|
|
94
93
|
description: 'Mnemonic for L1 accounts. Will be used ',
|
|
95
94
|
defaultValue: DefaultMnemonic,
|
|
96
95
|
env: 'MNEMONIC'
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
flag: '--local-network.testAccounts',
|
|
99
|
+
description: 'Deploy test accounts on local network start',
|
|
100
|
+
env: 'TEST_ACCOUNTS',
|
|
101
|
+
...booleanConfigHelper(true)
|
|
97
102
|
}
|
|
98
103
|
],
|
|
99
104
|
API: [
|
|
@@ -132,6 +137,13 @@ export const aztecStartOptions = {
|
|
|
132
137
|
env: 'AZTEC_RESET_ADMIN_API_KEY',
|
|
133
138
|
parseVal: (val)=>val === 'true' || val === '1'
|
|
134
139
|
},
|
|
140
|
+
{
|
|
141
|
+
flag: '--node-debug',
|
|
142
|
+
description: 'Expose debug endpoints (e.g. mineBlock) on the main RPC port',
|
|
143
|
+
defaultValue: false,
|
|
144
|
+
env: 'AZTEC_NODE_DEBUG',
|
|
145
|
+
parseVal: (val)=>val === undefined || val === 'true' || val === '1'
|
|
146
|
+
},
|
|
135
147
|
{
|
|
136
148
|
flag: '--api-prefix <value>',
|
|
137
149
|
description: 'Prefix for API routes on any service that is started',
|
|
@@ -175,12 +187,6 @@ export const aztecStartOptions = {
|
|
|
175
187
|
}
|
|
176
188
|
],
|
|
177
189
|
ARCHIVER: [
|
|
178
|
-
{
|
|
179
|
-
flag: '--archiver',
|
|
180
|
-
description: 'Starts Aztec Archiver with options',
|
|
181
|
-
defaultValue: undefined,
|
|
182
|
-
env: undefined
|
|
183
|
-
},
|
|
184
190
|
...getOptions('archiver', omitConfigMappings(archiverConfigMappings, Object.keys(l1ContractsConfigMappings)))
|
|
185
191
|
],
|
|
186
192
|
SEQUENCER: [
|
|
@@ -218,8 +224,7 @@ export const aztecStartOptions = {
|
|
|
218
224
|
defaultValue: undefined,
|
|
219
225
|
env: undefined
|
|
220
226
|
},
|
|
221
|
-
...getOptions('proverBroker',
|
|
222
|
-
proverBrokerConfigMappings)
|
|
227
|
+
...getOptions('proverBroker', proverBrokerConfigMappings)
|
|
223
228
|
],
|
|
224
229
|
'PROVER AGENT': [
|
|
225
230
|
{
|
|
@@ -267,12 +272,6 @@ export const aztecStartOptions = {
|
|
|
267
272
|
...getOptions('bot', botConfigMappings)
|
|
268
273
|
],
|
|
269
274
|
PXE: [
|
|
270
|
-
{
|
|
271
|
-
flag: '--pxe',
|
|
272
|
-
description: 'Starts Aztec PXE with options',
|
|
273
|
-
defaultValue: undefined,
|
|
274
|
-
env: undefined
|
|
275
|
-
},
|
|
276
275
|
...getOptions('pxe', allPxeConfigMappings)
|
|
277
276
|
],
|
|
278
277
|
TXE: [
|
package/dest/cli/cli.js
CHANGED
|
@@ -24,9 +24,9 @@ import { addOptions, printAztecStartHelpText } from './util.js';
|
|
|
24
24
|
program.addHelpText('after', `
|
|
25
25
|
Additional commands:
|
|
26
26
|
|
|
27
|
-
init
|
|
28
|
-
new <
|
|
29
|
-
test [options]
|
|
27
|
+
init creates a new Aztec Noir workspace in the current directory.
|
|
28
|
+
new <name> creates a new Aztec Noir workspace in its own directory (or creates a new contract-test crates pair and adds it to the current workspace if run in workspace).
|
|
29
|
+
test [options] starts a TXE and runs "nargo test" using it as the oracle resolver.
|
|
30
30
|
`);
|
|
31
31
|
}
|
|
32
32
|
program.command('preload-crs').description('Preload the points data needed for proving and verifying').action(async (options)=>{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
2
|
import type { Command } from 'commander';
|
|
3
3
|
export declare function injectCompileCommand(program: Command, log: LogFn): Command;
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGlsZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaS9jbWRzL2NvbXBpbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFJbkQsT0FBTyxLQUFLLEVBQUUsT0FBTyxFQUFFLE1BQU0sV0FBVyxDQUFDO0FBb0t6Qyx3QkFBZ0Isb0JBQW9CLENBQUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsS0FBSyxHQUFHLE9BQU8sQ0FzQjFFIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/compile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/compile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAInD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoKzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,GAAG,OAAO,CAsB1E"}
|
package/dest/cli/cmds/compile.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { findBbBinary } from '@aztec/bb.js';
|
|
2
|
+
import { getPackageVersion } from '@aztec/stdlib/update-checker';
|
|
1
3
|
import { execFileSync } from 'child_process';
|
|
2
4
|
import { readFile, writeFile } from 'fs/promises';
|
|
3
5
|
import { join } from 'path';
|
|
4
6
|
import { readArtifactFiles } from './utils/artifacts.js';
|
|
7
|
+
import { needsRecompile } from './utils/needs_recompile.js';
|
|
5
8
|
import { run } from './utils/spawn.js';
|
|
9
|
+
import { warnIfAztecVersionMismatch } from './utils/warn_if_aztec_version_mismatch.js';
|
|
6
10
|
/** Returns paths to contract artifacts in the target directory. */ async function collectContractArtifacts() {
|
|
7
11
|
let files;
|
|
8
12
|
try {
|
|
@@ -15,14 +19,12 @@ import { run } from './utils/spawn.js';
|
|
|
15
19
|
}
|
|
16
20
|
return files.filter((f)=>Array.isArray(f.content.functions)).map((f)=>f.filePath);
|
|
17
21
|
}
|
|
18
|
-
/**
|
|
22
|
+
/** Stamps the Aztec stack version into the contract artifacts. */ async function stampAztecVersion(artifactPaths) {
|
|
23
|
+
const version = getPackageVersion();
|
|
19
24
|
for (const path of artifactPaths){
|
|
20
25
|
const artifact = JSON.parse(await readFile(path, 'utf-8'));
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
fn.name = fn.name.replace(/^__aztec_nr_internals__/, '');
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
+
// eslint-disable-next-line camelcase
|
|
27
|
+
artifact.aztec_version = version;
|
|
26
28
|
await writeFile(path, JSON.stringify(artifact, null, 2) + '\n');
|
|
27
29
|
}
|
|
28
30
|
}
|
|
@@ -116,8 +118,13 @@ import { run } from './utils/spawn.js';
|
|
|
116
118
|
}
|
|
117
119
|
}
|
|
118
120
|
/** Compiles Aztec Noir contracts and postprocesses artifacts. */ async function compileAztecContract(nargoArgs, log) {
|
|
121
|
+
await warnIfAztecVersionMismatch(log);
|
|
122
|
+
if (!await needsRecompile()) {
|
|
123
|
+
log('No source changes detected, skipping compilation.');
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
119
126
|
const nargo = process.env.NARGO ?? 'nargo';
|
|
120
|
-
const bb = process.env.BB ?? 'bb';
|
|
127
|
+
const bb = process.env.BB ?? findBbBinary() ?? 'bb';
|
|
121
128
|
await run(nargo, [
|
|
122
129
|
'compile',
|
|
123
130
|
...nargoArgs
|
|
@@ -135,8 +142,7 @@ import { run } from './utils/spawn.js';
|
|
|
135
142
|
'aztec_process',
|
|
136
143
|
...bbArgs
|
|
137
144
|
]);
|
|
138
|
-
|
|
139
|
-
await stripInternalPrefixes(artifacts);
|
|
145
|
+
await stampAztecVersion(artifacts);
|
|
140
146
|
}
|
|
141
147
|
log('Compilation complete!');
|
|
142
148
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
2
|
import type { Command } from 'commander';
|
|
3
3
|
export declare function injectProfileCommand(program: Command, log: LogFn): Command;
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZmlsZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaS9jbWRzL3Byb2ZpbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFbkQsT0FBTyxLQUFLLEVBQUUsT0FBTyxFQUFFLE1BQU0sV0FBVyxDQUFDO0FBS3pDLHdCQUFnQixvQkFBb0IsQ0FBQyxPQUFPLEVBQUUsT0FBTyxFQUFFLEdBQUcsRUFBRSxLQUFLLEdBQUcsT0FBTyxDQWtCMUUifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,GAAG,OAAO,CAkB1E"}
|
package/dest/cli/cmds/profile.js
CHANGED
|
@@ -2,7 +2,7 @@ import { profileFlamegraph } from './profile_flamegraph.js';
|
|
|
2
2
|
import { profileGates } from './profile_gates.js';
|
|
3
3
|
export function injectProfileCommand(program, log) {
|
|
4
4
|
const profile = program.command('profile').description('Profile compiled Aztec artifacts.');
|
|
5
|
-
profile.command('gates').argument('[target-dir]', 'Path to the compiled artifacts directory', './target').description('Display gate counts for all compiled Aztec artifacts in a target directory.').action((targetDir)=>profileGates(targetDir, log));
|
|
5
|
+
profile.command('gates').argument('[target-dir]', 'Path to the compiled artifacts directory', './target').option('--json', 'Output gate counts as JSON instead of a table', false).description('Display gate counts for all compiled Aztec artifacts in a target directory.').action((targetDir, options)=>profileGates(targetDir, options.json, log));
|
|
6
6
|
profile.command('flamegraph').argument('<contract-artifact>', 'Path to the compiled contract artifact JSON').argument('<function>', 'Name of the contract function to profile').description('Generate a gate count flamegraph SVG for a contract function.').action((artifactPath, functionName)=>profileFlamegraph(artifactPath, functionName, log));
|
|
7
7
|
return program;
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
2
|
/** Generates a gate count flamegraph SVG for a single contract function. */
|
|
3
3
|
export declare function profileFlamegraph(artifactPath: string, functionName: string, log: LogFn): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZmlsZV9mbGFtZWdyYXBoLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY2xpL2NtZHMvcHJvZmlsZV9mbGFtZWdyYXBoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBU25ELDRFQUE0RTtBQUM1RSx3QkFBc0IsaUJBQWlCLENBQUMsWUFBWSxFQUFFLE1BQU0sRUFBRSxZQUFZLEVBQUUsTUFBTSxFQUFFLEdBQUcsRUFBRSxLQUFLLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQW9EN0cifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile_flamegraph.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/profile_flamegraph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"profile_flamegraph.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/profile_flamegraph.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AASnD,4EAA4E;AAC5E,wBAAsB,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAoD7G"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { findBbBinary } from '@aztec/bb.js';
|
|
1
2
|
import { readFile, rename, rm, writeFile } from 'fs/promises';
|
|
2
3
|
import { basename, dirname, join } from 'path';
|
|
3
4
|
import { makeFunctionArtifact } from './profile_utils.js';
|
|
@@ -22,7 +23,7 @@ import { run } from './utils/spawn.js';
|
|
|
22
23
|
try {
|
|
23
24
|
await writeFile(functionArtifact, makeFunctionArtifact(artifact, func));
|
|
24
25
|
const profiler = process.env.PROFILER_PATH ?? 'noir-profiler';
|
|
25
|
-
const bb = process.env.BB ?? 'bb';
|
|
26
|
+
const bb = process.env.BB ?? findBbBinary() ?? 'bb';
|
|
26
27
|
await run(profiler, [
|
|
27
28
|
'gates',
|
|
28
29
|
'--artifact-path',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
2
|
/** Profiles all compiled artifacts in a target directory and prints gate counts. */
|
|
3
|
-
export declare function profileGates(targetDir: string, log: LogFn): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
export declare function profileGates(targetDir: string, json: boolean, log: LogFn): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZmlsZV9nYXRlcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaS9jbWRzL3Byb2ZpbGVfZ2F0ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFnQ25ELG9GQUFvRjtBQUNwRix3QkFBc0IsWUFBWSxDQUFDLFNBQVMsRUFBRSxNQUFNLEVBQUUsSUFBSSxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsS0FBSyxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FnRDlGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile_gates.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/profile_gates.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"profile_gates.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/profile_gates.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAgCnD,oFAAoF;AACpF,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAgD9F"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { findBbBinary } from '@aztec/bb.js';
|
|
1
2
|
import { asyncPool } from '@aztec/foundation/async-pool';
|
|
2
3
|
import { execFile as execFileCb } from 'child_process';
|
|
3
4
|
import { rm } from 'fs/promises';
|
|
@@ -22,21 +23,39 @@ const execFile = promisify(execFileCb);
|
|
|
22
23
|
]);
|
|
23
24
|
return parseGateCount(stdout);
|
|
24
25
|
}
|
|
25
|
-
/** Profiles all compiled artifacts in a target directory and prints gate counts. */ export async function profileGates(targetDir, log) {
|
|
26
|
-
const bb = process.env.BB ?? 'bb';
|
|
26
|
+
/** Profiles all compiled artifacts in a target directory and prints gate counts. */ export async function profileGates(targetDir, json, log) {
|
|
27
|
+
const bb = process.env.BB ?? findBbBinary() ?? 'bb';
|
|
27
28
|
const { artifacts, tmpDir } = await discoverArtifacts(targetDir);
|
|
28
29
|
if (artifacts.length === 0) {
|
|
29
|
-
|
|
30
|
+
if (json) {
|
|
31
|
+
log('[]');
|
|
32
|
+
} else {
|
|
33
|
+
log('No artifacts found in target directory.');
|
|
34
|
+
}
|
|
30
35
|
return;
|
|
31
36
|
}
|
|
32
37
|
try {
|
|
33
38
|
const results = await asyncPool(MAX_CONCURRENT, artifacts, async (artifact)=>({
|
|
34
39
|
name: artifact.name,
|
|
40
|
+
type: artifact.type,
|
|
35
41
|
gateCount: await getGateCount(bb, artifact.filePath)
|
|
36
42
|
}));
|
|
37
43
|
results.sort((a, b)=>a.name.localeCompare(b.name));
|
|
38
44
|
if (results.length === 0) {
|
|
39
|
-
|
|
45
|
+
if (json) {
|
|
46
|
+
log('[]');
|
|
47
|
+
} else {
|
|
48
|
+
log('No constrained circuits found.');
|
|
49
|
+
}
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (json) {
|
|
53
|
+
const entries = results.map((r)=>({
|
|
54
|
+
name: r.name,
|
|
55
|
+
type: r.type,
|
|
56
|
+
gates: r.gateCount
|
|
57
|
+
}));
|
|
58
|
+
log(JSON.stringify(entries, null, 2));
|
|
40
59
|
return;
|
|
41
60
|
}
|
|
42
61
|
const maxNameLen = Math.max(...results.map((r)=>r.name.length));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Fr } from '@aztec/aztec.js/fields';
|
|
2
|
+
import type { GenesisStateConfig } from '@aztec/ethereum/config';
|
|
3
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
5
|
+
/**
|
|
6
|
+
* Computes the expected genesis archive root from the genesis state config.
|
|
7
|
+
* Reads test accounts and sponsored FPC addresses as specified, then computes
|
|
8
|
+
* the genesis values including the archive root and prefilled public data.
|
|
9
|
+
*/
|
|
10
|
+
export declare function computeExpectedGenesisRoot(config: GenesisStateConfig, userLog: LogFn): Promise<{
|
|
11
|
+
genesisArchiveRoot: Fr;
|
|
12
|
+
genesis: import("@aztec/stdlib/world-state").GenesisData;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Waits until the canonical rollup's genesis archive root, VK tree root, and protocol contracts hash
|
|
16
|
+
* all match the expected local values. If the rollup is not yet compatible (e.g. during L1 contract upgrades),
|
|
17
|
+
* enters standby mode: starts a lightweight HTTP server for K8s liveness probes and polls every 60s
|
|
18
|
+
* until a compatible rollup appears.
|
|
19
|
+
*/
|
|
20
|
+
export declare function waitForCompatibleRollup(config: {
|
|
21
|
+
l1RpcUrls: string[];
|
|
22
|
+
l1ChainId: number;
|
|
23
|
+
registryAddress: EthAddress;
|
|
24
|
+
rollupVersion?: number;
|
|
25
|
+
}, expected: {
|
|
26
|
+
genesisArchiveRoot: Fr;
|
|
27
|
+
vkTreeRoot: Fr;
|
|
28
|
+
protocolContractsHash: Fr;
|
|
29
|
+
}, port: number | undefined, userLog: LogFn): Promise<void>;
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhbmRieS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaS9jbWRzL3N0YW5kYnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFHakQsT0FBTyxLQUFLLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUVqRSxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUVoRSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQVNuRDs7OztHQUlHO0FBQ0gsd0JBQXNCLDBCQUEwQixDQUFDLE1BQU0sRUFBRSxrQkFBa0IsRUFBRSxPQUFPLEVBQUUsS0FBSzs7O0dBYTFGO0FBd0JEOzs7OztHQUtHO0FBQ0gsd0JBQXNCLHVCQUF1QixDQUMzQyxNQUFNLEVBQUU7SUFDTixTQUFTLEVBQUUsTUFBTSxFQUFFLENBQUM7SUFDcEIsU0FBUyxFQUFFLE1BQU0sQ0FBQztJQUNsQixlQUFlLEVBQUUsVUFBVSxDQUFDO0lBQzVCLGFBQWEsQ0FBQyxFQUFFLE1BQU0sQ0FBQztDQUN4QixFQUNELFFBQVEsRUFBRTtJQUFFLGtCQUFrQixFQUFFLEVBQUUsQ0FBQztJQUFDLFVBQVUsRUFBRSxFQUFFLENBQUM7SUFBQyxxQkFBcUIsRUFBRSxFQUFFLENBQUE7Q0FBRSxFQUMvRSxJQUFJLEVBQUUsTUFBTSxHQUFHLFNBQVMsRUFDeEIsT0FBTyxFQUFFLEtBQUssR0FDYixPQUFPLENBQUMsSUFBSSxDQUFDLENBd0RmIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standby.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/standby.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAGjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AASnD;;;;GAIG;AACH,wBAAsB,0BAA0B,CAAC,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,KAAK;;;GAa1F;AAwBD;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE;IACN,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,UAAU,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,EACD,QAAQ,EAAE;IAAE,kBAAkB,EAAE,EAAE,CAAC;IAAC,UAAU,EAAE,EAAE,CAAC;IAAC,qBAAqB,EAAE,EAAE,CAAA;CAAE,EAC/E,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,KAAK,GACb,OAAO,CAAC,IAAI,CAAC,CAwDf"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
|
+
import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
|
|
3
|
+
import { getPublicClient } from '@aztec/ethereum/client';
|
|
4
|
+
import { RegistryContract, RollupContract } from '@aztec/ethereum/contracts';
|
|
5
|
+
import { startHttpRpcServer } from '@aztec/foundation/json-rpc/server';
|
|
6
|
+
import { retryUntil } from '@aztec/foundation/retry';
|
|
7
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
|
+
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
9
|
+
import Koa from 'koa';
|
|
10
|
+
const ROLLUP_POLL_INTERVAL_S = 60;
|
|
11
|
+
/**
|
|
12
|
+
* Computes the expected genesis archive root from the genesis state config.
|
|
13
|
+
* Reads test accounts and sponsored FPC addresses as specified, then computes
|
|
14
|
+
* the genesis values including the archive root and prefilled public data.
|
|
15
|
+
*/ export async function computeExpectedGenesisRoot(config, userLog) {
|
|
16
|
+
const testAccounts = config.testAccounts ? (await getInitialTestAccountsData()).map((a)=>a.address) : [];
|
|
17
|
+
const sponsoredFPCAccounts = config.sponsoredFPC ? [
|
|
18
|
+
await getSponsoredFPCAddress()
|
|
19
|
+
] : [];
|
|
20
|
+
const prefundAddresses = (config.prefundAddresses ?? []).map((a)=>AztecAddress.fromString(a));
|
|
21
|
+
const initialFundedAccounts = testAccounts.concat(sponsoredFPCAccounts).concat(prefundAddresses);
|
|
22
|
+
userLog(`Initial funded accounts: ${initialFundedAccounts.map((a)=>a.toString()).join(', ')}`);
|
|
23
|
+
const { genesisArchiveRoot, genesis } = await getGenesisValues(initialFundedAccounts);
|
|
24
|
+
userLog(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
|
|
25
|
+
return {
|
|
26
|
+
genesisArchiveRoot,
|
|
27
|
+
genesis
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
async function checkRollupCompatibility(rollup, expected) {
|
|
31
|
+
const mismatches = [];
|
|
32
|
+
const [l1Genesis, l1Vk, l1Protocol] = await Promise.all([
|
|
33
|
+
rollup.getGenesisArchiveTreeRoot(),
|
|
34
|
+
rollup.getVkTreeRoot(),
|
|
35
|
+
rollup.getProtocolContractsHash()
|
|
36
|
+
]);
|
|
37
|
+
if (!l1Genesis.equals(expected.genesisArchiveRoot)) {
|
|
38
|
+
mismatches.push(`genesis archive root (expected ${expected.genesisArchiveRoot}, got ${l1Genesis})`);
|
|
39
|
+
}
|
|
40
|
+
if (!l1Vk.equals(expected.vkTreeRoot)) {
|
|
41
|
+
mismatches.push(`VK tree root (expected ${expected.vkTreeRoot}, got ${l1Vk})`);
|
|
42
|
+
}
|
|
43
|
+
if (!l1Protocol.equals(expected.protocolContractsHash)) {
|
|
44
|
+
mismatches.push(`protocol contracts hash (expected ${expected.protocolContractsHash}, got ${l1Protocol})`);
|
|
45
|
+
}
|
|
46
|
+
return mismatches;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Waits until the canonical rollup's genesis archive root, VK tree root, and protocol contracts hash
|
|
50
|
+
* all match the expected local values. If the rollup is not yet compatible (e.g. during L1 contract upgrades),
|
|
51
|
+
* enters standby mode: starts a lightweight HTTP server for K8s liveness probes and polls every 60s
|
|
52
|
+
* until a compatible rollup appears.
|
|
53
|
+
*/ export async function waitForCompatibleRollup(config, expected, port, userLog) {
|
|
54
|
+
const publicClient = getPublicClient(config);
|
|
55
|
+
const rollupVersion = config.rollupVersion ?? 'canonical';
|
|
56
|
+
const registry = new RegistryContract(publicClient, config.registryAddress);
|
|
57
|
+
const rollupAddress = await registry.getRollupAddress(rollupVersion);
|
|
58
|
+
const rollup = new RollupContract(publicClient, rollupAddress.toString());
|
|
59
|
+
let mismatches;
|
|
60
|
+
try {
|
|
61
|
+
mismatches = await checkRollupCompatibility(rollup, expected);
|
|
62
|
+
} catch (err) {
|
|
63
|
+
throw new Error(`Could not retrieve rollup config from canonical rollup at ${rollupAddress}: ${err.message}`);
|
|
64
|
+
}
|
|
65
|
+
if (mismatches.length === 0) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
userLog(`Rollup at ${rollupAddress} is incompatible: ${mismatches.join('; ')}. ` + `Entering standby mode. Will poll every ${ROLLUP_POLL_INTERVAL_S}s for a compatible rollup...`);
|
|
69
|
+
const standbyServer = await startHttpRpcServer({
|
|
70
|
+
getApp: ()=>new Koa(),
|
|
71
|
+
isHealthy: ()=>true
|
|
72
|
+
}, {
|
|
73
|
+
port
|
|
74
|
+
});
|
|
75
|
+
userLog(`Standby status server listening on port ${standbyServer.port}`);
|
|
76
|
+
try {
|
|
77
|
+
await retryUntil(async ()=>{
|
|
78
|
+
const currentRollupAddress = await registry.getRollupAddress(rollupVersion);
|
|
79
|
+
const currentRollup = new RollupContract(publicClient, currentRollupAddress.toString());
|
|
80
|
+
let currentMismatches;
|
|
81
|
+
try {
|
|
82
|
+
currentMismatches = await checkRollupCompatibility(currentRollup, expected);
|
|
83
|
+
} catch {
|
|
84
|
+
userLog(`Failed to fetch rollup config from rollup at ${currentRollupAddress}. Retrying...`);
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
if (currentMismatches.length === 0) {
|
|
88
|
+
userLog(`Compatible rollup found at ${currentRollupAddress}. Exiting standby mode.`);
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
userLog(`Still waiting. Rollup at ${currentRollupAddress}: ${currentMismatches.join('; ')}.`);
|
|
92
|
+
return undefined;
|
|
93
|
+
}, 'compatible rollup', 0, ROLLUP_POLL_INTERVAL_S);
|
|
94
|
+
} finally{
|
|
95
|
+
await new Promise((resolve, reject)=>standbyServer.close((err)=>err ? reject(err) : resolve()));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -5,4 +5,4 @@ import type { TelemetryClient } from '@aztec/telemetry-client';
|
|
|
5
5
|
import { EmbeddedWallet } from '@aztec/wallets/embedded';
|
|
6
6
|
export declare function startBot(options: any, signalHandlers: (() => Promise<void>)[], services: NamespacedApiHandlers, userLog: LogFn): Promise<void>;
|
|
7
7
|
export declare function addBot(options: any, signalHandlers: (() => Promise<void>)[], services: NamespacedApiHandlers, wallet: EmbeddedWallet, aztecNode: AztecNode, telemetry: TelemetryClient, aztecNodeAdmin?: AztecNodeAdmin, userLog?: LogFn): Promise<void>;
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhcnRfYm90LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY2xpL2NtZHMvc3RhcnRfYm90LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFDL0UsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFHbkQsT0FBTyxFQUFFLEtBQUssU0FBUyxFQUFFLEtBQUssY0FBYyxFQUF5QixNQUFNLGlDQUFpQyxDQUFDO0FBQzdHLE9BQU8sS0FBSyxFQUFFLGVBQWUsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBTS9ELE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUt6RCx3QkFBc0IsUUFBUSxDQUM1QixPQUFPLEVBQUUsR0FBRyxFQUNaLGNBQWMsRUFBRSxDQUFDLE1BQU0sT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDLEVBQUUsRUFDdkMsUUFBUSxFQUFFLHFCQUFxQixFQUMvQixPQUFPLEVBQUUsS0FBSyxpQkFzQmY7QUFFRCx3QkFBc0IsTUFBTSxDQUMxQixPQUFPLEVBQUUsR0FBRyxFQUNaLGNBQWMsRUFBRSxDQUFDLE1BQU0sT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDLEVBQUUsRUFDdkMsUUFBUSxFQUFFLHFCQUFxQixFQUMvQixNQUFNLEVBQUUsY0FBYyxFQUN0QixTQUFTLEVBQUUsU0FBUyxFQUNwQixTQUFTLEVBQUUsZUFBZSxFQUMxQixjQUFjLENBQUMsRUFBRSxjQUFjLEVBQy9CLE9BQU8sQ0FBQyxFQUFFLEtBQUssaUJBbUJoQiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_bot.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_bot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAyB,MAAM,iCAAiC,CAAC;AAC7G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAM/D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAKzD,wBAAsB,QAAQ,CAC5B,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_bot.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_bot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAyB,MAAM,iCAAiC,CAAC;AAC7G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAM/D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAKzD,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,iBAsBf;AAED,wBAAsB,MAAM,CAC1B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,eAAe,EAC1B,cAAc,CAAC,EAAE,cAAc,EAC/B,OAAO,CAAC,EAAE,KAAK,iBAmBhB"}
|