@aztec/end-to-end 0.86.0 → 0.87.0
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/client_flows_benchmark.js +1 -1
- package/dest/bench/client_flows/config.d.ts +1 -1
- package/dest/bench/client_flows/config.d.ts.map +1 -1
- package/dest/bench/client_flows/config.js +22 -3
- package/dest/bench/client_flows/data_extractor.d.ts.map +1 -1
- package/dest/bench/client_flows/data_extractor.js +23 -12
- package/dest/bench/utils.d.ts +1 -1
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +9 -5
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +1 -1
- 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 +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_deploy_contract/deploy_test.d.ts +1 -1
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.d.ts +13 -5
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +41 -16
- package/dest/e2e_fees/bridging_race.notest.d.ts +2 -0
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +1 -0
- package/dest/e2e_fees/bridging_race.notest.js +60 -0
- package/dest/e2e_fees/fees_test.d.ts +1 -1
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +15 -9
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +2 -2
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +2 -2
- package/dest/e2e_p2p/p2p_network.d.ts +10 -214
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +20 -23
- package/dest/e2e_p2p/shared.d.ts +1 -1
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +3 -7
- package/dest/e2e_prover/e2e_prover_test.d.ts.map +1 -1
- package/dest/e2e_prover/e2e_prover_test.js +2 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts +1 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +1 -1
- package/dest/fixtures/fixtures.d.ts +4 -6
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +2 -2
- 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/snapshot_manager.js +6 -2
- package/dest/fixtures/utils.d.ts +6 -6
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +64 -63
- package/dest/shared/capture_private_execution_steps.d.ts.map +1 -1
- package/dest/shared/capture_private_execution_steps.js +8 -4
- 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/shared/uniswap_l1_l2.js +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 -37
- package/src/bench/client_flows/client_flows_benchmark.ts +1 -1
- package/src/bench/client_flows/config.ts +12 -4
- package/src/bench/client_flows/data_extractor.ts +40 -20
- package/src/bench/utils.ts +7 -3
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +1 -1
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +16 -5
- package/src/e2e_deploy_contract/deploy_test.ts +1 -1
- package/src/e2e_epochs/epochs_test.ts +51 -18
- package/src/e2e_fees/bridging_race.notest.ts +74 -0
- package/src/e2e_fees/fees_test.ts +24 -9
- package/src/e2e_nested_contract/nested_contract_test.ts +6 -3
- package/src/e2e_p2p/p2p_network.ts +27 -21
- package/src/e2e_p2p/shared.ts +4 -6
- package/src/e2e_prover/e2e_prover_test.ts +1 -0
- package/src/e2e_token_contract/token_contract_test.ts +1 -1
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/fixtures.ts +2 -2
- package/src/fixtures/l1_to_l2_messaging.ts +1 -1
- package/src/fixtures/setup_p2p_test.ts +3 -3
- package/src/fixtures/snapshot_manager.ts +2 -2
- package/src/fixtures/utils.ts +57 -66
- package/src/shared/capture_private_execution_steps.ts +9 -2
- package/src/shared/uniswap_l1_l2.ts +1 -1
- package/src/simulators/token_simulator.ts +0 -1
- package/src/spartan/setup_test_wallets.ts +6 -3
|
@@ -6,13 +6,15 @@ 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
|
-
import { SpamContract } from '@aztec/noir-contracts.js/Spam';
|
|
17
|
+
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
16
18
|
import type { BootstrapNode } from '@aztec/p2p/bootstrap';
|
|
17
19
|
import { createBootstrapNodeFromPrivateKey, getBootstrapNodeEnr } from '@aztec/p2p/test-helpers';
|
|
18
20
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
@@ -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);
|
package/src/e2e_p2p/shared.ts
CHANGED
|
@@ -3,8 +3,8 @@ import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
|
3
3
|
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
4
4
|
import { Fr, type Logger, ProvenTx, type SentTx, TxStatus, getContractInstanceFromDeployParams } from '@aztec/aztec.js';
|
|
5
5
|
import { timesAsync } from '@aztec/foundation/collection';
|
|
6
|
-
import type { SpamContract } from '@aztec/noir-contracts.js/Spam';
|
|
7
|
-
import { TestContract, TestContractArtifact } from '@aztec/noir-contracts.js/Test';
|
|
6
|
+
import type { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
7
|
+
import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.js/Test';
|
|
8
8
|
import { PXEService, createPXEService, getPXEServiceConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
9
9
|
|
|
10
10
|
import type { NodeContext } from '../fixtures/setup_p2p_test.js';
|
|
@@ -22,9 +22,7 @@ export const submitComplexTxsTo = async (
|
|
|
22
22
|
const seed = 1234n;
|
|
23
23
|
const spamCount = 15;
|
|
24
24
|
for (let i = 0; i < numTxs; i++) {
|
|
25
|
-
const tx = spamContract.methods
|
|
26
|
-
.spam(seed + BigInt(i * spamCount), spamCount, !!opts.callPublic)
|
|
27
|
-
.send({ skipPublicSimulation: true });
|
|
25
|
+
const tx = spamContract.methods.spam(seed + BigInt(i * spamCount), spamCount, !!opts.callPublic).send();
|
|
28
26
|
const txHash = await tx.getTxHash();
|
|
29
27
|
|
|
30
28
|
logger.info(`Tx sent with hash ${txHash}`);
|
|
@@ -84,7 +82,7 @@ export async function createPXEServiceAndPrepareTransactions(
|
|
|
84
82
|
const contract = await TestContract.at(testContractInstance.address, wallet);
|
|
85
83
|
|
|
86
84
|
const txs = await timesAsync(numTxs, async () => {
|
|
87
|
-
const tx = await contract.methods.emit_nullifier(Fr.random()).prove(
|
|
85
|
+
const tx = await contract.methods.emit_nullifier(Fr.random()).prove();
|
|
88
86
|
const txHash = await tx.getTxHash();
|
|
89
87
|
logger.info(`Tx prepared with hash ${txHash}`);
|
|
90
88
|
return tx;
|
|
@@ -294,6 +294,7 @@ export class FullProverTest {
|
|
|
294
294
|
txGatheringIntervalMs: 1000,
|
|
295
295
|
txGatheringBatchSize: 10,
|
|
296
296
|
txGatheringMaxParallelRequestsPerNode: 100,
|
|
297
|
+
proverNodeFailedEpochStore: undefined,
|
|
297
298
|
};
|
|
298
299
|
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
299
300
|
const { prefilledPublicData } = await getGenesisValues(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { type AccountWallet, type AztecNode, type CompleteAddress, type Logger, createLogger } from '@aztec/aztec.js';
|
|
3
|
-
import { InvalidAccountContract } from '@aztec/noir-contracts.js/InvalidAccount';
|
|
4
3
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
4
|
+
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
5
5
|
|
|
6
6
|
import { jest } from '@jest/globals';
|
|
7
7
|
|