@aztec/aztec 0.0.1-commit.684755437 → 0.0.1-commit.6b113946b
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 +12 -5
- 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 -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 +1 -1
- package/dest/cli/cmds/profile_gates.d.ts.map +1 -1
- package/dest/cli/cmds/profile_gates.js +2 -1
- package/dest/cli/cmds/standby.d.ts +10 -5
- package/dest/cli/cmds/standby.d.ts.map +1 -1
- package/dest/cli/cmds/standby.js +33 -14
- 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 +7 -1
- 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 +7 -1
- package/dest/cli/cmds/utils/needs_recompile.js +19 -9
- 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 +3 -4
- package/package.json +33 -34
- package/src/cli/aztec_start_action.ts +7 -5
- package/src/cli/cmds/compile.ts +2 -1
- package/src/cli/cmds/profile_flamegraph.ts +2 -1
- package/src/cli/cmds/profile_gates.ts +2 -1
- package/src/cli/cmds/standby.ts +37 -16
- package/src/cli/cmds/start_node.ts +8 -1
- package/src/cli/cmds/start_prover_broker.ts +8 -1
- package/src/cli/cmds/utils/needs_recompile.ts +23 -11
- package/src/testing/epoch_test_settler.ts +3 -4
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXp0ZWNfc3RhcnRfYWN0aW9uLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY2xpL2F6dGVjX3N0YXJ0X2FjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPQSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFhM0Qsd0JBQXNCLFVBQVUsQ0FBQyxPQUFPLEVBQUUsR0FBRyxFQUFFLE9BQU8sRUFBRSxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0saUJBMklqRiJ9
|
|
@@ -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,iBA2IjF"}
|
|
@@ -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 { AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
3
|
+
import { AztecNodeAdminApiSchema, AztecNodeApiSchema } 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';
|
|
@@ -14,13 +14,13 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
14
14
|
const signalHandlers = [];
|
|
15
15
|
const services = {};
|
|
16
16
|
const adminServices = {};
|
|
17
|
+
const packageVersion = getPackageVersion();
|
|
17
18
|
let config = undefined;
|
|
18
19
|
if (options.localNetwork) {
|
|
19
|
-
const cliVersion = getPackageVersion() ?? 'unknown';
|
|
20
20
|
const localNetwork = extractNamespacedOptions(options, 'local-network');
|
|
21
21
|
localNetwork.testAccounts = true;
|
|
22
22
|
userLog(`${splash}\n${github}\n\n`);
|
|
23
|
-
userLog(`Setting up Aztec local network ${
|
|
23
|
+
userLog(`Setting up Aztec local network ${packageVersion ?? 'unknown'}, please stand by...`);
|
|
24
24
|
const { node, stop } = await createLocalNetwork({
|
|
25
25
|
l1Mnemonic: localNetwork.l1Mnemonic,
|
|
26
26
|
l1RpcUrls: options.l1RpcUrls,
|
|
@@ -38,6 +38,10 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
38
38
|
node,
|
|
39
39
|
AztecNodeApiSchema
|
|
40
40
|
];
|
|
41
|
+
adminServices.node = [
|
|
42
|
+
node,
|
|
43
|
+
AztecNodeAdminApiSchema
|
|
44
|
+
];
|
|
41
45
|
} else {
|
|
42
46
|
// Route --prover-node through startNode
|
|
43
47
|
if (options.proverNode && !options.node) {
|
|
@@ -75,6 +79,9 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
75
79
|
}
|
|
76
80
|
installSignalHandlers(debugLogger.info, signalHandlers);
|
|
77
81
|
const versions = getVersions(config);
|
|
82
|
+
const versioningOpts = {
|
|
83
|
+
packageVersion
|
|
84
|
+
};
|
|
78
85
|
// Start the main JSON-RPC server
|
|
79
86
|
if (Object.entries(services).length > 0) {
|
|
80
87
|
const rpcServer = createNamespacedSafeJsonRpcServer(services, {
|
|
@@ -82,7 +89,7 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
82
89
|
log: debugLogger,
|
|
83
90
|
middlewares: [
|
|
84
91
|
getOtelJsonRpcPropagationMiddleware(),
|
|
85
|
-
getVersioningMiddleware(versions)
|
|
92
|
+
getVersioningMiddleware(versions, versioningOpts)
|
|
86
93
|
],
|
|
87
94
|
maxBatchSize: options.rpcMaxBatchSize,
|
|
88
95
|
maxBodySizeBytes: options.rpcMaxBodySize
|
|
@@ -96,7 +103,7 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
96
103
|
if (Object.entries(adminServices).length > 0) {
|
|
97
104
|
const adminMiddlewares = [
|
|
98
105
|
getOtelJsonRpcPropagationMiddleware(),
|
|
99
|
-
getVersioningMiddleware(versions)
|
|
106
|
+
getVersioningMiddleware(versions, versioningOpts)
|
|
100
107
|
];
|
|
101
108
|
// Resolve the admin API key (auto-generated and persisted, or opt-out)
|
|
102
109
|
const apiKeyResolution = await resolveAdminApiKey({
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGlsZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaS9jbWRzL2NvbXBpbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFHbkQsT0FBTyxLQUFLLEVBQUUsT0FBTyxFQUFFLE1BQU0sV0FBVyxDQUFDO0FBb0t6Qyx3QkFBZ0Isb0JBQW9CLENBQUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsS0FBSyxHQUFHLE9BQU8sQ0FzQjFFIn0=
|
|
@@ -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;AAGnD,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,3 +1,4 @@
|
|
|
1
|
+
import { findBbBinary } from '@aztec/bb.js';
|
|
1
2
|
import { execFileSync } from 'child_process';
|
|
2
3
|
import { readFile, writeFile } from 'fs/promises';
|
|
3
4
|
import { join } from 'path';
|
|
@@ -122,7 +123,7 @@ import { run } from './utils/spawn.js';
|
|
|
122
123
|
return;
|
|
123
124
|
}
|
|
124
125
|
const nargo = process.env.NARGO ?? 'nargo';
|
|
125
|
-
const bb = process.env.BB ?? 'bb';
|
|
126
|
+
const bb = process.env.BB ?? findBbBinary() ?? 'bb';
|
|
126
127
|
await run(nargo, [
|
|
127
128
|
'compile',
|
|
128
129
|
...nargoArgs
|
|
@@ -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
3
|
export declare function profileGates(targetDir: string, log: LogFn): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZmlsZV9nYXRlcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaS9jbWRzL3Byb2ZpbGVfZ2F0ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUErQm5ELG9GQUFvRjtBQUNwRix3QkFBc0IsWUFBWSxDQUFDLFNBQVMsRUFBRSxNQUFNLEVBQUUsR0FBRyxFQUFFLEtBQUssR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBaUMvRSJ9
|
|
@@ -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;AA+BnD,oFAAoF;AACpF,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAiC/E"}
|
|
@@ -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';
|
|
@@ -23,7 +24,7 @@ const execFile = promisify(execFileCb);
|
|
|
23
24
|
return parseGateCount(stdout);
|
|
24
25
|
}
|
|
25
26
|
/** 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';
|
|
27
|
+
const bb = process.env.BB ?? findBbBinary() ?? 'bb';
|
|
27
28
|
const { artifacts, tmpDir } = await discoverArtifacts(targetDir);
|
|
28
29
|
if (artifacts.length === 0) {
|
|
29
30
|
log('No artifacts found in target directory.');
|
|
@@ -12,9 +12,10 @@ export declare function computeExpectedGenesisRoot(config: GenesisStateConfig, u
|
|
|
12
12
|
prefilledPublicData: import("@aztec/stdlib/trees").PublicDataTreeLeaf[];
|
|
13
13
|
}>;
|
|
14
14
|
/**
|
|
15
|
-
* Waits until the canonical rollup's genesis archive root
|
|
16
|
-
* If the rollup is not yet compatible (e.g. during L1 contract upgrades),
|
|
17
|
-
* starts a lightweight HTTP server for K8s liveness probes and polls every 60s
|
|
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.
|
|
18
19
|
*/
|
|
19
20
|
export declare function waitForCompatibleRollup(config: {
|
|
20
21
|
l1RpcUrls: string[];
|
|
@@ -23,5 +24,9 @@ export declare function waitForCompatibleRollup(config: {
|
|
|
23
24
|
registryAddress: EthAddress;
|
|
24
25
|
};
|
|
25
26
|
rollupVersion?: number;
|
|
26
|
-
},
|
|
27
|
-
|
|
27
|
+
}, expected: {
|
|
28
|
+
genesisArchiveRoot: Fr;
|
|
29
|
+
vkTreeRoot: Fr;
|
|
30
|
+
protocolContractsHash: Fr;
|
|
31
|
+
}, port: number | undefined, userLog: LogFn): Promise<void>;
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhbmRieS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaS9jbWRzL3N0YW5kYnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFHakQsT0FBTyxLQUFLLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUVqRSxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUVoRSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQVNuRDs7OztHQUlHO0FBQ0gsd0JBQXNCLDBCQUEwQixDQUFDLE1BQU0sRUFBRSxrQkFBa0IsRUFBRSxPQUFPLEVBQUUsS0FBSzs7O0dBYTFGO0FBd0JEOzs7OztHQUtHO0FBQ0gsd0JBQXNCLHVCQUF1QixDQUMzQyxNQUFNLEVBQUU7SUFDTixTQUFTLEVBQUUsTUFBTSxFQUFFLENBQUM7SUFDcEIsU0FBUyxFQUFFLE1BQU0sQ0FBQztJQUNsQixXQUFXLEVBQUU7UUFBRSxlQUFlLEVBQUUsVUFBVSxDQUFBO0tBQUUsQ0FBQztJQUM3QyxhQUFhLENBQUMsRUFBRSxNQUFNLENBQUM7Q0FDeEIsRUFDRCxRQUFRLEVBQUU7SUFBRSxrQkFBa0IsRUFBRSxFQUFFLENBQUM7SUFBQyxVQUFVLEVBQUUsRUFBRSxDQUFDO0lBQUMscUJBQXFCLEVBQUUsRUFBRSxDQUFBO0NBQUUsRUFDL0UsSUFBSSxFQUFFLE1BQU0sR0FBRyxTQUFTLEVBQ3hCLE9BQU8sRUFBRSxLQUFLLEdBQ2IsT0FBTyxDQUFDLElBQUksQ0FBQyxDQXdEZiJ9
|
|
@@ -1 +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;
|
|
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,WAAW,EAAE;QAAE,eAAe,EAAE,UAAU,CAAA;KAAE,CAAC;IAC7C,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"}
|
package/dest/cli/cmds/standby.js
CHANGED
|
@@ -27,26 +27,45 @@ const ROLLUP_POLL_INTERVAL_S = 60;
|
|
|
27
27
|
prefilledPublicData
|
|
28
28
|
};
|
|
29
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
|
+
}
|
|
30
48
|
/**
|
|
31
|
-
* Waits until the canonical rollup's genesis archive root
|
|
32
|
-
* If the rollup is not yet compatible (e.g. during L1 contract upgrades),
|
|
33
|
-
* starts a lightweight HTTP server for K8s liveness probes and polls every 60s
|
|
34
|
-
|
|
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) {
|
|
35
54
|
const publicClient = getPublicClient(config);
|
|
36
55
|
const rollupVersion = config.rollupVersion ?? 'canonical';
|
|
37
56
|
const registry = new RegistryContract(publicClient, config.l1Contracts.registryAddress);
|
|
38
57
|
const rollupAddress = await registry.getRollupAddress(rollupVersion);
|
|
39
58
|
const rollup = new RollupContract(publicClient, rollupAddress.toString());
|
|
40
|
-
let
|
|
59
|
+
let mismatches;
|
|
41
60
|
try {
|
|
42
|
-
|
|
61
|
+
mismatches = await checkRollupCompatibility(rollup, expected);
|
|
43
62
|
} catch (err) {
|
|
44
|
-
throw new Error(`Could not retrieve
|
|
63
|
+
throw new Error(`Could not retrieve rollup config from canonical rollup at ${rollupAddress}: ${err.message}`);
|
|
45
64
|
}
|
|
46
|
-
if (
|
|
65
|
+
if (mismatches.length === 0) {
|
|
47
66
|
return;
|
|
48
67
|
}
|
|
49
|
-
userLog(`
|
|
68
|
+
userLog(`Rollup at ${rollupAddress} is incompatible: ${mismatches.join('; ')}. ` + `Entering standby mode. Will poll every ${ROLLUP_POLL_INTERVAL_S}s for a compatible rollup...`);
|
|
50
69
|
const standbyServer = await startHttpRpcServer({
|
|
51
70
|
getApp: ()=>new Koa(),
|
|
52
71
|
isHealthy: ()=>true
|
|
@@ -58,18 +77,18 @@ const ROLLUP_POLL_INTERVAL_S = 60;
|
|
|
58
77
|
await retryUntil(async ()=>{
|
|
59
78
|
const currentRollupAddress = await registry.getRollupAddress(rollupVersion);
|
|
60
79
|
const currentRollup = new RollupContract(publicClient, currentRollupAddress.toString());
|
|
61
|
-
let
|
|
80
|
+
let currentMismatches;
|
|
62
81
|
try {
|
|
63
|
-
|
|
82
|
+
currentMismatches = await checkRollupCompatibility(currentRollup, expected);
|
|
64
83
|
} catch {
|
|
65
|
-
userLog(`Failed to fetch
|
|
84
|
+
userLog(`Failed to fetch rollup config from rollup at ${currentRollupAddress}. Retrying...`);
|
|
66
85
|
return undefined;
|
|
67
86
|
}
|
|
68
|
-
if (
|
|
87
|
+
if (currentMismatches.length === 0) {
|
|
69
88
|
userLog(`Compatible rollup found at ${currentRollupAddress}. Exiting standby mode.`);
|
|
70
89
|
return true;
|
|
71
90
|
}
|
|
72
|
-
userLog(`Still waiting. Rollup at ${currentRollupAddress}
|
|
91
|
+
userLog(`Still waiting. Rollup at ${currentRollupAddress}: ${currentMismatches.join('; ')}.`);
|
|
73
92
|
return undefined;
|
|
74
93
|
}, 'compatible rollup', 0, ROLLUP_POLL_INTERVAL_S);
|
|
75
94
|
} finally{
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhcnRfbm9kZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaS9jbWRzL3N0YXJ0X25vZGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEtBQUssZUFBZSxFQUE2QyxNQUFNLG1CQUFtQixDQUFDO0FBS3BHLE9BQU8sRUFBRSxLQUFLLFlBQVksRUFBZSxNQUFNLDBCQUEwQixDQUFDO0FBQzFFLE9BQU8sS0FBSyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFFL0UsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUEwQm5ELHdCQUFzQixTQUFTLENBQzdCLE9BQU8sRUFBRSxHQUFHLEVBQ1osY0FBYyxFQUFFLENBQUMsTUFBTSxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxFQUN2QyxRQUFRLEVBQUUscUJBQXFCLEVBQy9CLGFBQWEsRUFBRSxxQkFBcUIsRUFDcEMsT0FBTyxFQUFFLEtBQUssRUFDZCxXQUFXLEVBQUUsWUFBWSxHQUN4QixPQUFPLENBQUM7SUFBRSxNQUFNLEVBQUUsZUFBZSxDQUFBO0NBQUUsQ0FBQyxDQW9LdEMifQ==
|
|
@@ -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;AA0BnD,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,CAoKtC"}
|
|
@@ -5,6 +5,8 @@ import { getPublicClient } from '@aztec/ethereum/client';
|
|
|
5
5
|
import { getGenesisStateConfigEnvVars } from '@aztec/ethereum/config';
|
|
6
6
|
import { SecretValue } from '@aztec/foundation/config';
|
|
7
7
|
import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici';
|
|
8
|
+
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
9
|
+
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
8
10
|
import { ProvingJobConsumerSchema, createProvingJobBrokerClient } from '@aztec/prover-client/broker';
|
|
9
11
|
import { allPxeConfigMappings } from '@aztec/pxe/config';
|
|
10
12
|
import { AztecNodeAdminApiSchema, AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
@@ -70,7 +72,11 @@ export async function startNode(options, signalHandlers, services, adminServices
|
|
|
70
72
|
}
|
|
71
73
|
// Wait for a compatible rollup before proceeding with full L1 config fetch.
|
|
72
74
|
// This prevents crashes when the canonical rollup hasn't been upgraded yet.
|
|
73
|
-
await waitForCompatibleRollup(nodeConfig,
|
|
75
|
+
await waitForCompatibleRollup(nodeConfig, {
|
|
76
|
+
genesisArchiveRoot,
|
|
77
|
+
vkTreeRoot: getVKTreeRoot(),
|
|
78
|
+
protocolContractsHash
|
|
79
|
+
}, options.port, userLog);
|
|
74
80
|
const { addresses, config } = await getL1Config(nodeConfig.l1Contracts.registryAddress, nodeConfig.l1RpcUrls, nodeConfig.l1ChainId, nodeConfig.rollupVersion);
|
|
75
81
|
process.env.ROLLUP_CONTRACT_ADDRESS ??= addresses.rollupAddress.toString();
|
|
76
82
|
if (!Fr.fromHexString(config.genesisArchiveTreeRoot).equals(genesisArchiveRoot)) {
|
|
@@ -6,4 +6,4 @@ export declare function startProverBroker(options: any, signalHandlers: (() => P
|
|
|
6
6
|
broker: ProvingJobBroker;
|
|
7
7
|
config: ProverBrokerConfig;
|
|
8
8
|
}>;
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhcnRfcHJvdmVyX2Jyb2tlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaS9jbWRzL3N0YXJ0X3Byb3Zlcl9icm9rZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxLQUFLLEVBQUUscUJBQXFCLEVBQUUsTUFBTSxtQ0FBbUMsQ0FBQztBQUMvRSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUduRCxPQUFPLEVBQ0wsS0FBSyxrQkFBa0IsRUFLeEIsTUFBTSw2QkFBNkIsQ0FBQztBQUVyQyxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBTXhFLHdCQUFzQixpQkFBaUIsQ0FDckMsT0FBTyxFQUFFLEdBQUcsRUFDWixjQUFjLEVBQUUsQ0FBQyxNQUFNLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLEVBQ3ZDLFFBQVEsRUFBRSxxQkFBcUIsRUFDL0IsT0FBTyxFQUFFLEtBQUssR0FDYixPQUFPLENBQUM7SUFBRSxNQUFNLEVBQUUsZ0JBQWdCLENBQUM7SUFBQyxNQUFNLEVBQUUsa0JBQWtCLENBQUE7Q0FBRSxDQUFDLENBNENuRSJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_prover_broker.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_broker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"start_prover_broker.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_broker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EACL,KAAK,kBAAkB,EAKxB,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,CA4CnE"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { getL1Config } from '@aztec/cli/config';
|
|
2
2
|
import { getGenesisStateConfigEnvVars } from '@aztec/ethereum/config';
|
|
3
|
+
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
4
|
+
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
3
5
|
import { ProvingJobBrokerSchema, ProvingJobBrokerSchemaWithDebug, createAndStartProvingBroker, proverBrokerConfigMappings } from '@aztec/prover-client/broker';
|
|
4
6
|
import { getProverNodeBrokerConfigFromEnv } from '@aztec/prover-node';
|
|
5
7
|
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
@@ -19,7 +21,11 @@ export async function startProverBroker(options, signalHandlers, services, userL
|
|
|
19
21
|
}
|
|
20
22
|
const genesisConfig = getGenesisStateConfigEnvVars();
|
|
21
23
|
const { genesisArchiveRoot } = await computeExpectedGenesisRoot(genesisConfig, userLog);
|
|
22
|
-
await waitForCompatibleRollup(config,
|
|
24
|
+
await waitForCompatibleRollup(config, {
|
|
25
|
+
genesisArchiveRoot,
|
|
26
|
+
vkTreeRoot: getVKTreeRoot(),
|
|
27
|
+
protocolContractsHash
|
|
28
|
+
}, options.port, userLog);
|
|
23
29
|
const { addresses, config: rollupConfig } = await getL1Config(config.l1Contracts.registryAddress, config.l1RpcUrls, config.l1ChainId, config.rollupVersion);
|
|
24
30
|
config.l1Contracts = addresses;
|
|
25
31
|
config.rollupVersion = rollupConfig.rollupVersion;
|
|
@@ -61,17 +61,27 @@ import { join, resolve } from 'path';
|
|
|
61
61
|
const content = await readFile(tomlPath, 'utf-8').catch(()=>{
|
|
62
62
|
throw new Error(`Incorrectly defined dependency. Nargo.toml not found in ${absDir}`);
|
|
63
63
|
});
|
|
64
|
-
// We parse and iterate over the dependencies
|
|
65
64
|
const parsed = TOML.parse(content);
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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);
|
|
73
84
|
}
|
|
74
|
-
await visit(depPath);
|
|
75
85
|
}
|
|
76
86
|
}
|
|
77
87
|
}
|
|
@@ -16,4 +16,4 @@ export declare class EpochTestSettler {
|
|
|
16
16
|
stop(): Promise<void>;
|
|
17
17
|
handleEpochReadyToProve(epoch: EpochNumber): Promise<boolean>;
|
|
18
18
|
}
|
|
19
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXBvY2hfdGVzdF9zZXR0bGVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdGVzdGluZy9lcG9jaF90ZXN0X3NldHRsZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLEtBQUssYUFBYSxFQUFvQixNQUFNLHNCQUFzQixDQUFDO0FBQzVFLE9BQU8sRUFBRSxLQUFLLFdBQVcsRUFBYyxNQUFNLGlDQUFpQyxDQUFDO0FBQy9FLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBRXBELE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxhQUFhLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUdyRSxxQkFBYSxnQkFBZ0I7SUFPekIsT0FBTyxDQUFDLGFBQWE7SUFDckIsT0FBTyxDQUFDLEdBQUc7SUFDWCxPQUFPLENBQUMsT0FBTztJQVJqQixPQUFPLENBQUMsZ0JBQWdCLENBQW1CO0lBQzNDLE9BQU8sQ0FBQyxZQUFZLENBQUMsQ0FBZTtJQUVwQyxZQUNFLFVBQVUsRUFBRSxhQUFhLEVBQ3pCLGFBQWEsRUFBRSxVQUFVLEVBQ2pCLGFBQWEsRUFBRSxhQUFhLEVBQzVCLEdBQUcsRUFBRSxNQUFNLEVBQ1gsT0FBTyxFQUFFO1FBQUUsaUJBQWlCLEVBQUUsTUFBTSxDQUFDO1FBQUMsY0FBYyxDQUFDLEVBQUUsTUFBTSxDQUFBO0tBQUUsRUFHeEU7SUFFSyxLQUFLLGtCQUlWO0lBRUssSUFBSSxrQkFFVDtJQUVLLHVCQUF1QixDQUFDLEtBQUssRUFBRSxXQUFXLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQW9DbEU7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epoch_test_settler.d.ts","sourceRoot":"","sources":["../../src/testing/epoch_test_settler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,KAAK,WAAW,EAAc,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGrE,qBAAa,gBAAgB;IAOzB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,OAAO;IARjB,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,YAAY,CAAC,CAAe;IAEpC,YACE,UAAU,EAAE,aAAa,EACzB,aAAa,EAAE,UAAU,EACjB,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE;QAAE,iBAAiB,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,EAGxE;IAEK,KAAK,kBAIV;IAEK,IAAI,kBAET;IAEK,uBAAuB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"epoch_test_settler.d.ts","sourceRoot":"","sources":["../../src/testing/epoch_test_settler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,KAAK,WAAW,EAAc,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGrE,qBAAa,gBAAgB;IAOzB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,OAAO;IARjB,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,YAAY,CAAC,CAAe;IAEpC,YACE,UAAU,EAAE,aAAa,EACzB,aAAa,EAAE,UAAU,EACjB,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE;QAAE,iBAAiB,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,EAGxE;IAEK,KAAK,kBAIV;IAEK,IAAI,kBAET;IAEK,uBAAuB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAoClE;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RollupCheatCodes } from '@aztec/ethereum/test';
|
|
2
2
|
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
3
|
import { EpochMonitor } from '@aztec/prover-node';
|
|
4
|
-
import {
|
|
4
|
+
import { computeEpochOutHash } from '@aztec/stdlib/messaging';
|
|
5
5
|
export class EpochTestSettler {
|
|
6
6
|
l2BlockSource;
|
|
7
7
|
log;
|
|
@@ -44,9 +44,8 @@ export class EpochTestSettler {
|
|
|
44
44
|
}
|
|
45
45
|
messagesInEpoch[checkpointIndex].push(block.body.txEffects.map((txEffect)=>txEffect.l2ToL1Msgs));
|
|
46
46
|
}
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
-
const { root: outHash } = computeL2ToL1MembershipWitnessFromMessagesInEpoch(messagesInEpoch, firstMessage);
|
|
47
|
+
const outHash = computeEpochOutHash(messagesInEpoch);
|
|
48
|
+
if (!outHash.isZero()) {
|
|
50
49
|
await this.rollupCheatCodes.insertOutbox(epoch, outHash.toBigInt());
|
|
51
50
|
} else {
|
|
52
51
|
this.log.info(`No L2 to L1 messages in epoch ${epoch}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.6b113946b",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -28,39 +28,38 @@
|
|
|
28
28
|
"../package.common.json"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
32
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
33
|
-
"@aztec/aztec-
|
|
34
|
-
"@aztec/aztec
|
|
35
|
-
"@aztec/
|
|
36
|
-
"@aztec/bb
|
|
37
|
-
"@aztec/
|
|
38
|
-
"@aztec/
|
|
39
|
-
"@aztec/
|
|
40
|
-
"@aztec/
|
|
41
|
-
"@aztec/
|
|
42
|
-
"@aztec/
|
|
43
|
-
"@aztec/
|
|
44
|
-
"@aztec/
|
|
45
|
-
"@aztec/
|
|
46
|
-
"@aztec/
|
|
47
|
-
"@aztec/
|
|
48
|
-
"@aztec/
|
|
49
|
-
"@aztec/noir-
|
|
50
|
-
"@aztec/
|
|
51
|
-
"@aztec/p2p": "0.0.1-commit.
|
|
52
|
-
"@aztec/
|
|
53
|
-
"@aztec/
|
|
54
|
-
"@aztec/prover-
|
|
55
|
-
"@aztec/
|
|
56
|
-
"@aztec/
|
|
57
|
-
"@aztec/
|
|
58
|
-
"@aztec/
|
|
59
|
-
"@aztec/
|
|
60
|
-
"@aztec/
|
|
61
|
-
"@aztec/
|
|
62
|
-
"@aztec/
|
|
63
|
-
"@aztec/world-state": "0.0.1-commit.684755437",
|
|
31
|
+
"@aztec/accounts": "0.0.1-commit.6b113946b",
|
|
32
|
+
"@aztec/archiver": "0.0.1-commit.6b113946b",
|
|
33
|
+
"@aztec/aztec-node": "0.0.1-commit.6b113946b",
|
|
34
|
+
"@aztec/aztec.js": "0.0.1-commit.6b113946b",
|
|
35
|
+
"@aztec/bb-prover": "0.0.1-commit.6b113946b",
|
|
36
|
+
"@aztec/bb.js": "0.0.1-commit.6b113946b",
|
|
37
|
+
"@aztec/blob-client": "0.0.1-commit.6b113946b",
|
|
38
|
+
"@aztec/bot": "0.0.1-commit.6b113946b",
|
|
39
|
+
"@aztec/builder": "0.0.1-commit.6b113946b",
|
|
40
|
+
"@aztec/cli": "0.0.1-commit.6b113946b",
|
|
41
|
+
"@aztec/constants": "0.0.1-commit.6b113946b",
|
|
42
|
+
"@aztec/entrypoints": "0.0.1-commit.6b113946b",
|
|
43
|
+
"@aztec/ethereum": "0.0.1-commit.6b113946b",
|
|
44
|
+
"@aztec/foundation": "0.0.1-commit.6b113946b",
|
|
45
|
+
"@aztec/kv-store": "0.0.1-commit.6b113946b",
|
|
46
|
+
"@aztec/l1-artifacts": "0.0.1-commit.6b113946b",
|
|
47
|
+
"@aztec/node-lib": "0.0.1-commit.6b113946b",
|
|
48
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.6b113946b",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.6b113946b",
|
|
50
|
+
"@aztec/p2p": "0.0.1-commit.6b113946b",
|
|
51
|
+
"@aztec/p2p-bootstrap": "0.0.1-commit.6b113946b",
|
|
52
|
+
"@aztec/protocol-contracts": "0.0.1-commit.6b113946b",
|
|
53
|
+
"@aztec/prover-client": "0.0.1-commit.6b113946b",
|
|
54
|
+
"@aztec/prover-node": "0.0.1-commit.6b113946b",
|
|
55
|
+
"@aztec/pxe": "0.0.1-commit.6b113946b",
|
|
56
|
+
"@aztec/sequencer-client": "0.0.1-commit.6b113946b",
|
|
57
|
+
"@aztec/stdlib": "0.0.1-commit.6b113946b",
|
|
58
|
+
"@aztec/telemetry-client": "0.0.1-commit.6b113946b",
|
|
59
|
+
"@aztec/txe": "0.0.1-commit.6b113946b",
|
|
60
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.6b113946b",
|
|
61
|
+
"@aztec/wallets": "0.0.1-commit.6b113946b",
|
|
62
|
+
"@aztec/world-state": "0.0.1-commit.6b113946b",
|
|
64
63
|
"@iarna/toml": "^2.2.5",
|
|
65
64
|
"@types/chalk": "^2.2.0",
|
|
66
65
|
"abitype": "^0.8.11",
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from '@aztec/foundation/json-rpc/server';
|
|
8
8
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
9
9
|
import type { ChainConfig } from '@aztec/stdlib/config';
|
|
10
|
-
import { AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
10
|
+
import { AztecNodeAdminApiSchema, AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
11
11
|
import { getPackageVersion } from '@aztec/stdlib/update-checker';
|
|
12
12
|
import { getVersioningMiddleware } from '@aztec/stdlib/versioning';
|
|
13
13
|
import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
|
|
@@ -23,14 +23,14 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
23
23
|
const signalHandlers: Array<() => Promise<void>> = [];
|
|
24
24
|
const services: NamespacedApiHandlers = {};
|
|
25
25
|
const adminServices: NamespacedApiHandlers = {};
|
|
26
|
+
const packageVersion = getPackageVersion();
|
|
26
27
|
let config: ChainConfig | undefined = undefined;
|
|
27
28
|
|
|
28
29
|
if (options.localNetwork) {
|
|
29
|
-
const cliVersion = getPackageVersion() ?? 'unknown';
|
|
30
30
|
const localNetwork = extractNamespacedOptions(options, 'local-network');
|
|
31
31
|
localNetwork.testAccounts = true;
|
|
32
32
|
userLog(`${splash}\n${github}\n\n`);
|
|
33
|
-
userLog(`Setting up Aztec local network ${
|
|
33
|
+
userLog(`Setting up Aztec local network ${packageVersion ?? 'unknown'}, please stand by...`);
|
|
34
34
|
|
|
35
35
|
const { node, stop } = await createLocalNetwork(
|
|
36
36
|
{
|
|
@@ -50,6 +50,7 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
50
50
|
// Start Node and PXE JSON-RPC server
|
|
51
51
|
signalHandlers.push(stop);
|
|
52
52
|
services.node = [node, AztecNodeApiSchema];
|
|
53
|
+
adminServices.node = [node, AztecNodeAdminApiSchema];
|
|
53
54
|
} else {
|
|
54
55
|
// Route --prover-node through startNode
|
|
55
56
|
if (options.proverNode && !options.node) {
|
|
@@ -89,13 +90,14 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
89
90
|
|
|
90
91
|
installSignalHandlers(debugLogger.info, signalHandlers);
|
|
91
92
|
const versions = getVersions(config);
|
|
93
|
+
const versioningOpts = { packageVersion };
|
|
92
94
|
|
|
93
95
|
// Start the main JSON-RPC server
|
|
94
96
|
if (Object.entries(services).length > 0) {
|
|
95
97
|
const rpcServer = createNamespacedSafeJsonRpcServer(services, {
|
|
96
98
|
http200OnError: false,
|
|
97
99
|
log: debugLogger,
|
|
98
|
-
middlewares: [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions)],
|
|
100
|
+
middlewares: [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions, versioningOpts)],
|
|
99
101
|
maxBatchSize: options.rpcMaxBatchSize,
|
|
100
102
|
maxBodySizeBytes: options.rpcMaxBodySize,
|
|
101
103
|
});
|
|
@@ -105,7 +107,7 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
105
107
|
|
|
106
108
|
// If there are any admin services, start a separate JSON-RPC server for them
|
|
107
109
|
if (Object.entries(adminServices).length > 0) {
|
|
108
|
-
const adminMiddlewares = [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions)];
|
|
110
|
+
const adminMiddlewares = [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions, versioningOpts)];
|
|
109
111
|
|
|
110
112
|
// Resolve the admin API key (auto-generated and persisted, or opt-out)
|
|
111
113
|
const apiKeyResolution = await resolveAdminApiKey(
|
package/src/cli/cmds/compile.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { findBbBinary } from '@aztec/bb.js';
|
|
1
2
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
3
|
|
|
3
4
|
import { execFileSync } from 'child_process';
|
|
@@ -144,7 +145,7 @@ async function compileAztecContract(nargoArgs: string[], log: LogFn): Promise<vo
|
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
const nargo = process.env.NARGO ?? 'nargo';
|
|
147
|
-
const bb = process.env.BB ?? 'bb';
|
|
148
|
+
const bb = process.env.BB ?? findBbBinary() ?? 'bb';
|
|
148
149
|
|
|
149
150
|
await run(nargo, ['compile', ...nargoArgs]);
|
|
150
151
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { findBbBinary } from '@aztec/bb.js';
|
|
1
2
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
3
|
|
|
3
4
|
import { readFile, rename, rm, writeFile } from 'fs/promises';
|
|
@@ -33,7 +34,7 @@ export async function profileFlamegraph(artifactPath: string, functionName: stri
|
|
|
33
34
|
await writeFile(functionArtifact, makeFunctionArtifact(artifact, func));
|
|
34
35
|
|
|
35
36
|
const profiler = process.env.PROFILER_PATH ?? 'noir-profiler';
|
|
36
|
-
const bb = process.env.BB ?? 'bb';
|
|
37
|
+
const bb = process.env.BB ?? findBbBinary() ?? 'bb';
|
|
37
38
|
|
|
38
39
|
await run(profiler, [
|
|
39
40
|
'gates',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { findBbBinary } from '@aztec/bb.js';
|
|
1
2
|
import { asyncPool } from '@aztec/foundation/async-pool';
|
|
2
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
4
|
|
|
@@ -32,7 +33,7 @@ async function getGateCount(bb: string, artifactPath: string): Promise<number> {
|
|
|
32
33
|
|
|
33
34
|
/** Profiles all compiled artifacts in a target directory and prints gate counts. */
|
|
34
35
|
export async function profileGates(targetDir: string, log: LogFn): Promise<void> {
|
|
35
|
-
const bb = process.env.BB ?? 'bb';
|
|
36
|
+
const bb = process.env.BB ?? findBbBinary() ?? 'bb';
|
|
36
37
|
const { artifacts, tmpDir } = await discoverArtifacts(targetDir);
|
|
37
38
|
|
|
38
39
|
if (artifacts.length === 0) {
|
package/src/cli/cmds/standby.ts
CHANGED
|
@@ -35,10 +35,33 @@ export async function computeExpectedGenesisRoot(config: GenesisStateConfig, use
|
|
|
35
35
|
return { genesisArchiveRoot, prefilledPublicData };
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
async function checkRollupCompatibility(
|
|
39
|
+
rollup: RollupContract,
|
|
40
|
+
expected: { genesisArchiveRoot: Fr; vkTreeRoot: Fr; protocolContractsHash: Fr },
|
|
41
|
+
): Promise<string[]> {
|
|
42
|
+
const mismatches: string[] = [];
|
|
43
|
+
const [l1Genesis, l1Vk, l1Protocol] = await Promise.all([
|
|
44
|
+
rollup.getGenesisArchiveTreeRoot(),
|
|
45
|
+
rollup.getVkTreeRoot(),
|
|
46
|
+
rollup.getProtocolContractsHash(),
|
|
47
|
+
]);
|
|
48
|
+
if (!l1Genesis.equals(expected.genesisArchiveRoot)) {
|
|
49
|
+
mismatches.push(`genesis archive root (expected ${expected.genesisArchiveRoot}, got ${l1Genesis})`);
|
|
50
|
+
}
|
|
51
|
+
if (!l1Vk.equals(expected.vkTreeRoot)) {
|
|
52
|
+
mismatches.push(`VK tree root (expected ${expected.vkTreeRoot}, got ${l1Vk})`);
|
|
53
|
+
}
|
|
54
|
+
if (!l1Protocol.equals(expected.protocolContractsHash)) {
|
|
55
|
+
mismatches.push(`protocol contracts hash (expected ${expected.protocolContractsHash}, got ${l1Protocol})`);
|
|
56
|
+
}
|
|
57
|
+
return mismatches;
|
|
58
|
+
}
|
|
59
|
+
|
|
38
60
|
/**
|
|
39
|
-
* Waits until the canonical rollup's genesis archive root
|
|
40
|
-
* If the rollup is not yet compatible (e.g. during L1 contract upgrades),
|
|
41
|
-
* starts a lightweight HTTP server for K8s liveness probes and polls every 60s
|
|
61
|
+
* Waits until the canonical rollup's genesis archive root, VK tree root, and protocol contracts hash
|
|
62
|
+
* all match the expected local values. If the rollup is not yet compatible (e.g. during L1 contract upgrades),
|
|
63
|
+
* enters standby mode: starts a lightweight HTTP server for K8s liveness probes and polls every 60s
|
|
64
|
+
* until a compatible rollup appears.
|
|
42
65
|
*/
|
|
43
66
|
export async function waitForCompatibleRollup(
|
|
44
67
|
config: {
|
|
@@ -47,7 +70,7 @@ export async function waitForCompatibleRollup(
|
|
|
47
70
|
l1Contracts: { registryAddress: EthAddress };
|
|
48
71
|
rollupVersion?: number;
|
|
49
72
|
},
|
|
50
|
-
|
|
73
|
+
expected: { genesisArchiveRoot: Fr; vkTreeRoot: Fr; protocolContractsHash: Fr },
|
|
51
74
|
port: number | undefined,
|
|
52
75
|
userLog: LogFn,
|
|
53
76
|
): Promise<void> {
|
|
@@ -58,21 +81,19 @@ export async function waitForCompatibleRollup(
|
|
|
58
81
|
const rollupAddress = await registry.getRollupAddress(rollupVersion);
|
|
59
82
|
const rollup = new RollupContract(publicClient, rollupAddress.toString());
|
|
60
83
|
|
|
61
|
-
let
|
|
84
|
+
let mismatches: string[];
|
|
62
85
|
try {
|
|
63
|
-
|
|
86
|
+
mismatches = await checkRollupCompatibility(rollup, expected);
|
|
64
87
|
} catch (err: any) {
|
|
65
|
-
throw new Error(
|
|
66
|
-
`Could not retrieve genesis archive root from canonical rollup at ${rollupAddress}: ${err.message}`,
|
|
67
|
-
);
|
|
88
|
+
throw new Error(`Could not retrieve rollup config from canonical rollup at ${rollupAddress}: ${err.message}`);
|
|
68
89
|
}
|
|
69
90
|
|
|
70
|
-
if (
|
|
91
|
+
if (mismatches.length === 0) {
|
|
71
92
|
return;
|
|
72
93
|
}
|
|
73
94
|
|
|
74
95
|
userLog(
|
|
75
|
-
`
|
|
96
|
+
`Rollup at ${rollupAddress} is incompatible: ${mismatches.join('; ')}. ` +
|
|
76
97
|
`Entering standby mode. Will poll every ${ROLLUP_POLL_INTERVAL_S}s for a compatible rollup...`,
|
|
77
98
|
);
|
|
78
99
|
|
|
@@ -85,20 +106,20 @@ export async function waitForCompatibleRollup(
|
|
|
85
106
|
const currentRollupAddress = await registry.getRollupAddress(rollupVersion);
|
|
86
107
|
const currentRollup = new RollupContract(publicClient, currentRollupAddress.toString());
|
|
87
108
|
|
|
88
|
-
let
|
|
109
|
+
let currentMismatches: string[];
|
|
89
110
|
try {
|
|
90
|
-
|
|
111
|
+
currentMismatches = await checkRollupCompatibility(currentRollup, expected);
|
|
91
112
|
} catch {
|
|
92
|
-
userLog(`Failed to fetch
|
|
113
|
+
userLog(`Failed to fetch rollup config from rollup at ${currentRollupAddress}. Retrying...`);
|
|
93
114
|
return undefined;
|
|
94
115
|
}
|
|
95
116
|
|
|
96
|
-
if (
|
|
117
|
+
if (currentMismatches.length === 0) {
|
|
97
118
|
userLog(`Compatible rollup found at ${currentRollupAddress}. Exiting standby mode.`);
|
|
98
119
|
return true;
|
|
99
120
|
}
|
|
100
121
|
|
|
101
|
-
userLog(`Still waiting. Rollup at ${currentRollupAddress}
|
|
122
|
+
userLog(`Still waiting. Rollup at ${currentRollupAddress}: ${currentMismatches.join('; ')}.`);
|
|
102
123
|
return undefined;
|
|
103
124
|
},
|
|
104
125
|
'compatible rollup',
|
|
@@ -7,6 +7,8 @@ import { type NetworkNames, SecretValue } from '@aztec/foundation/config';
|
|
|
7
7
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
8
8
|
import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici';
|
|
9
9
|
import type { LogFn } from '@aztec/foundation/log';
|
|
10
|
+
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
11
|
+
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
10
12
|
import { ProvingJobConsumerSchema, createProvingJobBrokerClient } from '@aztec/prover-client/broker';
|
|
11
13
|
import { type CliPXEOptions, type PXEConfig, allPxeConfigMappings } from '@aztec/pxe/config';
|
|
12
14
|
import { AztecNodeAdminApiSchema, AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
@@ -92,7 +94,12 @@ export async function startNode(
|
|
|
92
94
|
|
|
93
95
|
// Wait for a compatible rollup before proceeding with full L1 config fetch.
|
|
94
96
|
// This prevents crashes when the canonical rollup hasn't been upgraded yet.
|
|
95
|
-
await waitForCompatibleRollup(
|
|
97
|
+
await waitForCompatibleRollup(
|
|
98
|
+
nodeConfig,
|
|
99
|
+
{ genesisArchiveRoot, vkTreeRoot: getVKTreeRoot(), protocolContractsHash },
|
|
100
|
+
options.port,
|
|
101
|
+
userLog,
|
|
102
|
+
);
|
|
96
103
|
|
|
97
104
|
const { addresses, config } = await getL1Config(
|
|
98
105
|
nodeConfig.l1Contracts.registryAddress,
|
|
@@ -2,6 +2,8 @@ import { getL1Config } from '@aztec/cli/config';
|
|
|
2
2
|
import { getGenesisStateConfigEnvVars } from '@aztec/ethereum/config';
|
|
3
3
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
4
4
|
import type { LogFn } from '@aztec/foundation/log';
|
|
5
|
+
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
6
|
+
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
5
7
|
import {
|
|
6
8
|
type ProverBrokerConfig,
|
|
7
9
|
ProvingJobBrokerSchema,
|
|
@@ -38,7 +40,12 @@ export async function startProverBroker(
|
|
|
38
40
|
|
|
39
41
|
const genesisConfig = getGenesisStateConfigEnvVars();
|
|
40
42
|
const { genesisArchiveRoot } = await computeExpectedGenesisRoot(genesisConfig, userLog);
|
|
41
|
-
await waitForCompatibleRollup(
|
|
43
|
+
await waitForCompatibleRollup(
|
|
44
|
+
config,
|
|
45
|
+
{ genesisArchiveRoot, vkTreeRoot: getVKTreeRoot(), protocolContractsHash },
|
|
46
|
+
options.port,
|
|
47
|
+
userLog,
|
|
48
|
+
);
|
|
42
49
|
|
|
43
50
|
const { addresses, config: rollupConfig } = await getL1Config(
|
|
44
51
|
config.l1Contracts.registryAddress,
|
|
@@ -73,19 +73,31 @@ async function collectCrateDirs(startCrateDir: string): Promise<string[]> {
|
|
|
73
73
|
throw new Error(`Incorrectly defined dependency. Nargo.toml not found in ${absDir}`);
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
// We parse and iterate over the dependencies
|
|
77
76
|
const parsed = TOML.parse(content) as Record<string, any>;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
|
|
78
|
+
const members = (parsed.workspace as Record<string, any>)?.members as string[] | undefined;
|
|
79
|
+
|
|
80
|
+
// A Nargo.toml is either a workspace root (has workspace.members) or a single crate (has dependencies).
|
|
81
|
+
if (Array.isArray(members)) {
|
|
82
|
+
// The crate is a workspace root and has members defined so we visit the members
|
|
83
|
+
for (const member of members) {
|
|
84
|
+
const memberPath = resolve(absDir, member);
|
|
85
|
+
await visit(memberPath);
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
// The crate is not a workspace root so we check for dependencies
|
|
89
|
+
const deps = (parsed.dependencies as Record<string, any>) ?? {};
|
|
90
|
+
for (const dep of Object.values(deps)) {
|
|
91
|
+
if (dep && typeof dep === 'object' && typeof dep.path === 'string') {
|
|
92
|
+
const depPath = resolve(absDir, dep.path);
|
|
93
|
+
const s = await stat(depPath);
|
|
94
|
+
if (!s.isDirectory()) {
|
|
95
|
+
throw new Error(
|
|
96
|
+
`Dependency path "${dep.path}" in ${tomlPath} resolves to ${depPath} which is not a directory`,
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
await visit(depPath);
|
|
87
100
|
}
|
|
88
|
-
await visit(depPath);
|
|
89
101
|
}
|
|
90
102
|
}
|
|
91
103
|
}
|
|
@@ -4,7 +4,7 @@ import { type EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
|
4
4
|
import type { Logger } from '@aztec/foundation/log';
|
|
5
5
|
import { EpochMonitor } from '@aztec/prover-node';
|
|
6
6
|
import type { EthAddress, L2BlockSource } from '@aztec/stdlib/block';
|
|
7
|
-
import {
|
|
7
|
+
import { computeEpochOutHash } from '@aztec/stdlib/messaging';
|
|
8
8
|
|
|
9
9
|
export class EpochTestSettler {
|
|
10
10
|
private rollupCheatCodes: RollupCheatCodes;
|
|
@@ -51,9 +51,8 @@ export class EpochTestSettler {
|
|
|
51
51
|
messagesInEpoch[checkpointIndex].push(block.body.txEffects.map(txEffect => txEffect.l2ToL1Msgs));
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const { root: outHash } = computeL2ToL1MembershipWitnessFromMessagesInEpoch(messagesInEpoch, firstMessage);
|
|
54
|
+
const outHash = computeEpochOutHash(messagesInEpoch);
|
|
55
|
+
if (!outHash.isZero()) {
|
|
57
56
|
await this.rollupCheatCodes.insertOutbox(epoch, outHash.toBigInt());
|
|
58
57
|
} else {
|
|
59
58
|
this.log.info(`No L2 to L1 messages in epoch ${epoch}`);
|