@aztec/end-to-end 0.0.1-commit.2ed92850 → 0.0.1-commit.3469e52
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.d.ts +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +13 -28
- package/dest/bench/utils.d.ts +4 -5
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +7 -9
- 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 +8 -7
- 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 +0 -3
- package/dest/e2e_fees/bridging_race.notest.js +1 -1
- 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 +6 -6
- package/dest/e2e_l1_publisher/write_json.d.ts +3 -3
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +1 -1
- 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 +1 -1
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +2 -6
- package/dest/e2e_p2p/shared.d.ts +6 -6
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +14 -7
- 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 +3 -3
- package/dest/fixtures/e2e_prover_test.d.ts +1 -1
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +4 -7
- package/dest/fixtures/setup.d.ts +1 -3
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +5 -11
- package/dest/fixtures/token_utils.d.ts +1 -1
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +4 -7
- package/dest/shared/cross_chain_test_harness.d.ts +4 -3
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +11 -11
- package/dest/shared/gas_portal_test_harness.js +1 -1
- package/dest/shared/submit-transactions.d.ts +3 -3
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +11 -9
- 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 +12 -12
- package/dest/simulators/lending_simulator.js +2 -2
- package/dest/spartan/setup_test_wallets.d.ts +1 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +34 -61
- package/dest/spartan/tx_metrics.d.ts +2 -4
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +4 -28
- package/dest/spartan/utils.d.ts +260 -2
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +942 -1
- package/package.json +39 -39
- package/src/bench/client_flows/client_flows_benchmark.ts +24 -11
- package/src/bench/utils.ts +7 -9
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +12 -9
- package/src/e2e_epochs/epochs_test.ts +24 -29
- package/src/e2e_fees/bridging_race.notest.ts +4 -1
- package/src/e2e_fees/fees_test.ts +14 -10
- package/src/e2e_l1_publisher/write_json.ts +2 -2
- package/src/e2e_nested_contract/nested_contract_test.ts +4 -2
- package/src/e2e_p2p/p2p_network.ts +9 -15
- package/src/e2e_p2p/shared.ts +20 -10
- package/src/e2e_token_contract/token_contract_test.ts +5 -3
- package/src/fixtures/e2e_prover_test.ts +8 -3
- package/src/fixtures/setup.ts +13 -20
- package/src/fixtures/token_utils.ts +5 -6
- package/src/shared/cross_chain_test_harness.ts +27 -13
- package/src/shared/gas_portal_test_harness.ts +1 -1
- package/src/shared/submit-transactions.ts +15 -9
- package/src/shared/uniswap_l1_l2.ts +19 -12
- package/src/simulators/lending_simulator.ts +2 -2
- package/src/spartan/setup_test_wallets.ts +24 -72
- package/src/spartan/tx_metrics.ts +7 -26
- package/src/spartan/utils.ts +1246 -1
- package/dest/spartan/utils/bot.d.ts +0 -27
- package/dest/spartan/utils/bot.d.ts.map +0 -1
- package/dest/spartan/utils/bot.js +0 -141
- package/dest/spartan/utils/chaos.d.ts +0 -79
- package/dest/spartan/utils/chaos.d.ts.map +0 -1
- package/dest/spartan/utils/chaos.js +0 -142
- package/dest/spartan/utils/clients.d.ts +0 -39
- package/dest/spartan/utils/clients.d.ts.map +0 -1
- package/dest/spartan/utils/clients.js +0 -90
- package/dest/spartan/utils/config.d.ts +0 -36
- package/dest/spartan/utils/config.d.ts.map +0 -1
- package/dest/spartan/utils/config.js +0 -20
- package/dest/spartan/utils/health.d.ts +0 -63
- package/dest/spartan/utils/health.d.ts.map +0 -1
- package/dest/spartan/utils/health.js +0 -202
- package/dest/spartan/utils/helm.d.ts +0 -15
- package/dest/spartan/utils/helm.d.ts.map +0 -1
- package/dest/spartan/utils/helm.js +0 -47
- package/dest/spartan/utils/index.d.ts +0 -9
- package/dest/spartan/utils/index.d.ts.map +0 -1
- package/dest/spartan/utils/index.js +0 -18
- package/dest/spartan/utils/k8s.d.ts +0 -98
- package/dest/spartan/utils/k8s.d.ts.map +0 -1
- package/dest/spartan/utils/k8s.js +0 -257
- package/dest/spartan/utils/nodes.d.ts +0 -31
- package/dest/spartan/utils/nodes.d.ts.map +0 -1
- package/dest/spartan/utils/nodes.js +0 -290
- package/dest/spartan/utils/scripts.d.ts +0 -16
- package/dest/spartan/utils/scripts.d.ts.map +0 -1
- package/dest/spartan/utils/scripts.js +0 -66
- package/src/spartan/utils/bot.ts +0 -185
- package/src/spartan/utils/chaos.ts +0 -253
- package/src/spartan/utils/clients.ts +0 -100
- package/src/spartan/utils/config.ts +0 -26
- package/src/spartan/utils/health.ts +0 -255
- package/src/spartan/utils/helm.ts +0 -84
- package/src/spartan/utils/index.ts +0 -62
- package/src/spartan/utils/k8s.ts +0 -375
- package/src/spartan/utils/nodes.ts +0 -323
- package/src/spartan/utils/scripts.ts +0 -63
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.3469e52",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,44 +25,44 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
29
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
30
|
-
"@aztec/aztec": "0.0.1-commit.
|
|
31
|
-
"@aztec/aztec-node": "0.0.1-commit.
|
|
32
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
33
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
34
|
-
"@aztec/bb.js": "0.0.1-commit.
|
|
35
|
-
"@aztec/blob-client": "0.0.1-commit.
|
|
36
|
-
"@aztec/blob-lib": "0.0.1-commit.
|
|
37
|
-
"@aztec/bot": "0.0.1-commit.
|
|
38
|
-
"@aztec/cli": "0.0.1-commit.
|
|
39
|
-
"@aztec/constants": "0.0.1-commit.
|
|
40
|
-
"@aztec/entrypoints": "0.0.1-commit.
|
|
41
|
-
"@aztec/epoch-cache": "0.0.1-commit.
|
|
42
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
43
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
44
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
45
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
46
|
-
"@aztec/merkle-tree": "0.0.1-commit.
|
|
47
|
-
"@aztec/node-keystore": "0.0.1-commit.
|
|
48
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
49
|
-
"@aztec/noir-noirc_abi": "0.0.1-commit.
|
|
50
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
51
|
-
"@aztec/noir-test-contracts.js": "0.0.1-commit.
|
|
52
|
-
"@aztec/p2p": "0.0.1-commit.
|
|
53
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
54
|
-
"@aztec/prover-client": "0.0.1-commit.
|
|
55
|
-
"@aztec/prover-node": "0.0.1-commit.
|
|
56
|
-
"@aztec/pxe": "0.0.1-commit.
|
|
57
|
-
"@aztec/sequencer-client": "0.0.1-commit.
|
|
58
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
59
|
-
"@aztec/slasher": "0.0.1-commit.
|
|
60
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
61
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
62
|
-
"@aztec/test-wallet": "0.0.1-commit.
|
|
63
|
-
"@aztec/validator-client": "0.0.1-commit.
|
|
64
|
-
"@aztec/validator-ha-signer": "0.0.1-commit.
|
|
65
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
28
|
+
"@aztec/accounts": "0.0.1-commit.3469e52",
|
|
29
|
+
"@aztec/archiver": "0.0.1-commit.3469e52",
|
|
30
|
+
"@aztec/aztec": "0.0.1-commit.3469e52",
|
|
31
|
+
"@aztec/aztec-node": "0.0.1-commit.3469e52",
|
|
32
|
+
"@aztec/aztec.js": "0.0.1-commit.3469e52",
|
|
33
|
+
"@aztec/bb-prover": "0.0.1-commit.3469e52",
|
|
34
|
+
"@aztec/bb.js": "0.0.1-commit.3469e52",
|
|
35
|
+
"@aztec/blob-client": "0.0.1-commit.3469e52",
|
|
36
|
+
"@aztec/blob-lib": "0.0.1-commit.3469e52",
|
|
37
|
+
"@aztec/bot": "0.0.1-commit.3469e52",
|
|
38
|
+
"@aztec/cli": "0.0.1-commit.3469e52",
|
|
39
|
+
"@aztec/constants": "0.0.1-commit.3469e52",
|
|
40
|
+
"@aztec/entrypoints": "0.0.1-commit.3469e52",
|
|
41
|
+
"@aztec/epoch-cache": "0.0.1-commit.3469e52",
|
|
42
|
+
"@aztec/ethereum": "0.0.1-commit.3469e52",
|
|
43
|
+
"@aztec/foundation": "0.0.1-commit.3469e52",
|
|
44
|
+
"@aztec/kv-store": "0.0.1-commit.3469e52",
|
|
45
|
+
"@aztec/l1-artifacts": "0.0.1-commit.3469e52",
|
|
46
|
+
"@aztec/merkle-tree": "0.0.1-commit.3469e52",
|
|
47
|
+
"@aztec/node-keystore": "0.0.1-commit.3469e52",
|
|
48
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.3469e52",
|
|
49
|
+
"@aztec/noir-noirc_abi": "0.0.1-commit.3469e52",
|
|
50
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.3469e52",
|
|
51
|
+
"@aztec/noir-test-contracts.js": "0.0.1-commit.3469e52",
|
|
52
|
+
"@aztec/p2p": "0.0.1-commit.3469e52",
|
|
53
|
+
"@aztec/protocol-contracts": "0.0.1-commit.3469e52",
|
|
54
|
+
"@aztec/prover-client": "0.0.1-commit.3469e52",
|
|
55
|
+
"@aztec/prover-node": "0.0.1-commit.3469e52",
|
|
56
|
+
"@aztec/pxe": "0.0.1-commit.3469e52",
|
|
57
|
+
"@aztec/sequencer-client": "0.0.1-commit.3469e52",
|
|
58
|
+
"@aztec/simulator": "0.0.1-commit.3469e52",
|
|
59
|
+
"@aztec/slasher": "0.0.1-commit.3469e52",
|
|
60
|
+
"@aztec/stdlib": "0.0.1-commit.3469e52",
|
|
61
|
+
"@aztec/telemetry-client": "0.0.1-commit.3469e52",
|
|
62
|
+
"@aztec/test-wallet": "0.0.1-commit.3469e52",
|
|
63
|
+
"@aztec/validator-client": "0.0.1-commit.3469e52",
|
|
64
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.3469e52",
|
|
65
|
+
"@aztec/world-state": "0.0.1-commit.3469e52",
|
|
66
66
|
"@iarna/toml": "^2.2.5",
|
|
67
67
|
"@jest/globals": "^30.0.0",
|
|
68
68
|
"@noble/curves": "=1.0.0",
|
|
@@ -156,7 +156,8 @@ export class ClientFlowsBenchmark {
|
|
|
156
156
|
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
157
157
|
await this.feeJuiceContract.methods
|
|
158
158
|
.claim(address, claim.claimAmount, secret, index)
|
|
159
|
-
.send({ from: this.adminAddress })
|
|
159
|
+
.send({ from: this.adminAddress })
|
|
160
|
+
.wait();
|
|
160
161
|
}
|
|
161
162
|
|
|
162
163
|
/** Admin mints bananaCoin tokens privately to the target address and redeems them. */
|
|
@@ -251,7 +252,9 @@ export class ClientFlowsBenchmark {
|
|
|
251
252
|
'BC',
|
|
252
253
|
'BC',
|
|
253
254
|
18n,
|
|
254
|
-
)
|
|
255
|
+
)
|
|
256
|
+
.send({ from: this.adminAddress })
|
|
257
|
+
.wait();
|
|
255
258
|
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
256
259
|
this.bananaCoin = bananaCoin;
|
|
257
260
|
this.bananaCoinInstance = bananaCoinInstance;
|
|
@@ -265,7 +268,9 @@ export class ClientFlowsBenchmark {
|
|
|
265
268
|
'CBC',
|
|
266
269
|
'CBC',
|
|
267
270
|
18n,
|
|
268
|
-
)
|
|
271
|
+
)
|
|
272
|
+
.send({ from: this.adminAddress })
|
|
273
|
+
.wait();
|
|
269
274
|
this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
|
|
270
275
|
this.candyBarCoin = candyBarCoin;
|
|
271
276
|
this.candyBarCoinInstance = candyBarCoinInstance;
|
|
@@ -281,7 +286,9 @@ export class ClientFlowsBenchmark {
|
|
|
281
286
|
this.adminWallet,
|
|
282
287
|
bananaCoin.address,
|
|
283
288
|
this.adminAddress,
|
|
284
|
-
)
|
|
289
|
+
)
|
|
290
|
+
.send({ from: this.adminAddress })
|
|
291
|
+
.wait();
|
|
285
292
|
|
|
286
293
|
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
287
294
|
|
|
@@ -329,10 +336,12 @@ export class ClientFlowsBenchmark {
|
|
|
329
336
|
const benchysAddress = benchysAccountManager.address;
|
|
330
337
|
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
|
|
331
338
|
const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
|
|
332
|
-
await behchysDeployMethod
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
339
|
+
await behchysDeployMethod
|
|
340
|
+
.send({
|
|
341
|
+
from: AztecAddress.ZERO,
|
|
342
|
+
fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
|
|
343
|
+
})
|
|
344
|
+
.wait();
|
|
336
345
|
// Register benchy on the user's Wallet, where we're going to be interacting from
|
|
337
346
|
const accountManager = await this.userWallet.createAccount({
|
|
338
347
|
secret: benchysAccount.getSecretKey(),
|
|
@@ -350,15 +359,19 @@ export class ClientFlowsBenchmark {
|
|
|
350
359
|
'LPT',
|
|
351
360
|
'LPT',
|
|
352
361
|
18n,
|
|
353
|
-
)
|
|
362
|
+
)
|
|
363
|
+
.send({ from: this.adminAddress })
|
|
364
|
+
.wait();
|
|
354
365
|
const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
|
|
355
366
|
this.adminWallet,
|
|
356
367
|
this.bananaCoin.address,
|
|
357
368
|
this.candyBarCoin.address,
|
|
358
369
|
liquidityToken.address,
|
|
359
|
-
)
|
|
370
|
+
)
|
|
371
|
+
.send({ from: this.adminAddress })
|
|
372
|
+
.wait();
|
|
360
373
|
this.logger.info(`AMM deployed at ${amm.address}`);
|
|
361
|
-
await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress });
|
|
374
|
+
await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress }).wait();
|
|
362
375
|
this.liquidityToken = liquidityToken;
|
|
363
376
|
this.liquidityTokenInstance = liquidityTokenInstance;
|
|
364
377
|
this.amm = amm;
|
package/src/bench/utils.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
2
2
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
-
import { BatchCall,
|
|
4
|
-
import { waitForTx } from '@aztec/aztec.js/node';
|
|
3
|
+
import { BatchCall, type SentTx, type WaitOpts } from '@aztec/aztec.js/contracts';
|
|
5
4
|
import { mean, stdDev, times } from '@aztec/foundation/collection';
|
|
6
5
|
import { BenchmarkingContract } from '@aztec/noir-test-contracts.js/Benchmarking';
|
|
7
|
-
import type { TxHash } from '@aztec/stdlib/tx';
|
|
8
6
|
import type { MetricDefinition } from '@aztec/telemetry-client';
|
|
9
7
|
import type { BenchmarkDataPoint, BenchmarkMetricsType, BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
|
|
10
8
|
|
|
@@ -25,7 +23,7 @@ export async function benchmarkSetup(
|
|
|
25
23
|
) {
|
|
26
24
|
const context = await setup(1, { ...opts, telemetryConfig: { benchmark: true } });
|
|
27
25
|
const defaultAccountAddress = context.accounts[0];
|
|
28
|
-
const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress });
|
|
26
|
+
const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress }).deployed();
|
|
29
27
|
context.logger.info(`Deployed benchmarking contract at ${contract.address}`);
|
|
30
28
|
const sequencer = (context.aztecNode as AztecNodeService).getSequencer()!;
|
|
31
29
|
const telemetry = context.telemetryClient! as BenchmarkTelemetryClient;
|
|
@@ -144,18 +142,18 @@ export async function sendTxs(
|
|
|
144
142
|
context: EndToEndContext,
|
|
145
143
|
contract: BenchmarkingContract,
|
|
146
144
|
heavyPublicCompute: boolean = false,
|
|
147
|
-
): Promise<
|
|
145
|
+
): Promise<SentTx[]> {
|
|
148
146
|
const calls = await Promise.all(times(txCount, index => makeCall(index, context, contract, heavyPublicCompute)));
|
|
149
147
|
context.logger.info(`Creating ${txCount} txs`);
|
|
150
148
|
const [from] = context.accounts;
|
|
151
149
|
context.logger.info(`Sending ${txCount} txs`);
|
|
152
|
-
return
|
|
150
|
+
return calls.map(call => call.send({ from }));
|
|
153
151
|
}
|
|
154
152
|
|
|
155
|
-
export async function waitTxs(txs:
|
|
153
|
+
export async function waitTxs(txs: SentTx[], context: EndToEndContext, txWaitOpts?: WaitOpts) {
|
|
156
154
|
context.logger.info(`Awaiting ${txs.length} txs to be mined`);
|
|
157
|
-
await Promise.all(txs.map(
|
|
158
|
-
context.logger.info(
|
|
155
|
+
await Promise.all(txs.map(tx => tx.wait(txWaitOpts)));
|
|
156
|
+
context.logger.info(`All ${txs.length} txs have been mined`);
|
|
159
157
|
}
|
|
160
158
|
|
|
161
159
|
function randomBytesAsBigInts(length: number): bigint[] {
|
|
@@ -105,13 +105,13 @@ export class BlacklistTokenContractTest {
|
|
|
105
105
|
await publicDeployAccounts(this.wallet, [this.adminAddress, this.otherAddress, this.blacklistedAddress]);
|
|
106
106
|
|
|
107
107
|
this.logger.verbose(`Deploying TokenContract...`);
|
|
108
|
-
this.asset = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress)
|
|
109
|
-
from: this.adminAddress
|
|
110
|
-
|
|
108
|
+
this.asset = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress)
|
|
109
|
+
.send({ from: this.adminAddress })
|
|
110
|
+
.deployed();
|
|
111
111
|
this.logger.verbose(`Token deployed to ${this.asset.address}`);
|
|
112
112
|
|
|
113
113
|
this.logger.verbose(`Deploying bad account...`);
|
|
114
|
-
this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress });
|
|
114
|
+
this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress }).deployed();
|
|
115
115
|
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
116
116
|
|
|
117
117
|
await this.crossTimestampOfChange();
|
|
@@ -171,12 +171,14 @@ export class BlacklistTokenContractTest {
|
|
|
171
171
|
const adminMinterRole = new Role().withAdmin().withMinter();
|
|
172
172
|
await this.asset.methods
|
|
173
173
|
.update_roles(this.adminAddress, adminMinterRole.toNoirStruct())
|
|
174
|
-
.send({ from: this.adminAddress })
|
|
174
|
+
.send({ from: this.adminAddress })
|
|
175
|
+
.wait();
|
|
175
176
|
|
|
176
177
|
const blacklistRole = new Role().withBlacklisted();
|
|
177
178
|
await this.asset.methods
|
|
178
179
|
.update_roles(this.blacklistedAddress, blacklistRole.toNoirStruct())
|
|
179
|
-
.send({ from: this.adminAddress })
|
|
180
|
+
.send({ from: this.adminAddress })
|
|
181
|
+
.wait();
|
|
180
182
|
|
|
181
183
|
await this.crossTimestampOfChange();
|
|
182
184
|
|
|
@@ -185,15 +187,16 @@ export class BlacklistTokenContractTest {
|
|
|
185
187
|
);
|
|
186
188
|
|
|
187
189
|
this.logger.verbose(`Minting ${amount} publicly...`);
|
|
188
|
-
await asset.methods.mint_public(this.adminAddress, amount).send({ from: this.adminAddress });
|
|
190
|
+
await asset.methods.mint_public(this.adminAddress, amount).send({ from: this.adminAddress }).wait();
|
|
189
191
|
|
|
190
192
|
this.logger.verbose(`Minting ${amount} privately...`);
|
|
191
193
|
const secret = Fr.random();
|
|
192
194
|
const secretHash = await computeSecretHash(secret);
|
|
193
|
-
const receipt = await asset.methods.mint_private(amount, secretHash).send({ from: this.adminAddress });
|
|
195
|
+
const receipt = await asset.methods.mint_private(amount, secretHash).send({ from: this.adminAddress }).wait();
|
|
194
196
|
|
|
195
197
|
await this.addPendingShieldNoteToPXE(asset, this.adminAddress, amount, secretHash, receipt.txHash);
|
|
196
|
-
|
|
198
|
+
const txClaim = asset.methods.redeem_shield(this.adminAddress, amount, secret).send({ from: this.adminAddress });
|
|
199
|
+
await txClaim.wait();
|
|
197
200
|
this.logger.verbose(`Minting complete.`);
|
|
198
201
|
|
|
199
202
|
tokenSim.mintPublic(this.adminAddress, amount);
|
|
@@ -121,35 +121,30 @@ export class EpochsTestContext {
|
|
|
121
121
|
|
|
122
122
|
// Set up system without any account nor protocol contracts
|
|
123
123
|
// and with faster block times and shorter epochs.
|
|
124
|
-
const context = await setup(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
...opts,
|
|
149
|
-
},
|
|
150
|
-
// Use checkpointed chain tip for PXE to avoid issues with blocks being dropped due to pruned anchor blocks.
|
|
151
|
-
{ syncChainTip: 'checkpointed' },
|
|
152
|
-
);
|
|
124
|
+
const context = await setup(opts.numberOfAccounts ?? 0, {
|
|
125
|
+
automineL1Setup: true,
|
|
126
|
+
checkIntervalMs: 50,
|
|
127
|
+
archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
|
|
128
|
+
worldStateBlockCheckIntervalMS: WORLD_STATE_BLOCK_CHECK_INTERVAL,
|
|
129
|
+
aztecEpochDuration,
|
|
130
|
+
aztecSlotDuration,
|
|
131
|
+
ethereumSlotDuration,
|
|
132
|
+
aztecProofSubmissionEpochs,
|
|
133
|
+
aztecTargetCommitteeSize: opts.initialValidators?.length ?? 0,
|
|
134
|
+
minTxsPerBlock: 0,
|
|
135
|
+
realProofs: false,
|
|
136
|
+
startProverNode: true,
|
|
137
|
+
proverTestDelayMs: opts.proverTestDelayMs ?? 0,
|
|
138
|
+
// We use numeric incremental prover ids for simplicity, but we can switch to
|
|
139
|
+
// using the prover's eth address if the proverId is used for something in the rollup contract
|
|
140
|
+
// Use numeric EthAddress for deterministic prover id
|
|
141
|
+
proverId: EthAddress.fromNumber(1),
|
|
142
|
+
worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
|
|
143
|
+
exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
144
|
+
slasherFlavor: 'none',
|
|
145
|
+
l1PublishingTime,
|
|
146
|
+
...opts,
|
|
147
|
+
});
|
|
153
148
|
|
|
154
149
|
this.context = context;
|
|
155
150
|
this.proverNodes = context.proverNode ? [context.proverNode] : [];
|
|
@@ -67,7 +67,10 @@ describe('e2e_fees bridging_race', () => {
|
|
|
67
67
|
// Yes, we need to REFACTOR it at some point
|
|
68
68
|
const claim = await t.feeJuiceBridgeTestHarness.prepareTokensOnL1(bobsAddress);
|
|
69
69
|
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
70
|
-
await t.feeJuiceContract.methods
|
|
70
|
+
await t.feeJuiceContract.methods
|
|
71
|
+
.claim(bobsAddress, claim.claimAmount, secret, index)
|
|
72
|
+
.send({ from: bobsAddress })
|
|
73
|
+
.wait();
|
|
71
74
|
const [balance] = await t.getGasBalanceFn(bobsAddress);
|
|
72
75
|
expect(balance).toEqual(claim.claimAmount);
|
|
73
76
|
});
|
|
@@ -152,7 +152,10 @@ export class FeesTest {
|
|
|
152
152
|
async mintAndBridgeFeeJuice(minter: AztecAddress, recipient: AztecAddress) {
|
|
153
153
|
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(recipient);
|
|
154
154
|
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
155
|
-
await this.feeJuiceContract.methods
|
|
155
|
+
await this.feeJuiceContract.methods
|
|
156
|
+
.claim(recipient, claim.claimAmount, secret, index)
|
|
157
|
+
.send({ from: minter })
|
|
158
|
+
.wait();
|
|
156
159
|
}
|
|
157
160
|
|
|
158
161
|
/** Alice mints bananaCoin tokens privately to the target address and redeems them. */
|
|
@@ -232,9 +235,9 @@ export class FeesTest {
|
|
|
232
235
|
async applyDeployBananaToken() {
|
|
233
236
|
this.logger.info('Applying deploy banana token setup');
|
|
234
237
|
|
|
235
|
-
const bananaCoin = await BananaCoin.deploy(this.wallet, this.aliceAddress, 'BC', 'BC', 18n)
|
|
236
|
-
from: this.aliceAddress
|
|
237
|
-
|
|
238
|
+
const bananaCoin = await BananaCoin.deploy(this.wallet, this.aliceAddress, 'BC', 'BC', 18n)
|
|
239
|
+
.send({ from: this.aliceAddress })
|
|
240
|
+
.deployed();
|
|
238
241
|
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
239
242
|
|
|
240
243
|
this.bananaCoin = bananaCoin;
|
|
@@ -259,9 +262,9 @@ export class FeesTest {
|
|
|
259
262
|
expect((await this.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
260
263
|
|
|
261
264
|
const bananaCoin = this.bananaCoin;
|
|
262
|
-
const bananaFPC = await FPCContract.deploy(this.wallet, bananaCoin.address, this.fpcAdmin)
|
|
263
|
-
from: this.aliceAddress
|
|
264
|
-
|
|
265
|
+
const bananaFPC = await FPCContract.deploy(this.wallet, bananaCoin.address, this.fpcAdmin)
|
|
266
|
+
.send({ from: this.aliceAddress })
|
|
267
|
+
.deployed();
|
|
265
268
|
|
|
266
269
|
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
267
270
|
|
|
@@ -303,10 +306,10 @@ export class FeesTest {
|
|
|
303
306
|
await this.rollupContract.getManaTarget(),
|
|
304
307
|
) + (await this.rollupContract.getProvingCostPerMana());
|
|
305
308
|
|
|
306
|
-
const price = await this.rollupContract.
|
|
309
|
+
const price = await this.rollupContract.getFeeAssetPerEth();
|
|
307
310
|
|
|
308
311
|
const mana = block!.header.totalManaUsed.toBigInt();
|
|
309
|
-
return mulDiv(mana * proverCost, 10n **
|
|
312
|
+
return mulDiv(mana * proverCost, price, 10n ** 9n);
|
|
310
313
|
};
|
|
311
314
|
}
|
|
312
315
|
|
|
@@ -328,7 +331,8 @@ export class FeesTest {
|
|
|
328
331
|
await this.mintPrivateBananas(this.ALICE_INITIAL_BANANAS, this.aliceAddress);
|
|
329
332
|
await this.bananaCoin.methods
|
|
330
333
|
.mint_to_public(this.aliceAddress, this.ALICE_INITIAL_BANANAS)
|
|
331
|
-
.send({ from: this.aliceAddress })
|
|
334
|
+
.send({ from: this.aliceAddress })
|
|
335
|
+
.wait();
|
|
332
336
|
}
|
|
333
337
|
|
|
334
338
|
public async applyFundAliceWithPrivateBananas() {
|
|
@@ -2,7 +2,7 @@ import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
|
2
2
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
3
3
|
import { BatchedBlob, Blob, getEthBlobEvaluationInputs, getPrefixedEthBlobCommitments } from '@aztec/blob-lib';
|
|
4
4
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
|
-
import {
|
|
5
|
+
import { L2BlockNew } from '@aztec/stdlib/block';
|
|
6
6
|
import { CheckpointHeader } from '@aztec/stdlib/rollup';
|
|
7
7
|
|
|
8
8
|
import { writeFile } from 'fs/promises';
|
|
@@ -15,7 +15,7 @@ const AZTEC_GENERATE_TEST_DATA = !!process.env.AZTEC_GENERATE_TEST_DATA;
|
|
|
15
15
|
*/
|
|
16
16
|
export async function writeJson(
|
|
17
17
|
fileName: string,
|
|
18
|
-
block:
|
|
18
|
+
block: L2BlockNew,
|
|
19
19
|
l1ToL2Content: Fr[],
|
|
20
20
|
blobs: Blob[],
|
|
21
21
|
batchedBlob: BatchedBlob,
|
|
@@ -65,8 +65,10 @@ export class NestedContractTest {
|
|
|
65
65
|
|
|
66
66
|
async applyManual() {
|
|
67
67
|
this.logger.info('Deploying parent and child contracts');
|
|
68
|
-
const parentContract = await ParentContract.deploy(this.wallet)
|
|
69
|
-
|
|
68
|
+
const parentContract = await ParentContract.deploy(this.wallet)
|
|
69
|
+
.send({ from: this.defaultAccountAddress })
|
|
70
|
+
.deployed();
|
|
71
|
+
const childContract = await ChildContract.deploy(this.wallet).send({ from: this.defaultAccountAddress }).deployed();
|
|
70
72
|
this.parentContract = parentContract;
|
|
71
73
|
this.childContract = childContract;
|
|
72
74
|
}
|
|
@@ -128,7 +128,6 @@ export class P2PNetworkTest {
|
|
|
128
128
|
metricsPort: metricsPort,
|
|
129
129
|
numberOfInitialFundedAccounts: 2,
|
|
130
130
|
startProverNode,
|
|
131
|
-
walletMinFeePadding: 2.0,
|
|
132
131
|
};
|
|
133
132
|
|
|
134
133
|
this.deployL1ContractsArgs = {
|
|
@@ -322,7 +321,7 @@ export class P2PNetworkTest {
|
|
|
322
321
|
throw new Error('Call setupAccount before deploying spam contract');
|
|
323
322
|
}
|
|
324
323
|
|
|
325
|
-
const spamContract = await SpamContract.deploy(this.wallet).send({ from: this.defaultAccountAddress! });
|
|
324
|
+
const spamContract = await SpamContract.deploy(this.wallet).send({ from: this.defaultAccountAddress! }).deployed();
|
|
326
325
|
this.spamContract = spamContract;
|
|
327
326
|
}
|
|
328
327
|
|
|
@@ -352,19 +351,14 @@ export class P2PNetworkTest {
|
|
|
352
351
|
|
|
353
352
|
async setup() {
|
|
354
353
|
this.logger.info('Setting up subsystems from fresh');
|
|
355
|
-
this.context = await setup(
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
l1ContractsArgs: this.deployL1ContractsArgs,
|
|
364
|
-
},
|
|
365
|
-
// Use checkpointed chain tip for PXE to avoid issues with blocks being dropped due to pruned anchor blocks.
|
|
366
|
-
{ syncChainTip: 'checkpointed' },
|
|
367
|
-
);
|
|
354
|
+
this.context = await setup(0, {
|
|
355
|
+
...this.setupOptions,
|
|
356
|
+
fundSponsoredFPC: true,
|
|
357
|
+
skipAccountDeployment: true,
|
|
358
|
+
slasherFlavor: this.setupOptions.slasherFlavor ?? this.deployL1ContractsArgs.slasherFlavor ?? 'none',
|
|
359
|
+
aztecTargetCommitteeSize: 0,
|
|
360
|
+
l1ContractsArgs: this.deployL1ContractsArgs,
|
|
361
|
+
});
|
|
368
362
|
this.ctx = this.context;
|
|
369
363
|
|
|
370
364
|
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
package/src/e2e_p2p/shared.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
2
2
|
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
3
3
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
4
|
-
import {
|
|
4
|
+
import { type SentTx, getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
|
|
5
5
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
6
6
|
import type { Logger } from '@aztec/aztec.js/log';
|
|
7
|
-
import {
|
|
7
|
+
import { Tx, TxStatus } from '@aztec/aztec.js/tx';
|
|
8
8
|
import type { RollupCheatCodes } from '@aztec/aztec/testing';
|
|
9
9
|
import type {
|
|
10
10
|
EmpireSlashingProposerContract,
|
|
@@ -22,7 +22,7 @@ import { getPXEConfig, getPXEConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
|
22
22
|
import { getRoundForOffense } from '@aztec/slasher';
|
|
23
23
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
24
24
|
import type { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
25
|
-
import {
|
|
25
|
+
import { TestWallet, proveInteraction } from '@aztec/test-wallet/server';
|
|
26
26
|
|
|
27
27
|
import { submitTxsTo } from '../shared/submit-transactions.js';
|
|
28
28
|
|
|
@@ -34,15 +34,24 @@ export const submitComplexTxsTo = async (
|
|
|
34
34
|
numTxs: number,
|
|
35
35
|
opts: { callPublic?: boolean } = {},
|
|
36
36
|
) => {
|
|
37
|
-
const txs:
|
|
37
|
+
const txs: SentTx[] = [];
|
|
38
38
|
|
|
39
39
|
const seed = 1234n;
|
|
40
40
|
const spamCount = 15;
|
|
41
41
|
for (let i = 0; i < numTxs; i++) {
|
|
42
|
-
const
|
|
43
|
-
const txHash = await
|
|
42
|
+
const tx = spamContract.methods.spam(seed + BigInt(i * spamCount), spamCount, !!opts.callPublic).send({ from });
|
|
43
|
+
const txHash = await tx.getTxHash();
|
|
44
|
+
|
|
44
45
|
logger.info(`Tx sent with hash ${txHash.toString()}`);
|
|
45
|
-
|
|
46
|
+
const receipt = await tx.getReceipt();
|
|
47
|
+
expect(receipt).toEqual(
|
|
48
|
+
expect.objectContaining({
|
|
49
|
+
status: TxStatus.PENDING,
|
|
50
|
+
error: '',
|
|
51
|
+
}),
|
|
52
|
+
);
|
|
53
|
+
logger.info(`Receipt received for ${txHash.toString()}`);
|
|
54
|
+
txs.push(tx);
|
|
46
55
|
}
|
|
47
56
|
return txs;
|
|
48
57
|
};
|
|
@@ -53,7 +62,7 @@ export const submitTransactions = async (
|
|
|
53
62
|
node: AztecNodeService,
|
|
54
63
|
numTxs: number,
|
|
55
64
|
fundedAccount: InitialAccountData,
|
|
56
|
-
): Promise<
|
|
65
|
+
): Promise<SentTx[]> => {
|
|
57
66
|
const rpcConfig = getRpcConfig();
|
|
58
67
|
rpcConfig.proverEnabled = false;
|
|
59
68
|
const wallet = await TestWallet.create(node, { ...getPXEConfig(), proverEnabled: false }, { useLogSuffix: true });
|
|
@@ -66,7 +75,7 @@ export async function prepareTransactions(
|
|
|
66
75
|
node: AztecNodeService,
|
|
67
76
|
numTxs: number,
|
|
68
77
|
fundedAccount: InitialAccountData,
|
|
69
|
-
): Promise<
|
|
78
|
+
): Promise<Tx[]> {
|
|
70
79
|
const rpcConfig = getRpcConfig();
|
|
71
80
|
rpcConfig.proverEnabled = false;
|
|
72
81
|
|
|
@@ -83,7 +92,8 @@ export async function prepareTransactions(
|
|
|
83
92
|
const tx = await proveInteraction(wallet, contract.methods.emit_nullifier(Fr.random()), {
|
|
84
93
|
from: fundedAccountManager.address,
|
|
85
94
|
});
|
|
86
|
-
|
|
95
|
+
const txHash = tx.getTxHash();
|
|
96
|
+
logger.info(`Tx prepared with hash ${txHash}`);
|
|
87
97
|
return tx;
|
|
88
98
|
});
|
|
89
99
|
}
|
|
@@ -85,11 +85,13 @@ export class TokenContractTest {
|
|
|
85
85
|
TokenContractTest.TOKEN_NAME,
|
|
86
86
|
TokenContractTest.TOKEN_SYMBOL,
|
|
87
87
|
TokenContractTest.TOKEN_DECIMALS,
|
|
88
|
-
)
|
|
88
|
+
)
|
|
89
|
+
.send({ from: this.adminAddress })
|
|
90
|
+
.deployed();
|
|
89
91
|
this.logger.verbose(`Token deployed to ${this.asset.address}`);
|
|
90
92
|
|
|
91
93
|
this.logger.verbose(`Deploying bad account...`);
|
|
92
|
-
this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress });
|
|
94
|
+
this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress }).deployed();
|
|
93
95
|
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
94
96
|
|
|
95
97
|
this.tokenSim = new TokenSimulator(this.asset, this.wallet, this.adminAddress, this.logger, [
|
|
@@ -128,7 +130,7 @@ export class TokenContractTest {
|
|
|
128
130
|
const amount = 10000n;
|
|
129
131
|
|
|
130
132
|
this.logger.verbose(`Minting ${amount} publicly...`);
|
|
131
|
-
await asset.methods.mint_to_public(adminAddress, amount).send({ from: adminAddress });
|
|
133
|
+
await asset.methods.mint_to_public(adminAddress, amount).send({ from: adminAddress }).wait();
|
|
132
134
|
tokenSim.mintPublic(adminAddress, amount);
|
|
133
135
|
|
|
134
136
|
const publicBalance = await asset.methods.balance_of_public(adminAddress).simulate({ from: adminAddress });
|
|
@@ -114,7 +114,9 @@ export class FullProverTest {
|
|
|
114
114
|
FullProverTest.TOKEN_NAME,
|
|
115
115
|
FullProverTest.TOKEN_SYMBOL,
|
|
116
116
|
FullProverTest.TOKEN_DECIMALS,
|
|
117
|
-
)
|
|
117
|
+
)
|
|
118
|
+
.send({ from: this.accounts[0] })
|
|
119
|
+
.wait();
|
|
118
120
|
this.logger.verbose(`Token deployed to ${asset.address}`);
|
|
119
121
|
|
|
120
122
|
this.fakeProofsAsset = asset;
|
|
@@ -306,10 +308,13 @@ export class FullProverTest {
|
|
|
306
308
|
const publicAmount = 10000n;
|
|
307
309
|
|
|
308
310
|
this.logger.verbose(`Minting ${privateAmount + publicAmount} publicly...`);
|
|
309
|
-
await asset.methods
|
|
311
|
+
await asset.methods
|
|
312
|
+
.mint_to_public(accounts[0], privateAmount + publicAmount)
|
|
313
|
+
.send({ from: accounts[0] })
|
|
314
|
+
.wait();
|
|
310
315
|
|
|
311
316
|
this.logger.verbose(`Transferring ${privateAmount} to private...`);
|
|
312
|
-
await asset.methods.transfer_to_private(accounts[0], privateAmount).send({ from: accounts[0] });
|
|
317
|
+
await asset.methods.transfer_to_private(accounts[0], privateAmount).send({ from: accounts[0] }).wait();
|
|
313
318
|
|
|
314
319
|
this.logger.info(`Minting complete`);
|
|
315
320
|
|