@aztec/aztec 4.1.0-rc.2 → 4.1.0-rc.3
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 +7 -4
- 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/local-network/local-network.d.ts +1 -1
- package/dest/local-network/local-network.d.ts.map +1 -1
- package/dest/local-network/local-network.js +1 -29
- 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/dest/testing/index.d.ts +2 -1
- package/dest/testing/index.d.ts.map +1 -1
- package/dest/testing/index.js +1 -0
- package/dest/testing/token_allowed_setup.d.ts +7 -0
- package/dest/testing/token_allowed_setup.d.ts.map +1 -0
- package/dest/testing/token_allowed_setup.js +20 -0
- package/package.json +34 -34
- package/src/cli/aztec_start_action.ts +5 -4
- 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/local-network/local-network.ts +2 -37
- package/src/testing/epoch_test_settler.ts +3 -4
- package/src/testing/index.ts +1 -0
- package/src/testing/token_allowed_setup.ts +19 -0
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXp0ZWNfc3RhcnRfYWN0aW9uLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY2xpL2F6dGVjX3N0YXJ0X2FjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPQSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFhM0Qsd0JBQXNCLFVBQVUsQ0FBQyxPQUFPLEVBQUUsR0FBRyxFQUFFLE9BQU8sRUFBRSxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0saUJBMElqRiJ9
|
|
@@ -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,iBA0IjF"}
|
|
@@ -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,
|
|
@@ -75,6 +75,9 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
75
75
|
}
|
|
76
76
|
installSignalHandlers(debugLogger.info, signalHandlers);
|
|
77
77
|
const versions = getVersions(config);
|
|
78
|
+
const versioningOpts = {
|
|
79
|
+
packageVersion
|
|
80
|
+
};
|
|
78
81
|
// Start the main JSON-RPC server
|
|
79
82
|
if (Object.entries(services).length > 0) {
|
|
80
83
|
const rpcServer = createNamespacedSafeJsonRpcServer(services, {
|
|
@@ -82,7 +85,7 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
82
85
|
log: debugLogger,
|
|
83
86
|
middlewares: [
|
|
84
87
|
getOtelJsonRpcPropagationMiddleware(),
|
|
85
|
-
getVersioningMiddleware(versions)
|
|
88
|
+
getVersioningMiddleware(versions, versioningOpts)
|
|
86
89
|
],
|
|
87
90
|
maxBatchSize: options.rpcMaxBatchSize,
|
|
88
91
|
maxBodySizeBytes: options.rpcMaxBodySize
|
|
@@ -96,7 +99,7 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
96
99
|
if (Object.entries(adminServices).length > 0) {
|
|
97
100
|
const adminMiddlewares = [
|
|
98
101
|
getOtelJsonRpcPropagationMiddleware(),
|
|
99
|
-
getVersioningMiddleware(versions)
|
|
102
|
+
getVersioningMiddleware(versions, versioningOpts)
|
|
100
103
|
];
|
|
101
104
|
// Resolve the admin API key (auto-generated and persisted, or opt-out)
|
|
102
105
|
const apiKeyResolution = await resolveAdminApiKey({
|
|
@@ -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;
|
|
@@ -70,4 +70,4 @@ export declare function createAztecNode(config?: Partial<AztecNodeConfig>, deps?
|
|
|
70
70
|
}, options?: {
|
|
71
71
|
prefilledPublicData?: PublicDataTreeLeaf[];
|
|
72
72
|
}): Promise<AztecNodeService>;
|
|
73
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
73
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWwtbmV0d29yay5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xvY2FsLW5ldHdvcmsvbG9jYWwtbmV0d29yay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBRUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDckQsT0FBTyxFQUFFLEtBQUssZUFBZSxFQUFvQixNQUFNLDBCQUEwQixDQUFDO0FBQ2xGLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUU1QyxPQUFPLEVBQUUsS0FBSyxtQkFBbUIsRUFBb0IsTUFBTSwyQkFBMkIsQ0FBQztBQVN2RixPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDM0QsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFDbkQsT0FBTyxFQUFFLFlBQVksRUFBb0IsTUFBTSx5QkFBeUIsQ0FBQztBQUt6RSxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ3hFLE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDOUQsT0FBTyxFQUNMLEtBQUssZUFBZSxFQUdyQixNQUFNLHlCQUF5QixDQUFDO0FBS2pDLE9BQU8sRUFBRSxLQUFLLEdBQUcsRUFBMkQsTUFBTSxNQUFNLENBQUM7QUFnQnpGOzs7O0dBSUc7QUFDSCx3QkFBc0IsbUJBQW1CLENBQ3ZDLGVBQWUsRUFBRSxlQUFlLEVBQ2hDLFVBQVUsRUFBRSxHQUFHLEVBQ2YsSUFBSSxHQUFFO0lBQ0osa0JBQWtCLENBQUMsRUFBRSxFQUFFLENBQUM7SUFDeEIsNEJBQTRCLENBQUMsRUFBRSxNQUFNLENBQUM7Q0FDbEM7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBb0JQO0FBRUQsOEJBQThCO0FBQzlCLE1BQU0sTUFBTSxrQkFBa0IsR0FBRyxlQUFlLEdBQUc7SUFDakQsMERBQTBEO0lBQzFELFVBQVUsRUFBRSxNQUFNLENBQUM7SUFDbkIsNkRBQTZEO0lBQzdELFlBQVksRUFBRSxPQUFPLENBQUM7Q0FDdkIsQ0FBQztBQUVGOzs7O0dBSUc7QUFDSCx3QkFBc0Isa0JBQWtCLENBQUMsTUFBTSx5Q0FBa0MsRUFBRSxPQUFPLEVBQUUsS0FBSzs7O0dBd0poRztBQUVEOzs7R0FHRztBQUNILHdCQUFzQixlQUFlLENBQ25DLE1BQU0sR0FBRSxPQUFPLENBQUMsZUFBZSxDQUFNLEVBQ3JDLElBQUksR0FBRTtJQUNKLFNBQVMsQ0FBQyxFQUFFLGVBQWUsQ0FBQztJQUM1QixVQUFVLENBQUMsRUFBRSxtQkFBbUIsQ0FBQztJQUNqQyxZQUFZLENBQUMsRUFBRSxZQUFZLENBQUM7SUFDNUIsWUFBWSxDQUFDLEVBQUUsZ0JBQWdCLENBQUM7Q0FDNUIsRUFDTixPQUFPLEdBQUU7SUFBRSxtQkFBbUIsQ0FBQyxFQUFFLGtCQUFrQixFQUFFLENBQUE7Q0FBTyw2QkFlN0QifQ==
|
|
@@ -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;
|
|
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,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,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,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAA;CAAO,6BAe7D"}
|
|
@@ -15,13 +15,10 @@ import { EthCheatCodes } from '@aztec/ethereum/test';
|
|
|
15
15
|
import { SecretValue } from '@aztec/foundation/config';
|
|
16
16
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
17
17
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
18
|
-
import { TokenContractArtifact } from '@aztec/noir-contracts.js/Token';
|
|
19
18
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
20
19
|
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
21
20
|
import { SequencerState } from '@aztec/sequencer-client';
|
|
22
|
-
import { FunctionSelector, countArgumentsSize } from '@aztec/stdlib/abi';
|
|
23
21
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
24
|
-
import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
25
22
|
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
26
23
|
import { EmbeddedWallet } from '@aztec/wallets/embedded';
|
|
27
24
|
import { deployFundedSchnorrAccounts } from '@aztec/wallets/testing';
|
|
@@ -33,35 +30,10 @@ import { createAccountLogs } from '../cli/util.js';
|
|
|
33
30
|
import { DefaultMnemonic } from '../mnemonic.js';
|
|
34
31
|
import { AnvilTestWatcher } from '../testing/anvil_test_watcher.js';
|
|
35
32
|
import { EpochTestSettler } from '../testing/epoch_test_settler.js';
|
|
33
|
+
import { getTokenAllowedSetupFunctions } from '../testing/token_allowed_setup.js';
|
|
36
34
|
import { getBananaFPCAddress, setupBananaFPC } from './banana_fpc.js';
|
|
37
35
|
import { getSponsoredFPCAddress } from './sponsored_fpc.js';
|
|
38
36
|
const logger = createLogger('local-network');
|
|
39
|
-
/**
|
|
40
|
-
* Returns Token-specific allowlist entries for FPC-based fee payments.
|
|
41
|
-
* The local network deploys a banana FPC and Token contracts, so the node must allow Token setup functions.
|
|
42
|
-
*/ async function getTokenAllowedSetupFunctions() {
|
|
43
|
-
const tokenClassId = (await getContractClassFromArtifact(TokenContractArtifact)).id;
|
|
44
|
-
const allFunctions = TokenContractArtifact.functions.concat(TokenContractArtifact.nonDispatchPublicFunctions || []);
|
|
45
|
-
const getCalldataLength = (name)=>{
|
|
46
|
-
const fn = allFunctions.find((f)=>f.name === name);
|
|
47
|
-
return 1 + countArgumentsSize(fn);
|
|
48
|
-
};
|
|
49
|
-
const increaseBalanceSelector = await FunctionSelector.fromSignature('_increase_public_balance((Field),u128)');
|
|
50
|
-
const transferInPublicSelector = await FunctionSelector.fromSignature('transfer_in_public((Field),(Field),u128,Field)');
|
|
51
|
-
return [
|
|
52
|
-
{
|
|
53
|
-
classId: tokenClassId,
|
|
54
|
-
selector: increaseBalanceSelector,
|
|
55
|
-
calldataLength: getCalldataLength('_increase_public_balance'),
|
|
56
|
-
onlySelf: true
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
classId: tokenClassId,
|
|
60
|
-
selector: transferInPublicSelector,
|
|
61
|
-
calldataLength: getCalldataLength('transfer_in_public')
|
|
62
|
-
}
|
|
63
|
-
];
|
|
64
|
-
}
|
|
65
37
|
const localAnvil = foundry;
|
|
66
38
|
/**
|
|
67
39
|
* Function to deploy our L1 contracts to the local network L1
|
|
@@ -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/dest/testing/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { AnvilTestWatcher } from './anvil_test_watcher.js';
|
|
|
2
2
|
export { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
3
3
|
export { CheatCodes } from './cheat_codes.js';
|
|
4
4
|
export { EpochTestSettler } from './epoch_test_settler.js';
|
|
5
|
-
|
|
5
|
+
export { getTokenAllowedSetupFunctions } from './token_allowed_setup.js';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0aW5nL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQzNELE9BQU8sRUFBRSxhQUFhLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUN2RSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDOUMsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDM0QsT0FBTyxFQUFFLDZCQUE2QixFQUFFLE1BQU0sMEJBQTBCLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dest/testing/index.js
CHANGED
|
@@ -2,3 +2,4 @@ export { AnvilTestWatcher } from './anvil_test_watcher.js';
|
|
|
2
2
|
export { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
3
3
|
export { CheatCodes } from './cheat_codes.js';
|
|
4
4
|
export { EpochTestSettler } from './epoch_test_settler.js';
|
|
5
|
+
export { getTokenAllowedSetupFunctions } from './token_allowed_setup.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AllowedElement } from '@aztec/stdlib/interfaces/server';
|
|
2
|
+
/**
|
|
3
|
+
* Returns Token-specific allowlist entries needed for FPC-based fee payments.
|
|
4
|
+
* These are test-only: FPC-based fee payment with custom tokens won't work on mainnet alpha.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getTokenAllowedSetupFunctions(): Promise<AllowedElement[]>;
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW5fYWxsb3dlZF9zZXR1cC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Rlc3RpbmcvdG9rZW5fYWxsb3dlZF9zZXR1cC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHQSxPQUFPLEtBQUssRUFBRSxjQUFjLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUV0RTs7O0dBR0c7QUFDSCx3QkFBc0IsNkJBQTZCLElBQUksT0FBTyxDQUFDLGNBQWMsRUFBRSxDQUFDLENBUy9FIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token_allowed_setup.d.ts","sourceRoot":"","sources":["../../src/testing/token_allowed_setup.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE;;;GAGG;AACH,wBAAsB,6BAA6B,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAS/E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TokenContractArtifact } from '@aztec/noir-contracts.js/Token';
|
|
2
|
+
import { buildAllowedElement } from '@aztec/p2p/msg_validators';
|
|
3
|
+
import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
4
|
+
/**
|
|
5
|
+
* Returns Token-specific allowlist entries needed for FPC-based fee payments.
|
|
6
|
+
* These are test-only: FPC-based fee payment with custom tokens won't work on mainnet alpha.
|
|
7
|
+
*/ export async function getTokenAllowedSetupFunctions() {
|
|
8
|
+
const tokenClassId = (await getContractClassFromArtifact(TokenContractArtifact)).id;
|
|
9
|
+
const target = {
|
|
10
|
+
classId: tokenClassId
|
|
11
|
+
};
|
|
12
|
+
return Promise.all([
|
|
13
|
+
// Token: needed for private transfers via FPC (transfer_to_public enqueues this)
|
|
14
|
+
buildAllowedElement(TokenContractArtifact, target, '_increase_public_balance', {
|
|
15
|
+
onlySelf: true
|
|
16
|
+
}),
|
|
17
|
+
// Token: needed for public transfers via FPC (fee_entrypoint_public enqueues this)
|
|
18
|
+
buildAllowedElement(TokenContractArtifact, target, 'transfer_in_public')
|
|
19
|
+
]);
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec",
|
|
3
|
-
"version": "4.1.0-rc.
|
|
3
|
+
"version": "4.1.0-rc.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -28,39 +28,39 @@
|
|
|
28
28
|
"../package.common.json"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@aztec/accounts": "4.1.0-rc.
|
|
32
|
-
"@aztec/archiver": "4.1.0-rc.
|
|
33
|
-
"@aztec/aztec-faucet": "4.1.0-rc.
|
|
34
|
-
"@aztec/aztec-node": "4.1.0-rc.
|
|
35
|
-
"@aztec/aztec.js": "4.1.0-rc.
|
|
36
|
-
"@aztec/bb-prover": "4.1.0-rc.
|
|
37
|
-
"@aztec/bb.js": "4.1.0-rc.
|
|
38
|
-
"@aztec/blob-client": "4.1.0-rc.
|
|
39
|
-
"@aztec/bot": "4.1.0-rc.
|
|
40
|
-
"@aztec/builder": "4.1.0-rc.
|
|
41
|
-
"@aztec/cli": "4.1.0-rc.
|
|
42
|
-
"@aztec/constants": "4.1.0-rc.
|
|
43
|
-
"@aztec/entrypoints": "4.1.0-rc.
|
|
44
|
-
"@aztec/ethereum": "4.1.0-rc.
|
|
45
|
-
"@aztec/foundation": "4.1.0-rc.
|
|
46
|
-
"@aztec/kv-store": "4.1.0-rc.
|
|
47
|
-
"@aztec/l1-artifacts": "4.1.0-rc.
|
|
48
|
-
"@aztec/node-lib": "4.1.0-rc.
|
|
49
|
-
"@aztec/noir-contracts.js": "4.1.0-rc.
|
|
50
|
-
"@aztec/noir-protocol-circuits-types": "4.1.0-rc.
|
|
51
|
-
"@aztec/p2p": "4.1.0-rc.
|
|
52
|
-
"@aztec/p2p-bootstrap": "4.1.0-rc.
|
|
53
|
-
"@aztec/protocol-contracts": "4.1.0-rc.
|
|
54
|
-
"@aztec/prover-client": "4.1.0-rc.
|
|
55
|
-
"@aztec/prover-node": "4.1.0-rc.
|
|
56
|
-
"@aztec/pxe": "4.1.0-rc.
|
|
57
|
-
"@aztec/sequencer-client": "4.1.0-rc.
|
|
58
|
-
"@aztec/stdlib": "4.1.0-rc.
|
|
59
|
-
"@aztec/telemetry-client": "4.1.0-rc.
|
|
60
|
-
"@aztec/txe": "4.1.0-rc.
|
|
61
|
-
"@aztec/validator-ha-signer": "4.1.0-rc.
|
|
62
|
-
"@aztec/wallets": "4.1.0-rc.
|
|
63
|
-
"@aztec/world-state": "4.1.0-rc.
|
|
31
|
+
"@aztec/accounts": "4.1.0-rc.3",
|
|
32
|
+
"@aztec/archiver": "4.1.0-rc.3",
|
|
33
|
+
"@aztec/aztec-faucet": "4.1.0-rc.3",
|
|
34
|
+
"@aztec/aztec-node": "4.1.0-rc.3",
|
|
35
|
+
"@aztec/aztec.js": "4.1.0-rc.3",
|
|
36
|
+
"@aztec/bb-prover": "4.1.0-rc.3",
|
|
37
|
+
"@aztec/bb.js": "4.1.0-rc.3",
|
|
38
|
+
"@aztec/blob-client": "4.1.0-rc.3",
|
|
39
|
+
"@aztec/bot": "4.1.0-rc.3",
|
|
40
|
+
"@aztec/builder": "4.1.0-rc.3",
|
|
41
|
+
"@aztec/cli": "4.1.0-rc.3",
|
|
42
|
+
"@aztec/constants": "4.1.0-rc.3",
|
|
43
|
+
"@aztec/entrypoints": "4.1.0-rc.3",
|
|
44
|
+
"@aztec/ethereum": "4.1.0-rc.3",
|
|
45
|
+
"@aztec/foundation": "4.1.0-rc.3",
|
|
46
|
+
"@aztec/kv-store": "4.1.0-rc.3",
|
|
47
|
+
"@aztec/l1-artifacts": "4.1.0-rc.3",
|
|
48
|
+
"@aztec/node-lib": "4.1.0-rc.3",
|
|
49
|
+
"@aztec/noir-contracts.js": "4.1.0-rc.3",
|
|
50
|
+
"@aztec/noir-protocol-circuits-types": "4.1.0-rc.3",
|
|
51
|
+
"@aztec/p2p": "4.1.0-rc.3",
|
|
52
|
+
"@aztec/p2p-bootstrap": "4.1.0-rc.3",
|
|
53
|
+
"@aztec/protocol-contracts": "4.1.0-rc.3",
|
|
54
|
+
"@aztec/prover-client": "4.1.0-rc.3",
|
|
55
|
+
"@aztec/prover-node": "4.1.0-rc.3",
|
|
56
|
+
"@aztec/pxe": "4.1.0-rc.3",
|
|
57
|
+
"@aztec/sequencer-client": "4.1.0-rc.3",
|
|
58
|
+
"@aztec/stdlib": "4.1.0-rc.3",
|
|
59
|
+
"@aztec/telemetry-client": "4.1.0-rc.3",
|
|
60
|
+
"@aztec/txe": "4.1.0-rc.3",
|
|
61
|
+
"@aztec/validator-ha-signer": "4.1.0-rc.3",
|
|
62
|
+
"@aztec/wallets": "4.1.0-rc.3",
|
|
63
|
+
"@aztec/world-state": "4.1.0-rc.3",
|
|
64
64
|
"@types/chalk": "^2.2.0",
|
|
65
65
|
"abitype": "^0.8.11",
|
|
66
66
|
"chalk": "^5.3.0",
|
|
@@ -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
|
{
|
|
@@ -89,13 +89,14 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
89
89
|
|
|
90
90
|
installSignalHandlers(debugLogger.info, signalHandlers);
|
|
91
91
|
const versions = getVersions(config);
|
|
92
|
+
const versioningOpts = { packageVersion };
|
|
92
93
|
|
|
93
94
|
// Start the main JSON-RPC server
|
|
94
95
|
if (Object.entries(services).length > 0) {
|
|
95
96
|
const rpcServer = createNamespacedSafeJsonRpcServer(services, {
|
|
96
97
|
http200OnError: false,
|
|
97
98
|
log: debugLogger,
|
|
98
|
-
middlewares: [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions)],
|
|
99
|
+
middlewares: [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions, versioningOpts)],
|
|
99
100
|
maxBatchSize: options.rpcMaxBatchSize,
|
|
100
101
|
maxBodySizeBytes: options.rpcMaxBodySize,
|
|
101
102
|
});
|
|
@@ -105,7 +106,7 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
105
106
|
|
|
106
107
|
// If there are any admin services, start a separate JSON-RPC server for them
|
|
107
108
|
if (Object.entries(adminServices).length > 0) {
|
|
108
|
-
const adminMiddlewares = [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions)];
|
|
109
|
+
const adminMiddlewares = [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions, versioningOpts)];
|
|
109
110
|
|
|
110
111
|
// Resolve the admin API key (auto-generated and persisted, or opt-out)
|
|
111
112
|
const apiKeyResolution = await resolveAdminApiKey(
|
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,
|
|
@@ -16,15 +16,11 @@ import { SecretValue } from '@aztec/foundation/config';
|
|
|
16
16
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
17
17
|
import type { LogFn } from '@aztec/foundation/log';
|
|
18
18
|
import { DateProvider, TestDateProvider } from '@aztec/foundation/timer';
|
|
19
|
-
import { TokenContractArtifact } from '@aztec/noir-contracts.js/Token';
|
|
20
19
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
21
20
|
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
22
21
|
import { SequencerState } from '@aztec/sequencer-client';
|
|
23
|
-
import { FunctionSelector, countArgumentsSize } from '@aztec/stdlib/abi';
|
|
24
|
-
import type { FunctionAbi } from '@aztec/stdlib/abi';
|
|
25
22
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
26
|
-
import {
|
|
27
|
-
import type { AllowedElement, ProvingJobBroker } from '@aztec/stdlib/interfaces/server';
|
|
23
|
+
import type { ProvingJobBroker } from '@aztec/stdlib/interfaces/server';
|
|
28
24
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
29
25
|
import {
|
|
30
26
|
type TelemetryClient,
|
|
@@ -43,43 +39,12 @@ import { createAccountLogs } from '../cli/util.js';
|
|
|
43
39
|
import { DefaultMnemonic } from '../mnemonic.js';
|
|
44
40
|
import { AnvilTestWatcher } from '../testing/anvil_test_watcher.js';
|
|
45
41
|
import { EpochTestSettler } from '../testing/epoch_test_settler.js';
|
|
42
|
+
import { getTokenAllowedSetupFunctions } from '../testing/token_allowed_setup.js';
|
|
46
43
|
import { getBananaFPCAddress, setupBananaFPC } from './banana_fpc.js';
|
|
47
44
|
import { getSponsoredFPCAddress } from './sponsored_fpc.js';
|
|
48
45
|
|
|
49
46
|
const logger = createLogger('local-network');
|
|
50
47
|
|
|
51
|
-
/**
|
|
52
|
-
* Returns Token-specific allowlist entries for FPC-based fee payments.
|
|
53
|
-
* The local network deploys a banana FPC and Token contracts, so the node must allow Token setup functions.
|
|
54
|
-
*/
|
|
55
|
-
async function getTokenAllowedSetupFunctions(): Promise<AllowedElement[]> {
|
|
56
|
-
const tokenClassId = (await getContractClassFromArtifact(TokenContractArtifact)).id;
|
|
57
|
-
const allFunctions: FunctionAbi[] = (TokenContractArtifact.functions as FunctionAbi[]).concat(
|
|
58
|
-
TokenContractArtifact.nonDispatchPublicFunctions || [],
|
|
59
|
-
);
|
|
60
|
-
const getCalldataLength = (name: string) => {
|
|
61
|
-
const fn = allFunctions.find(f => f.name === name)!;
|
|
62
|
-
return 1 + countArgumentsSize(fn);
|
|
63
|
-
};
|
|
64
|
-
const increaseBalanceSelector = await FunctionSelector.fromSignature('_increase_public_balance((Field),u128)');
|
|
65
|
-
const transferInPublicSelector = await FunctionSelector.fromSignature(
|
|
66
|
-
'transfer_in_public((Field),(Field),u128,Field)',
|
|
67
|
-
);
|
|
68
|
-
return [
|
|
69
|
-
{
|
|
70
|
-
classId: tokenClassId,
|
|
71
|
-
selector: increaseBalanceSelector,
|
|
72
|
-
calldataLength: getCalldataLength('_increase_public_balance'),
|
|
73
|
-
onlySelf: true,
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
classId: tokenClassId,
|
|
77
|
-
selector: transferInPublicSelector,
|
|
78
|
-
calldataLength: getCalldataLength('transfer_in_public'),
|
|
79
|
-
},
|
|
80
|
-
];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
48
|
const localAnvil = foundry;
|
|
84
49
|
|
|
85
50
|
/**
|
|
@@ -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}`);
|
package/src/testing/index.ts
CHANGED
|
@@ -2,3 +2,4 @@ export { AnvilTestWatcher } from './anvil_test_watcher.js';
|
|
|
2
2
|
export { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
3
3
|
export { CheatCodes } from './cheat_codes.js';
|
|
4
4
|
export { EpochTestSettler } from './epoch_test_settler.js';
|
|
5
|
+
export { getTokenAllowedSetupFunctions } from './token_allowed_setup.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TokenContractArtifact } from '@aztec/noir-contracts.js/Token';
|
|
2
|
+
import { buildAllowedElement } from '@aztec/p2p/msg_validators';
|
|
3
|
+
import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
4
|
+
import type { AllowedElement } from '@aztec/stdlib/interfaces/server';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Returns Token-specific allowlist entries needed for FPC-based fee payments.
|
|
8
|
+
* These are test-only: FPC-based fee payment with custom tokens won't work on mainnet alpha.
|
|
9
|
+
*/
|
|
10
|
+
export async function getTokenAllowedSetupFunctions(): Promise<AllowedElement[]> {
|
|
11
|
+
const tokenClassId = (await getContractClassFromArtifact(TokenContractArtifact)).id;
|
|
12
|
+
const target = { classId: tokenClassId };
|
|
13
|
+
return Promise.all([
|
|
14
|
+
// Token: needed for private transfers via FPC (transfer_to_public enqueues this)
|
|
15
|
+
buildAllowedElement(TokenContractArtifact, target, '_increase_public_balance', { onlySelf: true }),
|
|
16
|
+
// Token: needed for public transfers via FPC (fee_entrypoint_public enqueues this)
|
|
17
|
+
buildAllowedElement(TokenContractArtifact, target, 'transfer_in_public'),
|
|
18
|
+
]);
|
|
19
|
+
}
|