@aztec/aztec 0.0.1-commit.b1c78909e → 0.0.1-commit.b2a5d0dd1
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 +23 -7
- 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 +5 -15
- package/dest/cli/cmds/profile_flamegraph.d.ts +1 -1
- package/dest/cli/cmds/profile_flamegraph.d.ts.map +1 -1
- package/dest/cli/cmds/profile_flamegraph.js +2 -1
- package/dest/cli/cmds/profile_gates.d.ts +1 -1
- package/dest/cli/cmds/profile_gates.d.ts.map +1 -1
- package/dest/cli/cmds/profile_gates.js +2 -1
- package/dest/cli/cmds/standby.d.ts +11 -6
- package/dest/cli/cmds/standby.d.ts.map +1 -1
- package/dest/cli/cmds/standby.js +35 -16
- 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 +13 -21
- 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/start_prover_broker.d.ts +1 -1
- package/dest/cli/cmds/start_prover_broker.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_broker.js +7 -1
- package/dest/cli/cmds/utils/collect_crate_dirs.d.ts +21 -0
- package/dest/cli/cmds/utils/collect_crate_dirs.d.ts.map +1 -0
- package/dest/cli/cmds/utils/collect_crate_dirs.js +114 -0
- package/dest/cli/cmds/utils/needs_recompile.d.ts +1 -1
- package/dest/cli/cmds/utils/needs_recompile.d.ts.map +1 -1
- package/dest/cli/cmds/utils/needs_recompile.js +9 -43
- package/dest/cli/cmds/utils/warn_if_aztec_version_mismatch.d.ts +4 -0
- package/dest/cli/cmds/utils/warn_if_aztec_version_mismatch.d.ts.map +1 -0
- package/dest/cli/cmds/utils/warn_if_aztec_version_mismatch.js +62 -0
- package/dest/local-network/local-network.d.ts +3 -4
- package/dest/local-network/local-network.d.ts.map +1 -1
- package/dest/local-network/local-network.js +3 -3
- package/dest/testing/anvil_test_watcher.d.ts +7 -3
- package/dest/testing/anvil_test_watcher.d.ts.map +1 -1
- package/dest/testing/anvil_test_watcher.js +40 -14
- package/dest/testing/cheat_codes.d.ts +11 -15
- package/dest/testing/cheat_codes.d.ts.map +1 -1
- package/dest/testing/cheat_codes.js +34 -32
- package/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 -2
- package/dest/testing/index.d.ts.map +1 -1
- package/package.json +33 -34
- package/scripts/aztec.sh +5 -1
- package/src/cli/aztec_start_action.ts +12 -7
- package/src/cli/aztec_start_options.ts +19 -2
- package/src/cli/cmds/compile.ts +6 -18
- package/src/cli/cmds/profile_flamegraph.ts +2 -1
- package/src/cli/cmds/profile_gates.ts +2 -1
- package/src/cli/cmds/standby.ts +39 -18
- package/src/cli/cmds/start_archiver.ts +7 -1
- package/src/cli/cmds/start_node.ts +17 -12
- package/src/cli/cmds/start_prover_agent.ts +3 -6
- package/src/cli/cmds/start_prover_broker.ts +8 -1
- package/src/cli/cmds/utils/collect_crate_dirs.ts +118 -0
- package/src/cli/cmds/utils/needs_recompile.ts +8 -49
- package/src/cli/cmds/utils/warn_if_aztec_version_mismatch.ts +77 -0
- package/src/local-network/local-network.ts +5 -5
- package/src/testing/anvil_test_watcher.ts +44 -13
- package/src/testing/cheat_codes.ts +42 -36
- package/src/testing/epoch_test_settler.ts +3 -4
- package/src/testing/index.ts +1 -1
|
@@ -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(
|
|
58
|
-
|
|
56
|
+
*/ async warpL2TimeAtLeastBy(node, duration) {
|
|
57
|
+
if (BigInt(duration) <= 0n) {
|
|
58
|
+
throw new Error(`warpL2TimeAtLeastBy: duration must be positive, got ${duration} seconds.`);
|
|
59
|
+
}
|
|
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
|
}
|
|
@@ -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
|
@@ -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.b2a5d0dd1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -28,39 +28,38 @@
|
|
|
28
28
|
"../package.common.json"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
32
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
33
|
-
"@aztec/aztec-
|
|
34
|
-
"@aztec/aztec
|
|
35
|
-
"@aztec/
|
|
36
|
-
"@aztec/bb
|
|
37
|
-
"@aztec/
|
|
38
|
-
"@aztec/
|
|
39
|
-
"@aztec/
|
|
40
|
-
"@aztec/
|
|
41
|
-
"@aztec/
|
|
42
|
-
"@aztec/
|
|
43
|
-
"@aztec/
|
|
44
|
-
"@aztec/
|
|
45
|
-
"@aztec/
|
|
46
|
-
"@aztec/
|
|
47
|
-
"@aztec/
|
|
48
|
-
"@aztec/
|
|
49
|
-
"@aztec/noir-
|
|
50
|
-
"@aztec/
|
|
51
|
-
"@aztec/p2p": "0.0.1-commit.
|
|
52
|
-
"@aztec/
|
|
53
|
-
"@aztec/
|
|
54
|
-
"@aztec/prover-
|
|
55
|
-
"@aztec/
|
|
56
|
-
"@aztec/
|
|
57
|
-
"@aztec/
|
|
58
|
-
"@aztec/
|
|
59
|
-
"@aztec/
|
|
60
|
-
"@aztec/
|
|
61
|
-
"@aztec/
|
|
62
|
-
"@aztec/
|
|
63
|
-
"@aztec/world-state": "0.0.1-commit.b1c78909e",
|
|
31
|
+
"@aztec/accounts": "0.0.1-commit.b2a5d0dd1",
|
|
32
|
+
"@aztec/archiver": "0.0.1-commit.b2a5d0dd1",
|
|
33
|
+
"@aztec/aztec-node": "0.0.1-commit.b2a5d0dd1",
|
|
34
|
+
"@aztec/aztec.js": "0.0.1-commit.b2a5d0dd1",
|
|
35
|
+
"@aztec/bb-prover": "0.0.1-commit.b2a5d0dd1",
|
|
36
|
+
"@aztec/bb.js": "0.0.1-commit.b2a5d0dd1",
|
|
37
|
+
"@aztec/blob-client": "0.0.1-commit.b2a5d0dd1",
|
|
38
|
+
"@aztec/bot": "0.0.1-commit.b2a5d0dd1",
|
|
39
|
+
"@aztec/builder": "0.0.1-commit.b2a5d0dd1",
|
|
40
|
+
"@aztec/cli": "0.0.1-commit.b2a5d0dd1",
|
|
41
|
+
"@aztec/constants": "0.0.1-commit.b2a5d0dd1",
|
|
42
|
+
"@aztec/entrypoints": "0.0.1-commit.b2a5d0dd1",
|
|
43
|
+
"@aztec/ethereum": "0.0.1-commit.b2a5d0dd1",
|
|
44
|
+
"@aztec/foundation": "0.0.1-commit.b2a5d0dd1",
|
|
45
|
+
"@aztec/kv-store": "0.0.1-commit.b2a5d0dd1",
|
|
46
|
+
"@aztec/l1-artifacts": "0.0.1-commit.b2a5d0dd1",
|
|
47
|
+
"@aztec/node-lib": "0.0.1-commit.b2a5d0dd1",
|
|
48
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.b2a5d0dd1",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.b2a5d0dd1",
|
|
50
|
+
"@aztec/p2p": "0.0.1-commit.b2a5d0dd1",
|
|
51
|
+
"@aztec/p2p-bootstrap": "0.0.1-commit.b2a5d0dd1",
|
|
52
|
+
"@aztec/protocol-contracts": "0.0.1-commit.b2a5d0dd1",
|
|
53
|
+
"@aztec/prover-client": "0.0.1-commit.b2a5d0dd1",
|
|
54
|
+
"@aztec/prover-node": "0.0.1-commit.b2a5d0dd1",
|
|
55
|
+
"@aztec/pxe": "0.0.1-commit.b2a5d0dd1",
|
|
56
|
+
"@aztec/sequencer-client": "0.0.1-commit.b2a5d0dd1",
|
|
57
|
+
"@aztec/stdlib": "0.0.1-commit.b2a5d0dd1",
|
|
58
|
+
"@aztec/telemetry-client": "0.0.1-commit.b2a5d0dd1",
|
|
59
|
+
"@aztec/txe": "0.0.1-commit.b2a5d0dd1",
|
|
60
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.b2a5d0dd1",
|
|
61
|
+
"@aztec/wallets": "0.0.1-commit.b2a5d0dd1",
|
|
62
|
+
"@aztec/world-state": "0.0.1-commit.b2a5d0dd1",
|
|
64
63
|
"@iarna/toml": "^2.2.5",
|
|
65
64
|
"@types/chalk": "^2.2.0",
|
|
66
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 { 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';
|
|
@@ -23,14 +23,13 @@ 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
|
|
30
|
-
const localNetwork = extractNamespacedOptions(options, 'local-network');
|
|
31
|
-
localNetwork.testAccounts = true;
|
|
30
|
+
const localNetwork = extractNamespacedOptions(options, 'localNetwork');
|
|
32
31
|
userLog(`${splash}\n${github}\n\n`);
|
|
33
|
-
userLog(`Setting up Aztec local network ${
|
|
32
|
+
userLog(`Setting up Aztec local network ${packageVersion ?? 'unknown'}, please stand by...`);
|
|
34
33
|
|
|
35
34
|
const { node, stop } = await createLocalNetwork(
|
|
36
35
|
{
|
|
@@ -50,6 +49,8 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
50
49
|
// Start Node and PXE JSON-RPC server
|
|
51
50
|
signalHandlers.push(stop);
|
|
52
51
|
services.node = [node, AztecNodeApiSchema];
|
|
52
|
+
adminServices.node = [node, AztecNodeAdminApiSchema];
|
|
53
|
+
services.nodeDebug = [node, AztecNodeDebugApiSchema];
|
|
53
54
|
} else {
|
|
54
55
|
// Route --prover-node through startNode
|
|
55
56
|
if (options.proverNode && !options.node) {
|
|
@@ -60,6 +61,9 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
60
61
|
const { startNode } = await import('./cmds/start_node.js');
|
|
61
62
|
const networkName = getActiveNetworkName(options.network);
|
|
62
63
|
({ config } = await startNode(options, signalHandlers, services, adminServices, userLog, networkName));
|
|
64
|
+
if (options.nodeDebug && services.node) {
|
|
65
|
+
services.nodeDebug = [services.node[0], AztecNodeDebugApiSchema];
|
|
66
|
+
}
|
|
63
67
|
} else if (options.bot) {
|
|
64
68
|
const { startBot } = await import('./cmds/start_bot.js');
|
|
65
69
|
await startBot(options, signalHandlers, services, userLog);
|
|
@@ -89,13 +93,14 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
89
93
|
|
|
90
94
|
installSignalHandlers(debugLogger.info, signalHandlers);
|
|
91
95
|
const versions = getVersions(config);
|
|
96
|
+
const versioningOpts = { packageVersion };
|
|
92
97
|
|
|
93
98
|
// Start the main JSON-RPC server
|
|
94
99
|
if (Object.entries(services).length > 0) {
|
|
95
100
|
const rpcServer = createNamespacedSafeJsonRpcServer(services, {
|
|
96
101
|
http200OnError: false,
|
|
97
102
|
log: debugLogger,
|
|
98
|
-
middlewares: [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions)],
|
|
103
|
+
middlewares: [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions, versioningOpts)],
|
|
99
104
|
maxBatchSize: options.rpcMaxBatchSize,
|
|
100
105
|
maxBodySizeBytes: options.rpcMaxBodySize,
|
|
101
106
|
});
|
|
@@ -105,7 +110,7 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
105
110
|
|
|
106
111
|
// If there are any admin services, start a separate JSON-RPC server for them
|
|
107
112
|
if (Object.entries(adminServices).length > 0) {
|
|
108
|
-
const adminMiddlewares = [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions)];
|
|
113
|
+
const adminMiddlewares = [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions, versioningOpts)];
|
|
109
114
|
|
|
110
115
|
// Resolve the admin API key (auto-generated and persisted, or opt-out)
|
|
111
116
|
const apiKeyResolution = await resolveAdminApiKey(
|
|
@@ -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
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { findBbBinary } from '@aztec/bb.js';
|
|
1
2
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
3
|
|
|
3
4
|
import { execFileSync } from 'child_process';
|
|
4
5
|
import type { Command } from 'commander';
|
|
5
|
-
import { readFile
|
|
6
|
+
import { readFile } from 'fs/promises';
|
|
6
7
|
import { join } from 'path';
|
|
7
8
|
|
|
8
9
|
import { readArtifactFiles } from './utils/artifacts.js';
|
|
9
10
|
import { needsRecompile } from './utils/needs_recompile.js';
|
|
10
11
|
import { run } from './utils/spawn.js';
|
|
12
|
+
import { warnIfAztecVersionMismatch } from './utils/warn_if_aztec_version_mismatch.js';
|
|
11
13
|
|
|
12
14
|
/** Returns paths to contract artifacts in the target directory. */
|
|
13
15
|
async function collectContractArtifacts(): Promise<string[]> {
|
|
@@ -23,19 +25,6 @@ async function collectContractArtifacts(): Promise<string[]> {
|
|
|
23
25
|
return files.filter(f => Array.isArray(f.content.functions)).map(f => f.filePath);
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
/** Strips the `__aztec_nr_internals__` prefix from function names in contract artifacts. */
|
|
27
|
-
async function stripInternalPrefixes(artifactPaths: string[]): Promise<void> {
|
|
28
|
-
for (const path of artifactPaths) {
|
|
29
|
-
const artifact = JSON.parse(await readFile(path, 'utf-8'));
|
|
30
|
-
for (const fn of artifact.functions) {
|
|
31
|
-
if (typeof fn.name === 'string') {
|
|
32
|
-
fn.name = fn.name.replace(/^__aztec_nr_internals__/, '');
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
await writeFile(path, JSON.stringify(artifact, null, 2) + '\n');
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
28
|
/** Returns the set of package names that are contract crates in the current workspace. */
|
|
40
29
|
async function getContractPackageNames(): Promise<Set<string>> {
|
|
41
30
|
const contractNames = new Set<string>();
|
|
@@ -138,13 +127,15 @@ async function checkNoTestsInContracts(nargo: string, log: LogFn): Promise<void>
|
|
|
138
127
|
|
|
139
128
|
/** Compiles Aztec Noir contracts and postprocesses artifacts. */
|
|
140
129
|
async function compileAztecContract(nargoArgs: string[], log: LogFn): Promise<void> {
|
|
130
|
+
await warnIfAztecVersionMismatch(log);
|
|
131
|
+
|
|
141
132
|
if (!(await needsRecompile())) {
|
|
142
133
|
log('No source changes detected, skipping compilation.');
|
|
143
134
|
return;
|
|
144
135
|
}
|
|
145
136
|
|
|
146
137
|
const nargo = process.env.NARGO ?? 'nargo';
|
|
147
|
-
const bb = process.env.BB ?? 'bb';
|
|
138
|
+
const bb = process.env.BB ?? findBbBinary() ?? 'bb';
|
|
148
139
|
|
|
149
140
|
await run(nargo, ['compile', ...nargoArgs]);
|
|
150
141
|
|
|
@@ -157,9 +148,6 @@ async function compileAztecContract(nargoArgs: string[], log: LogFn): Promise<vo
|
|
|
157
148
|
log('Postprocessing contracts...');
|
|
158
149
|
const bbArgs = artifacts.flatMap(a => ['-i', a]);
|
|
159
150
|
await run(bb, ['aztec_process', ...bbArgs]);
|
|
160
|
-
|
|
161
|
-
// TODO: This should be part of bb aztec_process!
|
|
162
|
-
await stripInternalPrefixes(artifacts);
|
|
163
151
|
}
|
|
164
152
|
|
|
165
153
|
log('Compilation complete!');
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { findBbBinary } from '@aztec/bb.js';
|
|
1
2
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
3
|
|
|
3
4
|
import { readFile, rename, rm, writeFile } from 'fs/promises';
|
|
@@ -33,7 +34,7 @@ export async function profileFlamegraph(artifactPath: string, functionName: stri
|
|
|
33
34
|
await writeFile(functionArtifact, makeFunctionArtifact(artifact, func));
|
|
34
35
|
|
|
35
36
|
const profiler = process.env.PROFILER_PATH ?? 'noir-profiler';
|
|
36
|
-
const bb = process.env.BB ?? 'bb';
|
|
37
|
+
const bb = process.env.BB ?? findBbBinary() ?? 'bb';
|
|
37
38
|
|
|
38
39
|
await run(profiler, [
|
|
39
40
|
'gates',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { findBbBinary } from '@aztec/bb.js';
|
|
1
2
|
import { asyncPool } from '@aztec/foundation/async-pool';
|
|
2
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
4
|
|
|
@@ -32,7 +33,7 @@ async function getGateCount(bb: string, artifactPath: string): Promise<number> {
|
|
|
32
33
|
|
|
33
34
|
/** Profiles all compiled artifacts in a target directory and prints gate counts. */
|
|
34
35
|
export async function profileGates(targetDir: string, log: LogFn): Promise<void> {
|
|
35
|
-
const bb = process.env.BB ?? 'bb';
|
|
36
|
+
const bb = process.env.BB ?? findBbBinary() ?? 'bb';
|
|
36
37
|
const { artifacts, tmpDir } = await discoverArtifacts(targetDir);
|
|
37
38
|
|
|
38
39
|
if (artifacts.length === 0) {
|
package/src/cli/cmds/standby.ts
CHANGED
|
@@ -28,17 +28,40 @@ 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
|
+
}
|
|
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;
|
|
36
58
|
}
|
|
37
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',
|
|
@@ -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
|
|