@aztec/end-to-end 0.86.0-starknet.1 → 0.87.0-nightly.20250521
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/data_extractor.js +0 -1
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +5 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +5 -2
- 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 +8 -4
- package/dest/e2e_epochs/epochs_test.d.ts +9 -4
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +26 -14
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.d.ts +9 -213
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +19 -22
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_prover/e2e_prover_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/fixtures/fixtures.d.ts +2 -4
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.d.ts +5 -1
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +5 -4
- package/dest/fixtures/setup_l1_contracts.d.ts +1 -1
- package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.d.ts +1 -2
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +3 -3
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/utils.d.ts +0 -2
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +1 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/utils.d.ts +0 -1
- package/dest/spartan/utils.d.ts.map +1 -1
- package/package.json +38 -38
- package/src/bench/client_flows/data_extractor.ts +3 -3
- package/src/bench/utils.ts +3 -1
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +16 -5
- package/src/e2e_epochs/epochs_test.ts +28 -15
- package/src/e2e_nested_contract/nested_contract_test.ts +4 -1
- package/src/e2e_p2p/p2p_network.ts +26 -20
- package/src/fixtures/l1_to_l2_messaging.ts +1 -1
- package/src/fixtures/setup_p2p_test.ts +3 -3
- package/src/simulators/token_simulator.ts +0 -1
- package/src/spartan/setup_test_wallets.ts +6 -3
|
@@ -6,10 +6,12 @@ import {
|
|
|
6
6
|
type ExtendedViemWalletClient,
|
|
7
7
|
L1TxUtils,
|
|
8
8
|
RollupContract,
|
|
9
|
+
deployL1Contract,
|
|
9
10
|
getExpectedAddress,
|
|
10
11
|
getL1ContractsConfigEnvVars,
|
|
12
|
+
l1Artifacts,
|
|
11
13
|
} from '@aztec/ethereum';
|
|
12
|
-
import { ChainMonitor
|
|
14
|
+
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
13
15
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
14
16
|
import { ForwarderAbi, ForwarderBytecode, RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
|
|
15
17
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
@@ -42,9 +44,10 @@ const BOOTSTRAP_NODE_PRIVATE_KEY = '080212208f988fc0899e4a73a5aee4d271a5f2067060
|
|
|
42
44
|
const l1ContractsConfig = getL1ContractsConfigEnvVars();
|
|
43
45
|
export const WAIT_FOR_TX_TIMEOUT = l1ContractsConfig.aztecSlotDuration * 3;
|
|
44
46
|
|
|
45
|
-
export const
|
|
47
|
+
export const SHORTENED_BLOCK_TIME_CONFIG_NO_PRUNES = {
|
|
46
48
|
aztecSlotDuration: 12,
|
|
47
49
|
ethereumSlotDuration: 4,
|
|
50
|
+
aztecProofSubmissionWindow: 640,
|
|
48
51
|
};
|
|
49
52
|
|
|
50
53
|
export class P2PNetworkTest {
|
|
@@ -83,7 +86,7 @@ export class P2PNetworkTest {
|
|
|
83
86
|
this.logger = createLogger(`e2e:e2e_p2p:${testName}`);
|
|
84
87
|
|
|
85
88
|
// Set up the base account and node private keys for the initial network deployment
|
|
86
|
-
this.baseAccountPrivateKey = `0x${getPrivateKeyFromIndex(
|
|
89
|
+
this.baseAccountPrivateKey = `0x${getPrivateKeyFromIndex(1)!.toString('hex')}`;
|
|
87
90
|
this.baseAccount = privateKeyToAccount(this.baseAccountPrivateKey);
|
|
88
91
|
this.proposerPrivateKeys = generatePrivateKeys(PROPOSER_PRIVATE_KEYS_START_INDEX, numberOfNodes);
|
|
89
92
|
this.attesterPrivateKeys = generatePrivateKeys(ATTESTER_PRIVATE_KEYS_START_INDEX, numberOfNodes);
|
|
@@ -192,7 +195,7 @@ export class P2PNetworkTest {
|
|
|
192
195
|
await this.addBootstrapNode();
|
|
193
196
|
await this.snapshotManager.snapshot(
|
|
194
197
|
'add-validators',
|
|
195
|
-
async ({ deployL1ContractsValues,
|
|
198
|
+
async ({ deployL1ContractsValues, dateProvider, cheatCodes }) => {
|
|
196
199
|
const rollup = getContract({
|
|
197
200
|
address: deployL1ContractsValues.l1ContractAddresses.rollupAddress.toString(),
|
|
198
201
|
abi: RollupAbi,
|
|
@@ -207,31 +210,34 @@ export class P2PNetworkTest {
|
|
|
207
210
|
client: deployL1ContractsValues.l1Client,
|
|
208
211
|
});
|
|
209
212
|
|
|
213
|
+
const { address: multiAdderAddress } = await deployL1Contract(
|
|
214
|
+
deployL1ContractsValues.l1Client,
|
|
215
|
+
l1Artifacts.multiAdder.contractAbi,
|
|
216
|
+
l1Artifacts.multiAdder.contractBytecode,
|
|
217
|
+
[rollup.address, deployL1ContractsValues.l1Client.account.address],
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
const multiAdder = getContract({
|
|
221
|
+
address: multiAdderAddress.toString(),
|
|
222
|
+
abi: l1Artifacts.multiAdder.contractAbi,
|
|
223
|
+
client: deployL1ContractsValues.l1Client,
|
|
224
|
+
});
|
|
225
|
+
|
|
210
226
|
const stakeNeeded = l1ContractsConfig.minimumStake * BigInt(this.numberOfNodes);
|
|
211
227
|
await Promise.all(
|
|
212
|
-
[
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
[deployL1ContractsValues.l1ContractAddresses.rollupAddress.toString(), stakeNeeded],
|
|
216
|
-
{} as any,
|
|
217
|
-
),
|
|
218
|
-
].map(txHash => deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash: txHash })),
|
|
228
|
+
[await stakingAsset.write.mint([multiAdder.address, stakeNeeded], {} as any)].map(txHash =>
|
|
229
|
+
deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash: txHash }),
|
|
230
|
+
),
|
|
219
231
|
);
|
|
220
232
|
|
|
221
233
|
const { validators } = this.getValidators();
|
|
222
234
|
this.validators = validators;
|
|
235
|
+
|
|
223
236
|
await deployL1ContractsValues.l1Client.waitForTransactionReceipt({
|
|
224
|
-
hash: await
|
|
237
|
+
hash: await multiAdder.write.addValidators([this.validators]),
|
|
225
238
|
});
|
|
226
239
|
|
|
227
|
-
const
|
|
228
|
-
const timestamp = await rollup.read.getTimestampForSlot([slotsInEpoch]);
|
|
229
|
-
const cheatCodes = new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls);
|
|
230
|
-
try {
|
|
231
|
-
await cheatCodes.warp(Number(timestamp));
|
|
232
|
-
} catch (err) {
|
|
233
|
-
this.logger.debug('Warp failed, time already satisfied');
|
|
234
|
-
}
|
|
240
|
+
const timestamp = await cheatCodes.rollup.advanceToEpoch(2n);
|
|
235
241
|
|
|
236
242
|
// Send and await a tx to make sure we mine a block for the warp to correctly progress.
|
|
237
243
|
await this._sendDummyTx(deployL1ContractsValues.l1Client);
|
|
@@ -46,5 +46,5 @@ export async function sendL1ToL2Message(
|
|
|
46
46
|
const receivedMsgHash = topics.args.hash;
|
|
47
47
|
const receivedGlobalLeafIndex = topics.args.index;
|
|
48
48
|
|
|
49
|
-
return
|
|
49
|
+
return { msgHash: Fr.fromHexString(receivedMsgHash), globalLeafIndex: new Fr(receivedGlobalLeafIndex), txReceipt };
|
|
50
50
|
}
|
|
@@ -15,9 +15,9 @@ import { TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
|
|
|
15
15
|
import { getPrivateKeyFromIndex } from './utils.js';
|
|
16
16
|
import { getEndToEndTestTelemetryClient } from './with_telemetry_utils.js';
|
|
17
17
|
|
|
18
|
-
// Setup snapshots will create a node with index 0,
|
|
19
|
-
// need to start from
|
|
20
|
-
export const PROPOSER_PRIVATE_KEYS_START_INDEX =
|
|
18
|
+
// Setup snapshots will create a node with index 0, and run extra bootstrap with
|
|
19
|
+
// index 1, so all of our loops here need to start from 2 to avoid running validators with the same key
|
|
20
|
+
export const PROPOSER_PRIVATE_KEYS_START_INDEX = 2;
|
|
21
21
|
export const ATTESTER_PRIVATE_KEYS_START_INDEX = 1001;
|
|
22
22
|
|
|
23
23
|
export interface NodeContext {
|
|
@@ -170,9 +170,12 @@ export async function performTransfers({
|
|
|
170
170
|
for (let i = 0; i < rounds; i++) {
|
|
171
171
|
const interactions = await Promise.all(
|
|
172
172
|
testWallets.wallets.map(async w =>
|
|
173
|
-
(
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
(await TokenContract.at(testWallets.tokenAddress, w)).methods.transfer_in_public(
|
|
174
|
+
w.getAddress(),
|
|
175
|
+
recipient,
|
|
176
|
+
transferAmount,
|
|
177
|
+
0,
|
|
178
|
+
),
|
|
176
179
|
),
|
|
177
180
|
);
|
|
178
181
|
|