@aztec/end-to-end 1.0.0-nightly.20250713 → 1.0.0-nightly.20250715
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/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +2 -1
- package/dest/e2e_p2p/p2p_network.d.ts +5 -3
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +14 -11
- package/dest/fixtures/setup_p2p_test.d.ts +1 -1
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +7 -6
- package/package.json +35 -35
- package/src/e2e_epochs/epochs_test.ts +2 -1
- package/src/e2e_p2p/p2p_network.ts +18 -10
- package/src/fixtures/setup_p2p_test.ts +7 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epochs_test.d.ts","sourceRoot":"","sources":["../../src/e2e_epochs/epochs_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,EAAE,EACF,KAAK,MAAM,EAEX,KAAK,MAAM,EAKZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,
|
|
1
|
+
{"version":3,"file":"epochs_test.d.ts","sourceRoot":"","sources":["../../src/e2e_epochs/epochs_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,EAAE,EACF,KAAK,MAAM,EAEX,KAAK,MAAM,EAKZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAA4B,KAAK,wBAAwB,EAA0B,MAAM,iBAAiB,CAAC;AAClH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAkB,KAAK,OAAO,EAAqC,MAAM,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AAM,EAAE,GAAG,CAAc;;;;CAiD/D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AztecNodeService } from '@aztec/aztec-node';
|
|
2
2
|
import { Fr, MerkleTreeId, getContractInstanceFromInstantiationParams, getTimestampRangeForEpoch, retryUntil, sleep } from '@aztec/aztec.js';
|
|
3
|
-
import { createExtendedL1Client } from '@aztec/ethereum';
|
|
3
|
+
import { DefaultL1ContractsConfig, createExtendedL1Client } from '@aztec/ethereum';
|
|
4
4
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
5
5
|
import { ChainMonitor, DelayedTxUtils, waitUntilL1Timestamp, withDelayer } from '@aztec/ethereum/test';
|
|
6
6
|
import { SecretValue } from '@aztec/foundation/config';
|
|
@@ -82,6 +82,7 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
82
82
|
// but not so much to hang the sequencer and timeout the teardown
|
|
83
83
|
txPropagationMaxQueryAttempts: opts.txPropagationMaxQueryAttempts ?? 12,
|
|
84
84
|
worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
|
|
85
|
+
exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
85
86
|
...opts
|
|
86
87
|
});
|
|
87
88
|
this.context = context;
|
|
@@ -19,7 +19,8 @@ export declare const SHORTENED_BLOCK_TIME_CONFIG_NO_PRUNES: {
|
|
|
19
19
|
export declare class P2PNetworkTest {
|
|
20
20
|
bootstrapNodeEnr: string;
|
|
21
21
|
bootNodePort: number;
|
|
22
|
-
|
|
22
|
+
numberOfValidators: number;
|
|
23
|
+
numberOfNodes: number;
|
|
23
24
|
private metricsPort?;
|
|
24
25
|
private snapshotManager;
|
|
25
26
|
baseAccountPrivateKey: `0x${string}`;
|
|
@@ -53,10 +54,11 @@ export declare class P2PNetworkTest {
|
|
|
53
54
|
wallet?: AccountWalletWithSecretKey;
|
|
54
55
|
spamContract?: SpamContract;
|
|
55
56
|
bootstrapNode?: BootstrapNode;
|
|
56
|
-
constructor(testName: string, bootstrapNodeEnr: string, bootNodePort: number,
|
|
57
|
-
static create({ testName, numberOfNodes, basePort, metricsPort, initialConfig, startProverNode, mockZkPassportVerifier, }: {
|
|
57
|
+
constructor(testName: string, bootstrapNodeEnr: string, bootNodePort: number, numberOfValidators: number, initialValidatorConfig: AztecNodeConfig, numberOfNodes?: number, metricsPort?: number | undefined, startProverNode?: boolean, mockZkPassportVerifier?: boolean);
|
|
58
|
+
static create({ testName, numberOfNodes, numberOfValidators, basePort, metricsPort, initialConfig, startProverNode, mockZkPassportVerifier, }: {
|
|
58
59
|
testName: string;
|
|
59
60
|
numberOfNodes: number;
|
|
61
|
+
numberOfValidators: number;
|
|
60
62
|
basePort?: number;
|
|
61
63
|
metricsPort?: number;
|
|
62
64
|
initialConfig?: Partial<AztecNodeConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p2p_network.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/p2p_network.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,KAAK,0BAA0B,EAAc,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAGL,KAAK,QAAQ,EACb,cAAc,EACd,KAAK,UAAU,EAIhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAa,eAAe,EAAE,UAAU,EAAE,mBAAmB,EAAgB,MAAM,qBAAqB,CAAC;AAChH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAA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EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,aAAa,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;QACzC,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,sBAAsB,CAAC,EAAE,OAAO,CAAC;KAClC;IAwBD,IAAI,aAAa,uBAKhB;IAEK,gBAAgB;IActB,aAAa;;;IAiBP,kBAAkB;IAkElB,YAAY;IAYZ,kBAAkB;IAoBlB,iBAAiB;IAgBjB,WAAW;;;;YAIH,YAAY;IAQpB,KAAK;IAcL,SAAS,CAAC,KAAK,EAAE,gBAAgB,EAAE;IAanC,QAAQ;IAMR,YAAY,IAAI,OAAO,CAAC;QAC5B,MAAM,EAAE,cAAc,CAAC;QACvB,eAAe,EAAE,qBAAqB,CAAC,OAAO,UAAU,EAAE,UAAU,CAAC,CAAC;QACtE,gBAAgB,EAAE,qBAAqB,CAAC,OAAO,mBAAmB,EAAE,UAAU,CAAC,CAAC;QAChF,YAAY,EAAE,qBAAqB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,CAAC;KACzE,CAAC;CA8BH"}
|
|
@@ -27,6 +27,7 @@ export const SHORTENED_BLOCK_TIME_CONFIG_NO_PRUNES = {
|
|
|
27
27
|
export class P2PNetworkTest {
|
|
28
28
|
bootstrapNodeEnr;
|
|
29
29
|
bootNodePort;
|
|
30
|
+
numberOfValidators;
|
|
30
31
|
numberOfNodes;
|
|
31
32
|
metricsPort;
|
|
32
33
|
snapshotManager;
|
|
@@ -45,10 +46,11 @@ export class P2PNetworkTest {
|
|
|
45
46
|
wallet;
|
|
46
47
|
spamContract;
|
|
47
48
|
bootstrapNode;
|
|
48
|
-
constructor(testName, bootstrapNodeEnr, bootNodePort,
|
|
49
|
+
constructor(testName, bootstrapNodeEnr, bootNodePort, numberOfValidators, initialValidatorConfig, numberOfNodes = 0, // If set enable metrics collection
|
|
49
50
|
metricsPort, startProverNode, mockZkPassportVerifier){
|
|
50
51
|
this.bootstrapNodeEnr = bootstrapNodeEnr;
|
|
51
52
|
this.bootNodePort = bootNodePort;
|
|
53
|
+
this.numberOfValidators = numberOfValidators;
|
|
52
54
|
this.numberOfNodes = numberOfNodes;
|
|
53
55
|
this.metricsPort = metricsPort;
|
|
54
56
|
this.attesterPrivateKeys = [];
|
|
@@ -61,7 +63,7 @@ export class P2PNetworkTest {
|
|
|
61
63
|
// Set up the base account and node private keys for the initial network deployment
|
|
62
64
|
this.baseAccountPrivateKey = `0x${getPrivateKeyFromIndex(1).toString('hex')}`;
|
|
63
65
|
this.baseAccount = privateKeyToAccount(this.baseAccountPrivateKey);
|
|
64
|
-
this.attesterPrivateKeys = generatePrivateKeys(ATTESTER_PRIVATE_KEYS_START_INDEX,
|
|
66
|
+
this.attesterPrivateKeys = generatePrivateKeys(ATTESTER_PRIVATE_KEYS_START_INDEX + numberOfNodes, numberOfValidators);
|
|
65
67
|
this.attesterPublicKeys = this.attesterPrivateKeys.map((privateKey)=>privateKeyToAccount(privateKey).address);
|
|
66
68
|
this.snapshotManager = createSnapshotManager(`e2e_p2p_network/${testName}`, process.env.E2E_DATA_PATH, {
|
|
67
69
|
...initialValidatorConfig,
|
|
@@ -69,7 +71,7 @@ export class P2PNetworkTest {
|
|
|
69
71
|
aztecEpochDuration: initialValidatorConfig.aztecEpochDuration ?? l1ContractsConfig.aztecEpochDuration,
|
|
70
72
|
aztecSlotDuration: initialValidatorConfig.aztecSlotDuration ?? l1ContractsConfig.aztecSlotDuration,
|
|
71
73
|
aztecProofSubmissionEpochs: initialValidatorConfig.aztecProofSubmissionEpochs ?? l1ContractsConfig.aztecProofSubmissionEpochs,
|
|
72
|
-
aztecTargetCommitteeSize:
|
|
74
|
+
aztecTargetCommitteeSize: numberOfValidators,
|
|
73
75
|
salt: 420,
|
|
74
76
|
metricsPort: metricsPort,
|
|
75
77
|
numberOfInitialFundedAccounts: 2,
|
|
@@ -80,19 +82,19 @@ export class P2PNetworkTest {
|
|
|
80
82
|
ethereumSlotDuration: initialValidatorConfig.ethereumSlotDuration ?? l1ContractsConfig.ethereumSlotDuration,
|
|
81
83
|
aztecSlotDuration: initialValidatorConfig.aztecSlotDuration ?? l1ContractsConfig.aztecSlotDuration,
|
|
82
84
|
aztecProofSubmissionEpochs: initialValidatorConfig.aztecProofSubmissionEpochs ?? l1ContractsConfig.aztecProofSubmissionEpochs,
|
|
83
|
-
aztecTargetCommitteeSize:
|
|
85
|
+
aztecTargetCommitteeSize: numberOfValidators,
|
|
84
86
|
initialValidators: [],
|
|
85
87
|
zkPassportArgs: {
|
|
86
88
|
mockZkPassportVerifier
|
|
87
89
|
}
|
|
88
90
|
});
|
|
89
91
|
}
|
|
90
|
-
static async create({ testName, numberOfNodes, basePort, metricsPort, initialConfig, startProverNode, mockZkPassportVerifier }) {
|
|
92
|
+
static async create({ testName, numberOfNodes, numberOfValidators, basePort, metricsPort, initialConfig, startProverNode, mockZkPassportVerifier }) {
|
|
91
93
|
const port = basePort || await getPort();
|
|
92
94
|
const bootstrapNodeENR = await getBootstrapNodeEnr(BOOTSTRAP_NODE_PRIVATE_KEY, port);
|
|
93
95
|
const bootstrapNodeEnr = bootstrapNodeENR.encodeTxt();
|
|
94
96
|
const initialValidatorConfig = await createValidatorConfig(initialConfig ?? {}, bootstrapNodeEnr);
|
|
95
|
-
return new P2PNetworkTest(testName, bootstrapNodeEnr, port,
|
|
97
|
+
return new P2PNetworkTest(testName, bootstrapNodeEnr, port, numberOfValidators, initialValidatorConfig, numberOfNodes, metricsPort, startProverNode, mockZkPassportVerifier);
|
|
96
98
|
}
|
|
97
99
|
get fundedAccount() {
|
|
98
100
|
if (!this.deployedAccounts[0]) {
|
|
@@ -110,8 +112,9 @@ export class P2PNetworkTest {
|
|
|
110
112
|
}
|
|
111
113
|
getValidators() {
|
|
112
114
|
const validators = [];
|
|
113
|
-
for(let i = 0; i < this.
|
|
114
|
-
const
|
|
115
|
+
for(let i = 0; i < this.numberOfValidators; i++){
|
|
116
|
+
const keyIndex = i;
|
|
117
|
+
const attester = privateKeyToAccount(this.attesterPrivateKeys[keyIndex]);
|
|
115
118
|
validators.push({
|
|
116
119
|
attester: EthAddress.fromString(attester.address),
|
|
117
120
|
withdrawer: EthAddress.fromString(attester.address)
|
|
@@ -130,7 +133,7 @@ export class P2PNetworkTest {
|
|
|
130
133
|
abi: RollupAbi,
|
|
131
134
|
client: deployL1ContractsValues.l1Client
|
|
132
135
|
});
|
|
133
|
-
this.logger.
|
|
136
|
+
this.logger.info(`Adding ${this.numberOfValidators} validators`);
|
|
134
137
|
const stakingAsset = getContract({
|
|
135
138
|
address: deployL1ContractsValues.l1ContractAddresses.stakingAssetAddress.toString(),
|
|
136
139
|
abi: TestERC20Abi,
|
|
@@ -145,7 +148,7 @@ export class P2PNetworkTest {
|
|
|
145
148
|
abi: l1Artifacts.multiAdder.contractAbi,
|
|
146
149
|
client: deployL1ContractsValues.l1Client
|
|
147
150
|
});
|
|
148
|
-
const stakeNeeded = l1ContractsConfig.depositAmount * BigInt(this.
|
|
151
|
+
const stakeNeeded = l1ContractsConfig.depositAmount * BigInt(this.numberOfValidators);
|
|
149
152
|
await Promise.all([
|
|
150
153
|
await stakingAsset.write.mint([
|
|
151
154
|
multiAdder.address,
|
|
@@ -198,7 +201,7 @@ export class P2PNetworkTest {
|
|
|
198
201
|
});
|
|
199
202
|
}
|
|
200
203
|
async removeInitialNode() {
|
|
201
|
-
await this.snapshotManager.snapshot('remove-
|
|
204
|
+
await this.snapshotManager.snapshot('remove-initial-validator', async ({ deployL1ContractsValues, aztecNode, dateProvider })=>{
|
|
202
205
|
// Send and await a tx to make sure we mine a block for the warp to correctly progress.
|
|
203
206
|
const { receipt } = await this._sendDummyTx(deployL1ContractsValues.l1Client);
|
|
204
207
|
const block = await deployL1ContractsValues.l1Client.getBlock({
|
|
@@ -15,7 +15,7 @@ export interface NodeContext {
|
|
|
15
15
|
txs: SentTx[];
|
|
16
16
|
}
|
|
17
17
|
export declare function generatePrivateKeys(startIndex: number, numberOfKeys: number): `0x${string}`[];
|
|
18
|
-
export declare function createNodes(config: AztecNodeConfig, dateProvider: DateProvider, bootstrapNodeEnr: string, numNodes: number, bootNodePort: number, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number): Promise<AztecNodeService[]>;
|
|
18
|
+
export declare function createNodes(config: AztecNodeConfig, dateProvider: DateProvider, bootstrapNodeEnr: string, numNodes: number, bootNodePort: number, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number, indexOffset?: number): Promise<AztecNodeService[]>;
|
|
19
19
|
export declare function createNode(config: AztecNodeConfig, dateProvider: DateProvider, tcpPort: number, bootstrapNode: string | undefined, addressIndex: number, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number, loggerIdStorage?: AsyncLocalStorage<string>): Promise<AztecNodeService>;
|
|
20
20
|
export declare function createProverNode(config: AztecNodeConfig, tcpPort: number, bootstrapNode: string | undefined, addressIndex: number, proverNodeDeps: ProverNodeDeps & Required<Pick<ProverNodeDeps, 'dateProvider'>>, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number, loggerIdStorage?: AsyncLocalStorage<string>): Promise<import("@aztec/prover-node").ProverNode>;
|
|
21
21
|
export declare function createValidatorConfig(config: AztecNodeConfig, bootstrapNodeEnr?: string, port?: number, addressIndex?: number, dataDirectory?: string): Promise<AztecNodeConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_p2p_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/setup_p2p_test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAI9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAoB,cAAc,EAA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M,EACpB,eAAe,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,oDAyB5C;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,eAAe,EACvB,gBAAgB,CAAC,EAAE,MAAM,EACzB,IAAI,CAAC,EAAE,MAAM,EACb,YAAY,GAAE,MAAU,EACxB,aAAa,CAAC,EAAE,MAAM,4BAuBvB"}
|
|
@@ -20,22 +20,23 @@ export function generatePrivateKeys(startIndex, numberOfKeys) {
|
|
|
20
20
|
}
|
|
21
21
|
return privateKeys;
|
|
22
22
|
}
|
|
23
|
-
export async function createNodes(config, dateProvider, bootstrapNodeEnr, numNodes, bootNodePort, prefilledPublicData, dataDirectory, metricsPort) {
|
|
23
|
+
export async function createNodes(config, dateProvider, bootstrapNodeEnr, numNodes, bootNodePort, prefilledPublicData, dataDirectory, metricsPort, indexOffset = 0) {
|
|
24
24
|
const nodePromises = [];
|
|
25
25
|
const loggerIdStorage = new AsyncLocalStorage();
|
|
26
26
|
const logNameHandler = (module)=>loggerIdStorage.getStore() ? `${module}:${loggerIdStorage.getStore()}` : module;
|
|
27
27
|
addLogNameHandler(logNameHandler);
|
|
28
28
|
for(let i = 0; i < numNodes; i++){
|
|
29
|
+
const index = indexOffset + i;
|
|
29
30
|
// We run on ports from the bootnode upwards
|
|
30
|
-
const port = bootNodePort +
|
|
31
|
-
const dataDir = dataDirectory ? `${dataDirectory}-${
|
|
32
|
-
const nodePromise = createNode(config, dateProvider, port, bootstrapNodeEnr,
|
|
31
|
+
const port = bootNodePort + 1 + index;
|
|
32
|
+
const dataDir = dataDirectory ? `${dataDirectory}-${index}` : undefined;
|
|
33
|
+
const nodePromise = createNode(config, dateProvider, port, bootstrapNodeEnr, index, prefilledPublicData, dataDir, metricsPort, loggerIdStorage);
|
|
33
34
|
nodePromises.push(nodePromise);
|
|
34
35
|
}
|
|
35
36
|
const nodes = await Promise.all(nodePromises);
|
|
36
|
-
// Sanity check that we have a sequencer
|
|
37
|
+
// Sanity check that we have a sequencer if required
|
|
37
38
|
const seqClient = nodes[0].getSequencer();
|
|
38
|
-
if (!seqClient) {
|
|
39
|
+
if (!seqClient && config.disableValidator === false) {
|
|
39
40
|
throw new Error('Sequencer not found');
|
|
40
41
|
}
|
|
41
42
|
removeLogNameHandler(logNameHandler);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "1.0.0-nightly.
|
|
3
|
+
"version": "1.0.0-nightly.20250715",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,40 +25,40 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "1.0.0-nightly.
|
|
29
|
-
"@aztec/archiver": "1.0.0-nightly.
|
|
30
|
-
"@aztec/aztec": "1.0.0-nightly.
|
|
31
|
-
"@aztec/aztec-node": "1.0.0-nightly.
|
|
32
|
-
"@aztec/aztec.js": "1.0.0-nightly.
|
|
33
|
-
"@aztec/bb-prover": "1.0.0-nightly.
|
|
34
|
-
"@aztec/blob-lib": "1.0.0-nightly.
|
|
35
|
-
"@aztec/blob-sink": "1.0.0-nightly.
|
|
36
|
-
"@aztec/bot": "1.0.0-nightly.
|
|
37
|
-
"@aztec/cli": "1.0.0-nightly.
|
|
38
|
-
"@aztec/constants": "1.0.0-nightly.
|
|
39
|
-
"@aztec/entrypoints": "1.0.0-nightly.
|
|
40
|
-
"@aztec/epoch-cache": "1.0.0-nightly.
|
|
41
|
-
"@aztec/ethereum": "1.0.0-nightly.
|
|
42
|
-
"@aztec/foundation": "1.0.0-nightly.
|
|
43
|
-
"@aztec/kv-store": "1.0.0-nightly.
|
|
44
|
-
"@aztec/l1-artifacts": "1.0.0-nightly.
|
|
45
|
-
"@aztec/merkle-tree": "1.0.0-nightly.
|
|
46
|
-
"@aztec/noir-contracts.js": "1.0.0-nightly.
|
|
47
|
-
"@aztec/noir-noirc_abi": "1.0.0-nightly.
|
|
48
|
-
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.
|
|
49
|
-
"@aztec/noir-test-contracts.js": "1.0.0-nightly.
|
|
50
|
-
"@aztec/p2p": "1.0.0-nightly.
|
|
51
|
-
"@aztec/protocol-contracts": "1.0.0-nightly.
|
|
52
|
-
"@aztec/prover-client": "1.0.0-nightly.
|
|
53
|
-
"@aztec/prover-node": "1.0.0-nightly.
|
|
54
|
-
"@aztec/pxe": "1.0.0-nightly.
|
|
55
|
-
"@aztec/sequencer-client": "1.0.0-nightly.
|
|
56
|
-
"@aztec/simulator": "1.0.0-nightly.
|
|
57
|
-
"@aztec/slasher": "1.0.0-nightly.
|
|
58
|
-
"@aztec/stdlib": "1.0.0-nightly.
|
|
59
|
-
"@aztec/telemetry-client": "1.0.0-nightly.
|
|
60
|
-
"@aztec/validator-client": "1.0.0-nightly.
|
|
61
|
-
"@aztec/world-state": "1.0.0-nightly.
|
|
28
|
+
"@aztec/accounts": "1.0.0-nightly.20250715",
|
|
29
|
+
"@aztec/archiver": "1.0.0-nightly.20250715",
|
|
30
|
+
"@aztec/aztec": "1.0.0-nightly.20250715",
|
|
31
|
+
"@aztec/aztec-node": "1.0.0-nightly.20250715",
|
|
32
|
+
"@aztec/aztec.js": "1.0.0-nightly.20250715",
|
|
33
|
+
"@aztec/bb-prover": "1.0.0-nightly.20250715",
|
|
34
|
+
"@aztec/blob-lib": "1.0.0-nightly.20250715",
|
|
35
|
+
"@aztec/blob-sink": "1.0.0-nightly.20250715",
|
|
36
|
+
"@aztec/bot": "1.0.0-nightly.20250715",
|
|
37
|
+
"@aztec/cli": "1.0.0-nightly.20250715",
|
|
38
|
+
"@aztec/constants": "1.0.0-nightly.20250715",
|
|
39
|
+
"@aztec/entrypoints": "1.0.0-nightly.20250715",
|
|
40
|
+
"@aztec/epoch-cache": "1.0.0-nightly.20250715",
|
|
41
|
+
"@aztec/ethereum": "1.0.0-nightly.20250715",
|
|
42
|
+
"@aztec/foundation": "1.0.0-nightly.20250715",
|
|
43
|
+
"@aztec/kv-store": "1.0.0-nightly.20250715",
|
|
44
|
+
"@aztec/l1-artifacts": "1.0.0-nightly.20250715",
|
|
45
|
+
"@aztec/merkle-tree": "1.0.0-nightly.20250715",
|
|
46
|
+
"@aztec/noir-contracts.js": "1.0.0-nightly.20250715",
|
|
47
|
+
"@aztec/noir-noirc_abi": "1.0.0-nightly.20250715",
|
|
48
|
+
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250715",
|
|
49
|
+
"@aztec/noir-test-contracts.js": "1.0.0-nightly.20250715",
|
|
50
|
+
"@aztec/p2p": "1.0.0-nightly.20250715",
|
|
51
|
+
"@aztec/protocol-contracts": "1.0.0-nightly.20250715",
|
|
52
|
+
"@aztec/prover-client": "1.0.0-nightly.20250715",
|
|
53
|
+
"@aztec/prover-node": "1.0.0-nightly.20250715",
|
|
54
|
+
"@aztec/pxe": "1.0.0-nightly.20250715",
|
|
55
|
+
"@aztec/sequencer-client": "1.0.0-nightly.20250715",
|
|
56
|
+
"@aztec/simulator": "1.0.0-nightly.20250715",
|
|
57
|
+
"@aztec/slasher": "1.0.0-nightly.20250715",
|
|
58
|
+
"@aztec/stdlib": "1.0.0-nightly.20250715",
|
|
59
|
+
"@aztec/telemetry-client": "1.0.0-nightly.20250715",
|
|
60
|
+
"@aztec/validator-client": "1.0.0-nightly.20250715",
|
|
61
|
+
"@aztec/world-state": "1.0.0-nightly.20250715",
|
|
62
62
|
"@iarna/toml": "^2.2.5",
|
|
63
63
|
"@jest/globals": "^30.0.0",
|
|
64
64
|
"@noble/curves": "^1.0.0",
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
retryUntil,
|
|
10
10
|
sleep,
|
|
11
11
|
} from '@aztec/aztec.js';
|
|
12
|
-
import { type ExtendedViemWalletClient, createExtendedL1Client } from '@aztec/ethereum';
|
|
12
|
+
import { DefaultL1ContractsConfig, type ExtendedViemWalletClient, createExtendedL1Client } from '@aztec/ethereum';
|
|
13
13
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
14
14
|
import { ChainMonitor, DelayedTxUtils, type Delayer, waitUntilL1Timestamp, withDelayer } from '@aztec/ethereum/test';
|
|
15
15
|
import { SecretValue } from '@aztec/foundation/config';
|
|
@@ -126,6 +126,7 @@ export class EpochsTestContext {
|
|
|
126
126
|
// but not so much to hang the sequencer and timeout the teardown
|
|
127
127
|
txPropagationMaxQueryAttempts: opts.txPropagationMaxQueryAttempts ?? 12,
|
|
128
128
|
worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
|
|
129
|
+
exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
129
130
|
...opts,
|
|
130
131
|
});
|
|
131
132
|
|
|
@@ -77,8 +77,9 @@ export class P2PNetworkTest {
|
|
|
77
77
|
testName: string,
|
|
78
78
|
public bootstrapNodeEnr: string,
|
|
79
79
|
public bootNodePort: number,
|
|
80
|
-
|
|
80
|
+
public numberOfValidators: number,
|
|
81
81
|
initialValidatorConfig: AztecNodeConfig,
|
|
82
|
+
public numberOfNodes = 0,
|
|
82
83
|
// If set enable metrics collection
|
|
83
84
|
private metricsPort?: number,
|
|
84
85
|
startProverNode?: boolean,
|
|
@@ -89,7 +90,10 @@ export class P2PNetworkTest {
|
|
|
89
90
|
// Set up the base account and node private keys for the initial network deployment
|
|
90
91
|
this.baseAccountPrivateKey = `0x${getPrivateKeyFromIndex(1)!.toString('hex')}`;
|
|
91
92
|
this.baseAccount = privateKeyToAccount(this.baseAccountPrivateKey);
|
|
92
|
-
this.attesterPrivateKeys = generatePrivateKeys(
|
|
93
|
+
this.attesterPrivateKeys = generatePrivateKeys(
|
|
94
|
+
ATTESTER_PRIVATE_KEYS_START_INDEX + numberOfNodes,
|
|
95
|
+
numberOfValidators,
|
|
96
|
+
);
|
|
93
97
|
this.attesterPublicKeys = this.attesterPrivateKeys.map(privateKey => privateKeyToAccount(privateKey).address);
|
|
94
98
|
|
|
95
99
|
this.snapshotManager = createSnapshotManager(
|
|
@@ -102,7 +106,7 @@ export class P2PNetworkTest {
|
|
|
102
106
|
aztecSlotDuration: initialValidatorConfig.aztecSlotDuration ?? l1ContractsConfig.aztecSlotDuration,
|
|
103
107
|
aztecProofSubmissionEpochs:
|
|
104
108
|
initialValidatorConfig.aztecProofSubmissionEpochs ?? l1ContractsConfig.aztecProofSubmissionEpochs,
|
|
105
|
-
aztecTargetCommitteeSize:
|
|
109
|
+
aztecTargetCommitteeSize: numberOfValidators,
|
|
106
110
|
salt: 420,
|
|
107
111
|
metricsPort: metricsPort,
|
|
108
112
|
numberOfInitialFundedAccounts: 2,
|
|
@@ -115,7 +119,7 @@ export class P2PNetworkTest {
|
|
|
115
119
|
aztecSlotDuration: initialValidatorConfig.aztecSlotDuration ?? l1ContractsConfig.aztecSlotDuration,
|
|
116
120
|
aztecProofSubmissionEpochs:
|
|
117
121
|
initialValidatorConfig.aztecProofSubmissionEpochs ?? l1ContractsConfig.aztecProofSubmissionEpochs,
|
|
118
|
-
aztecTargetCommitteeSize:
|
|
122
|
+
aztecTargetCommitteeSize: numberOfValidators,
|
|
119
123
|
initialValidators: [],
|
|
120
124
|
zkPassportArgs: {
|
|
121
125
|
mockZkPassportVerifier,
|
|
@@ -127,6 +131,7 @@ export class P2PNetworkTest {
|
|
|
127
131
|
static async create({
|
|
128
132
|
testName,
|
|
129
133
|
numberOfNodes,
|
|
134
|
+
numberOfValidators,
|
|
130
135
|
basePort,
|
|
131
136
|
metricsPort,
|
|
132
137
|
initialConfig,
|
|
@@ -135,6 +140,7 @@ export class P2PNetworkTest {
|
|
|
135
140
|
}: {
|
|
136
141
|
testName: string;
|
|
137
142
|
numberOfNodes: number;
|
|
143
|
+
numberOfValidators: number;
|
|
138
144
|
basePort?: number;
|
|
139
145
|
metricsPort?: number;
|
|
140
146
|
initialConfig?: Partial<AztecNodeConfig>;
|
|
@@ -155,8 +161,9 @@ export class P2PNetworkTest {
|
|
|
155
161
|
testName,
|
|
156
162
|
bootstrapNodeEnr,
|
|
157
163
|
port,
|
|
158
|
-
|
|
164
|
+
numberOfValidators,
|
|
159
165
|
initialValidatorConfig,
|
|
166
|
+
numberOfNodes,
|
|
160
167
|
metricsPort,
|
|
161
168
|
startProverNode,
|
|
162
169
|
mockZkPassportVerifier,
|
|
@@ -187,8 +194,9 @@ export class P2PNetworkTest {
|
|
|
187
194
|
getValidators() {
|
|
188
195
|
const validators: Operator[] = [];
|
|
189
196
|
|
|
190
|
-
for (let i = 0; i < this.
|
|
191
|
-
const
|
|
197
|
+
for (let i = 0; i < this.numberOfValidators; i++) {
|
|
198
|
+
const keyIndex = i;
|
|
199
|
+
const attester = privateKeyToAccount(this.attesterPrivateKeys[keyIndex]!);
|
|
192
200
|
|
|
193
201
|
validators.push({
|
|
194
202
|
attester: EthAddress.fromString(attester.address),
|
|
@@ -211,7 +219,7 @@ export class P2PNetworkTest {
|
|
|
211
219
|
client: deployL1ContractsValues.l1Client,
|
|
212
220
|
});
|
|
213
221
|
|
|
214
|
-
this.logger.
|
|
222
|
+
this.logger.info(`Adding ${this.numberOfValidators} validators`);
|
|
215
223
|
|
|
216
224
|
const stakingAsset = getContract({
|
|
217
225
|
address: deployL1ContractsValues.l1ContractAddresses.stakingAssetAddress.toString(),
|
|
@@ -232,7 +240,7 @@ export class P2PNetworkTest {
|
|
|
232
240
|
client: deployL1ContractsValues.l1Client,
|
|
233
241
|
});
|
|
234
242
|
|
|
235
|
-
const stakeNeeded = l1ContractsConfig.depositAmount * BigInt(this.
|
|
243
|
+
const stakeNeeded = l1ContractsConfig.depositAmount * BigInt(this.numberOfValidators);
|
|
236
244
|
await Promise.all(
|
|
237
245
|
[await stakingAsset.write.mint([multiAdder.address, stakeNeeded], {} as any)].map(txHash =>
|
|
238
246
|
deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash: txHash }),
|
|
@@ -300,7 +308,7 @@ export class P2PNetworkTest {
|
|
|
300
308
|
|
|
301
309
|
async removeInitialNode() {
|
|
302
310
|
await this.snapshotManager.snapshot(
|
|
303
|
-
'remove-
|
|
311
|
+
'remove-initial-validator',
|
|
304
312
|
async ({ deployL1ContractsValues, aztecNode, dateProvider }) => {
|
|
305
313
|
// Send and await a tx to make sure we mine a block for the warp to correctly progress.
|
|
306
314
|
const { receipt } = await this._sendDummyTx(deployL1ContractsValues.l1Client);
|
|
@@ -46,6 +46,7 @@ export async function createNodes(
|
|
|
46
46
|
prefilledPublicData?: PublicDataTreeLeaf[],
|
|
47
47
|
dataDirectory?: string,
|
|
48
48
|
metricsPort?: number,
|
|
49
|
+
indexOffset = 0,
|
|
49
50
|
): Promise<AztecNodeService[]> {
|
|
50
51
|
const nodePromises: Promise<AztecNodeService>[] = [];
|
|
51
52
|
const loggerIdStorage = new AsyncLocalStorage<string>();
|
|
@@ -54,16 +55,17 @@ export async function createNodes(
|
|
|
54
55
|
addLogNameHandler(logNameHandler);
|
|
55
56
|
|
|
56
57
|
for (let i = 0; i < numNodes; i++) {
|
|
58
|
+
const index = indexOffset + i;
|
|
57
59
|
// We run on ports from the bootnode upwards
|
|
58
|
-
const port = bootNodePort +
|
|
60
|
+
const port = bootNodePort + 1 + index;
|
|
59
61
|
|
|
60
|
-
const dataDir = dataDirectory ? `${dataDirectory}-${
|
|
62
|
+
const dataDir = dataDirectory ? `${dataDirectory}-${index}` : undefined;
|
|
61
63
|
const nodePromise = createNode(
|
|
62
64
|
config,
|
|
63
65
|
dateProvider,
|
|
64
66
|
port,
|
|
65
67
|
bootstrapNodeEnr,
|
|
66
|
-
|
|
68
|
+
index,
|
|
67
69
|
prefilledPublicData,
|
|
68
70
|
dataDir,
|
|
69
71
|
metricsPort,
|
|
@@ -73,9 +75,9 @@ export async function createNodes(
|
|
|
73
75
|
}
|
|
74
76
|
const nodes = await Promise.all(nodePromises);
|
|
75
77
|
|
|
76
|
-
// Sanity check that we have a sequencer
|
|
78
|
+
// Sanity check that we have a sequencer if required
|
|
77
79
|
const seqClient = nodes[0].getSequencer();
|
|
78
|
-
if (!seqClient) {
|
|
80
|
+
if (!seqClient && config.disableValidator === false) {
|
|
79
81
|
throw new Error('Sequencer not found');
|
|
80
82
|
}
|
|
81
83
|
|