@aztec/aztec 0.0.1-commit.3e3d0c9cd → 0.0.1-commit.3f5453c7b
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/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 +11 -1
- package/dest/cli/aztec_start_options.d.ts +1 -1
- package/dest/cli/aztec_start_options.d.ts.map +1 -1
- package/dest/cli/aztec_start_options.js +7 -0
- 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 +2 -0
- package/dest/cli/cmds/standby.d.ts +1 -1
- package/dest/cli/cmds/standby.js +2 -2
- package/dest/cli/cmds/start_node.d.ts +1 -1
- package/dest/cli/cmds/start_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_node.js +6 -20
- 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 +3 -15
- 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 +1 -1
- package/dest/cli/cmds/utils/needs_recompile.d.ts.map +1 -1
- package/dest/cli/cmds/utils/needs_recompile.js +9 -53
- 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 +41 -0
- package/dest/local-network/local-network.d.ts +3 -4
- package/dest/local-network/local-network.d.ts.map +1 -1
- package/dest/local-network/local-network.js +3 -3
- package/dest/testing/anvil_test_watcher.js +1 -1
- package/dest/testing/cheat_codes.d.ts +11 -15
- package/dest/testing/cheat_codes.d.ts.map +1 -1
- package/dest/testing/cheat_codes.js +34 -32
- package/package.json +33 -33
- package/scripts/aztec.sh +1 -1
- package/src/cli/aztec_start_action.ts +5 -1
- package/src/cli/aztec_start_options.ts +7 -0
- package/src/cli/cmds/compile.ts +3 -0
- package/src/cli/cmds/standby.ts +2 -2
- package/src/cli/cmds/start_node.ts +9 -11
- package/src/cli/cmds/start_prover_agent.ts +3 -6
- package/src/cli/cmds/utils/collect_crate_dirs.ts +118 -0
- package/src/cli/cmds/utils/needs_recompile.ts +8 -61
- package/src/cli/cmds/utils/warn_if_aztec_version_mismatch.ts +54 -0
- package/src/local-network/local-network.ts +5 -5
- package/src/testing/anvil_test_watcher.ts +1 -1
- package/src/testing/cheat_codes.ts +42 -36
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXp0ZWNfc3RhcnRfYWN0aW9uLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY2xpL2F6dGVjX3N0YXJ0X2FjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPQSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFhM0Qsd0JBQXNCLFVBQVUsQ0FBQyxPQUFPLEVBQUUsR0FBRyxFQUFFLE9BQU8sRUFBRSxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0saUJBK0lqRiJ9
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,iBA+IjF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getActiveNetworkName } from '@aztec/foundation/config';
|
|
2
2
|
import { createNamespacedSafeJsonRpcServer, getApiKeyAuthMiddleware, startHttpRpcServer } from '@aztec/foundation/json-rpc/server';
|
|
3
|
-
import { AztecNodeAdminApiSchema, AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
3
|
+
import { AztecNodeAdminApiSchema, AztecNodeApiSchema, AztecNodeDebugApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
4
4
|
import { getPackageVersion } from '@aztec/stdlib/update-checker';
|
|
5
5
|
import { getVersioningMiddleware } from '@aztec/stdlib/versioning';
|
|
6
6
|
import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
|
|
@@ -42,6 +42,10 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
42
42
|
node,
|
|
43
43
|
AztecNodeAdminApiSchema
|
|
44
44
|
];
|
|
45
|
+
services.nodeDebug = [
|
|
46
|
+
node,
|
|
47
|
+
AztecNodeDebugApiSchema
|
|
48
|
+
];
|
|
45
49
|
} else {
|
|
46
50
|
// Route --prover-node through startNode
|
|
47
51
|
if (options.proverNode && !options.node) {
|
|
@@ -51,6 +55,12 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
51
55
|
const { startNode } = await import('./cmds/start_node.js');
|
|
52
56
|
const networkName = getActiveNetworkName(options.network);
|
|
53
57
|
({ config } = await startNode(options, signalHandlers, services, adminServices, userLog, networkName));
|
|
58
|
+
if (options.nodeDebug && services.node) {
|
|
59
|
+
services.nodeDebug = [
|
|
60
|
+
services.node[0],
|
|
61
|
+
AztecNodeDebugApiSchema
|
|
62
|
+
];
|
|
63
|
+
}
|
|
54
64
|
} else if (options.bot) {
|
|
55
65
|
const { startBot } = await import('./cmds/start_bot.js');
|
|
56
66
|
await startBot(options, signalHandlers, services, userLog);
|
|
@@ -14,4 +14,4 @@ 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXp0ZWNfc3RhcnRfb3B0aW9ucy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NsaS9henRlY19zdGFydF9vcHRpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9BLE9BQU8sRUFDTCxLQUFLLGFBQWEsRUFDbEIsS0FBSyxNQUFNLEVBSVosTUFBTSwwQkFBMEIsQ0FBQztBQWVsQyxNQUFNLFdBQVcsZ0JBQWdCO0lBQy9CLElBQUksRUFBRSxNQUFNLENBQUM7SUFDYixXQUFXLEVBQUUsTUFBTSxDQUFDO0lBQ3BCLFlBQVksRUFBRSxHQUFHLENBQUM7SUFDbEIsWUFBWSxDQUFDLEVBQUUsQ0FBQyxHQUFHLEVBQUUsR0FBRyxLQUFLLE1BQU0sQ0FBQztJQUNwQyxHQUFHLEVBQUUsTUFBTSxHQUFHLFNBQVMsQ0FBQztJQUN4QixRQUFRLENBQUMsRUFBRSxNQUFNLEVBQUUsQ0FBQztJQUNwQixRQUFRLENBQUMsRUFBRSxDQUFDLEdBQUcsRUFBRSxNQUFNLEtBQUssR0FBRyxDQUFDO0NBQ2pDO0FBRUQsZUFBTyxNQUFNLFVBQVUsMEZBb0J0QixDQUFDO0FBdUJGLGVBQU8sTUFBTSxnQkFBZ0IsVUFZNUIsQ0FBQztBQUVGLGVBQU8sTUFBTSxZQUFZLFlBQVksQ0FBQztBQUd0QyxlQUFPLE1BQU0saUJBQWlCLEVBQUU7SUFBRSxDQUFDLEdBQUcsRUFBRSxNQUFNLEdBQUcsZ0JBQWdCLEVBQUUsQ0FBQTtDQTZPbEUsQ0FBQyJ9
|
|
@@ -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,0FAoBtB,CAAC;AAuBF,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;
|
|
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,0FAoBtB,CAAC;AAuBF,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;CA6OlE,CAAC"}
|
|
@@ -131,6 +131,13 @@ export const aztecStartOptions = {
|
|
|
131
131
|
env: 'AZTEC_RESET_ADMIN_API_KEY',
|
|
132
132
|
parseVal: (val)=>val === 'true' || val === '1'
|
|
133
133
|
},
|
|
134
|
+
{
|
|
135
|
+
flag: '--node-debug',
|
|
136
|
+
description: 'Expose debug endpoints (e.g. mineBlock) on the main RPC port',
|
|
137
|
+
defaultValue: false,
|
|
138
|
+
env: 'AZTEC_NODE_DEBUG',
|
|
139
|
+
parseVal: (val)=>val === undefined || val === 'true' || val === '1'
|
|
140
|
+
},
|
|
134
141
|
{
|
|
135
142
|
flag: '--api-prefix <value>',
|
|
136
143
|
description: 'Prefix for API routes on any service that is started',
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGlsZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaS9jbWRzL2NvbXBpbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFHbkQsT0FBTyxLQUFLLEVBQUUsT0FBTyxFQUFFLE1BQU0sV0FBVyxDQUFDO0FBdUt6Qyx3QkFBZ0Isb0JBQW9CLENBQUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsS0FBSyxHQUFHLE9BQU8sQ0FzQjFFIn0=
|
|
@@ -1 +1 @@
|
|
|
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;AAGnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
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;AAGnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuKzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,GAAG,OAAO,CAsB1E"}
|
package/dest/cli/cmds/compile.js
CHANGED
|
@@ -5,6 +5,7 @@ import { join } from 'path';
|
|
|
5
5
|
import { readArtifactFiles } from './utils/artifacts.js';
|
|
6
6
|
import { needsRecompile } from './utils/needs_recompile.js';
|
|
7
7
|
import { run } from './utils/spawn.js';
|
|
8
|
+
import { warnIfAztecVersionMismatch } from './utils/warn_if_aztec_version_mismatch.js';
|
|
8
9
|
/** Returns paths to contract artifacts in the target directory. */ async function collectContractArtifacts() {
|
|
9
10
|
let files;
|
|
10
11
|
try {
|
|
@@ -118,6 +119,7 @@ import { run } from './utils/spawn.js';
|
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
/** Compiles Aztec Noir contracts and postprocesses artifacts. */ async function compileAztecContract(nargoArgs, log) {
|
|
122
|
+
await warnIfAztecVersionMismatch(log);
|
|
121
123
|
if (!await needsRecompile()) {
|
|
122
124
|
log('No source changes detected, skipping compilation.');
|
|
123
125
|
return;
|
|
@@ -9,7 +9,7 @@ import type { LogFn } from '@aztec/foundation/log';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function computeExpectedGenesisRoot(config: GenesisStateConfig, userLog: LogFn): Promise<{
|
|
11
11
|
genesisArchiveRoot: Fr;
|
|
12
|
-
|
|
12
|
+
genesis: import("@aztec/stdlib/world-state").GenesisData;
|
|
13
13
|
}>;
|
|
14
14
|
/**
|
|
15
15
|
* Waits until the canonical rollup's genesis archive root, VK tree root, and protocol contracts hash
|
package/dest/cli/cmds/standby.js
CHANGED
|
@@ -20,11 +20,11 @@ const ROLLUP_POLL_INTERVAL_S = 60;
|
|
|
20
20
|
const prefundAddresses = (config.prefundAddresses ?? []).map((a)=>AztecAddress.fromString(a));
|
|
21
21
|
const initialFundedAccounts = testAccounts.concat(sponsoredFPCAccounts).concat(prefundAddresses);
|
|
22
22
|
userLog(`Initial funded accounts: ${initialFundedAccounts.map((a)=>a.toString()).join(', ')}`);
|
|
23
|
-
const { genesisArchiveRoot,
|
|
23
|
+
const { genesisArchiveRoot, genesis } = await getGenesisValues(initialFundedAccounts);
|
|
24
24
|
userLog(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
|
|
25
25
|
return {
|
|
26
26
|
genesisArchiveRoot,
|
|
27
|
-
|
|
27
|
+
genesis
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
async function checkRollupCompatibility(rollup, expected) {
|
|
@@ -5,4 +5,4 @@ import type { LogFn } from '@aztec/foundation/log';
|
|
|
5
5
|
export declare function startNode(options: any, signalHandlers: (() => Promise<void>)[], services: NamespacedApiHandlers, adminServices: NamespacedApiHandlers, userLog: LogFn, networkName: NetworkNames): Promise<{
|
|
6
6
|
config: AztecNodeConfig;
|
|
7
7
|
}>;
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhcnRfbm9kZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaS9jbWRzL3N0YXJ0X25vZGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEtBQUssZUFBZSxFQUE2QyxNQUFNLG1CQUFtQixDQUFDO0FBS3BHLE9BQU8sRUFBRSxLQUFLLFlBQVksRUFBZSxNQUFNLDBCQUEwQixDQUFDO0FBQzFFLE9BQU8sS0FBSyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFFL0UsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUE4Qm5ELHdCQUFzQixTQUFTLENBQzdCLE9BQU8sRUFBRSxHQUFHLEVBQ1osY0FBYyxFQUFFLENBQUMsTUFBTSxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxFQUN2QyxRQUFRLEVBQUUscUJBQXFCLEVBQy9CLGFBQWEsRUFBRSxxQkFBcUIsRUFDcEMsT0FBTyxFQUFFLEtBQUssRUFDZCxXQUFXLEVBQUUsWUFBWSxHQUN4QixPQUFPLENBQUM7SUFBRSxNQUFNLEVBQUUsZUFBZSxDQUFBO0NBQUUsQ0FBQyxDQThKdEMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAA6C,MAAM,mBAAmB,CAAC;AAKpG,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,0BAA0B,CAAC;AAC1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"start_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAA6C,MAAM,mBAAmB,CAAC;AAKpG,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,0BAA0B,CAAC;AAC1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AA8BnD,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,EACd,WAAW,EAAE,YAAY,GACxB,OAAO,CAAC;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC,CA8JtC"}
|
|
@@ -7,7 +7,7 @@ import { SecretValue } from '@aztec/foundation/config';
|
|
|
7
7
|
import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici';
|
|
8
8
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
9
9
|
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
10
|
-
import { ProvingJobConsumerSchema, createProvingJobBrokerClient } from '@aztec/prover-client/broker';
|
|
10
|
+
import { ProvingJobConsumerSchema, createProvingJobBrokerClient, proverBrokerBackoff } from '@aztec/prover-client/broker';
|
|
11
11
|
import { allPxeConfigMappings } from '@aztec/pxe/config';
|
|
12
12
|
import { AztecNodeAdminApiSchema, AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
13
13
|
import { P2PApiSchema, ProverNodeApiSchema } from '@aztec/stdlib/interfaces/server';
|
|
@@ -39,20 +39,8 @@ export async function startNode(options, signalHandlers, services, adminServices
|
|
|
39
39
|
if (nodeConfig.proverBrokerUrl) {
|
|
40
40
|
// at 1TPS we'd enqueue ~1k chonk verifier proofs and ~1k AVM proofs immediately
|
|
41
41
|
// set a lower connection limit such that we don't overload the server
|
|
42
|
-
//
|
|
43
|
-
const fetch = makeTracedFetch(
|
|
44
|
-
1,
|
|
45
|
-
2,
|
|
46
|
-
3,
|
|
47
|
-
3,
|
|
48
|
-
3,
|
|
49
|
-
3,
|
|
50
|
-
3,
|
|
51
|
-
3,
|
|
52
|
-
3,
|
|
53
|
-
3,
|
|
54
|
-
3
|
|
55
|
-
], false, makeUndiciFetch(new Agent({
|
|
42
|
+
// Retry indefinitely until the epoch proving times out and the chain reorgs
|
|
43
|
+
const fetch = makeTracedFetch(proverBrokerBackoff, false, makeUndiciFetch(new Agent({
|
|
56
44
|
connections: 100
|
|
57
45
|
})));
|
|
58
46
|
broker = createProvingJobBrokerClient(nodeConfig.proverBrokerUrl, getVersions(nodeConfig), fetch);
|
|
@@ -65,7 +53,7 @@ export async function startNode(options, signalHandlers, services, adminServices
|
|
|
65
53
|
}
|
|
66
54
|
await preloadCrsDataForVerifying(nodeConfig, userLog);
|
|
67
55
|
const genesisConfig = getGenesisStateConfigEnvVars();
|
|
68
|
-
const { genesisArchiveRoot,
|
|
56
|
+
const { genesisArchiveRoot, genesis } = await computeExpectedGenesisRoot(genesisConfig, userLog);
|
|
69
57
|
const followsCanonicalRollup = typeof nodeConfig.rollupVersion !== 'number' || nodeConfig.rollupVersion === 'canonical';
|
|
70
58
|
if (!nodeConfig.l1Contracts.registryAddress || nodeConfig.l1Contracts.registryAddress.isZero()) {
|
|
71
59
|
throw new Error('L1 registry address is required to start Aztec Node');
|
|
@@ -82,12 +70,10 @@ export async function startNode(options, signalHandlers, services, adminServices
|
|
|
82
70
|
if (!Fr.fromHexString(config.genesisArchiveTreeRoot).equals(genesisArchiveRoot)) {
|
|
83
71
|
throw new Error(`The computed genesis archive tree root ${genesisArchiveRoot} does not match the expected genesis archive tree root ${config.genesisArchiveTreeRoot} for the rollup deployed at ${addresses.rollupAddress}`);
|
|
84
72
|
}
|
|
85
|
-
// TODO(#12272): will clean this up.
|
|
86
73
|
nodeConfig = {
|
|
87
74
|
...nodeConfig,
|
|
88
75
|
l1Contracts: {
|
|
89
|
-
...addresses
|
|
90
|
-
slashFactoryAddress: nodeConfig.l1Contracts.slashFactoryAddress
|
|
76
|
+
...addresses
|
|
91
77
|
},
|
|
92
78
|
...config
|
|
93
79
|
};
|
|
@@ -121,7 +107,7 @@ export async function startNode(options, signalHandlers, services, adminServices
|
|
|
121
107
|
telemetry,
|
|
122
108
|
proverBroker: broker
|
|
123
109
|
}, {
|
|
124
|
-
|
|
110
|
+
genesis
|
|
125
111
|
});
|
|
126
112
|
// Add node and p2p to services list
|
|
127
113
|
services.node = [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
2
2
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
3
|
export declare function startProverAgent(options: any, signalHandlers: (() => Promise<void>)[], services: NamespacedApiHandlers, userLog: LogFn): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhcnRfcHJvdmVyX2FnZW50LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY2xpL2NtZHMvc3RhcnRfcHJvdmVyX2FnZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFFL0UsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFpQm5ELHdCQUFzQixnQkFBZ0IsQ0FDcEMsT0FBTyxFQUFFLEdBQUcsRUFDWixjQUFjLEVBQUUsQ0FBQyxNQUFNLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLEVBQ3ZDLFFBQVEsRUFBRSxxQkFBcUIsRUFDL0IsT0FBTyxFQUFFLEtBQUssaUJBb0RmIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_prover_agent.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_agent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"start_prover_agent.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_agent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAiBnD,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,iBAoDf"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { times } from '@aztec/foundation/collection';
|
|
2
2
|
import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici';
|
|
3
3
|
import { buildServerCircuitProver } from '@aztec/prover-client';
|
|
4
|
-
import { ProvingAgent, createProofStore, createProvingJobBrokerClient, proverAgentConfigMappings } from '@aztec/prover-client/broker';
|
|
4
|
+
import { ProvingAgent, createProofStore, createProvingJobBrokerClient, proverAgentConfigMappings, proverBrokerBackoff } from '@aztec/prover-client/broker';
|
|
5
5
|
import { getProverNodeAgentConfigFromEnv } from '@aztec/prover-node';
|
|
6
6
|
import { ProverAgentApiSchema } from '@aztec/stdlib/interfaces/server';
|
|
7
7
|
import { initTelemetryClient, makeTracedFetch, telemetryClientConfigMappings } from '@aztec/telemetry-client';
|
|
@@ -25,20 +25,8 @@ export async function startProverAgent(options, signalHandlers, services, userLo
|
|
|
25
25
|
process.exit(1);
|
|
26
26
|
}
|
|
27
27
|
await preloadCrsDataForServerSideProving(config, userLog);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
1,
|
|
31
|
-
2,
|
|
32
|
-
3,
|
|
33
|
-
3,
|
|
34
|
-
3,
|
|
35
|
-
3,
|
|
36
|
-
3,
|
|
37
|
-
3,
|
|
38
|
-
3,
|
|
39
|
-
3,
|
|
40
|
-
3
|
|
41
|
-
], false, makeUndiciFetch(new Agent({
|
|
28
|
+
// Retry indefinitely until the epoch proving times out and the chain reorgs
|
|
29
|
+
const fetch = makeTracedFetch(proverBrokerBackoff, false, makeUndiciFetch(new Agent({
|
|
42
30
|
connections: 10
|
|
43
31
|
})));
|
|
44
32
|
const broker = createProvingJobBrokerClient(config.proverBrokerUrl, getVersions(), fetch);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively collects crate directories starting from startCrateDir by following dependencies declared in Nargo.toml
|
|
3
|
+
* files.
|
|
4
|
+
*
|
|
5
|
+
* When `skipGitDeps` is false (default), git-based deps are followed and fetched into the nargo cache
|
|
6
|
+
* (`$HOME/nargo/<domain>/<repo-path>/<tag>`) if not already present.
|
|
7
|
+
*
|
|
8
|
+
* When `skipGitDeps` is true, git-based deps are ignored entirely.
|
|
9
|
+
*/
|
|
10
|
+
export declare function collectCrateDirs(startCrateDir: string, opts?: {
|
|
11
|
+
skipGitDeps?: boolean;
|
|
12
|
+
}): Promise<string[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Computes the local nargo cache path for a git dependency, mirroring nargo's own `git_dep_location` function.
|
|
15
|
+
* Path format: `$HOME/nargo/<domain>/<repo-path>/<tag>`
|
|
16
|
+
* e.g. `~/nargo/github.com/AztecProtocol/aztec-packages/v0.82.0`
|
|
17
|
+
*
|
|
18
|
+
* Source: noir/noir-repo/tooling/nargo_toml/src/git.rs
|
|
19
|
+
*/
|
|
20
|
+
export declare function nargoGitDepPath(gitUrl: string, tag: string): string;
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sbGVjdF9jcmF0ZV9kaXJzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY2xpL2NtZHMvdXRpbHMvY29sbGVjdF9jcmF0ZV9kaXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVFBOzs7Ozs7OztHQVFHO0FBQ0gsd0JBQXNCLGdCQUFnQixDQUFDLGFBQWEsRUFBRSxNQUFNLEVBQUUsSUFBSSxDQUFDLEVBQUU7SUFBRSxXQUFXLENBQUMsRUFBRSxPQUFPLENBQUE7Q0FBRSxHQUFHLE9BQU8sQ0FBQyxNQUFNLEVBQUUsQ0FBQyxDQWlFakg7QUFFRDs7Ozs7O0dBTUc7QUFDSCx3QkFBZ0IsZUFBZSxDQUFDLE1BQU0sRUFBRSxNQUFNLEVBQUUsR0FBRyxFQUFFLE1BQU0sR0FBRyxNQUFNLENBS25FIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect_crate_dirs.d.ts","sourceRoot":"","sources":["../../../../src/cli/cmds/utils/collect_crate_dirs.ts"],"names":[],"mappings":"AAQA;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAiEjH;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAKnE"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import TOML from '@iarna/toml';
|
|
2
|
+
import { existsSync } from 'fs';
|
|
3
|
+
import { mkdir, readFile, stat } from 'fs/promises';
|
|
4
|
+
import { homedir } from 'os';
|
|
5
|
+
import { dirname, join, resolve } from 'path';
|
|
6
|
+
import { run } from './spawn.js';
|
|
7
|
+
/**
|
|
8
|
+
* Recursively collects crate directories starting from startCrateDir by following dependencies declared in Nargo.toml
|
|
9
|
+
* files.
|
|
10
|
+
*
|
|
11
|
+
* When `skipGitDeps` is false (default), git-based deps are followed and fetched into the nargo cache
|
|
12
|
+
* (`$HOME/nargo/<domain>/<repo-path>/<tag>`) if not already present.
|
|
13
|
+
*
|
|
14
|
+
* When `skipGitDeps` is true, git-based deps are ignored entirely.
|
|
15
|
+
*/ export async function collectCrateDirs(startCrateDir, opts) {
|
|
16
|
+
const { skipGitDeps = false } = opts ?? {};
|
|
17
|
+
const visited = new Set();
|
|
18
|
+
async function visit(crateDir) {
|
|
19
|
+
const absDir = resolve(crateDir);
|
|
20
|
+
if (visited.has(absDir)) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
visited.add(absDir);
|
|
24
|
+
const tomlPath = join(absDir, 'Nargo.toml');
|
|
25
|
+
const content = await readFile(tomlPath, 'utf-8').catch(()=>{
|
|
26
|
+
throw new Error(`Incorrectly defined dependency. Nargo.toml not found in ${absDir}`);
|
|
27
|
+
});
|
|
28
|
+
const parsed = TOML.parse(content);
|
|
29
|
+
const members = parsed.workspace?.members;
|
|
30
|
+
// A Nargo.toml is either a workspace root (has workspace.members) or a single crate (has dependencies).
|
|
31
|
+
if (Array.isArray(members)) {
|
|
32
|
+
// The crate is a workspace root and has members defined so we visit the members
|
|
33
|
+
for (const member of members){
|
|
34
|
+
await visit(resolve(absDir, member));
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
// Single crate — follow its deps
|
|
38
|
+
const deps = parsed.dependencies ?? {};
|
|
39
|
+
for (const dep of Object.values(deps)){
|
|
40
|
+
if (!dep || typeof dep !== 'object') {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (typeof dep.path === 'string') {
|
|
44
|
+
// Dependency contains "path" hence it's a local dependency. We just check it's a real directory and then we
|
|
45
|
+
// recursively search through it
|
|
46
|
+
const depPath = resolve(absDir, dep.path);
|
|
47
|
+
const s = await stat(depPath);
|
|
48
|
+
if (!s.isDirectory()) {
|
|
49
|
+
throw new Error(`Dependency path "${dep.path}" in ${tomlPath} resolves to ${depPath} which is not a directory`);
|
|
50
|
+
}
|
|
51
|
+
await visit(depPath);
|
|
52
|
+
} else if (!skipGitDeps && typeof dep.git === 'string' && typeof dep.tag === 'string') {
|
|
53
|
+
// Dependency contains "git" hence it's a git dependency. We ensure it has been fetched and fetch it if
|
|
54
|
+
// it's not the case and then we recursively search through it.
|
|
55
|
+
await fetchAndVisit(dep.git, dep.tag, dep.directory);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async function fetchAndVisit(gitUrl, tag, directory) {
|
|
61
|
+
// `directory` is set when the dep lives in a subdirectory of a repository, e.g.:
|
|
62
|
+
// aztec = { git = "https://github.com/AztecProtocol/aztec-packages", tag = "v0.82.0",
|
|
63
|
+
// directory = "noir-projects/aztec-nr/aztec" }
|
|
64
|
+
// In that case nargo clones the whole repo and the crate root is <cachePath>/<directory>.
|
|
65
|
+
const cachePath = nargoGitDepPath(gitUrl, tag);
|
|
66
|
+
const crateDir = directory ? join(cachePath, directory) : cachePath;
|
|
67
|
+
await ensureGitDepCached(gitUrl, tag, cachePath);
|
|
68
|
+
await visit(crateDir);
|
|
69
|
+
}
|
|
70
|
+
await visit(startCrateDir);
|
|
71
|
+
return [
|
|
72
|
+
...visited
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Computes the local nargo cache path for a git dependency, mirroring nargo's own `git_dep_location` function.
|
|
77
|
+
* Path format: `$HOME/nargo/<domain>/<repo-path>/<tag>`
|
|
78
|
+
* e.g. `~/nargo/github.com/AztecProtocol/aztec-packages/v0.82.0`
|
|
79
|
+
*
|
|
80
|
+
* Source: noir/noir-repo/tooling/nargo_toml/src/git.rs
|
|
81
|
+
*/ export function nargoGitDepPath(gitUrl, tag) {
|
|
82
|
+
const url = new URL(gitUrl);
|
|
83
|
+
const domain = url.hostname;
|
|
84
|
+
const repoPath = url.pathname.replace(/^\//, '');
|
|
85
|
+
return join(process.env.HOME ?? homedir(), 'nargo', domain, repoPath, tag);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Ensures a git dep is present in the nargo cache, cloning it if it isn't. Mirrors nargo's `clone_git_repo`.
|
|
89
|
+
* If cloning fails (e.g. no network), throws with a message suggesting `nargo check` to prime the cache.
|
|
90
|
+
*
|
|
91
|
+
* Source: noir/noir-repo/tooling/nargo_toml/src/git.rs
|
|
92
|
+
*/ async function ensureGitDepCached(gitUrl, tag, cachePath) {
|
|
93
|
+
if (existsSync(cachePath)) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
await mkdir(dirname(cachePath), {
|
|
97
|
+
recursive: true
|
|
98
|
+
});
|
|
99
|
+
try {
|
|
100
|
+
await run('git', [
|
|
101
|
+
'-c',
|
|
102
|
+
'advice.detachedHead=false',
|
|
103
|
+
'clone',
|
|
104
|
+
'--depth',
|
|
105
|
+
'1',
|
|
106
|
+
'--branch',
|
|
107
|
+
tag,
|
|
108
|
+
gitUrl,
|
|
109
|
+
cachePath
|
|
110
|
+
]);
|
|
111
|
+
} catch (err) {
|
|
112
|
+
throw new Error(`Failed to fetch git dependency ${gitUrl}@${tag}: ${err?.message ?? err}.\n` + `Try running \`nargo check\` first to prime the dependency cache.`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* Note: The above implies that if there is a random json file in the target dir we would be always recompiling.
|
|
8
8
|
*/
|
|
9
9
|
export declare function needsRecompile(): Promise<boolean>;
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmVlZHNfcmVjb21waWxlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY2xpL2NtZHMvdXRpbHMvbmVlZHNfcmVjb21waWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUtBOzs7Ozs7O0dBT0c7QUFDSCx3QkFBc0IsY0FBYyxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FXdkQifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"needs_recompile.d.ts","sourceRoot":"","sources":["../../../../src/cli/cmds/utils/needs_recompile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"needs_recompile.d.ts","sourceRoot":"","sources":["../../../../src/cli/cmds/utils/needs_recompile.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAWvD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { readdir, stat } from 'fs/promises';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { collectCrateDirs } from './collect_crate_dirs.js';
|
|
4
4
|
/**
|
|
5
5
|
* Returns true if recompilation is needed: either no artifacts exist in target/ or any .nr or Nargo.toml source file
|
|
6
6
|
* (including path-based dependencies) is newer than the oldest artifact. We compare against the oldest artifact so
|
|
@@ -13,7 +13,12 @@ import { join, resolve } from 'path';
|
|
|
13
13
|
if (oldestArtifactMs === undefined) {
|
|
14
14
|
return true;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
// Git deps are pinned to a specific tag in Nargo.toml and nargo always fetches an exact tag, so their contents never
|
|
17
|
+
// change without Nargo.toml itself changing — and Nargo.toml is already tracked as a source file. Hence we can
|
|
18
|
+
// safely ignore checking source files of git deps.
|
|
19
|
+
const crateDirs = await collectCrateDirs('.', {
|
|
20
|
+
skipGitDeps: true
|
|
21
|
+
});
|
|
17
22
|
return hasNewerSourceFile(crateDirs, oldestArtifactMs);
|
|
18
23
|
}
|
|
19
24
|
/**
|
|
@@ -41,55 +46,6 @@ import { join, resolve } from 'path';
|
|
|
41
46
|
}
|
|
42
47
|
return oldest;
|
|
43
48
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Recursively collects crate directories starting from startCrateDir by following path-based dependencies declared in
|
|
46
|
-
* Nargo.toml files. Git-based deps are ignored (they only change when Nargo.toml itself is modified since the deps are
|
|
47
|
-
* tagged).
|
|
48
|
-
*/ async function collectCrateDirs(startCrateDir) {
|
|
49
|
-
// We have a set of visited dirs we check against when entering a new dir because we could stumble upon a directory
|
|
50
|
-
// multiple times in case multiple deps shared a dep (e.g. dep A and dep B both sharing dep C).
|
|
51
|
-
const visited = new Set();
|
|
52
|
-
async function visit(crateDir) {
|
|
53
|
-
const absDir = resolve(crateDir);
|
|
54
|
-
if (visited.has(absDir)) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
visited.add(absDir);
|
|
58
|
-
// Every dep is its own crate and every crate needs to have Nargo.toml defined in the root so we try to load it and
|
|
59
|
-
// error out if it's not the case.
|
|
60
|
-
const tomlPath = join(absDir, 'Nargo.toml');
|
|
61
|
-
const content = await readFile(tomlPath, 'utf-8').catch(()=>{
|
|
62
|
-
throw new Error(`Incorrectly defined dependency. Nargo.toml not found in ${absDir}`);
|
|
63
|
-
});
|
|
64
|
-
const parsed = TOML.parse(content);
|
|
65
|
-
const members = parsed.workspace?.members;
|
|
66
|
-
// A Nargo.toml is either a workspace root (has workspace.members) or a single crate (has dependencies).
|
|
67
|
-
if (Array.isArray(members)) {
|
|
68
|
-
// The crate is a workspace root and has members defined so we visit the members
|
|
69
|
-
for (const member of members){
|
|
70
|
-
const memberPath = resolve(absDir, member);
|
|
71
|
-
await visit(memberPath);
|
|
72
|
-
}
|
|
73
|
-
} else {
|
|
74
|
-
// The crate is not a workspace root so we check for dependencies
|
|
75
|
-
const deps = parsed.dependencies ?? {};
|
|
76
|
-
for (const dep of Object.values(deps)){
|
|
77
|
-
if (dep && typeof dep === 'object' && typeof dep.path === 'string') {
|
|
78
|
-
const depPath = resolve(absDir, dep.path);
|
|
79
|
-
const s = await stat(depPath);
|
|
80
|
-
if (!s.isDirectory()) {
|
|
81
|
-
throw new Error(`Dependency path "${dep.path}" in ${tomlPath} resolves to ${depPath} which is not a directory`);
|
|
82
|
-
}
|
|
83
|
-
await visit(depPath);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
await visit(startCrateDir);
|
|
89
|
-
return [
|
|
90
|
-
...visited
|
|
91
|
-
];
|
|
92
|
-
}
|
|
93
49
|
/**
|
|
94
50
|
* Walks crate dirs looking for .nr and Nargo.toml files newer than thresholdMs. Short-circuits on the first match.
|
|
95
51
|
*/ async function hasNewerSourceFile(crateDirs, thresholdMs) {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
+
/** Warns if the `aztec` dependency tag in any crate's Nargo.toml doesn't match the CLI version. */
|
|
3
|
+
export declare function warnIfAztecVersionMismatch(log: LogFn, cliVersion?: string): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2Fybl9pZl9henRlY192ZXJzaW9uX21pc21hdGNoLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY2xpL2NtZHMvdXRpbHMvd2Fybl9pZl9henRlY192ZXJzaW9uX21pc21hdGNoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBU25ELG1HQUFtRztBQUNuRyx3QkFBc0IsMEJBQTBCLENBQUMsR0FBRyxFQUFFLEtBQUssRUFBRSxVQUFVLENBQUMsRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQTJDL0YifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warn_if_aztec_version_mismatch.d.ts","sourceRoot":"","sources":["../../../../src/cli/cmds/utils/warn_if_aztec_version_mismatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AASnD,mGAAmG;AACnG,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2C/F"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { getPackageVersion } from '@aztec/stdlib/update-checker';
|
|
2
|
+
import TOML from '@iarna/toml';
|
|
3
|
+
import { readFile } from 'fs/promises';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
import { collectCrateDirs } from './collect_crate_dirs.js';
|
|
6
|
+
/** Warns if the `aztec` dependency tag in any crate's Nargo.toml doesn't match the CLI version. */ export async function warnIfAztecVersionMismatch(log, cliVersion) {
|
|
7
|
+
const version = cliVersion ?? getPackageVersion();
|
|
8
|
+
if (!version) {
|
|
9
|
+
log(`WARNING: aztec CLI version not found. Skipping dependency compatibility check.`);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const expectedTag = `v${version}`;
|
|
13
|
+
const mismatches = [];
|
|
14
|
+
const crateDirs = await collectCrateDirs('.', {
|
|
15
|
+
skipGitDeps: true
|
|
16
|
+
});
|
|
17
|
+
for (const dir of crateDirs){
|
|
18
|
+
const tomlPath = join(dir, 'Nargo.toml');
|
|
19
|
+
let content;
|
|
20
|
+
try {
|
|
21
|
+
content = await readFile(tomlPath, 'utf-8');
|
|
22
|
+
} catch {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
const parsed = TOML.parse(content);
|
|
26
|
+
const aztecDep = parsed.dependencies?.aztec;
|
|
27
|
+
if (!aztecDep || typeof aztecDep !== 'object' || typeof aztecDep.tag !== 'string') {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (aztecDep.tag !== expectedTag) {
|
|
31
|
+
mismatches.push({
|
|
32
|
+
file: tomlPath,
|
|
33
|
+
tag: aztecDep.tag
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (mismatches.length > 0) {
|
|
38
|
+
const details = mismatches.map((m)=>` ${m.file} (${m.tag})`).join('\n');
|
|
39
|
+
log(`WARNING: Aztec dependency version mismatch detected.\n` + `The following crates have an aztec dependency that does not match the CLI version (${expectedTag}):\n` + `${details}\n\n` + `See https://docs.aztec.network/errors/9 for how to update your dependencies.`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -7,7 +7,7 @@ import { EthAddress } from '@aztec/foundation/eth-address';
|
|
|
7
7
|
import type { LogFn } from '@aztec/foundation/log';
|
|
8
8
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
9
9
|
import type { ProvingJobBroker } from '@aztec/stdlib/interfaces/server';
|
|
10
|
-
import type {
|
|
10
|
+
import type { GenesisData } from '@aztec/stdlib/world-state';
|
|
11
11
|
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
12
12
|
import { type Hex } from 'viem';
|
|
13
13
|
/**
|
|
@@ -31,7 +31,6 @@ export declare function deployContractsToL1(aztecNodeConfig: AztecNodeConfig, pr
|
|
|
31
31
|
rollupAddress: EthAddress;
|
|
32
32
|
stakingAssetAddress: EthAddress;
|
|
33
33
|
} & {
|
|
34
|
-
slashFactoryAddress?: EthAddress | undefined;
|
|
35
34
|
feeAssetHandlerAddress?: EthAddress | undefined;
|
|
36
35
|
stakingAssetHandlerAddress?: EthAddress | undefined;
|
|
37
36
|
zkPassportVerifierAddress?: EthAddress | undefined;
|
|
@@ -68,6 +67,6 @@ export declare function createAztecNode(config?: Partial<AztecNodeConfig>, deps?
|
|
|
68
67
|
dateProvider?: DateProvider;
|
|
69
68
|
proverBroker?: ProvingJobBroker;
|
|
70
69
|
}, options?: {
|
|
71
|
-
|
|
70
|
+
genesis?: GenesisData;
|
|
72
71
|
}): Promise<AztecNodeService>;
|
|
73
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
72
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWwtbmV0d29yay5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xvY2FsLW5ldHdvcmsvbG9jYWwtbmV0d29yay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBRUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDckQsT0FBTyxFQUFFLEtBQUssZUFBZSxFQUFvQixNQUFNLDBCQUEwQixDQUFDO0FBQ2xGLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUU1QyxPQUFPLEVBQUUsS0FBSyxtQkFBbUIsRUFBb0IsTUFBTSwyQkFBMkIsQ0FBQztBQVN2RixPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDM0QsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFDbkQsT0FBTyxFQUFFLFlBQVksRUFBb0IsTUFBTSx5QkFBeUIsQ0FBQztBQUt6RSxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ3hFLE9BQU8sS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQzdELE9BQU8sRUFDTCxLQUFLLGVBQWUsRUFHckIsTUFBTSx5QkFBeUIsQ0FBQztBQUtqQyxPQUFPLEVBQUUsS0FBSyxHQUFHLEVBQTJELE1BQU0sTUFBTSxDQUFDO0FBZ0J6Rjs7OztHQUlHO0FBQ0gsd0JBQXNCLG1CQUFtQixDQUN2QyxlQUFlLEVBQUUsZUFBZSxFQUNoQyxVQUFVLEVBQUUsR0FBRyxFQUNmLElBQUksR0FBRTtJQUNKLGtCQUFrQixDQUFDLEVBQUUsRUFBRSxDQUFDO0lBQ3hCLDRCQUE0QixDQUFDLEVBQUUsTUFBTSxDQUFDO0NBQ2xDOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBb0JQO0FBRUQsOEJBQThCO0FBQzlCLE1BQU0sTUFBTSxrQkFBa0IsR0FBRyxlQUFlLEdBQUc7SUFDakQsMERBQTBEO0lBQzFELFVBQVUsRUFBRSxNQUFNLENBQUM7SUFDbkIsNkRBQTZEO0lBQzdELFlBQVksRUFBRSxPQUFPLENBQUM7Q0FDdkIsQ0FBQztBQUVGOzs7O0dBSUc7QUFDSCx3QkFBc0Isa0JBQWtCLENBQUMsTUFBTSx5Q0FBa0MsRUFBRSxPQUFPLEVBQUUsS0FBSzs7O0dBd0poRztBQUVEOzs7R0FHRztBQUNILHdCQUFzQixlQUFlLENBQ25DLE1BQU0sR0FBRSxPQUFPLENBQUMsZUFBZSxDQUFNLEVBQ3JDLElBQUksR0FBRTtJQUNKLFNBQVMsQ0FBQyxFQUFFLGVBQWUsQ0FBQztJQUM1QixVQUFVLENBQUMsRUFBRSxtQkFBbUIsQ0FBQztJQUNqQyxZQUFZLENBQUMsRUFBRSxZQUFZLENBQUM7SUFDNUIsWUFBWSxDQUFDLEVBQUUsZ0JBQWdCLENBQUM7Q0FDNUIsRUFDTixPQUFPLEdBQUU7SUFBRSxPQUFPLENBQUMsRUFBRSxXQUFXLENBQUE7Q0FBTyw2QkFleEMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-network.d.ts","sourceRoot":"","sources":["../../src/local-network/local-network.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAE5C,OAAO,EAAE,KAAK,mBAAmB,EAAoB,MAAM,2BAA2B,CAAC;AASvF,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAoB,MAAM,yBAAyB,CAAC;AAKzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"local-network.d.ts","sourceRoot":"","sources":["../../src/local-network/local-network.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAE5C,OAAO,EAAE,KAAK,mBAAmB,EAAoB,MAAM,2BAA2B,CAAC;AASvF,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAoB,MAAM,yBAAyB,CAAC;AAKzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAE,KAAK,GAAG,EAA2D,MAAM,MAAM,CAAC;AAgBzF;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,GAAG,EACf,IAAI,GAAE;IACJ,kBAAkB,CAAC,EAAE,EAAE,CAAC;IACxB,4BAA4B,CAAC,EAAE,MAAM,CAAC;CAClC;;;;;;;;;;;;;;;;;;;;;;GAoBP;AAED,8BAA8B;AAC9B,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG;IACjD,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,yCAAkC,EAAE,OAAO,EAAE,KAAK;;;GAwJhG;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,EACrC,IAAI,GAAE;IACJ,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,YAAY,CAAC,EAAE,gBAAgB,CAAC;CAC5B,EACN,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,WAAW,CAAA;CAAO,6BAexC"}
|
|
@@ -49,7 +49,7 @@ const localAnvil = foundry;
|
|
|
49
49
|
genesisArchiveRoot: opts.genesisArchiveRoot ?? new Fr(GENESIS_ARCHIVE_ROOT),
|
|
50
50
|
feeJuicePortalInitialBalance: opts.feeJuicePortalInitialBalance,
|
|
51
51
|
aztecTargetCommitteeSize: 0,
|
|
52
|
-
|
|
52
|
+
slasherEnabled: false,
|
|
53
53
|
realVerifier: false
|
|
54
54
|
});
|
|
55
55
|
aztecNodeConfig.l1Contracts = l1Contracts.l1ContractAddresses;
|
|
@@ -116,7 +116,7 @@ const localAnvil = foundry;
|
|
|
116
116
|
] : [],
|
|
117
117
|
...prefundAddresses
|
|
118
118
|
];
|
|
119
|
-
const { genesisArchiveRoot,
|
|
119
|
+
const { genesisArchiveRoot, genesis, fundingNeeded } = await getGenesisValues(fundedAddresses);
|
|
120
120
|
const dateProvider = new TestDateProvider();
|
|
121
121
|
let cheatcodes;
|
|
122
122
|
let rollupAddress;
|
|
@@ -153,7 +153,7 @@ const localAnvil = foundry;
|
|
|
153
153
|
blobClient,
|
|
154
154
|
dateProvider
|
|
155
155
|
}, {
|
|
156
|
-
|
|
156
|
+
genesis
|
|
157
157
|
});
|
|
158
158
|
// Now that the node is up, let the watcher check for pending txs so it can skip unfilled slots faster when
|
|
159
159
|
// transactions are waiting in the mempool. Also let it check if the sequencer is actively building, to avoid
|