@aztec/end-to-end 4.0.0-nightly.20250907 → 4.0.0-nightly.20260108
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/bench/client_flows/benchmark.d.ts +4 -3
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +2 -2
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +26 -15
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +111 -90
- package/dest/bench/client_flows/config.d.ts +1 -1
- package/dest/bench/client_flows/data_extractor.d.ts +1 -1
- package/dest/bench/client_flows/data_extractor.js +10 -30
- package/dest/bench/utils.d.ts +3 -12
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +17 -37
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +8 -8
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +42 -42
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +13 -10
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +35 -35
- package/dest/e2e_deploy_contract/deploy_test.d.ts +12 -6
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +9 -18
- package/dest/e2e_epochs/epochs_test.d.ts +20 -12
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +36 -27
- package/dest/e2e_fees/bridging_race.notest.d.ts +1 -1
- package/dest/e2e_fees/bridging_race.notest.js +14 -11
- package/dest/e2e_fees/fees_test.d.ts +13 -9
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +39 -40
- package/dest/e2e_l1_publisher/write_json.d.ts +4 -2
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +9 -8
- package/dest/e2e_multi_validator/utils.d.ts +2 -2
- package/dest/e2e_multi_validator/utils.d.ts.map +1 -1
- package/dest/e2e_multi_validator/utils.js +4 -10
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +7 -4
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +11 -12
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +31 -0
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -0
- package/dest/e2e_p2p/inactivity_slash_test.js +136 -0
- package/dest/e2e_p2p/p2p_network.d.ts +238 -18
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +50 -25
- package/dest/e2e_p2p/shared.d.ts +16 -17
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +57 -56
- package/dest/e2e_token_contract/token_contract_test.d.ts +6 -5
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +14 -17
- package/dest/fixtures/e2e_prover_test.d.ts +13 -11
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +57 -66
- package/dest/fixtures/fixtures.d.ts +2 -3
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +2 -3
- package/dest/fixtures/get_acvm_config.d.ts +2 -2
- package/dest/fixtures/get_acvm_config.d.ts.map +1 -1
- package/dest/fixtures/get_acvm_config.js +1 -1
- package/dest/fixtures/get_bb_config.d.ts +2 -2
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +2 -2
- package/dest/fixtures/index.d.ts +1 -1
- package/dest/fixtures/l1_to_l2_messaging.d.ts +4 -3
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +2 -2
- package/dest/fixtures/logging.d.ts +1 -1
- package/dest/fixtures/setup_p2p_test.d.ts +12 -11
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +50 -24
- package/dest/fixtures/snapshot_manager.d.ts +16 -15
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +84 -88
- package/dest/fixtures/token_utils.d.ts +10 -5
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +17 -18
- package/dest/fixtures/utils.d.ts +44 -47
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +128 -185
- package/dest/fixtures/web3signer.d.ts +5 -0
- package/dest/fixtures/web3signer.d.ts.map +1 -0
- package/dest/fixtures/web3signer.js +53 -0
- package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
- package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
- package/dest/fixtures/with_telemetry_utils.js +2 -2
- package/dest/index.d.ts +1 -1
- package/dest/quality_of_service/alert_checker.d.ts +2 -2
- package/dest/quality_of_service/alert_checker.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.d.ts +20 -23
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +14 -16
- package/dest/shared/gas_portal_test_harness.d.ts +10 -17
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +11 -8
- package/dest/shared/index.d.ts +1 -1
- package/dest/shared/jest_setup.d.ts +1 -1
- package/dest/shared/jest_setup.js +1 -1
- package/dest/shared/submit-transactions.d.ts +6 -4
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +8 -7
- package/dest/shared/uniswap_l1_l2.d.ts +13 -9
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +44 -58
- package/dest/simulators/index.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts +4 -7
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +8 -5
- package/dest/simulators/token_simulator.d.ts +4 -2
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +2 -2
- package/dest/spartan/setup_test_wallets.d.ts +22 -14
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +144 -86
- package/dest/spartan/tx_metrics.d.ts +39 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +95 -0
- package/dest/spartan/utils.d.ts +101 -16
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +414 -52
- package/package.json +43 -40
- package/src/bench/client_flows/benchmark.ts +8 -8
- package/src/bench/client_flows/client_flows_benchmark.ts +143 -115
- package/src/bench/client_flows/data_extractor.ts +9 -31
- package/src/bench/utils.ts +15 -39
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +46 -63
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +46 -55
- package/src/e2e_deploy_contract/deploy_test.ts +18 -36
- package/src/e2e_epochs/epochs_test.ts +59 -42
- package/src/e2e_fees/bridging_race.notest.ts +16 -11
- package/src/e2e_fees/fees_test.ts +48 -52
- package/src/e2e_l1_publisher/write_json.ts +12 -9
- package/src/e2e_multi_validator/utils.ts +5 -11
- package/src/e2e_nested_contract/nested_contract_test.ts +15 -13
- package/src/e2e_p2p/inactivity_slash_test.ts +179 -0
- package/src/e2e_p2p/p2p_network.ts +125 -89
- package/src/e2e_p2p/shared.ts +69 -60
- package/src/e2e_token_contract/token_contract_test.ts +17 -17
- package/src/fixtures/e2e_prover_test.ts +65 -105
- package/src/fixtures/fixtures.ts +2 -5
- package/src/fixtures/get_acvm_config.ts +2 -2
- package/src/fixtures/get_bb_config.ts +3 -2
- package/src/fixtures/l1_to_l2_messaging.ts +4 -2
- package/src/fixtures/setup_p2p_test.ts +79 -32
- package/src/fixtures/snapshot_manager.ts +120 -131
- package/src/fixtures/token_utils.ts +16 -24
- package/src/fixtures/utils.ts +175 -269
- package/src/fixtures/web3signer.ts +63 -0
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/guides/up_quick_start.sh +3 -11
- package/src/quality_of_service/alert_checker.ts +1 -1
- package/src/shared/cross_chain_test_harness.ts +23 -31
- package/src/shared/gas_portal_test_harness.ts +14 -21
- package/src/shared/jest_setup.ts +1 -1
- package/src/shared/submit-transactions.ts +12 -8
- package/src/shared/uniswap_l1_l2.ts +80 -88
- package/src/simulators/lending_simulator.ts +9 -6
- package/src/simulators/token_simulator.ts +5 -2
- package/src/spartan/DEVELOP.md +15 -3
- package/src/spartan/setup_test_wallets.ts +171 -127
- package/src/spartan/tx_metrics.ts +130 -0
- package/src/spartan/utils.ts +543 -45
- package/dest/fixtures/setup_l1_contracts.d.ts +0 -6
- package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
- package/dest/fixtures/setup_l1_contracts.js +0 -17
- package/src/fixtures/setup_l1_contracts.ts +0 -26
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
* Test fixtures and utilities to set up and run a test using multiple validators
|
|
3
3
|
*/
|
|
4
4
|
import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
5
|
-
import
|
|
5
|
+
import { range } from '@aztec/foundation/array';
|
|
6
6
|
import { SecretValue } from '@aztec/foundation/config';
|
|
7
7
|
import { addLogNameHandler, removeLogNameHandler } from '@aztec/foundation/log';
|
|
8
8
|
import { bufferToHex } from '@aztec/foundation/string';
|
|
9
9
|
import type { DateProvider } from '@aztec/foundation/timer';
|
|
10
10
|
import type { ProverNodeConfig, ProverNodeDeps } from '@aztec/prover-node';
|
|
11
|
-
import type { PXEService } from '@aztec/pxe/server';
|
|
12
11
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
13
12
|
|
|
14
13
|
import getPort from 'get-port';
|
|
@@ -23,12 +22,6 @@ import { getEndToEndTestTelemetryClient } from './with_telemetry_utils.js';
|
|
|
23
22
|
// to avoid running validators with the same key
|
|
24
23
|
export const ATTESTER_PRIVATE_KEYS_START_INDEX = 3;
|
|
25
24
|
|
|
26
|
-
export interface NodeContext {
|
|
27
|
-
node: AztecNodeService;
|
|
28
|
-
pxeService: PXEService;
|
|
29
|
-
txs: SentTx[];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
25
|
export function generatePrivateKeys(startIndex: number, numberOfKeys: number): `0x${string}`[] {
|
|
33
26
|
const privateKeys: `0x${string}`[] = [];
|
|
34
27
|
// Do not start from 0 as it is used during setup
|
|
@@ -39,7 +32,7 @@ export function generatePrivateKeys(startIndex: number, numberOfKeys: number): `
|
|
|
39
32
|
}
|
|
40
33
|
|
|
41
34
|
export async function createNodes(
|
|
42
|
-
config: AztecNodeConfig,
|
|
35
|
+
config: AztecNodeConfig & { dontStartSequencer?: boolean },
|
|
43
36
|
dateProvider: DateProvider,
|
|
44
37
|
bootstrapNodeEnr: string,
|
|
45
38
|
numNodes: number,
|
|
@@ -48,6 +41,7 @@ export async function createNodes(
|
|
|
48
41
|
dataDirectory?: string,
|
|
49
42
|
metricsPort?: number,
|
|
50
43
|
indexOffset = 0,
|
|
44
|
+
validatorsPerNode = 1,
|
|
51
45
|
): Promise<AztecNodeService[]> {
|
|
52
46
|
const nodePromises: Promise<AztecNodeService>[] = [];
|
|
53
47
|
const loggerIdStorage = new AsyncLocalStorage<string>();
|
|
@@ -60,13 +54,18 @@ export async function createNodes(
|
|
|
60
54
|
// We run on ports from the bootnode upwards
|
|
61
55
|
const port = bootNodePort + 1 + index;
|
|
62
56
|
|
|
57
|
+
// Determine validator indices for this node
|
|
58
|
+
const validatorIndices = validatorsPerNode === 1 ? index : range(validatorsPerNode, validatorsPerNode * index);
|
|
59
|
+
|
|
60
|
+
// Assign data directory
|
|
63
61
|
const dataDir = dataDirectory ? `${dataDirectory}-${index}` : undefined;
|
|
62
|
+
|
|
64
63
|
const nodePromise = createNode(
|
|
65
64
|
config,
|
|
66
65
|
dateProvider,
|
|
67
66
|
port,
|
|
68
67
|
bootstrapNodeEnr,
|
|
69
|
-
|
|
68
|
+
validatorIndices,
|
|
70
69
|
prefilledPublicData,
|
|
71
70
|
dataDir,
|
|
72
71
|
metricsPort,
|
|
@@ -86,13 +85,13 @@ export async function createNodes(
|
|
|
86
85
|
return nodes;
|
|
87
86
|
}
|
|
88
87
|
|
|
89
|
-
|
|
88
|
+
/** Creates a P2P enabled instance of Aztec Node Service with a validator */
|
|
90
89
|
export async function createNode(
|
|
91
|
-
config: AztecNodeConfig,
|
|
90
|
+
config: AztecNodeConfig & { dontStartSequencer?: boolean },
|
|
92
91
|
dateProvider: DateProvider,
|
|
93
92
|
tcpPort: number,
|
|
94
93
|
bootstrapNode: string | undefined,
|
|
95
|
-
addressIndex: number,
|
|
94
|
+
addressIndex: number | number[],
|
|
96
95
|
prefilledPublicData?: PublicDataTreeLeaf[],
|
|
97
96
|
dataDirectory?: string,
|
|
98
97
|
metricsPort?: number,
|
|
@@ -100,8 +99,37 @@ export async function createNode(
|
|
|
100
99
|
) {
|
|
101
100
|
const createNode = async () => {
|
|
102
101
|
const validatorConfig = await createValidatorConfig(config, bootstrapNode, tcpPort, addressIndex, dataDirectory);
|
|
103
|
-
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
104
|
-
return await AztecNodeService.createAndSync(
|
|
102
|
+
const telemetry = await getEndToEndTestTelemetryClient(metricsPort);
|
|
103
|
+
return await AztecNodeService.createAndSync(
|
|
104
|
+
validatorConfig,
|
|
105
|
+
{ telemetry, dateProvider },
|
|
106
|
+
{ prefilledPublicData, dontStartSequencer: config.dontStartSequencer },
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Creates a P2P enabled instance of Aztec Node Service without a validator */
|
|
113
|
+
export async function createNonValidatorNode(
|
|
114
|
+
baseConfig: AztecNodeConfig,
|
|
115
|
+
dateProvider: DateProvider,
|
|
116
|
+
tcpPort: number,
|
|
117
|
+
bootstrapNode: string | undefined,
|
|
118
|
+
prefilledPublicData?: PublicDataTreeLeaf[],
|
|
119
|
+
dataDirectory?: string,
|
|
120
|
+
metricsPort?: number,
|
|
121
|
+
loggerIdStorage?: AsyncLocalStorage<string>,
|
|
122
|
+
) {
|
|
123
|
+
const createNode = async () => {
|
|
124
|
+
const p2pConfig = await createP2PConfig(baseConfig, bootstrapNode, tcpPort, dataDirectory);
|
|
125
|
+
const config: AztecNodeConfig = {
|
|
126
|
+
...p2pConfig,
|
|
127
|
+
disableValidator: true,
|
|
128
|
+
validatorPrivateKeys: undefined,
|
|
129
|
+
publisherPrivateKeys: [],
|
|
130
|
+
};
|
|
131
|
+
const telemetry = await getEndToEndTestTelemetryClient(metricsPort);
|
|
132
|
+
return await AztecNodeService.createAndSync(config, { telemetry, dateProvider }, { prefilledPublicData });
|
|
105
133
|
};
|
|
106
134
|
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
|
|
107
135
|
}
|
|
@@ -119,16 +147,15 @@ export async function createProverNode(
|
|
|
119
147
|
) {
|
|
120
148
|
const createProverNode = async () => {
|
|
121
149
|
const proverNodePrivateKey = getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex)!;
|
|
122
|
-
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
123
|
-
|
|
124
|
-
const proverConfig: Partial<ProverNodeConfig> =
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
};
|
|
150
|
+
const telemetry = await getEndToEndTestTelemetryClient(metricsPort);
|
|
151
|
+
|
|
152
|
+
const proverConfig: Partial<ProverNodeConfig> = await createP2PConfig(
|
|
153
|
+
config,
|
|
154
|
+
bootstrapNode,
|
|
155
|
+
tcpPort,
|
|
156
|
+
dataDirectory,
|
|
157
|
+
);
|
|
158
|
+
|
|
132
159
|
const aztecNodeRpcTxProvider = undefined;
|
|
133
160
|
return await createAndSyncProverNode(
|
|
134
161
|
bufferToHex(proverNodePrivateKey),
|
|
@@ -142,20 +169,14 @@ export async function createProverNode(
|
|
|
142
169
|
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createProverNode) : createProverNode();
|
|
143
170
|
}
|
|
144
171
|
|
|
145
|
-
export async function
|
|
172
|
+
export async function createP2PConfig(
|
|
146
173
|
config: AztecNodeConfig,
|
|
147
174
|
bootstrapNodeEnr?: string,
|
|
148
175
|
port?: number,
|
|
149
|
-
addressIndex: number = 1,
|
|
150
176
|
dataDirectory?: string,
|
|
151
177
|
) {
|
|
152
178
|
port = port ?? (await getPort());
|
|
153
179
|
|
|
154
|
-
const attesterPrivateKey = bufferToHex(getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex)!);
|
|
155
|
-
|
|
156
|
-
config.validatorPrivateKeys = new SecretValue([attesterPrivateKey]);
|
|
157
|
-
config.publisherPrivateKeys = [new SecretValue(attesterPrivateKey)];
|
|
158
|
-
|
|
159
180
|
const nodeConfig: AztecNodeConfig = {
|
|
160
181
|
...config,
|
|
161
182
|
p2pIp: `127.0.0.1`,
|
|
@@ -169,3 +190,29 @@ export async function createValidatorConfig(
|
|
|
169
190
|
|
|
170
191
|
return nodeConfig;
|
|
171
192
|
}
|
|
193
|
+
|
|
194
|
+
export async function createValidatorConfig(
|
|
195
|
+
config: AztecNodeConfig,
|
|
196
|
+
bootstrapNodeEnr?: string,
|
|
197
|
+
port?: number,
|
|
198
|
+
addressIndex: number | number[] = 1,
|
|
199
|
+
dataDirectory?: string,
|
|
200
|
+
) {
|
|
201
|
+
const addressIndices = Array.isArray(addressIndex) ? addressIndex : [addressIndex];
|
|
202
|
+
if (addressIndices.length === 0) {
|
|
203
|
+
throw new Error('At least one address index must be provided to create a validator config');
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const attesterPrivateKeys = addressIndices.map(index =>
|
|
207
|
+
bufferToHex(getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + index)!),
|
|
208
|
+
);
|
|
209
|
+
const p2pConfig = await createP2PConfig(config, bootstrapNodeEnr, port, dataDirectory);
|
|
210
|
+
const nodeConfig: AztecNodeConfig = {
|
|
211
|
+
...config,
|
|
212
|
+
...p2pConfig,
|
|
213
|
+
validatorPrivateKeys: new SecretValue(attesterPrivateKeys),
|
|
214
|
+
publisherPrivateKeys: [new SecretValue(attesterPrivateKeys[0])],
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
return nodeConfig;
|
|
218
|
+
}
|