@aztec/end-to-end 0.0.1-commit.fcb71a6 → 0.0.1-commit.ff7989d6c
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 +3 -2
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +21 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +13 -14
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +121 -136
- 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/bench/client_flows/data_extractor.js +3 -1
- package/dest/bench/utils.d.ts +9 -8
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +17 -12
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +9 -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 +106 -112
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +16 -11
- 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 +90 -70
- package/dest/e2e_deploy_contract/deploy_test.d.ts +5 -4
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +18 -13
- package/dest/e2e_epochs/epochs_test.d.ts +15 -7
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +87 -40
- package/dest/e2e_fees/bridging_race.notest.js +3 -5
- package/dest/e2e_fees/fees_test.d.ts +14 -14
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +125 -143
- package/dest/e2e_l1_publisher/write_json.d.ts +4 -3
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +14 -16
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +6 -9
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +31 -39
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +3 -3
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +3 -3
- package/dest/e2e_p2p/p2p_network.d.ts +8 -7
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +127 -106
- package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
- package/dest/e2e_p2p/reqresp/utils.js +177 -0
- 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 +18 -21
- 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/e2e_token_contract/token_contract_test.d.ts +19 -10
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +99 -91
- package/dest/fixtures/authwit_proxy.d.ts +15 -0
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
- package/dest/fixtures/authwit_proxy.js +30 -0
- package/dest/fixtures/e2e_prover_test.d.ts +11 -17
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +112 -128
- package/dest/fixtures/fixtures.d.ts +5 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +6 -0
- package/dest/fixtures/ha_setup.d.ts +71 -0
- package/dest/fixtures/ha_setup.d.ts.map +1 -0
- package/dest/fixtures/ha_setup.js +116 -0
- package/dest/fixtures/index.d.ts +2 -1
- package/dest/fixtures/index.d.ts.map +1 -1
- package/dest/fixtures/index.js +1 -0
- package/dest/fixtures/setup.d.ts +235 -0
- package/dest/fixtures/setup.d.ts.map +1 -0
- package/dest/fixtures/setup.js +605 -0
- package/dest/fixtures/setup_p2p_test.d.ts +16 -9
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +40 -29
- package/dest/fixtures/token_utils.d.ts +2 -2
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +10 -6
- package/dest/fixtures/utils.d.ts +5 -194
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +4 -619
- package/dest/quality_of_service/grafana_client.d.ts +41 -0
- package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
- package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
- package/dest/quality_of_service/prometheus_client.d.ts +38 -0
- package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
- package/dest/quality_of_service/prometheus_client.js +67 -0
- package/dest/shared/cross_chain_test_harness.d.ts +16 -6
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +13 -13
- package/dest/shared/gas_portal_test_harness.d.ts +11 -1
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +1 -1
- package/dest/shared/index.d.ts +3 -2
- package/dest/shared/index.d.ts.map +1 -1
- package/dest/shared/index.js +1 -0
- package/dest/shared/mock_state_view.d.ts +86 -0
- package/dest/shared/mock_state_view.d.ts.map +1 -0
- package/dest/shared/mock_state_view.js +186 -0
- package/dest/shared/submit-transactions.d.ts +4 -4
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +9 -11
- package/dest/shared/uniswap_l1_l2.d.ts +3 -28
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +53 -33
- package/dest/simulators/lending_simulator.d.ts +5 -1
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +2 -2
- package/dest/simulators/token_simulator.d.ts +1 -1
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +2 -23
- package/dest/spartan/setup_test_wallets.d.ts +12 -4
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +92 -35
- package/dest/spartan/tx_metrics.d.ts +51 -2
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +333 -6
- package/dest/spartan/utils/bot.d.ts +28 -0
- package/dest/spartan/utils/bot.d.ts.map +1 -0
- package/dest/spartan/utils/bot.js +142 -0
- package/dest/spartan/utils/chaos.d.ts +79 -0
- package/dest/spartan/utils/chaos.d.ts.map +1 -0
- package/dest/spartan/utils/chaos.js +142 -0
- package/dest/spartan/utils/clients.d.ts +39 -0
- package/dest/spartan/utils/clients.d.ts.map +1 -0
- package/dest/spartan/utils/clients.js +90 -0
- package/dest/spartan/utils/config.d.ts +39 -0
- package/dest/spartan/utils/config.d.ts.map +1 -0
- package/dest/spartan/utils/config.js +21 -0
- package/dest/spartan/utils/health.d.ts +63 -0
- package/dest/spartan/utils/health.d.ts.map +1 -0
- package/dest/spartan/utils/health.js +202 -0
- package/dest/spartan/utils/helm.d.ts +15 -0
- package/dest/spartan/utils/helm.d.ts.map +1 -0
- package/dest/spartan/utils/helm.js +47 -0
- package/dest/spartan/utils/index.d.ts +9 -0
- package/dest/spartan/utils/index.d.ts.map +1 -0
- package/dest/spartan/utils/index.js +18 -0
- package/dest/spartan/utils/k8s.d.ts +128 -0
- package/dest/spartan/utils/k8s.d.ts.map +1 -0
- package/dest/spartan/utils/k8s.js +381 -0
- package/dest/spartan/utils/nodes.d.ts +40 -0
- package/dest/spartan/utils/nodes.d.ts.map +1 -0
- package/dest/spartan/utils/nodes.js +460 -0
- package/dest/spartan/utils/scripts.d.ts +30 -0
- package/dest/spartan/utils/scripts.d.ts.map +1 -0
- package/dest/spartan/utils/scripts.js +81 -0
- package/dest/spartan/utils.d.ts +2 -253
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +1 -892
- package/dest/test-wallet/test_wallet.d.ts +83 -0
- package/dest/test-wallet/test_wallet.d.ts.map +1 -0
- package/dest/test-wallet/test_wallet.js +214 -0
- package/dest/test-wallet/utils.d.ts +41 -0
- package/dest/test-wallet/utils.d.ts.map +1 -0
- package/dest/test-wallet/utils.js +71 -0
- package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
- package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
- package/dest/test-wallet/wallet_worker_script.js +40 -0
- package/dest/test-wallet/worker_wallet.d.ts +52 -0
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet.js +103 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts +274 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet_schema.js +10 -0
- package/package.json +44 -39
- package/src/bench/client_flows/benchmark.ts +24 -2
- package/src/bench/client_flows/client_flows_benchmark.ts +141 -211
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/client_flows/data_extractor.ts +1 -1
- package/src/bench/utils.ts +21 -15
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +114 -143
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +127 -117
- package/src/e2e_deploy_contract/deploy_test.ts +22 -15
- package/src/e2e_epochs/epochs_test.ts +130 -94
- package/src/e2e_fees/bridging_race.notest.ts +4 -10
- package/src/e2e_fees/fees_test.ts +164 -227
- package/src/e2e_l1_publisher/write_json.ts +16 -16
- package/src/e2e_nested_contract/nested_contract_test.ts +33 -56
- package/src/e2e_p2p/inactivity_slash_test.ts +3 -3
- package/src/e2e_p2p/p2p_network.ts +197 -171
- package/src/e2e_p2p/reqresp/utils.ts +235 -0
- package/src/e2e_p2p/shared.ts +28 -27
- 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 +113 -119
- package/src/fixtures/authwit_proxy.ts +50 -0
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/e2e_prover_test.ts +127 -172
- package/src/fixtures/fixtures.ts +10 -0
- package/src/fixtures/ha_setup.ts +186 -0
- package/src/fixtures/index.ts +1 -0
- package/src/fixtures/setup.ts +896 -0
- package/src/fixtures/setup_p2p_test.ts +40 -44
- package/src/fixtures/token_utils.ts +7 -5
- package/src/fixtures/utils.ts +27 -907
- package/src/guides/up_quick_start.sh +3 -3
- package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
- package/src/quality_of_service/prometheus_client.ts +113 -0
- package/src/shared/cross_chain_test_harness.ts +16 -36
- package/src/shared/gas_portal_test_harness.ts +1 -1
- package/src/shared/index.ts +2 -1
- package/src/shared/mock_state_view.ts +188 -0
- package/src/shared/submit-transactions.ts +14 -16
- package/src/shared/uniswap_l1_l2.ts +59 -80
- package/src/simulators/lending_simulator.ts +2 -2
- package/src/simulators/token_simulator.ts +1 -29
- package/src/spartan/setup_test_wallets.ts +134 -26
- package/src/spartan/tx_metrics.ts +255 -9
- package/src/spartan/utils/bot.ts +188 -0
- package/src/spartan/utils/chaos.ts +253 -0
- package/src/spartan/utils/clients.ts +100 -0
- package/src/spartan/utils/config.ts +27 -0
- package/src/spartan/utils/health.ts +255 -0
- package/src/spartan/utils/helm.ts +84 -0
- package/src/spartan/utils/index.ts +65 -0
- package/src/spartan/utils/k8s.ts +535 -0
- package/src/spartan/utils/nodes.ts +535 -0
- package/src/spartan/utils/scripts.ts +99 -0
- package/src/spartan/utils.ts +1 -1158
- package/src/test-wallet/test_wallet.ts +306 -0
- package/src/test-wallet/utils.ts +112 -0
- package/src/test-wallet/wallet_worker_script.ts +43 -0
- package/src/test-wallet/worker_wallet.ts +165 -0
- package/src/test-wallet/worker_wallet_schema.ts +13 -0
- package/dest/fixtures/snapshot_manager.d.ts +0 -93
- package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
- package/dest/fixtures/snapshot_manager.js +0 -493
- package/dest/quality_of_service/alert_checker.d.ts +0 -41
- package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
- package/src/fixtures/snapshot_manager.ts +0 -651
|
@@ -26,38 +26,31 @@ import { type PXEConfig, getPXEConfig } from '@aztec/pxe/server';
|
|
|
26
26
|
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
27
27
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
28
28
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
29
|
-
import { TestWallet } from '@aztec/test-wallet/server';
|
|
30
29
|
|
|
31
30
|
import { MNEMONIC } from '../../fixtures/fixtures.js';
|
|
32
|
-
import {
|
|
33
|
-
type ISnapshotManager,
|
|
34
|
-
type SubsystemsContext,
|
|
35
|
-
createSnapshotManager,
|
|
36
|
-
deployAccounts,
|
|
37
|
-
} from '../../fixtures/snapshot_manager.js';
|
|
31
|
+
import { type EndToEndContext, type SetupOptions, deployAccounts, setup, teardown } from '../../fixtures/setup.js';
|
|
38
32
|
import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
|
|
39
|
-
import {
|
|
33
|
+
import { setupSponsoredFPC } from '../../fixtures/utils.js';
|
|
40
34
|
import { CrossChainTestHarness } from '../../shared/cross_chain_test_harness.js';
|
|
41
35
|
import {
|
|
42
36
|
FeeJuicePortalTestingHarnessFactory,
|
|
43
37
|
type GasBridgingTestHarness,
|
|
44
38
|
} from '../../shared/gas_portal_test_harness.js';
|
|
39
|
+
import { TestWallet } from '../../test-wallet/test_wallet.js';
|
|
45
40
|
import { ProxyLogger } from './benchmark.js';
|
|
46
41
|
import { type ClientFlowsConfig, FULL_FLOWS_CONFIG, KEY_FLOWS_CONFIG } from './config.js';
|
|
47
42
|
|
|
48
|
-
const {
|
|
43
|
+
const { BENCHMARK_CONFIG } = process.env;
|
|
49
44
|
|
|
50
45
|
export type AccountType = 'ecdsar1' | 'schnorr';
|
|
51
46
|
export type FeePaymentMethodGetter = (wallet: Wallet, sender: AztecAddress) => Promise<FeePaymentMethod | undefined>;
|
|
52
47
|
export type BenchmarkingFeePaymentMethod = 'bridged_fee_juice' | 'private_fpc' | 'sponsored_fpc' | 'fee_juice';
|
|
53
48
|
|
|
54
49
|
export class ClientFlowsBenchmark {
|
|
55
|
-
private snapshotManager: ISnapshotManager;
|
|
56
|
-
|
|
57
50
|
public logger: Logger;
|
|
58
51
|
public aztecNode!: AztecNode;
|
|
59
52
|
public cheatCodes!: CheatCodes;
|
|
60
|
-
public context!:
|
|
53
|
+
public context!: EndToEndContext;
|
|
61
54
|
public chainMonitor!: ChainMonitor;
|
|
62
55
|
public feeJuiceBridgeTestHarness!: GasBridgingTestHarness;
|
|
63
56
|
public adminWallet!: TestWallet;
|
|
@@ -125,33 +118,37 @@ export class ClientFlowsBenchmark {
|
|
|
125
118
|
public config: ClientFlowsConfig;
|
|
126
119
|
|
|
127
120
|
private proxyLogger: ProxyLogger;
|
|
121
|
+
private setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs>;
|
|
128
122
|
|
|
129
123
|
constructor(testName?: string, setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs> = {}) {
|
|
130
124
|
this.logger = createLogger(`bench:client_flows${testName ? `:${testName}` : ''}`);
|
|
131
|
-
this.
|
|
132
|
-
`bench_client_flows${testName ? `/${testName}` : ''}`,
|
|
133
|
-
dataPath,
|
|
134
|
-
{ startProverNode: true, ...setupOptions },
|
|
135
|
-
{ ...setupOptions },
|
|
136
|
-
);
|
|
125
|
+
this.setupOptions = { startProverNode: true, ...setupOptions };
|
|
137
126
|
this.config = BENCHMARK_CONFIG === 'key_flows' ? KEY_FLOWS_CONFIG : FULL_FLOWS_CONFIG;
|
|
138
127
|
ProxyLogger.create();
|
|
139
128
|
this.proxyLogger = ProxyLogger.getInstance();
|
|
140
129
|
}
|
|
141
130
|
|
|
142
131
|
async setup() {
|
|
143
|
-
|
|
144
|
-
await
|
|
132
|
+
this.logger.info('Setting up subsystems from fresh');
|
|
133
|
+
this.context = await setup(0, {
|
|
134
|
+
...this.setupOptions,
|
|
135
|
+
fundSponsoredFPC: true,
|
|
136
|
+
skipAccountDeployment: true,
|
|
137
|
+
l1ContractsArgs: this.setupOptions,
|
|
138
|
+
});
|
|
139
|
+
await this.applyBaseSetup();
|
|
140
|
+
|
|
141
|
+
await this.context.aztecNodeService.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
|
|
145
142
|
|
|
146
|
-
const rollupContract = RollupContract.getFromConfig(context.
|
|
147
|
-
this.chainMonitor = new ChainMonitor(rollupContract, context.dateProvider, this.logger, 200).start();
|
|
143
|
+
const rollupContract = RollupContract.getFromConfig(this.context.config);
|
|
144
|
+
this.chainMonitor = new ChainMonitor(rollupContract, this.context.dateProvider, this.logger, 200).start();
|
|
148
145
|
|
|
149
146
|
return this;
|
|
150
147
|
}
|
|
151
148
|
|
|
152
149
|
async teardown() {
|
|
153
150
|
await this.chainMonitor.stop();
|
|
154
|
-
await this.
|
|
151
|
+
await teardown(this.context);
|
|
155
152
|
}
|
|
156
153
|
|
|
157
154
|
async mintAndBridgeFeeJuice(address: AztecAddress) {
|
|
@@ -159,21 +156,16 @@ export class ClientFlowsBenchmark {
|
|
|
159
156
|
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
160
157
|
await this.feeJuiceContract.methods
|
|
161
158
|
.claim(address, claim.claimAmount, secret, index)
|
|
162
|
-
.send({ from: this.adminAddress })
|
|
163
|
-
.wait();
|
|
159
|
+
.send({ from: this.adminAddress });
|
|
164
160
|
}
|
|
165
161
|
|
|
166
162
|
/** Admin mints bananaCoin tokens privately to the target address and redeems them. */
|
|
167
163
|
async mintPrivateBananas(amount: bigint, address: AztecAddress) {
|
|
168
|
-
const balanceBefore = await this.bananaCoin.methods
|
|
169
|
-
.balance_of_private(address)
|
|
170
|
-
.simulate({ from: this.adminAddress });
|
|
164
|
+
const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate({ from: address });
|
|
171
165
|
|
|
172
166
|
await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
|
|
173
167
|
|
|
174
|
-
const balanceAfter = await this.bananaCoin.methods
|
|
175
|
-
.balance_of_private(address)
|
|
176
|
-
.simulate({ from: this.adminAddress });
|
|
168
|
+
const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate({ from: address });
|
|
177
169
|
expect(balanceAfter).toEqual(balanceBefore + amount);
|
|
178
170
|
}
|
|
179
171
|
|
|
@@ -193,161 +185,118 @@ export class ClientFlowsBenchmark {
|
|
|
193
185
|
}
|
|
194
186
|
}
|
|
195
187
|
|
|
196
|
-
public async
|
|
197
|
-
await this.
|
|
198
|
-
await this.
|
|
188
|
+
public async applyBaseSetup() {
|
|
189
|
+
await this.applyInitialAccounts();
|
|
190
|
+
await this.applySetupFeeJuice();
|
|
199
191
|
}
|
|
200
192
|
|
|
201
|
-
async
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
193
|
+
async applyInitialAccounts() {
|
|
194
|
+
this.logger.info('Applying initial accounts setup');
|
|
195
|
+
const { deployedAccounts } = await deployAccounts(
|
|
196
|
+
2,
|
|
197
|
+
this.logger,
|
|
198
|
+
)({
|
|
199
|
+
wallet: this.context.wallet,
|
|
200
|
+
initialFundedAccounts: this.context.initialFundedAccounts,
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
const [{ address: adminAddress }, { address: sequencerAddress }] = deployedAccounts;
|
|
204
|
+
|
|
205
|
+
this.adminWallet = this.context.wallet;
|
|
206
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
207
|
+
this.cheatCodes = this.context.cheatCodes;
|
|
208
|
+
|
|
209
|
+
this.adminAddress = adminAddress;
|
|
210
|
+
this.sequencerAddress = sequencerAddress;
|
|
211
|
+
|
|
212
|
+
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
213
|
+
this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
|
|
214
|
+
this.coinbase = EthAddress.random();
|
|
215
|
+
|
|
216
|
+
const userPXEConfig = getPXEConfig();
|
|
217
|
+
const userPXEConfigWithContracts = {
|
|
218
|
+
...userPXEConfig,
|
|
219
|
+
proverEnabled: this.realProofs,
|
|
220
|
+
} as PXEConfig;
|
|
221
|
+
|
|
222
|
+
this.userWallet = await TestWallet.create(this.aztecNode, userPXEConfigWithContracts, {
|
|
223
|
+
loggers: {
|
|
224
|
+
prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied'),
|
|
231
225
|
},
|
|
232
|
-
);
|
|
226
|
+
});
|
|
233
227
|
}
|
|
234
228
|
|
|
235
|
-
async
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
aztecNodeAdmin: context.aztecNode,
|
|
247
|
-
l1Client: context.deployL1ContractsValues.l1Client,
|
|
248
|
-
wallet: this.adminWallet,
|
|
249
|
-
logger: this.logger,
|
|
250
|
-
});
|
|
251
|
-
},
|
|
252
|
-
);
|
|
229
|
+
async applySetupFeeJuice() {
|
|
230
|
+
this.logger.info('Applying fee juice setup');
|
|
231
|
+
this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
|
|
232
|
+
|
|
233
|
+
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
234
|
+
aztecNode: this.context.aztecNodeService,
|
|
235
|
+
aztecNodeAdmin: this.context.aztecNodeService,
|
|
236
|
+
l1Client: this.context.deployL1ContractsValues.l1Client,
|
|
237
|
+
wallet: this.adminWallet,
|
|
238
|
+
logger: this.logger,
|
|
239
|
+
});
|
|
253
240
|
}
|
|
254
241
|
|
|
255
|
-
async
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
.wait();
|
|
268
|
-
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
269
|
-
return { bananaCoinAddress: bananaCoin.address, bananaCoinInstance };
|
|
270
|
-
},
|
|
271
|
-
({ bananaCoinAddress, bananaCoinInstance }) => {
|
|
272
|
-
this.bananaCoin = BananaCoin.at(bananaCoinAddress, this.adminWallet);
|
|
273
|
-
this.bananaCoinInstance = bananaCoinInstance;
|
|
274
|
-
return Promise.resolve();
|
|
275
|
-
},
|
|
276
|
-
);
|
|
242
|
+
async applyDeployBananaToken() {
|
|
243
|
+
this.logger.info('Applying banana token deployment');
|
|
244
|
+
const { contract: bananaCoin, instance: bananaCoinInstance } = await BananaCoin.deploy(
|
|
245
|
+
this.adminWallet,
|
|
246
|
+
this.adminAddress,
|
|
247
|
+
'BC',
|
|
248
|
+
'BC',
|
|
249
|
+
18n,
|
|
250
|
+
).send({ from: this.adminAddress, wait: { returnReceipt: true } });
|
|
251
|
+
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
252
|
+
this.bananaCoin = bananaCoin;
|
|
253
|
+
this.bananaCoinInstance = bananaCoinInstance;
|
|
277
254
|
}
|
|
278
255
|
|
|
279
|
-
async
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
.wait();
|
|
292
|
-
this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
|
|
293
|
-
return { candyBarCoinAddress: candyBarCoin.address, candyBarCoinInstance };
|
|
294
|
-
},
|
|
295
|
-
({ candyBarCoinAddress, candyBarCoinInstance }) => {
|
|
296
|
-
this.candyBarCoin = TokenContract.at(candyBarCoinAddress, this.adminWallet);
|
|
297
|
-
this.candyBarCoinInstance = candyBarCoinInstance;
|
|
298
|
-
return Promise.resolve();
|
|
299
|
-
},
|
|
300
|
-
);
|
|
256
|
+
async applyDeployCandyBarToken() {
|
|
257
|
+
this.logger.info('Applying candy bar token deployment');
|
|
258
|
+
const { contract: candyBarCoin, instance: candyBarCoinInstance } = await TokenContract.deploy(
|
|
259
|
+
this.adminWallet,
|
|
260
|
+
this.adminAddress,
|
|
261
|
+
'CBC',
|
|
262
|
+
'CBC',
|
|
263
|
+
18n,
|
|
264
|
+
).send({ from: this.adminAddress, wait: { returnReceipt: true } });
|
|
265
|
+
this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
|
|
266
|
+
this.candyBarCoin = candyBarCoin;
|
|
267
|
+
this.candyBarCoinInstance = candyBarCoinInstance;
|
|
301
268
|
}
|
|
302
269
|
|
|
303
|
-
public async
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
308
|
-
expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
270
|
+
public async applyFPCSetup() {
|
|
271
|
+
this.logger.info('Applying FPC setup');
|
|
272
|
+
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
273
|
+
expect((await this.context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
309
274
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
.send({ from: this.adminAddress })
|
|
317
|
-
.wait();
|
|
275
|
+
const bananaCoin = this.bananaCoin;
|
|
276
|
+
const { contract: bananaFPC, instance: bananaFPCInstance } = await FPCContract.deploy(
|
|
277
|
+
this.adminWallet,
|
|
278
|
+
bananaCoin.address,
|
|
279
|
+
this.adminAddress,
|
|
280
|
+
).send({ from: this.adminAddress, wait: { returnReceipt: true } });
|
|
318
281
|
|
|
319
|
-
|
|
282
|
+
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
320
283
|
|
|
321
|
-
|
|
284
|
+
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.adminAddress);
|
|
322
285
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
data => {
|
|
326
|
-
this.bananaFPC = FPCContract.at(data.bananaFPCAddress, this.adminWallet);
|
|
327
|
-
this.bananaFPCInstance = data.bananaFPCInstance;
|
|
328
|
-
return Promise.resolve();
|
|
329
|
-
},
|
|
330
|
-
);
|
|
286
|
+
this.bananaFPC = bananaFPC;
|
|
287
|
+
this.bananaFPCInstance = bananaFPCInstance;
|
|
331
288
|
}
|
|
332
289
|
|
|
333
|
-
async
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
return { sponsoredFPCAddress: sponsoredFPCInstance.address, sponsoredFPCInstance };
|
|
340
|
-
},
|
|
341
|
-
({ sponsoredFPCAddress, sponsoredFPCInstance }) => {
|
|
342
|
-
this.sponsoredFPC = SponsoredFPCContract.at(sponsoredFPCAddress, this.adminWallet);
|
|
343
|
-
this.sponsoredFPCInstance = sponsoredFPCInstance;
|
|
344
|
-
return Promise.resolve();
|
|
345
|
-
},
|
|
346
|
-
);
|
|
290
|
+
async applyDeploySponsoredFPC() {
|
|
291
|
+
this.logger.info('Applying sponsored FPC deployment');
|
|
292
|
+
const sponsoredFPCInstance = await setupSponsoredFPC(this.adminWallet);
|
|
293
|
+
this.logger.info(`SponsoredFPC at ${sponsoredFPCInstance.address}`);
|
|
294
|
+
this.sponsoredFPC = SponsoredFPCContract.at(sponsoredFPCInstance.address, this.adminWallet);
|
|
295
|
+
this.sponsoredFPCInstance = sponsoredFPCInstance;
|
|
347
296
|
}
|
|
348
297
|
|
|
349
298
|
public async createCrossChainTestHarness(owner: AztecAddress) {
|
|
350
|
-
const l1Client = createExtendedL1Client(this.context.
|
|
299
|
+
const l1Client = createExtendedL1Client(this.context.config.l1RpcUrls, MNEMONIC);
|
|
351
300
|
|
|
352
301
|
const underlyingERC20Address = await deployL1Contract(l1Client, TestERC20Abi, TestERC20Bytecode, [
|
|
353
302
|
'Underlying',
|
|
@@ -376,12 +325,10 @@ export class ClientFlowsBenchmark {
|
|
|
376
325
|
const benchysAddress = benchysAccountManager.address;
|
|
377
326
|
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
|
|
378
327
|
const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
|
|
379
|
-
await behchysDeployMethod
|
|
380
|
-
.
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
})
|
|
384
|
-
.wait();
|
|
328
|
+
await behchysDeployMethod.send({
|
|
329
|
+
from: AztecAddress.ZERO,
|
|
330
|
+
fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
|
|
331
|
+
});
|
|
385
332
|
// Register benchy on the user's Wallet, where we're going to be interacting from
|
|
386
333
|
const accountManager = await this.userWallet.createAccount({
|
|
387
334
|
secret: benchysAccount.getSecretKey(),
|
|
@@ -391,44 +338,27 @@ export class ClientFlowsBenchmark {
|
|
|
391
338
|
return accountManager.address;
|
|
392
339
|
}
|
|
393
340
|
|
|
394
|
-
public async
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
this.logger.info(`AMM deployed at ${amm.address}`);
|
|
416
|
-
await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress }).wait();
|
|
417
|
-
return {
|
|
418
|
-
ammAddress: amm.address,
|
|
419
|
-
ammInstance,
|
|
420
|
-
liquidityTokenAddress: liquidityToken.address,
|
|
421
|
-
liquidityTokenInstance,
|
|
422
|
-
};
|
|
423
|
-
},
|
|
424
|
-
({ ammAddress, ammInstance, liquidityTokenAddress, liquidityTokenInstance }) => {
|
|
425
|
-
this.liquidityToken = TokenContract.at(liquidityTokenAddress, this.adminWallet);
|
|
426
|
-
this.liquidityTokenInstance = liquidityTokenInstance;
|
|
427
|
-
this.amm = AMMContract.at(ammAddress, this.adminWallet);
|
|
428
|
-
this.ammInstance = ammInstance;
|
|
429
|
-
return Promise.resolve();
|
|
430
|
-
},
|
|
431
|
-
);
|
|
341
|
+
public async applyDeployAmm() {
|
|
342
|
+
this.logger.info('Applying AMM deployment');
|
|
343
|
+
const { contract: liquidityToken, instance: liquidityTokenInstance } = await TokenContract.deploy(
|
|
344
|
+
this.adminWallet,
|
|
345
|
+
this.adminAddress,
|
|
346
|
+
'LPT',
|
|
347
|
+
'LPT',
|
|
348
|
+
18n,
|
|
349
|
+
).send({ from: this.adminAddress, wait: { returnReceipt: true } });
|
|
350
|
+
const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
|
|
351
|
+
this.adminWallet,
|
|
352
|
+
this.bananaCoin.address,
|
|
353
|
+
this.candyBarCoin.address,
|
|
354
|
+
liquidityToken.address,
|
|
355
|
+
).send({ from: this.adminAddress, wait: { returnReceipt: true } });
|
|
356
|
+
this.logger.info(`AMM deployed at ${amm.address}`);
|
|
357
|
+
await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress });
|
|
358
|
+
this.liquidityToken = liquidityToken;
|
|
359
|
+
this.liquidityTokenInstance = liquidityTokenInstance;
|
|
360
|
+
this.amm = amm;
|
|
361
|
+
this.ammInstance = ammInstance;
|
|
432
362
|
}
|
|
433
363
|
|
|
434
364
|
public async getBridgedFeeJuicePaymentMethodForWallet(_wallet: Wallet, sender: AztecAddress) {
|
|
@@ -439,7 +369,7 @@ export class ClientFlowsBenchmark {
|
|
|
439
369
|
public async getPrivateFPCPaymentMethodForWallet(wallet: Wallet, sender: AztecAddress) {
|
|
440
370
|
// The private fee paying method assembled on the app side requires knowledge of the maximum
|
|
441
371
|
// fee the user is willing to pay
|
|
442
|
-
const maxFeesPerGas = (await this.aztecNode.
|
|
372
|
+
const maxFeesPerGas = (await this.aztecNode.getCurrentMinFees()).mul(1.5);
|
|
443
373
|
const gasSettings = GasSettings.default({ maxFeesPerGas });
|
|
444
374
|
return new PrivateFeePaymentMethod(this.bananaFPC.address, sender, wallet, gasSettings);
|
|
445
375
|
}
|
|
@@ -6,7 +6,7 @@ export type ClientFlowConfig = {
|
|
|
6
6
|
recursions?: number[];
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
type ClientFlows = 'accountDeployments' | 'deployments' | 'transfers' | 'bridging' | 'amm';
|
|
9
|
+
type ClientFlows = 'accountDeployments' | 'deployments' | 'transfers' | 'bridging' | 'amm' | 'storageProof';
|
|
10
10
|
|
|
11
11
|
export type ClientFlowsConfig = {
|
|
12
12
|
[key in ClientFlows]: ClientFlowConfig;
|
|
@@ -34,6 +34,10 @@ export const KEY_FLOWS_CONFIG: ClientFlowsConfig = {
|
|
|
34
34
|
feePaymentMethods: ['sponsored_fpc', 'private_fpc'],
|
|
35
35
|
recursions: [0, 1],
|
|
36
36
|
},
|
|
37
|
+
storageProof: {
|
|
38
|
+
accounts: ['ecdsar1'],
|
|
39
|
+
feePaymentMethods: ['sponsored_fpc'],
|
|
40
|
+
},
|
|
37
41
|
};
|
|
38
42
|
|
|
39
43
|
export const FULL_FLOWS_CONFIG: ClientFlowsConfig = {
|
|
@@ -58,4 +62,8 @@ export const FULL_FLOWS_CONFIG: ClientFlowsConfig = {
|
|
|
58
62
|
feePaymentMethods: ['sponsored_fpc', 'private_fpc'],
|
|
59
63
|
recursions: [0, 1, 2],
|
|
60
64
|
},
|
|
65
|
+
storageProof: {
|
|
66
|
+
accounts: ['ecdsar1', 'schnorr'],
|
|
67
|
+
feePaymentMethods: ['sponsored_fpc', 'private_fpc'],
|
|
68
|
+
},
|
|
61
69
|
};
|
|
@@ -22,7 +22,7 @@ async function main() {
|
|
|
22
22
|
logger.info(`Flows in ${ivcFolder}: \n${flows.map(flowName => `\t- ${flowName}`).join('\n')}`);
|
|
23
23
|
const simulator = new WASMSimulator();
|
|
24
24
|
const log = proxyLogger.createLogger('bb:prover');
|
|
25
|
-
const prover = new BBBundlePrivateKernelProver(simulator, log);
|
|
25
|
+
const prover = new BBBundlePrivateKernelProver(simulator, { logger: log });
|
|
26
26
|
|
|
27
27
|
const userLog = createLogger('chonk_flows:data_processor');
|
|
28
28
|
|
package/src/bench/utils.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
2
2
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
-
import { BatchCall,
|
|
3
|
+
import { BatchCall, NO_WAIT, type WaitOpts } from '@aztec/aztec.js/contracts';
|
|
4
|
+
import { waitForTx } from '@aztec/aztec.js/node';
|
|
4
5
|
import { mean, stdDev, times } from '@aztec/foundation/collection';
|
|
5
6
|
import { BenchmarkingContract } from '@aztec/noir-test-contracts.js/Benchmarking';
|
|
6
|
-
import type {
|
|
7
|
+
import type { TxHash } from '@aztec/stdlib/tx';
|
|
8
|
+
import type { MetricDefinition } from '@aztec/telemetry-client';
|
|
7
9
|
import type { BenchmarkDataPoint, BenchmarkMetricsType, BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
|
|
8
10
|
|
|
9
11
|
import { mkdirSync, writeFileSync } from 'fs';
|
|
@@ -16,17 +18,17 @@ import { type EndToEndContext, type SetupOptions, setup } from '../fixtures/util
|
|
|
16
18
|
*/
|
|
17
19
|
export async function benchmarkSetup(
|
|
18
20
|
opts: Partial<SetupOptions> & {
|
|
19
|
-
/** What metrics to export */ metrics: (
|
|
21
|
+
/** What metrics to export */ metrics: (MetricDefinition | MetricFilter)[];
|
|
20
22
|
/** Where to output the benchmark data (defaults to BENCH_OUTPUT or bench.json) */
|
|
21
23
|
benchOutput?: string;
|
|
22
24
|
},
|
|
23
25
|
) {
|
|
24
26
|
const context = await setup(1, { ...opts, telemetryConfig: { benchmark: true } });
|
|
25
27
|
const defaultAccountAddress = context.accounts[0];
|
|
26
|
-
const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress })
|
|
28
|
+
const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress });
|
|
27
29
|
context.logger.info(`Deployed benchmarking contract at ${contract.address}`);
|
|
28
30
|
const sequencer = (context.aztecNode as AztecNodeService).getSequencer()!;
|
|
29
|
-
const telemetry = context.telemetryClient
|
|
31
|
+
const telemetry = context.telemetryClient as BenchmarkTelemetryClient;
|
|
30
32
|
context.logger.warn(`Cleared benchmark data points from setup`);
|
|
31
33
|
telemetry.clear();
|
|
32
34
|
const origTeardown = context.teardown.bind(context);
|
|
@@ -47,7 +49,7 @@ export async function benchmarkSetup(
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
type MetricFilter = {
|
|
50
|
-
source:
|
|
52
|
+
source: MetricDefinition;
|
|
51
53
|
transform: (value: number) => number;
|
|
52
54
|
name: string;
|
|
53
55
|
unit?: string;
|
|
@@ -62,17 +64,21 @@ export type GithubActionBenchmarkResult = {
|
|
|
62
64
|
extra?: string;
|
|
63
65
|
};
|
|
64
66
|
|
|
67
|
+
function isMetricDefinition(f: MetricDefinition | MetricFilter): f is MetricDefinition {
|
|
68
|
+
return 'description' in f;
|
|
69
|
+
}
|
|
70
|
+
|
|
65
71
|
function formatMetricsForGithubBenchmarkAction(
|
|
66
72
|
data: BenchmarkMetricsType,
|
|
67
|
-
filter: (
|
|
73
|
+
filter: (MetricDefinition | MetricFilter)[],
|
|
68
74
|
): GithubActionBenchmarkResult[] {
|
|
69
75
|
const allFilters: MetricFilter[] = filter.map(f =>
|
|
70
|
-
|
|
76
|
+
isMetricDefinition(f) ? { name: f.name, source: f, transform: (x: number) => x, unit: f.unit } : f,
|
|
71
77
|
);
|
|
72
78
|
return data.flatMap(meter => {
|
|
73
79
|
return meter.metrics
|
|
74
|
-
.filter(metric => allFilters.map(f => f.source).includes(metric.name
|
|
75
|
-
.map(metric => [metric, allFilters.find(f => f.source === metric.name)!] as const)
|
|
80
|
+
.filter(metric => allFilters.map(f => f.source.name).includes(metric.name))
|
|
81
|
+
.map(metric => [metric, allFilters.find(f => f.source.name === metric.name)!] as const)
|
|
76
82
|
.map(([metric, filter]) => ({
|
|
77
83
|
name: `${meter.name}/${filter.name}`,
|
|
78
84
|
unit: filter.unit ?? metric.unit ?? 'unknown',
|
|
@@ -138,18 +144,18 @@ export async function sendTxs(
|
|
|
138
144
|
context: EndToEndContext,
|
|
139
145
|
contract: BenchmarkingContract,
|
|
140
146
|
heavyPublicCompute: boolean = false,
|
|
141
|
-
): Promise<
|
|
147
|
+
): Promise<TxHash[]> {
|
|
142
148
|
const calls = await Promise.all(times(txCount, index => makeCall(index, context, contract, heavyPublicCompute)));
|
|
143
149
|
context.logger.info(`Creating ${txCount} txs`);
|
|
144
150
|
const [from] = context.accounts;
|
|
145
151
|
context.logger.info(`Sending ${txCount} txs`);
|
|
146
|
-
return calls.map(call => call.send({ from }));
|
|
152
|
+
return Promise.all(calls.map(call => call.send({ from, wait: NO_WAIT })));
|
|
147
153
|
}
|
|
148
154
|
|
|
149
|
-
export async function waitTxs(txs:
|
|
155
|
+
export async function waitTxs(txs: TxHash[], context: EndToEndContext, txWaitOpts?: WaitOpts) {
|
|
150
156
|
context.logger.info(`Awaiting ${txs.length} txs to be mined`);
|
|
151
|
-
await Promise.all(txs.map(
|
|
152
|
-
context.logger.info(
|
|
157
|
+
await Promise.all(txs.map(txHash => waitForTx(context.aztecNode, txHash, txWaitOpts)));
|
|
158
|
+
context.logger.info(`${txs.length} txs have been mined`);
|
|
153
159
|
}
|
|
154
160
|
|
|
155
161
|
function randomBytesAsBigInts(length: number): bigint[] {
|