@aztec/end-to-end 0.0.1-commit.6230a0c → 0.0.1-commit.64b6bbb
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/config.d.ts +2 -2
- package/dest/bench/client_flows/config.d.ts.map +1 -1
- package/dest/bench/client_flows/config.js +18 -0
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +1 -1
- 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 +3 -2
- package/dest/e2e_epochs/epochs_test.d.ts +1 -1
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +9 -3
- 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 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
- package/dest/fixtures/setup.d.ts +13 -13
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +10 -75
- package/dest/fixtures/setup_p2p_test.d.ts +10 -5
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +6 -3
- package/dest/shared/uniswap_l1_l2.d.ts +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +8 -6
- package/package.json +39 -39
- package/src/bench/client_flows/client_flows_benchmark.ts +5 -5
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/utils.ts +1 -1
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +1 -1
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +6 -7
- package/src/e2e_deploy_contract/deploy_test.ts +2 -2
- package/src/e2e_epochs/epochs_test.ts +13 -3
- package/src/e2e_fees/fees_test.ts +6 -6
- package/src/e2e_nested_contract/nested_contract_test.ts +1 -1
- package/src/e2e_p2p/inactivity_slash_test.ts +4 -4
- package/src/e2e_p2p/p2p_network.ts +4 -4
- package/src/e2e_p2p/reqresp/utils.ts +4 -4
- package/src/e2e_p2p/shared.ts +1 -0
- package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
- package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
- package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
- package/src/e2e_token_contract/token_contract_test.ts +1 -1
- package/src/fixtures/e2e_prover_test.ts +3 -3
- package/src/fixtures/setup.ts +20 -105
- package/src/fixtures/setup_p2p_test.ts +16 -7
- package/src/shared/uniswap_l1_l2.ts +8 -10
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
} from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
14
14
|
import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
|
|
15
15
|
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
16
|
-
import {
|
|
16
|
+
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
17
17
|
import { sleep } from '@aztec/foundation/sleep';
|
|
18
18
|
import { TestERC20Abi, TestERC20Bytecode } from '@aztec/l1-artifacts';
|
|
19
19
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
@@ -86,9 +86,8 @@ export class CrossChainMessagingTest {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
async advanceToEpochProven(l2TxReceipt: TxReceipt): Promise<EpochNumber> {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
);
|
|
89
|
+
const block = await this.aztecNode.getBlock(l2TxReceipt.blockNumber!);
|
|
90
|
+
const epoch = await this.rollup.getEpochNumberForCheckpoint(block!.checkpointNumber);
|
|
92
91
|
// Warp to the next epoch.
|
|
93
92
|
await this.cheatCodes.rollup.advanceToEpoch(EpochNumber(epoch + 1));
|
|
94
93
|
// Wait for the tx to be proven.
|
|
@@ -110,16 +109,16 @@ export class CrossChainMessagingTest {
|
|
|
110
109
|
|
|
111
110
|
async applyBaseSetup() {
|
|
112
111
|
// Set up base context fields
|
|
113
|
-
this.aztecNode = this.context.aztecNodeService
|
|
112
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
114
113
|
this.wallet = this.context.wallet;
|
|
115
114
|
this.aztecNodeConfig = this.context.config;
|
|
116
115
|
this.cheatCodes = this.context.cheatCodes;
|
|
117
116
|
this.deployL1ContractsValues = this.context.deployL1ContractsValues;
|
|
118
|
-
this.aztecNodeAdmin = this.context.aztecNodeService
|
|
117
|
+
this.aztecNodeAdmin = this.context.aztecNodeService;
|
|
119
118
|
|
|
120
119
|
if (this.requireEpochProven) {
|
|
121
120
|
// Turn off the watcher to prevent it from keep marking blocks as proven.
|
|
122
|
-
this.context.watcher
|
|
121
|
+
this.context.watcher.setIsMarkingAsProven(false);
|
|
123
122
|
}
|
|
124
123
|
|
|
125
124
|
// Deploy 3 accounts
|
|
@@ -30,9 +30,9 @@ export class DeployTest {
|
|
|
30
30
|
fundSponsoredFPC: true,
|
|
31
31
|
skipAccountDeployment: true,
|
|
32
32
|
});
|
|
33
|
-
this.aztecNode = this.context.aztecNodeService
|
|
33
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
34
34
|
this.wallet = this.context.wallet;
|
|
35
|
-
this.aztecNodeAdmin = this.context.aztecNodeService
|
|
35
|
+
this.aztecNodeAdmin = this.context.aztecNodeService;
|
|
36
36
|
await this.applyInitialAccount();
|
|
37
37
|
return this;
|
|
38
38
|
}
|
|
@@ -194,6 +194,7 @@ export class EpochsTestContext {
|
|
|
194
194
|
l1GenesisTime: await this.rollup.getL1GenesisTime(),
|
|
195
195
|
ethereumSlotDuration,
|
|
196
196
|
proofSubmissionEpochs: Number(await this.rollup.getProofSubmissionEpochs()),
|
|
197
|
+
targetCommitteeSize: await this.rollup.getTargetCommitteeSize(),
|
|
197
198
|
};
|
|
198
199
|
|
|
199
200
|
this.logger.info(
|
|
@@ -212,10 +213,14 @@ export class EpochsTestContext {
|
|
|
212
213
|
this.logger.warn('Creating and syncing a simulated prover node...');
|
|
213
214
|
const proverNodePrivateKey = this.getNextPrivateKey();
|
|
214
215
|
const proverIndex = this.proverNodes.length + 1;
|
|
216
|
+
const { mockGossipSubNetwork } = this.context;
|
|
215
217
|
const proverNode = await withLoggerBindings({ actor: `prover-${proverIndex}` }, () =>
|
|
216
218
|
createAndSyncProverNode(
|
|
217
219
|
proverNodePrivateKey,
|
|
218
|
-
{
|
|
220
|
+
{
|
|
221
|
+
...this.context.config,
|
|
222
|
+
p2pEnabled: this.context.config.p2pEnabled || mockGossipSubNetwork !== undefined,
|
|
223
|
+
},
|
|
219
224
|
{
|
|
220
225
|
dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
|
|
221
226
|
proverId: EthAddress.fromNumber(proverIndex),
|
|
@@ -224,7 +229,12 @@ export class EpochsTestContext {
|
|
|
224
229
|
},
|
|
225
230
|
this.context.aztecNode,
|
|
226
231
|
this.context.prefilledPublicData ?? [],
|
|
227
|
-
{
|
|
232
|
+
{
|
|
233
|
+
dateProvider: this.context.dateProvider,
|
|
234
|
+
p2pClientDeps: mockGossipSubNetwork
|
|
235
|
+
? { p2pServiceFactory: getMockPubSubP2PServiceFactory(mockGossipSubNetwork) }
|
|
236
|
+
: undefined,
|
|
237
|
+
},
|
|
228
238
|
),
|
|
229
239
|
);
|
|
230
240
|
this.proverNodes.push(proverNode);
|
|
@@ -404,7 +414,7 @@ export class EpochsTestContext {
|
|
|
404
414
|
privateKeyToAccount(this.getNextPrivateKey()),
|
|
405
415
|
this.l1Client.chain,
|
|
406
416
|
),
|
|
407
|
-
this.context.dateProvider
|
|
417
|
+
this.context.dateProvider,
|
|
408
418
|
{ ethereumSlotDuration: this.L1_BLOCK_TIME_IN_S },
|
|
409
419
|
);
|
|
410
420
|
expect(await client.getBalance({ address: client.account.address })).toBeGreaterThan(0n);
|
|
@@ -113,7 +113,7 @@ export class FeesTest {
|
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
this.rollupContract = RollupContract.getFromConfig(this.context.config);
|
|
116
|
-
this.chainMonitor = new ChainMonitor(this.rollupContract, this.context.dateProvider
|
|
116
|
+
this.chainMonitor = new ChainMonitor(this.rollupContract, this.context.dateProvider, this.logger, 200).start();
|
|
117
117
|
|
|
118
118
|
await this.applyBaseSetup();
|
|
119
119
|
|
|
@@ -126,7 +126,7 @@ export class FeesTest {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
setIsMarkingAsProven(b: boolean) {
|
|
129
|
-
this.context.watcher
|
|
129
|
+
this.context.watcher.setIsMarkingAsProven(b);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
async catchUpProvenChain() {
|
|
@@ -188,8 +188,8 @@ export class FeesTest {
|
|
|
188
188
|
});
|
|
189
189
|
|
|
190
190
|
this.wallet = this.context.wallet;
|
|
191
|
-
this.aztecNode = this.context.aztecNodeService
|
|
192
|
-
this.aztecNodeAdmin = this.context.aztecNodeService
|
|
191
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
192
|
+
this.aztecNodeAdmin = this.context.aztecNodeService;
|
|
193
193
|
this.gasSettings = GasSettings.default({ maxFeesPerGas: (await this.aztecNode.getCurrentMinFees()).mul(2) });
|
|
194
194
|
this.cheatCodes = this.context.cheatCodes;
|
|
195
195
|
this.accounts = deployedAccounts.map(a => a.address);
|
|
@@ -221,8 +221,8 @@ export class FeesTest {
|
|
|
221
221
|
);
|
|
222
222
|
|
|
223
223
|
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
224
|
-
aztecNode: this.context.aztecNodeService
|
|
225
|
-
aztecNodeAdmin: this.context.aztecNodeService
|
|
224
|
+
aztecNode: this.context.aztecNodeService,
|
|
225
|
+
aztecNodeAdmin: this.context.aztecNodeService,
|
|
226
226
|
l1Client: this.context.deployL1ContractsValues.l1Client,
|
|
227
227
|
wallet: this.wallet,
|
|
228
228
|
logger: this.logger,
|
|
@@ -44,7 +44,7 @@ export class NestedContractTest {
|
|
|
44
44
|
});
|
|
45
45
|
this.wallet = this.context.wallet;
|
|
46
46
|
[{ address: this.defaultAccountAddress }] = deployedAccounts;
|
|
47
|
-
this.aztecNode = this.context.aztecNodeService
|
|
47
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
48
48
|
|
|
49
49
|
this.logger.info('Public deploy accounts');
|
|
50
50
|
await publicDeployAccounts(this.wallet, [this.defaultAccountAddress]);
|
|
@@ -98,13 +98,13 @@ export class P2PInactivityTest {
|
|
|
98
98
|
this.rollup = rollup;
|
|
99
99
|
|
|
100
100
|
if (!this.keepInitialNode) {
|
|
101
|
-
await this.test.ctx.aztecNodeService
|
|
101
|
+
await this.test.ctx.aztecNodeService.stop();
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
// Create all active nodes
|
|
105
105
|
this.activeNodes = await createNodes(
|
|
106
106
|
this.test.ctx.aztecNodeConfig,
|
|
107
|
-
this.test.ctx.dateProvider
|
|
107
|
+
this.test.ctx.dateProvider,
|
|
108
108
|
this.test.bootstrapNodeEnr,
|
|
109
109
|
NUM_NODES - this.inactiveNodeCount - Number(this.keepInitialNode),
|
|
110
110
|
BOOT_NODE_UDP_PORT,
|
|
@@ -118,7 +118,7 @@ export class P2PInactivityTest {
|
|
|
118
118
|
const inactiveConfig = { ...this.test.ctx.aztecNodeConfig, dontStartSequencer: true };
|
|
119
119
|
this.inactiveNodes = await createNodes(
|
|
120
120
|
inactiveConfig,
|
|
121
|
-
this.test.ctx.dateProvider
|
|
121
|
+
this.test.ctx.dateProvider,
|
|
122
122
|
this.test.bootstrapNodeEnr,
|
|
123
123
|
this.inactiveNodeCount,
|
|
124
124
|
BOOT_NODE_UDP_PORT,
|
|
@@ -129,7 +129,7 @@ export class P2PInactivityTest {
|
|
|
129
129
|
);
|
|
130
130
|
|
|
131
131
|
this.nodes = [
|
|
132
|
-
...(this.keepInitialNode ? [this.test.ctx.aztecNodeService
|
|
132
|
+
...(this.keepInitialNode ? [this.test.ctx.aztecNodeService] : []),
|
|
133
133
|
...this.activeNodes,
|
|
134
134
|
...this.inactiveNodes,
|
|
135
135
|
];
|
|
@@ -333,9 +333,9 @@ export class P2PNetworkTest {
|
|
|
333
333
|
const block = await this.context.deployL1ContractsValues.l1Client.getBlock({
|
|
334
334
|
blockNumber: receipt.blockNumber,
|
|
335
335
|
});
|
|
336
|
-
this.context.dateProvider
|
|
336
|
+
this.context.dateProvider.setTime(Number(block.timestamp) * 1000);
|
|
337
337
|
|
|
338
|
-
await this.context.aztecNodeService
|
|
338
|
+
await this.context.aztecNodeService.stop();
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
async sendDummyTx() {
|
|
@@ -374,8 +374,8 @@ export class P2PNetworkTest {
|
|
|
374
374
|
this.prefilledPublicData = prefilledPublicData;
|
|
375
375
|
|
|
376
376
|
const rollupContract = RollupContract.getFromL1ContractsValues(this.context.deployL1ContractsValues);
|
|
377
|
-
this.monitor = new ChainMonitor(rollupContract, this.context.dateProvider
|
|
378
|
-
this.monitor.on('l1-block', ({ timestamp }) => this.context.dateProvider
|
|
377
|
+
this.monitor = new ChainMonitor(rollupContract, this.context.dateProvider).start();
|
|
378
|
+
this.monitor.on('l1-block', ({ timestamp }) => this.context.dateProvider.setTime(Number(timestamp) * 1000));
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
async stopNodes(nodes: AztecNodeService[]) {
|
|
@@ -81,7 +81,7 @@ export async function runReqrespTxTest(params: {
|
|
|
81
81
|
|
|
82
82
|
const nodes = await createNodes(
|
|
83
83
|
aztecNodeConfig,
|
|
84
|
-
t.ctx.dateProvider
|
|
84
|
+
t.ctx.dateProvider,
|
|
85
85
|
t.bootstrapNodeEnr,
|
|
86
86
|
NUM_VALIDATORS,
|
|
87
87
|
BOOT_NODE_UDP_PORT,
|
|
@@ -95,7 +95,7 @@ export async function runReqrespTxTest(params: {
|
|
|
95
95
|
|
|
96
96
|
await t.setupAccount();
|
|
97
97
|
|
|
98
|
-
const targetBlockNumber = await t.ctx.aztecNodeService
|
|
98
|
+
const targetBlockNumber = await t.ctx.aztecNodeService.getBlockNumber();
|
|
99
99
|
await retryUntil(
|
|
100
100
|
async () => {
|
|
101
101
|
const blockNumbers = await Promise.all(nodes.map(node => node.getBlockNumber()));
|
|
@@ -108,7 +108,7 @@ export async function runReqrespTxTest(params: {
|
|
|
108
108
|
|
|
109
109
|
t.logger.info('Preparing transactions to send');
|
|
110
110
|
const txBatches = await timesAsync(2, () =>
|
|
111
|
-
prepareTransactions(t.logger, t.ctx.aztecNodeService
|
|
111
|
+
prepareTransactions(t.logger, t.ctx.aztecNodeService, NUM_TXS_PER_NODE, t.fundedAccount),
|
|
112
112
|
);
|
|
113
113
|
|
|
114
114
|
t.logger.info('Removing initial node');
|
|
@@ -116,7 +116,7 @@ export async function runReqrespTxTest(params: {
|
|
|
116
116
|
|
|
117
117
|
t.logger.info('Starting fresh slot');
|
|
118
118
|
const [timestamp] = await t.ctx.cheatCodes.rollup.advanceToNextSlot();
|
|
119
|
-
t.ctx.dateProvider
|
|
119
|
+
t.ctx.dateProvider.setTime(Number(timestamp) * 1000);
|
|
120
120
|
const startSlotTimestamp = BigInt(timestamp);
|
|
121
121
|
|
|
122
122
|
const { proposerIndexes, nodesToTurnOffTxGossip } = await getProposerIndexes(t, startSlotTimestamp);
|
package/src/e2e_p2p/shared.ts
CHANGED
|
@@ -145,6 +145,7 @@ export async function awaitCommitteeExists({
|
|
|
145
145
|
'non-empty committee',
|
|
146
146
|
60,
|
|
147
147
|
);
|
|
148
|
+
logger.warn(`Committee has been formed`, { committee: committee!.map(c => c.toString()) });
|
|
148
149
|
return committee!.map(c => c.toString() as `0x${string}`);
|
|
149
150
|
}
|
|
150
151
|
|