@aztec/aztec 0.0.1-commit.f5d02921e → 0.0.1-commit.f7ea82942
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 -3
- package/dest/cli/aztec_start_options.d.ts +2 -2
- package/dest/cli/aztec_start_options.d.ts.map +1 -1
- package/dest/cli/aztec_start_options.js +13 -0
- package/dest/cli/cmds/compile.d.ts +1 -1
- package/dest/cli/cmds/compile.d.ts.map +1 -1
- package/dest/cli/cmds/compile.js +1 -14
- package/dest/cli/cmds/standby.d.ts +1 -1
- package/dest/cli/cmds/standby.js +2 -2
- package/dest/cli/cmds/start_archiver.d.ts +1 -1
- package/dest/cli/cmds/start_archiver.d.ts.map +1 -1
- package/dest/cli/cmds/start_archiver.js +3 -1
- package/dest/cli/cmds/start_node.d.ts +1 -1
- package/dest/cli/cmds/start_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_node.js +6 -20
- package/dest/cli/cmds/start_prover_agent.d.ts +1 -1
- package/dest/cli/cmds/start_prover_agent.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_agent.js +3 -15
- package/dest/cli/cmds/utils/warn_if_aztec_version_mismatch.d.ts +2 -2
- package/dest/cli/cmds/utils/warn_if_aztec_version_mismatch.d.ts.map +1 -1
- package/dest/cli/cmds/utils/warn_if_aztec_version_mismatch.js +33 -12
- package/dest/local-network/local-network.d.ts +3 -4
- package/dest/local-network/local-network.d.ts.map +1 -1
- package/dest/local-network/local-network.js +3 -3
- package/dest/testing/anvil_test_watcher.d.ts +7 -3
- package/dest/testing/anvil_test_watcher.d.ts.map +1 -1
- package/dest/testing/anvil_test_watcher.js +39 -13
- package/dest/testing/cheat_codes.d.ts +11 -15
- package/dest/testing/cheat_codes.d.ts.map +1 -1
- package/dest/testing/cheat_codes.js +33 -31
- package/dest/testing/index.d.ts +2 -2
- package/dest/testing/index.d.ts.map +1 -1
- package/package.json +33 -33
- package/scripts/aztec.sh +5 -1
- package/src/cli/aztec_start_action.ts +6 -3
- package/src/cli/aztec_start_options.ts +19 -2
- package/src/cli/cmds/compile.ts +1 -17
- package/src/cli/cmds/standby.ts +2 -2
- package/src/cli/cmds/start_archiver.ts +7 -1
- package/src/cli/cmds/start_node.ts +9 -11
- package/src/cli/cmds/start_prover_agent.ts +3 -6
- package/src/cli/cmds/utils/warn_if_aztec_version_mismatch.ts +35 -12
- package/src/local-network/local-network.ts +5 -5
- package/src/testing/anvil_test_watcher.ts +43 -12
- package/src/testing/cheat_codes.ts +41 -35
- package/src/testing/index.ts +1 -1
|
@@ -14,6 +14,7 @@ import { getAddress, getContract } from 'viem';
|
|
|
14
14
|
cheatcodes;
|
|
15
15
|
dateProvider;
|
|
16
16
|
isLocalNetwork;
|
|
17
|
+
isMarkingAsProven;
|
|
17
18
|
rollup;
|
|
18
19
|
rollupCheatCodes;
|
|
19
20
|
l2SlotDuration;
|
|
@@ -21,19 +22,16 @@ import { getAddress, getContract } from 'viem';
|
|
|
21
22
|
syncDateProviderPromise;
|
|
22
23
|
markingAsProvenRunningPromise;
|
|
23
24
|
logger;
|
|
24
|
-
isMarkingAsProven;
|
|
25
25
|
// Optional callback to check if there are pending txs in the mempool.
|
|
26
26
|
getPendingTxCount;
|
|
27
27
|
// Optional callback to check if the sequencer is actively building a block.
|
|
28
28
|
isSequencerBuilding;
|
|
29
29
|
// Tracks when we first observed the current unfilled slot with pending txs (real wall time).
|
|
30
30
|
unfilledSlotFirstSeen;
|
|
31
|
-
constructor(cheatcodes, rollupAddress, l1Client, dateProvider){
|
|
31
|
+
constructor(cheatcodes, rollupAddress, l1Client, dateProvider, opts = {}){
|
|
32
32
|
this.cheatcodes = cheatcodes;
|
|
33
33
|
this.dateProvider = dateProvider;
|
|
34
|
-
this.isLocalNetwork = false;
|
|
35
34
|
this.logger = createLogger(`aztecjs:utils:watcher`);
|
|
36
|
-
this.isMarkingAsProven = true;
|
|
37
35
|
this.rollup = getContract({
|
|
38
36
|
address: getAddress(rollupAddress.toString()),
|
|
39
37
|
abi: RollupAbi,
|
|
@@ -42,6 +40,8 @@ import { getAddress, getContract } from 'viem';
|
|
|
42
40
|
this.rollupCheatCodes = new RollupCheatCodes(this.cheatcodes, {
|
|
43
41
|
rollupAddress
|
|
44
42
|
});
|
|
43
|
+
this.isLocalNetwork = opts.isLocalNetwork ?? false;
|
|
44
|
+
this.isMarkingAsProven = opts.isMarkingAsProven ?? true;
|
|
45
45
|
this.logger.debug(`Watcher created for rollup at ${rollupAddress}`);
|
|
46
46
|
}
|
|
47
47
|
setIsMarkingAsProven(isMarkingAsProven) {
|
|
@@ -107,8 +107,19 @@ import { getAddress, getContract } from 'viem';
|
|
|
107
107
|
this.logger.warn(`L1 is ahead of wall time. Syncing wall time to L1 time`);
|
|
108
108
|
this.dateProvider.setTime(l1Time);
|
|
109
109
|
} else if (l1Time + Number(this.l2SlotDuration) * 1000 < wallTime) {
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
// Warp L1 to the slot boundary at-or-before wall time. Rounding to a slot boundary (rather than
|
|
111
|
+
// `ceil(wallTime / 1000)`) keeps this loop's target aligned with `warpTimeIfNeeded`'s
|
|
112
|
+
// `nextSlotTimestamp` target, avoiding a race where the two loops pick timestamps a fraction of
|
|
113
|
+
// a second apart and one of them is then rejected by anvil as non-monotonic.
|
|
114
|
+
const wallSec = Math.floor(wallTime / 1000);
|
|
115
|
+
const targetSlot = await this.rollup.read.getSlotAt([
|
|
116
|
+
BigInt(wallSec)
|
|
117
|
+
]);
|
|
118
|
+
const targetTimestamp = Number(await this.rollup.read.getTimestampForSlot([
|
|
119
|
+
targetSlot
|
|
120
|
+
]));
|
|
121
|
+
this.logger.warn(`L1 is more than 1 L2 slot behind wall time. Warping to slot ${targetSlot} boundary`);
|
|
122
|
+
await this.warpToTimestamp(targetTimestamp);
|
|
112
123
|
}
|
|
113
124
|
}
|
|
114
125
|
async warpTimeIfNeeded() {
|
|
@@ -124,8 +135,9 @@ import { getAddress, getContract } from 'viem';
|
|
|
124
135
|
]));
|
|
125
136
|
if (BigInt(currentSlot) === checkpointLog.slotNumber) {
|
|
126
137
|
// The current slot has been filled, we should jump to the next slot.
|
|
127
|
-
await this.warpToTimestamp(nextSlotTimestamp)
|
|
128
|
-
|
|
138
|
+
if (await this.warpToTimestamp(nextSlotTimestamp)) {
|
|
139
|
+
this.logger.info(`Slot ${currentSlot} was filled, jumped to next slot`);
|
|
140
|
+
}
|
|
129
141
|
return;
|
|
130
142
|
}
|
|
131
143
|
// If we are not in local network, we don't need to warp time
|
|
@@ -152,9 +164,10 @@ import { getAddress, getContract } from 'viem';
|
|
|
152
164
|
return;
|
|
153
165
|
}
|
|
154
166
|
if (realNow - this.unfilledSlotFirstSeen.realTime > 2000) {
|
|
155
|
-
await this.warpToTimestamp(nextSlotTimestamp)
|
|
167
|
+
if (await this.warpToTimestamp(nextSlotTimestamp)) {
|
|
168
|
+
this.logger.info(`Slot ${currentSlot} was missed with pending txs, jumped to next slot`);
|
|
169
|
+
}
|
|
156
170
|
this.unfilledSlotFirstSeen = undefined;
|
|
157
|
-
this.logger.info(`Slot ${currentSlot} was missed with pending txs, jumped to next slot`);
|
|
158
171
|
}
|
|
159
172
|
return;
|
|
160
173
|
}
|
|
@@ -162,20 +175,33 @@ import { getAddress, getContract } from 'viem';
|
|
|
162
175
|
// Fallback: warp when the dateProvider time has passed the next slot timestamp.
|
|
163
176
|
const currentTimestamp = this.dateProvider?.now() ?? Date.now();
|
|
164
177
|
if (currentTimestamp > nextSlotTimestamp * 1000) {
|
|
165
|
-
await this.warpToTimestamp(nextSlotTimestamp)
|
|
166
|
-
|
|
178
|
+
if (await this.warpToTimestamp(nextSlotTimestamp)) {
|
|
179
|
+
this.logger.info(`Slot ${currentSlot} was missed, jumped to next slot`);
|
|
180
|
+
}
|
|
167
181
|
}
|
|
168
182
|
} catch {
|
|
169
183
|
this.logger.error('mineIfSlotFilled failed');
|
|
170
184
|
}
|
|
171
185
|
}
|
|
172
|
-
|
|
186
|
+
/**
|
|
187
|
+
* Warps L1 to `timestamp`, unless L1 is already at or past it. Returns true when a warp actually
|
|
188
|
+
* happened, false when skipped or on error. Callers use the return value to gate success logs.
|
|
189
|
+
*/ async warpToTimestamp(timestamp) {
|
|
173
190
|
try {
|
|
191
|
+
// Anvil rejects evm_setNextBlockTimestamp values <= the current block's timestamp. The two
|
|
192
|
+
// watcher loops can race and pick targets a fraction of a second apart; skip here rather than
|
|
193
|
+
// letting the second one error out noisily.
|
|
194
|
+
const lastTimestamp = await this.cheatcodes.lastBlockTimestamp();
|
|
195
|
+
if (timestamp <= lastTimestamp) {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
174
198
|
await this.cheatcodes.warp(timestamp, {
|
|
175
199
|
resetBlockInterval: true
|
|
176
200
|
});
|
|
201
|
+
return true;
|
|
177
202
|
} catch (e) {
|
|
178
203
|
this.logger.error(`Failed to warp to timestamp ${timestamp}: ${e}`);
|
|
204
|
+
return false;
|
|
179
205
|
}
|
|
180
206
|
}
|
|
181
207
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
2
2
|
import type { DateProvider } from '@aztec/foundation/timer';
|
|
3
|
-
import type {
|
|
4
|
-
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
3
|
+
import type { AztecNode, AztecNodeDebug } from '@aztec/stdlib/interfaces/client';
|
|
5
4
|
/**
|
|
6
5
|
* A class that provides utility functions for interacting with the chain.
|
|
7
6
|
* @deprecated There used to be 3 kinds of cheat codes: eth, rollup and aztec. We have nuked the Aztec ones because
|
|
@@ -13,6 +12,7 @@ export declare class CheatCodes {
|
|
|
13
12
|
eth: EthCheatCodes;
|
|
14
13
|
/** Cheat codes for the Aztec Rollup contract on L1. */
|
|
15
14
|
rollup: RollupCheatCodes;
|
|
15
|
+
private logger;
|
|
16
16
|
constructor(
|
|
17
17
|
/** Cheat codes for L1.*/
|
|
18
18
|
eth: EthCheatCodes,
|
|
@@ -21,23 +21,19 @@ export declare class CheatCodes {
|
|
|
21
21
|
static create(rpcUrls: string[], node: AztecNode, dateProvider: DateProvider): Promise<CheatCodes>;
|
|
22
22
|
/**
|
|
23
23
|
* Warps the L1 timestamp to a target timestamp and mines an L2 block that advances the L2 timestamp to at least
|
|
24
|
-
* the target timestamp.
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @param sequencerClient - The sequencer client to use to force an empty block to be mined.
|
|
28
|
-
* @param node - The Aztec node used to query if a new block has been mined.
|
|
24
|
+
* the target timestamp. If the target timestamp falls within the current L2 slot (which already has a block),
|
|
25
|
+
* the timestamp is automatically adjusted forward to the start of the next slot so that `mineBlock()` succeeds.
|
|
26
|
+
* @param node - The Aztec node used to force an empty block to be mined.
|
|
29
27
|
* @param targetTimestamp - The target timestamp to warp to (in seconds)
|
|
30
28
|
*/
|
|
31
|
-
warpL2TimeAtLeastTo(
|
|
29
|
+
warpL2TimeAtLeastTo(node: AztecNodeDebug, targetTimestamp: bigint | number): Promise<void>;
|
|
32
30
|
/**
|
|
33
31
|
* Warps the L1 timestamp forward by a specified duration and mines an L2 block that advances the L2 timestamp at
|
|
34
|
-
* least by the duration.
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* @param sequencerClient - The sequencer client to use to force an empty block to be mined.
|
|
38
|
-
* @param node - The Aztec node used to query if a new block has been mined.
|
|
32
|
+
* least by the duration. If the duration is too short to cross an L2 slot boundary, the warp is automatically
|
|
33
|
+
* extended to the start of the next slot so that `mineBlock()` succeeds.
|
|
34
|
+
* @param node - The Aztec node used to force an empty block to be mined.
|
|
39
35
|
* @param duration - The duration to advance time by (in seconds)
|
|
40
36
|
*/
|
|
41
|
-
warpL2TimeAtLeastBy(
|
|
37
|
+
warpL2TimeAtLeastBy(node: AztecNodeDebug, duration: bigint | number): Promise<void>;
|
|
42
38
|
}
|
|
43
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
39
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlYXRfY29kZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0aW5nL2NoZWF0X2NvZGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxhQUFhLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUd2RSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUM1RCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsY0FBYyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFFakY7Ozs7O0dBS0c7QUFDSCxxQkFBYSxVQUFVO0lBSW5CLHlCQUF5QjtJQUNsQixHQUFHLEVBQUUsYUFBYTtJQUN6Qix1REFBdUQ7SUFDaEQsTUFBTSxFQUFFLGdCQUFnQjtJQU5qQyxPQUFPLENBQUMsTUFBTSxDQUF1QztJQUVyRDtJQUNFLHlCQUF5QjtJQUNsQixHQUFHLEVBQUUsYUFBYTtJQUN6Qix1REFBdUQ7SUFDaEQsTUFBTSxFQUFFLGdCQUFnQixFQUM3QjtJQUVKLE9BQWEsTUFBTSxDQUFDLE9BQU8sRUFBRSxNQUFNLEVBQUUsRUFBRSxJQUFJLEVBQUUsU0FBUyxFQUFFLFlBQVksRUFBRSxZQUFZLEdBQUcsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQU92RztJQUVEOzs7Ozs7T0FNRztJQUNHLG1CQUFtQixDQUFDLElBQUksRUFBRSxjQUFjLEVBQUUsZUFBZSxFQUFFLE1BQU0sR0FBRyxNQUFNLGlCQTRCL0U7SUFFRDs7Ozs7O09BTUc7SUFDRyxtQkFBbUIsQ0FBQyxJQUFJLEVBQUUsY0FBYyxFQUFFLFFBQVEsRUFBRSxNQUFNLEdBQUcsTUFBTSxpQkFReEU7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cheat_codes.d.ts","sourceRoot":"","sources":["../../src/testing/cheat_codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"cheat_codes.d.ts","sourceRoot":"","sources":["../../src/testing/cheat_codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjF;;;;;GAKG;AACH,qBAAa,UAAU;IAInB,yBAAyB;IAClB,GAAG,EAAE,aAAa;IACzB,uDAAuD;IAChD,MAAM,EAAE,gBAAgB;IANjC,OAAO,CAAC,MAAM,CAAuC;IAErD;IACE,yBAAyB;IAClB,GAAG,EAAE,aAAa;IACzB,uDAAuD;IAChD,MAAM,EAAE,gBAAgB,EAC7B;IAEJ,OAAa,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAOvG;IAED;;;;;;OAMG;IACG,mBAAmB,CAAC,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,iBA4B/E;IAED;;;;;;OAMG;IACG,mBAAmB,CAAC,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,iBAQxE;CACF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
2
|
-
import {
|
|
2
|
+
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
3
4
|
/**
|
|
4
5
|
* A class that provides utility functions for interacting with the chain.
|
|
5
6
|
* @deprecated There used to be 3 kinds of cheat codes: eth, rollup and aztec. We have nuked the Aztec ones because
|
|
@@ -8,9 +9,11 @@ import { retryUntil } from '@aztec/foundation/retry';
|
|
|
8
9
|
*/ export class CheatCodes {
|
|
9
10
|
eth;
|
|
10
11
|
rollup;
|
|
12
|
+
logger;
|
|
11
13
|
constructor(/** Cheat codes for L1.*/ eth, /** Cheat codes for the Aztec Rollup contract on L1. */ rollup){
|
|
12
14
|
this.eth = eth;
|
|
13
15
|
this.rollup = rollup;
|
|
16
|
+
this.logger = createLogger('aztecjs:cheat_codes');
|
|
14
17
|
}
|
|
15
18
|
static async create(rpcUrls, node, dateProvider) {
|
|
16
19
|
const ethCheatCodes = new EthCheatCodes(rpcUrls, dateProvider);
|
|
@@ -19,44 +22,43 @@ import { retryUntil } from '@aztec/foundation/retry';
|
|
|
19
22
|
}
|
|
20
23
|
/**
|
|
21
24
|
* Warps the L1 timestamp to a target timestamp and mines an L2 block that advances the L2 timestamp to at least
|
|
22
|
-
* the target timestamp.
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @param sequencerClient - The sequencer client to use to force an empty block to be mined.
|
|
26
|
-
* @param node - The Aztec node used to query if a new block has been mined.
|
|
25
|
+
* the target timestamp. If the target timestamp falls within the current L2 slot (which already has a block),
|
|
26
|
+
* the timestamp is automatically adjusted forward to the start of the next slot so that `mineBlock()` succeeds.
|
|
27
|
+
* @param node - The Aztec node used to force an empty block to be mined.
|
|
27
28
|
* @param targetTimestamp - The target timestamp to warp to (in seconds)
|
|
28
|
-
*/ async warpL2TimeAtLeastTo(
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
*/ async warpL2TimeAtLeastTo(node, targetTimestamp) {
|
|
30
|
+
const targetBigInt = BigInt(targetTimestamp);
|
|
31
|
+
const currentTimestamp = BigInt(await this.eth.lastBlockTimestamp());
|
|
32
|
+
if (targetBigInt <= currentTimestamp) {
|
|
33
|
+
throw new Error(`warpL2TimeAtLeastTo: target timestamp ${targetBigInt} is not in the future (current L1 timestamp is ${currentTimestamp}).`);
|
|
34
|
+
}
|
|
35
|
+
const currentSlot = await this.rollup.getSlot();
|
|
36
|
+
const targetSlot = await this.rollup.getSlotAt(targetBigInt);
|
|
37
|
+
let effectiveTimestamp = targetBigInt;
|
|
38
|
+
if (targetSlot <= currentSlot) {
|
|
39
|
+
// Target lands in the same (or earlier) slot — auto-adjust to the next slot's start.
|
|
40
|
+
const nextSlot = SlotNumber(currentSlot + 1);
|
|
41
|
+
const nextSlotTimestamp = await this.rollup.getTimestampForSlot(nextSlot);
|
|
42
|
+
this.logger.warn(`warpL2TimeAtLeastTo: target timestamp ${targetBigInt} falls in current slot ${currentSlot}. ` + `Auto-adjusting to start of slot ${nextSlot} at timestamp ${nextSlotTimestamp}.`);
|
|
43
|
+
effectiveTimestamp = nextSlotTimestamp;
|
|
44
|
+
}
|
|
45
|
+
await this.eth.warp(effectiveTimestamp, {
|
|
32
46
|
resetBlockInterval: true
|
|
33
47
|
});
|
|
34
|
-
|
|
35
|
-
const sequencer = sequencerClient.getSequencer();
|
|
36
|
-
const minTxsPerBlock = sequencer.getConfig().minTxsPerBlock;
|
|
37
|
-
sequencer.updateConfig({
|
|
38
|
-
minTxsPerBlock: 0
|
|
39
|
-
});
|
|
40
|
-
await retryUntil(async ()=>{
|
|
41
|
-
const newL2BlockNumber = await node.getBlockNumber();
|
|
42
|
-
return newL2BlockNumber > currentL2BlockNumber;
|
|
43
|
-
}, 'new block after warping L2 time', 36, 1);
|
|
44
|
-
// Restore original minTxsPerBlock
|
|
45
|
-
sequencer.updateConfig({
|
|
46
|
-
minTxsPerBlock
|
|
47
|
-
});
|
|
48
|
+
await node.mineBlock();
|
|
48
49
|
}
|
|
49
50
|
/**
|
|
50
51
|
* Warps the L1 timestamp forward by a specified duration and mines an L2 block that advances the L2 timestamp at
|
|
51
|
-
* least by the duration.
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* @param sequencerClient - The sequencer client to use to force an empty block to be mined.
|
|
55
|
-
* @param node - The Aztec node used to query if a new block has been mined.
|
|
52
|
+
* least by the duration. If the duration is too short to cross an L2 slot boundary, the warp is automatically
|
|
53
|
+
* extended to the start of the next slot so that `mineBlock()` succeeds.
|
|
54
|
+
* @param node - The Aztec node used to force an empty block to be mined.
|
|
56
55
|
* @param duration - The duration to advance time by (in seconds)
|
|
57
|
-
*/ async warpL2TimeAtLeastBy(
|
|
56
|
+
*/ async warpL2TimeAtLeastBy(node, duration) {
|
|
57
|
+
if (BigInt(duration) <= 0n) {
|
|
58
|
+
throw new Error(`warpL2TimeAtLeastBy: duration must be positive, got ${duration} seconds.`);
|
|
59
|
+
}
|
|
58
60
|
const currentTimestamp = await this.eth.lastBlockTimestamp();
|
|
59
61
|
const targetTimestamp = BigInt(currentTimestamp) + BigInt(duration);
|
|
60
|
-
await this.warpL2TimeAtLeastTo(
|
|
62
|
+
await this.warpL2TimeAtLeastTo(node, targetTimestamp);
|
|
61
63
|
}
|
|
62
64
|
}
|
package/dest/testing/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { AnvilTestWatcher } from './anvil_test_watcher.js';
|
|
1
|
+
export { AnvilTestWatcher, type AnvilTestWatcherOpts } 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,
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0aW5nL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxLQUFLLG9CQUFvQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDdEYsT0FBTyxFQUFFLGFBQWEsRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ3ZFLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUM5QyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUMzRCxPQUFPLEVBQUUsNkJBQTZCLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQyJ9
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACtF,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/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.f7ea82942",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -28,38 +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-node": "0.0.1-commit.
|
|
34
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
35
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
36
|
-
"@aztec/bb.js": "0.0.1-commit.
|
|
37
|
-
"@aztec/blob-client": "0.0.1-commit.
|
|
38
|
-
"@aztec/bot": "0.0.1-commit.
|
|
39
|
-
"@aztec/builder": "0.0.1-commit.
|
|
40
|
-
"@aztec/cli": "0.0.1-commit.
|
|
41
|
-
"@aztec/constants": "0.0.1-commit.
|
|
42
|
-
"@aztec/entrypoints": "0.0.1-commit.
|
|
43
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
44
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
45
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
46
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
47
|
-
"@aztec/node-lib": "0.0.1-commit.
|
|
48
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
50
|
-
"@aztec/p2p": "0.0.1-commit.
|
|
51
|
-
"@aztec/p2p-bootstrap": "0.0.1-commit.
|
|
52
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
53
|
-
"@aztec/prover-client": "0.0.1-commit.
|
|
54
|
-
"@aztec/prover-node": "0.0.1-commit.
|
|
55
|
-
"@aztec/pxe": "0.0.1-commit.
|
|
56
|
-
"@aztec/sequencer-client": "0.0.1-commit.
|
|
57
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
58
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
59
|
-
"@aztec/txe": "0.0.1-commit.
|
|
60
|
-
"@aztec/validator-ha-signer": "0.0.1-commit.
|
|
61
|
-
"@aztec/wallets": "0.0.1-commit.
|
|
62
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
31
|
+
"@aztec/accounts": "0.0.1-commit.f7ea82942",
|
|
32
|
+
"@aztec/archiver": "0.0.1-commit.f7ea82942",
|
|
33
|
+
"@aztec/aztec-node": "0.0.1-commit.f7ea82942",
|
|
34
|
+
"@aztec/aztec.js": "0.0.1-commit.f7ea82942",
|
|
35
|
+
"@aztec/bb-prover": "0.0.1-commit.f7ea82942",
|
|
36
|
+
"@aztec/bb.js": "0.0.1-commit.f7ea82942",
|
|
37
|
+
"@aztec/blob-client": "0.0.1-commit.f7ea82942",
|
|
38
|
+
"@aztec/bot": "0.0.1-commit.f7ea82942",
|
|
39
|
+
"@aztec/builder": "0.0.1-commit.f7ea82942",
|
|
40
|
+
"@aztec/cli": "0.0.1-commit.f7ea82942",
|
|
41
|
+
"@aztec/constants": "0.0.1-commit.f7ea82942",
|
|
42
|
+
"@aztec/entrypoints": "0.0.1-commit.f7ea82942",
|
|
43
|
+
"@aztec/ethereum": "0.0.1-commit.f7ea82942",
|
|
44
|
+
"@aztec/foundation": "0.0.1-commit.f7ea82942",
|
|
45
|
+
"@aztec/kv-store": "0.0.1-commit.f7ea82942",
|
|
46
|
+
"@aztec/l1-artifacts": "0.0.1-commit.f7ea82942",
|
|
47
|
+
"@aztec/node-lib": "0.0.1-commit.f7ea82942",
|
|
48
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.f7ea82942",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.f7ea82942",
|
|
50
|
+
"@aztec/p2p": "0.0.1-commit.f7ea82942",
|
|
51
|
+
"@aztec/p2p-bootstrap": "0.0.1-commit.f7ea82942",
|
|
52
|
+
"@aztec/protocol-contracts": "0.0.1-commit.f7ea82942",
|
|
53
|
+
"@aztec/prover-client": "0.0.1-commit.f7ea82942",
|
|
54
|
+
"@aztec/prover-node": "0.0.1-commit.f7ea82942",
|
|
55
|
+
"@aztec/pxe": "0.0.1-commit.f7ea82942",
|
|
56
|
+
"@aztec/sequencer-client": "0.0.1-commit.f7ea82942",
|
|
57
|
+
"@aztec/stdlib": "0.0.1-commit.f7ea82942",
|
|
58
|
+
"@aztec/telemetry-client": "0.0.1-commit.f7ea82942",
|
|
59
|
+
"@aztec/txe": "0.0.1-commit.f7ea82942",
|
|
60
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.f7ea82942",
|
|
61
|
+
"@aztec/wallets": "0.0.1-commit.f7ea82942",
|
|
62
|
+
"@aztec/world-state": "0.0.1-commit.f7ea82942",
|
|
63
63
|
"@iarna/toml": "^2.2.5",
|
|
64
64
|
"@types/chalk": "^2.2.0",
|
|
65
65
|
"abitype": "^0.8.11",
|
package/scripts/aztec.sh
CHANGED
|
@@ -23,10 +23,14 @@ case $cmd in
|
|
|
23
23
|
# Attempt to compile, no-op if there are no changes
|
|
24
24
|
node --no-warnings "$script_dir/../dest/bin/index.js" compile
|
|
25
25
|
|
|
26
|
-
export LOG_LEVEL="${LOG_LEVEL:-"error;trace:
|
|
26
|
+
export LOG_LEVEL="${LOG_LEVEL:-"error;trace:^contract:"}"
|
|
27
27
|
aztec start --txe --port 8081 &
|
|
28
28
|
server_pid=$!
|
|
29
29
|
trap 'kill $server_pid &>/dev/null || true' EXIT
|
|
30
|
+
if ! command -v nc &>/dev/null; then
|
|
31
|
+
echo "Error: 'nc' (netcat) is required but not installed." >&2
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
30
34
|
while ! nc -z 127.0.0.1 8081 &>/dev/null; do sleep 0.2; done
|
|
31
35
|
export NARGO_FOREIGN_CALL_TIMEOUT=300000
|
|
32
36
|
nargo test --silence-warnings --oracle-resolver http://127.0.0.1:8081 --test-threads 16 "$@"
|
|
@@ -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 { AztecNodeAdminApiSchema, AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
10
|
+
import { AztecNodeAdminApiSchema, AztecNodeApiSchema, AztecNodeDebugApiSchema } 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';
|
|
@@ -27,8 +27,7 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
27
27
|
let config: ChainConfig | undefined = undefined;
|
|
28
28
|
|
|
29
29
|
if (options.localNetwork) {
|
|
30
|
-
const localNetwork = extractNamespacedOptions(options, '
|
|
31
|
-
localNetwork.testAccounts = true;
|
|
30
|
+
const localNetwork = extractNamespacedOptions(options, 'localNetwork');
|
|
32
31
|
userLog(`${splash}\n${github}\n\n`);
|
|
33
32
|
userLog(`Setting up Aztec local network ${packageVersion ?? 'unknown'}, please stand by...`);
|
|
34
33
|
|
|
@@ -51,6 +50,7 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
51
50
|
signalHandlers.push(stop);
|
|
52
51
|
services.node = [node, AztecNodeApiSchema];
|
|
53
52
|
adminServices.node = [node, AztecNodeAdminApiSchema];
|
|
53
|
+
services.nodeDebug = [node, AztecNodeDebugApiSchema];
|
|
54
54
|
} else {
|
|
55
55
|
// Route --prover-node through startNode
|
|
56
56
|
if (options.proverNode && !options.node) {
|
|
@@ -61,6 +61,9 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
61
61
|
const { startNode } = await import('./cmds/start_node.js');
|
|
62
62
|
const networkName = getActiveNetworkName(options.network);
|
|
63
63
|
({ config } = await startNode(options, signalHandlers, services, adminServices, userLog, networkName));
|
|
64
|
+
if (options.nodeDebug && services.node) {
|
|
65
|
+
services.nodeDebug = [services.node[0], AztecNodeDebugApiSchema];
|
|
66
|
+
}
|
|
64
67
|
} else if (options.bot) {
|
|
65
68
|
const { startBot } = await import('./cmds/start_bot.js');
|
|
66
69
|
await startBot(options, signalHandlers, services, userLog);
|
|
@@ -36,7 +36,7 @@ export interface AztecStartOption {
|
|
|
36
36
|
parseVal?: (val: string) => any;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
export const getOptions = (namespace: string, configMappings: Record<string, ConfigMapping
|
|
39
|
+
export const getOptions = (namespace: string, configMappings: Record<string, ConfigMapping<unknown>>) => {
|
|
40
40
|
const options: AztecStartOption[] = [];
|
|
41
41
|
for (const [key, { env, defaultValue: def, parseEnv, description, printDefault, fallback }] of Object.entries(
|
|
42
42
|
configMappings,
|
|
@@ -58,7 +58,11 @@ export const getOptions = (namespace: string, configMappings: Record<string, Con
|
|
|
58
58
|
return options;
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
const configToFlag = (
|
|
61
|
+
const configToFlag = (
|
|
62
|
+
flag: string,
|
|
63
|
+
configMapping: ConfigMapping<unknown>,
|
|
64
|
+
overrideDefaultValue?: any,
|
|
65
|
+
): AztecStartOption => {
|
|
62
66
|
if (!configMapping.isBoolean) {
|
|
63
67
|
flag += ' <value>';
|
|
64
68
|
}
|
|
@@ -125,6 +129,12 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
125
129
|
defaultValue: DefaultMnemonic,
|
|
126
130
|
env: 'MNEMONIC',
|
|
127
131
|
},
|
|
132
|
+
{
|
|
133
|
+
flag: '--local-network.testAccounts',
|
|
134
|
+
description: 'Deploy test accounts on local network start',
|
|
135
|
+
env: 'TEST_ACCOUNTS',
|
|
136
|
+
...booleanConfigHelper(true),
|
|
137
|
+
},
|
|
128
138
|
],
|
|
129
139
|
API: [
|
|
130
140
|
{
|
|
@@ -165,6 +175,13 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
165
175
|
env: 'AZTEC_RESET_ADMIN_API_KEY',
|
|
166
176
|
parseVal: val => val === 'true' || val === '1',
|
|
167
177
|
},
|
|
178
|
+
{
|
|
179
|
+
flag: '--node-debug',
|
|
180
|
+
description: 'Expose debug endpoints (e.g. mineBlock) on the main RPC port',
|
|
181
|
+
defaultValue: false,
|
|
182
|
+
env: 'AZTEC_NODE_DEBUG',
|
|
183
|
+
parseVal: val => val === undefined || val === 'true' || val === '1',
|
|
184
|
+
},
|
|
168
185
|
{
|
|
169
186
|
flag: '--api-prefix <value>',
|
|
170
187
|
description: 'Prefix for API routes on any service that is started',
|
package/src/cli/cmds/compile.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { LogFn } from '@aztec/foundation/log';
|
|
|
3
3
|
|
|
4
4
|
import { execFileSync } from 'child_process';
|
|
5
5
|
import type { Command } from 'commander';
|
|
6
|
-
import { readFile
|
|
6
|
+
import { readFile } from 'fs/promises';
|
|
7
7
|
import { join } from 'path';
|
|
8
8
|
|
|
9
9
|
import { readArtifactFiles } from './utils/artifacts.js';
|
|
@@ -25,19 +25,6 @@ async function collectContractArtifacts(): Promise<string[]> {
|
|
|
25
25
|
return files.filter(f => Array.isArray(f.content.functions)).map(f => f.filePath);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
/** Strips the `__aztec_nr_internals__` prefix from function names in contract artifacts. */
|
|
29
|
-
async function stripInternalPrefixes(artifactPaths: string[]): Promise<void> {
|
|
30
|
-
for (const path of artifactPaths) {
|
|
31
|
-
const artifact = JSON.parse(await readFile(path, 'utf-8'));
|
|
32
|
-
for (const fn of artifact.functions) {
|
|
33
|
-
if (typeof fn.name === 'string') {
|
|
34
|
-
fn.name = fn.name.replace(/^__aztec_nr_internals__/, '');
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
await writeFile(path, JSON.stringify(artifact, null, 2) + '\n');
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
28
|
/** Returns the set of package names that are contract crates in the current workspace. */
|
|
42
29
|
async function getContractPackageNames(): Promise<Set<string>> {
|
|
43
30
|
const contractNames = new Set<string>();
|
|
@@ -161,9 +148,6 @@ async function compileAztecContract(nargoArgs: string[], log: LogFn): Promise<vo
|
|
|
161
148
|
log('Postprocessing contracts...');
|
|
162
149
|
const bbArgs = artifacts.flatMap(a => ['-i', a]);
|
|
163
150
|
await run(bb, ['aztec_process', ...bbArgs]);
|
|
164
|
-
|
|
165
|
-
// TODO: This should be part of bb aztec_process!
|
|
166
|
-
await stripInternalPrefixes(artifacts);
|
|
167
151
|
}
|
|
168
152
|
|
|
169
153
|
log('Compilation complete!');
|
package/src/cli/cmds/standby.ts
CHANGED
|
@@ -28,11 +28,11 @@ export async function computeExpectedGenesisRoot(config: GenesisStateConfig, use
|
|
|
28
28
|
|
|
29
29
|
userLog(`Initial funded accounts: ${initialFundedAccounts.map(a => a.toString()).join(', ')}`);
|
|
30
30
|
|
|
31
|
-
const { genesisArchiveRoot,
|
|
31
|
+
const { genesisArchiveRoot, genesis } = await getGenesisValues(initialFundedAccounts);
|
|
32
32
|
|
|
33
33
|
userLog(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
|
|
34
34
|
|
|
35
|
-
return { genesisArchiveRoot,
|
|
35
|
+
return { genesisArchiveRoot, genesis };
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
async function checkRollupCompatibility(
|
|
@@ -20,7 +20,13 @@ export async function startArchiver(
|
|
|
20
20
|
const envConfig = getArchiverConfigFromEnv();
|
|
21
21
|
const cliOptions = extractRelevantOptions<ArchiverConfig & DataStoreConfig & BlobClientConfig>(
|
|
22
22
|
options,
|
|
23
|
-
{
|
|
23
|
+
{
|
|
24
|
+
// dataConfigMappings must come first: its l1Contracts only maps rollupAddress,
|
|
25
|
+
// while archiverConfigMappings (spread later) maps all L1 contract addresses.
|
|
26
|
+
...dataConfigMappings,
|
|
27
|
+
...archiverConfigMappings,
|
|
28
|
+
...blobClientConfigMapping,
|
|
29
|
+
},
|
|
24
30
|
'archiver',
|
|
25
31
|
);
|
|
26
32
|
|
|
@@ -9,7 +9,11 @@ import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici';
|
|
|
9
9
|
import type { LogFn } from '@aztec/foundation/log';
|
|
10
10
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
11
11
|
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
ProvingJobConsumerSchema,
|
|
14
|
+
createProvingJobBrokerClient,
|
|
15
|
+
proverBrokerBackoff,
|
|
16
|
+
} from '@aztec/prover-client/broker';
|
|
13
17
|
import { type CliPXEOptions, type PXEConfig, allPxeConfigMappings } from '@aztec/pxe/config';
|
|
14
18
|
import { AztecNodeAdminApiSchema, AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
15
19
|
import { P2PApiSchema, ProverNodeApiSchema, type ProvingJobBroker } from '@aztec/stdlib/interfaces/server';
|
|
@@ -65,12 +69,8 @@ export async function startNode(
|
|
|
65
69
|
if (nodeConfig.proverBrokerUrl) {
|
|
66
70
|
// at 1TPS we'd enqueue ~1k chonk verifier proofs and ~1k AVM proofs immediately
|
|
67
71
|
// set a lower connection limit such that we don't overload the server
|
|
68
|
-
//
|
|
69
|
-
const fetch = makeTracedFetch(
|
|
70
|
-
[1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3],
|
|
71
|
-
false,
|
|
72
|
-
makeUndiciFetch(new Agent({ connections: 100 })),
|
|
73
|
-
);
|
|
72
|
+
// Retry indefinitely until the epoch proving times out and the chain reorgs
|
|
73
|
+
const fetch = makeTracedFetch(proverBrokerBackoff, false, makeUndiciFetch(new Agent({ connections: 100 })));
|
|
74
74
|
broker = createProvingJobBrokerClient(nodeConfig.proverBrokerUrl, getVersions(nodeConfig), fetch);
|
|
75
75
|
} else if (options.proverBroker) {
|
|
76
76
|
({ broker } = await startProverBroker(options, signalHandlers, services, userLog));
|
|
@@ -83,7 +83,7 @@ export async function startNode(
|
|
|
83
83
|
await preloadCrsDataForVerifying(nodeConfig, userLog);
|
|
84
84
|
|
|
85
85
|
const genesisConfig = getGenesisStateConfigEnvVars();
|
|
86
|
-
const { genesisArchiveRoot,
|
|
86
|
+
const { genesisArchiveRoot, genesis } = await computeExpectedGenesisRoot(genesisConfig, userLog);
|
|
87
87
|
|
|
88
88
|
const followsCanonicalRollup =
|
|
89
89
|
typeof nodeConfig.rollupVersion !== 'number' || (nodeConfig.rollupVersion as unknown as string) === 'canonical';
|
|
@@ -116,12 +116,10 @@ export async function startNode(
|
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
// TODO(#12272): will clean this up.
|
|
120
119
|
nodeConfig = {
|
|
121
120
|
...nodeConfig,
|
|
122
121
|
l1Contracts: {
|
|
123
122
|
...addresses,
|
|
124
|
-
slashFactoryAddress: nodeConfig.l1Contracts.slashFactoryAddress,
|
|
125
123
|
},
|
|
126
124
|
...config,
|
|
127
125
|
};
|
|
@@ -158,7 +156,7 @@ export async function startNode(
|
|
|
158
156
|
const telemetry = await initTelemetryClient(telemetryConfig);
|
|
159
157
|
|
|
160
158
|
// Create and start Aztec Node
|
|
161
|
-
const node = await createAztecNode(nodeConfig, { telemetry, proverBroker: broker }, {
|
|
159
|
+
const node = await createAztecNode(nodeConfig, { telemetry, proverBroker: broker }, { genesis });
|
|
162
160
|
|
|
163
161
|
// Add node and p2p to services list
|
|
164
162
|
services.node = [node, AztecNodeApiSchema];
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
createProofStore,
|
|
10
10
|
createProvingJobBrokerClient,
|
|
11
11
|
proverAgentConfigMappings,
|
|
12
|
+
proverBrokerBackoff,
|
|
12
13
|
} from '@aztec/prover-client/broker';
|
|
13
14
|
import { getProverNodeAgentConfigFromEnv } from '@aztec/prover-node';
|
|
14
15
|
import { ProverAgentApiSchema } from '@aztec/stdlib/interfaces/server';
|
|
@@ -45,12 +46,8 @@ export async function startProverAgent(
|
|
|
45
46
|
|
|
46
47
|
await preloadCrsDataForServerSideProving(config, userLog);
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
[1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3],
|
|
51
|
-
false,
|
|
52
|
-
makeUndiciFetch(new Agent({ connections: 10 })),
|
|
53
|
-
);
|
|
49
|
+
// Retry indefinitely until the epoch proving times out and the chain reorgs
|
|
50
|
+
const fetch = makeTracedFetch(proverBrokerBackoff, false, makeUndiciFetch(new Agent({ connections: 10 })));
|
|
54
51
|
const broker = createProvingJobBrokerClient(config.proverBrokerUrl, getVersions(), fetch);
|
|
55
52
|
|
|
56
53
|
const telemetry = await initTelemetryClient(extractRelevantOptions(options, telemetryClientConfigMappings, 'tel'));
|