@aztec/end-to-end 0.0.1-commit.b655e406 → 0.0.1-commit.b9865e97
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/README.md +27 -0
- package/dest/bench/client_flows/benchmark.d.ts +17 -2
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +38 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +23 -17
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +143 -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.d.ts +1 -1
- package/dest/bench/client_flows/data_extractor.js +7 -27
- package/dest/bench/utils.d.ts +8 -7
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +33 -19
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +12 -10
- 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 +120 -117
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +33 -16
- 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 +124 -70
- package/dest/e2e_deploy_contract/deploy_test.d.ts +7 -6
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +20 -14
- package/dest/e2e_epochs/epochs_test.d.ts +49 -16
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +188 -64
- package/dest/e2e_fees/bridging_race.notest.d.ts +1 -1
- package/dest/e2e_fees/bridging_race.notest.js +5 -7
- package/dest/e2e_fees/fees_test.d.ts +25 -18
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +162 -141
- 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 +18 -19
- package/dest/e2e_multi_validator/utils.d.ts +1 -1
- package/dest/e2e_multi_validator/utils.js +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +7 -10
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +32 -40
- 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 +11 -9
- package/dest/e2e_p2p/p2p_network.d.ts +237 -28
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +176 -129
- 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 +206 -0
- package/dest/e2e_p2p/shared.d.ts +44 -15
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +102 -68
- 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 +20 -11
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +103 -93
- 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 +34 -0
- package/dest/fixtures/e2e_prover_test.d.ts +19 -24
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +126 -145
- package/dest/fixtures/elu_monitor.d.ts +21 -0
- package/dest/fixtures/elu_monitor.d.ts.map +1 -0
- package/dest/fixtures/elu_monitor.js +102 -0
- package/dest/fixtures/fixtures.d.ts +75 -3
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +73 -3
- package/dest/fixtures/get_acvm_config.d.ts +1 -1
- package/dest/fixtures/get_acvm_config.js +1 -1
- package/dest/fixtures/get_bb_config.d.ts +1 -1
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +5 -5
- 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/l1_to_l2_messaging.d.ts +4 -3
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +2 -2
- package/dest/fixtures/logging.d.ts +1 -1
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
- package/dest/fixtures/setup.d.ts +272 -0
- package/dest/fixtures/setup.d.ts.map +1 -0
- package/dest/fixtures/setup.js +735 -0
- package/dest/fixtures/setup_p2p_test.d.ts +22 -11
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +57 -38
- package/dest/fixtures/token_utils.d.ts +6 -3
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +13 -9
- package/dest/fixtures/utils.d.ts +5 -192
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +4 -648
- package/dest/fixtures/web3signer.d.ts +1 -1
- package/dest/fixtures/web3signer.js +1 -1
- package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
- package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
- package/dest/fixtures/with_telemetry_utils.js +2 -2
- package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
- package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
- package/dest/forward-compatibility/wallet_service.d.ts +3 -0
- package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_service.js +109 -0
- package/dest/index.d.ts +1 -1
- package/dest/install_legacy_contracts.d.cts +10 -0
- package/dest/install_legacy_contracts.d.cts.map +1 -0
- package/dest/legacy-jest-resolver.d.cts +3 -0
- package/dest/legacy-jest-resolver.d.cts.map +1 -0
- 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 +9 -6
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +34 -30
- package/dest/shared/gas_portal_test_harness.d.ts +9 -6
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +21 -12
- 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/jest_setup.d.ts +1 -1
- package/dest/shared/jest_setup.js +41 -1
- 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 -27
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +87 -50
- package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
- package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
- package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
- package/dest/simulators/index.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts +11 -4
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +32 -18
- 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 +3 -24
- package/dest/spartan/setup_test_wallets.d.ts +18 -6
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +159 -30
- package/dest/spartan/tx_metrics.d.ts +102 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +475 -0
- 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 +19 -0
- package/dest/spartan/utils/config.d.ts.map +1 -0
- package/dest/spartan/utils/config.js +23 -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 +11 -0
- package/dest/spartan/utils/index.d.ts.map +1 -0
- package/dest/spartan/utils/index.js +22 -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 +461 -0
- package/dest/spartan/utils/pod_logs.d.ts +25 -0
- package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
- package/dest/spartan/utils/pod_logs.js +74 -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 -218
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +1 -749
- package/dest/test-wallet/test_wallet.d.ts +85 -0
- package/dest/test-wallet/test_wallet.d.ts.map +1 -0
- package/dest/test-wallet/test_wallet.js +273 -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 +66 -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 +53 -0
- package/dest/test-wallet/worker_wallet.d.ts +53 -0
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet.js +155 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts +160 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet_schema.js +22 -0
- package/package.json +56 -46
- package/src/bench/client_flows/benchmark.ts +43 -2
- package/src/bench/client_flows/client_flows_benchmark.ts +203 -206
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/client_flows/data_extractor.ts +6 -28
- package/src/bench/utils.ts +38 -22
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +141 -152
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +180 -127
- package/src/e2e_deploy_contract/deploy_test.ts +25 -17
- package/src/e2e_epochs/epochs_test.ts +254 -116
- package/src/e2e_fees/bridging_race.notest.ts +6 -12
- package/src/e2e_fees/fees_test.ts +215 -229
- package/src/e2e_l1_publisher/write_json.ts +20 -19
- package/src/e2e_multi_validator/utils.ts +1 -1
- package/src/e2e_nested_contract/nested_contract_test.ts +38 -56
- package/src/e2e_p2p/inactivity_slash_test.ts +12 -10
- package/src/e2e_p2p/p2p_network.ts +246 -201
- package/src/e2e_p2p/reqresp/utils.ts +274 -0
- package/src/e2e_p2p/shared.ts +132 -82
- 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 +129 -117
- package/src/fixtures/authwit_proxy.ts +54 -0
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/e2e_prover_test.ts +154 -199
- package/src/fixtures/elu_monitor.ts +126 -0
- package/src/fixtures/fixtures.ts +95 -5
- package/src/fixtures/get_acvm_config.ts +1 -1
- package/src/fixtures/get_bb_config.ts +7 -6
- package/src/fixtures/ha_setup.ts +188 -0
- package/src/fixtures/index.ts +1 -0
- package/src/fixtures/l1_to_l2_messaging.ts +4 -2
- package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +1056 -0
- package/src/fixtures/setup_p2p_test.ts +70 -56
- package/src/fixtures/token_utils.ts +9 -8
- package/src/fixtures/utils.ts +29 -947
- package/src/fixtures/web3signer.ts +1 -1
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
- package/src/forward-compatibility/wallet_service.ts +104 -0
- package/src/guides/up_quick_start.sh +4 -6
- package/src/install_legacy_contracts.cjs +75 -0
- package/src/legacy-jest-resolver.cjs +112 -0
- 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 +37 -40
- package/src/shared/gas_portal_test_harness.ts +24 -14
- package/src/shared/index.ts +2 -1
- package/src/shared/jest_setup.ts +51 -1
- package/src/shared/mock_state_view.ts +188 -0
- package/src/shared/submit-transactions.ts +11 -16
- package/src/shared/uniswap_l1_l2.ts +142 -114
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +39 -19
- package/src/simulators/token_simulator.ts +6 -30
- package/src/spartan/DEVELOP.md +7 -0
- package/src/spartan/setup_test_wallets.ts +234 -32
- package/src/spartan/tx_metrics.ts +434 -0
- 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 +29 -0
- package/src/spartan/utils/health.ts +255 -0
- package/src/spartan/utils/helm.ts +84 -0
- package/src/spartan/utils/index.ts +71 -0
- package/src/spartan/utils/k8s.ts +535 -0
- package/src/spartan/utils/nodes.ts +543 -0
- package/src/spartan/utils/pod_logs.ts +99 -0
- package/src/spartan/utils/scripts.ts +99 -0
- package/src/spartan/utils.ts +1 -942
- package/src/test-wallet/test_wallet.ts +376 -0
- package/src/test-wallet/utils.ts +108 -0
- package/src/test-wallet/wallet_worker_script.ts +63 -0
- package/src/test-wallet/worker_wallet.ts +218 -0
- package/src/test-wallet/worker_wallet_schema.ts +13 -0
- package/dest/fixtures/setup_l1_contracts.d.ts +0 -6
- package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
- package/dest/fixtures/setup_l1_contracts.js +0 -17
- package/dest/fixtures/snapshot_manager.d.ts +0 -95
- package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
- package/dest/fixtures/snapshot_manager.js +0 -505
- 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/setup_l1_contracts.ts +0 -26
- package/src/fixtures/snapshot_manager.ts +0 -665
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NO_FROM } from '@aztec/aztec.js/account';
|
|
2
2
|
import { FeeJuicePaymentMethodWithClaim } from '@aztec/aztec.js/fee';
|
|
3
3
|
import { PrivateFeePaymentMethod, SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee';
|
|
4
4
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
5
|
-
import {
|
|
5
|
+
import { getTokenAllowedSetupFunctions } from '@aztec/aztec/testing';
|
|
6
|
+
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
7
|
+
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
8
|
+
import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
|
|
6
9
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
7
|
-
import { randomBytes } from '@aztec/foundation/crypto';
|
|
10
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
11
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
8
12
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
9
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
10
13
|
import { TestERC20Abi } from '@aztec/l1-artifacts/TestERC20Abi';
|
|
11
14
|
import { TestERC20Bytecode } from '@aztec/l1-artifacts/TestERC20Bytecode';
|
|
12
15
|
import { AMMContract } from '@aztec/noir-contracts.js/AMM';
|
|
@@ -19,18 +22,17 @@ import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
|
19
22
|
import { getPXEConfig } from '@aztec/pxe/server';
|
|
20
23
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
21
24
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { createSnapshotManager, deployAccounts } from '../../fixtures/snapshot_manager.js';
|
|
25
|
+
import { AUTOMINE_E2E_OPTS, MNEMONIC, getPaddedMaxFeesPerGas } from '../../fixtures/fixtures.js';
|
|
26
|
+
import { deployAccounts, setup, teardown } from '../../fixtures/setup.js';
|
|
25
27
|
import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
|
|
26
28
|
import { setupSponsoredFPC } from '../../fixtures/utils.js';
|
|
27
29
|
import { CrossChainTestHarness } from '../../shared/cross_chain_test_harness.js';
|
|
28
30
|
import { FeeJuicePortalTestingHarnessFactory } from '../../shared/gas_portal_test_harness.js';
|
|
31
|
+
import { TestWallet } from '../../test-wallet/test_wallet.js';
|
|
29
32
|
import { ProxyLogger } from './benchmark.js';
|
|
30
33
|
import { FULL_FLOWS_CONFIG, KEY_FLOWS_CONFIG } from './config.js';
|
|
31
|
-
const {
|
|
34
|
+
const { BENCHMARK_CONFIG } = process.env;
|
|
32
35
|
export class ClientFlowsBenchmark {
|
|
33
|
-
snapshotManager;
|
|
34
36
|
logger;
|
|
35
37
|
aztecNode;
|
|
36
38
|
cheatCodes;
|
|
@@ -47,88 +49,111 @@ export class ClientFlowsBenchmark {
|
|
|
47
49
|
feeJuiceContract;
|
|
48
50
|
// Asset in which fees are paid via FPC
|
|
49
51
|
bananaCoin;
|
|
52
|
+
bananaCoinInstance;
|
|
50
53
|
bananaFPC;
|
|
54
|
+
bananaFPCInstance;
|
|
51
55
|
// Random asset we want to trade
|
|
52
56
|
candyBarCoin;
|
|
57
|
+
candyBarCoinInstance;
|
|
53
58
|
// AMM contract
|
|
54
59
|
amm;
|
|
60
|
+
ammInstance;
|
|
55
61
|
// Liquidity token for AMM
|
|
56
62
|
liquidityToken;
|
|
63
|
+
liquidityTokenInstance;
|
|
57
64
|
// Sponsored FPC contract
|
|
58
65
|
sponsoredFPC;
|
|
66
|
+
sponsoredFPCInstance;
|
|
59
67
|
// PXE and Wallet used by the benchmarking user. It can be set up with client-side proving enabled
|
|
60
68
|
userWallet;
|
|
61
69
|
realProofs = [
|
|
62
70
|
'true',
|
|
63
71
|
'1'
|
|
64
72
|
].includes(process.env.REAL_PROOFS ?? '');
|
|
73
|
+
// `apps` is the number of private function calls contributed by this payment method.
|
|
74
|
+
// Each app produces one execution step at proving time; the orchestrator additionally produces
|
|
75
|
+
// one kernel step per batch of N apps (see `expectedExecutionSteps` in `benchmark.ts`).
|
|
65
76
|
paymentMethods = {
|
|
66
77
|
// eslint-disable-next-line camelcase
|
|
67
78
|
bridged_fee_juice: {
|
|
68
79
|
forWallet: this.getBridgedFeeJuicePaymentMethodForWallet.bind(this),
|
|
69
|
-
|
|
80
|
+
apps: 1
|
|
70
81
|
},
|
|
71
82
|
// eslint-disable-next-line camelcase
|
|
72
83
|
private_fpc: {
|
|
73
84
|
forWallet: this.getPrivateFPCPaymentMethodForWallet.bind(this),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
85
|
+
apps: 1 + // FPC entrypoint
|
|
86
|
+
1 + // BananaCoin transfer_to_public
|
|
87
|
+
1 + // Account verify_private_authwit
|
|
88
|
+
1
|
|
78
89
|
},
|
|
79
90
|
// eslint-disable-next-line camelcase
|
|
80
91
|
sponsored_fpc: {
|
|
81
92
|
forWallet: this.getSponsoredFPCPaymentMethodForWallet.bind(this),
|
|
82
|
-
|
|
93
|
+
apps: 1
|
|
83
94
|
},
|
|
84
95
|
// eslint-disable-next-line camelcase
|
|
85
96
|
fee_juice: {
|
|
86
97
|
forWallet: ()=>Promise.resolve(undefined),
|
|
87
|
-
|
|
98
|
+
apps: 0
|
|
88
99
|
}
|
|
89
100
|
};
|
|
90
101
|
config;
|
|
91
102
|
proxyLogger;
|
|
103
|
+
setupOptions;
|
|
92
104
|
constructor(testName, setupOptions = {}){
|
|
93
105
|
this.logger = createLogger(`bench:client_flows${testName ? `:${testName}` : ''}`);
|
|
94
|
-
this.
|
|
106
|
+
this.setupOptions = {
|
|
107
|
+
...AUTOMINE_E2E_OPTS,
|
|
95
108
|
startProverNode: true,
|
|
96
109
|
...setupOptions
|
|
97
|
-
}
|
|
98
|
-
...setupOptions
|
|
99
|
-
});
|
|
110
|
+
};
|
|
100
111
|
this.config = BENCHMARK_CONFIG === 'key_flows' ? KEY_FLOWS_CONFIG : FULL_FLOWS_CONFIG;
|
|
101
112
|
ProxyLogger.create();
|
|
102
113
|
this.proxyLogger = ProxyLogger.getInstance();
|
|
103
114
|
}
|
|
104
115
|
async setup() {
|
|
105
|
-
|
|
106
|
-
|
|
116
|
+
this.logger.info('Setting up subsystems from fresh');
|
|
117
|
+
// Token allowlist entries are test-only: FPC-based fee payment with custom tokens won't work on mainnet alpha.
|
|
118
|
+
const tokenAllowList = await getTokenAllowedSetupFunctions();
|
|
119
|
+
this.context = await setup(0, {
|
|
120
|
+
...this.setupOptions,
|
|
121
|
+
fundSponsoredFPC: true,
|
|
122
|
+
skipAccountDeployment: true,
|
|
123
|
+
l1ContractsArgs: this.setupOptions,
|
|
124
|
+
txPublicSetupAllowListExtend: [
|
|
125
|
+
...this.setupOptions.txPublicSetupAllowListExtend ?? [],
|
|
126
|
+
...tokenAllowList
|
|
127
|
+
]
|
|
128
|
+
});
|
|
129
|
+
await this.applyBaseSetup();
|
|
130
|
+
await this.context.aztecNodeService.setConfig({
|
|
107
131
|
feeRecipient: this.sequencerAddress,
|
|
108
132
|
coinbase: this.coinbase
|
|
109
133
|
});
|
|
110
|
-
const rollupContract = RollupContract.getFromConfig(context.
|
|
111
|
-
this.chainMonitor = new ChainMonitor(rollupContract, context.dateProvider, this.logger, 200).start();
|
|
134
|
+
const rollupContract = RollupContract.getFromConfig(this.context.config);
|
|
135
|
+
this.chainMonitor = new ChainMonitor(rollupContract, this.context.dateProvider, this.logger, 200).start();
|
|
112
136
|
return this;
|
|
113
137
|
}
|
|
114
138
|
async teardown() {
|
|
115
139
|
await this.chainMonitor.stop();
|
|
116
|
-
await this.
|
|
140
|
+
await this.userWallet?.stop();
|
|
141
|
+
await teardown(this.context);
|
|
117
142
|
}
|
|
118
143
|
async mintAndBridgeFeeJuice(address) {
|
|
119
144
|
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(address);
|
|
120
145
|
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
121
146
|
await this.feeJuiceContract.methods.claim(address, claim.claimAmount, secret, index).send({
|
|
122
147
|
from: this.adminAddress
|
|
123
|
-
})
|
|
148
|
+
});
|
|
124
149
|
}
|
|
125
150
|
/** Admin mints bananaCoin tokens privately to the target address and redeems them. */ async mintPrivateBananas(amount, address) {
|
|
126
|
-
const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
127
|
-
from:
|
|
151
|
+
const { result: balanceBefore } = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
152
|
+
from: address
|
|
128
153
|
});
|
|
129
154
|
await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
|
|
130
|
-
const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
131
|
-
from:
|
|
155
|
+
const { result: balanceAfter } = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
156
|
+
from: address
|
|
132
157
|
});
|
|
133
158
|
expect(balanceAfter).toEqual(balanceBefore + amount);
|
|
134
159
|
}
|
|
@@ -146,101 +171,87 @@ export class ClientFlowsBenchmark {
|
|
|
146
171
|
throw new Error(`Unknown account type: ${type}`);
|
|
147
172
|
}
|
|
148
173
|
}
|
|
149
|
-
async
|
|
150
|
-
await this.
|
|
151
|
-
await this.
|
|
174
|
+
async applyBaseSetup() {
|
|
175
|
+
await this.applyInitialAccounts();
|
|
176
|
+
await this.applySetupFeeJuice();
|
|
152
177
|
}
|
|
153
|
-
async
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
this.
|
|
157
|
-
this.
|
|
158
|
-
this.adminAddress = adminAddress;
|
|
159
|
-
this.sequencerAddress = sequencerAddress;
|
|
160
|
-
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
161
|
-
this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
|
|
162
|
-
this.coinbase = EthAddress.random();
|
|
163
|
-
const userPXEConfig = getPXEConfig();
|
|
164
|
-
const userPXEConfigWithContracts = {
|
|
165
|
-
...userPXEConfig,
|
|
166
|
-
proverEnabled: this.realProofs
|
|
167
|
-
};
|
|
168
|
-
this.userWallet = await TestWallet.create(this.aztecNode, userPXEConfigWithContracts, {
|
|
169
|
-
loggers: {
|
|
170
|
-
prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied')
|
|
171
|
-
}
|
|
172
|
-
});
|
|
178
|
+
async applyInitialAccounts() {
|
|
179
|
+
this.logger.info('Applying initial accounts setup');
|
|
180
|
+
const { deployedAccounts } = await deployAccounts(2, this.logger)({
|
|
181
|
+
wallet: this.context.wallet,
|
|
182
|
+
initialFundedAccounts: this.context.initialFundedAccounts
|
|
173
183
|
});
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
const [{ address: adminAddress }, { address: sequencerAddress }] = deployedAccounts;
|
|
185
|
+
this.adminWallet = this.context.wallet;
|
|
186
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
187
|
+
this.cheatCodes = this.context.cheatCodes;
|
|
188
|
+
this.adminAddress = adminAddress;
|
|
189
|
+
this.sequencerAddress = sequencerAddress;
|
|
190
|
+
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
191
|
+
this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
|
|
192
|
+
this.coinbase = EthAddress.random();
|
|
193
|
+
const userPXEConfig = getPXEConfig();
|
|
194
|
+
const userPXEConfigWithContracts = {
|
|
195
|
+
...userPXEConfig,
|
|
196
|
+
proverEnabled: this.realProofs
|
|
197
|
+
};
|
|
198
|
+
this.userWallet = await TestWallet.create(this.aztecNode, userPXEConfigWithContracts, {
|
|
199
|
+
loggers: {
|
|
200
|
+
prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied')
|
|
201
|
+
}
|
|
186
202
|
});
|
|
187
203
|
}
|
|
188
|
-
async
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
this.
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}, async ({ bananaCoinAddress })=>{
|
|
198
|
-
this.bananaCoin = await BananaCoin.at(bananaCoinAddress, this.adminWallet);
|
|
204
|
+
async applySetupFeeJuice() {
|
|
205
|
+
this.logger.info('Applying fee juice setup');
|
|
206
|
+
this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
|
|
207
|
+
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
208
|
+
aztecNode: this.context.aztecNodeService,
|
|
209
|
+
aztecNodeAdmin: this.context.aztecNodeService,
|
|
210
|
+
l1Client: this.context.deployL1ContractsValues.l1Client,
|
|
211
|
+
wallet: this.adminWallet,
|
|
212
|
+
logger: this.logger
|
|
199
213
|
});
|
|
200
214
|
}
|
|
201
|
-
async
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}).deployed();
|
|
206
|
-
this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
|
|
207
|
-
return {
|
|
208
|
-
candyBarCoinAddress: candyBarCoin.address
|
|
209
|
-
};
|
|
210
|
-
}, async ({ candyBarCoinAddress })=>{
|
|
211
|
-
this.candyBarCoin = await TokenContract.at(candyBarCoinAddress, this.adminWallet);
|
|
215
|
+
async applyDeployBananaToken() {
|
|
216
|
+
this.logger.info('Applying banana token deployment');
|
|
217
|
+
const { contract: bananaCoin, instance: bananaCoinInstance } = await BananaCoin.deploy(this.adminWallet, this.adminAddress, 'BC', 'BC', 18n).send({
|
|
218
|
+
from: this.adminAddress
|
|
212
219
|
});
|
|
220
|
+
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
221
|
+
this.bananaCoin = bananaCoin;
|
|
222
|
+
this.bananaCoinInstance = bananaCoinInstance;
|
|
213
223
|
}
|
|
214
|
-
async
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
const bananaCoin = this.bananaCoin;
|
|
219
|
-
const bananaFPC = await FPCContract.deploy(this.adminWallet, bananaCoin.address, this.adminAddress).send({
|
|
220
|
-
from: this.adminAddress
|
|
221
|
-
}).deployed();
|
|
222
|
-
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
223
|
-
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.adminAddress);
|
|
224
|
-
return {
|
|
225
|
-
bananaFPCAddress: bananaFPC.address
|
|
226
|
-
};
|
|
227
|
-
}, async (data)=>{
|
|
228
|
-
this.bananaFPC = await FPCContract.at(data.bananaFPCAddress, this.adminWallet);
|
|
224
|
+
async applyDeployCandyBarToken() {
|
|
225
|
+
this.logger.info('Applying candy bar token deployment');
|
|
226
|
+
const { contract: candyBarCoin, instance: candyBarCoinInstance } = await TokenContract.deploy(this.adminWallet, this.adminAddress, 'CBC', 'CBC', 18n).send({
|
|
227
|
+
from: this.adminAddress
|
|
229
228
|
});
|
|
229
|
+
this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
|
|
230
|
+
this.candyBarCoin = candyBarCoin;
|
|
231
|
+
this.candyBarCoinInstance = candyBarCoinInstance;
|
|
230
232
|
}
|
|
231
|
-
async
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}, async ({ sponsoredFPCAddress })=>{
|
|
239
|
-
this.sponsoredFPC = await SponsoredFPCContract.at(sponsoredFPCAddress, this.adminWallet);
|
|
233
|
+
async applyFPCSetup() {
|
|
234
|
+
this.logger.info('Applying FPC setup');
|
|
235
|
+
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
236
|
+
expect((await this.context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
237
|
+
const bananaCoin = this.bananaCoin;
|
|
238
|
+
const { contract: bananaFPC, instance: bananaFPCInstance } = await FPCContract.deploy(this.adminWallet, bananaCoin.address, this.adminAddress).send({
|
|
239
|
+
from: this.adminAddress
|
|
240
240
|
});
|
|
241
|
+
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
242
|
+
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.adminAddress);
|
|
243
|
+
this.bananaFPC = bananaFPC;
|
|
244
|
+
this.bananaFPCInstance = bananaFPCInstance;
|
|
245
|
+
}
|
|
246
|
+
async applyDeploySponsoredFPC() {
|
|
247
|
+
this.logger.info('Applying sponsored FPC deployment');
|
|
248
|
+
const sponsoredFPCInstance = await setupSponsoredFPC(this.adminWallet);
|
|
249
|
+
this.logger.info(`SponsoredFPC at ${sponsoredFPCInstance.address}`);
|
|
250
|
+
this.sponsoredFPC = SponsoredFPCContract.at(sponsoredFPCInstance.address, this.adminWallet);
|
|
251
|
+
this.sponsoredFPCInstance = sponsoredFPCInstance;
|
|
241
252
|
}
|
|
242
253
|
async createCrossChainTestHarness(owner) {
|
|
243
|
-
const l1Client = createExtendedL1Client(this.context.
|
|
254
|
+
const l1Client = createExtendedL1Client(this.context.config.l1RpcUrls, MNEMONIC);
|
|
244
255
|
const underlyingERC20Address = await deployL1Contract(l1Client, TestERC20Abi, TestERC20Bytecode, [
|
|
245
256
|
'Underlying',
|
|
246
257
|
'UND',
|
|
@@ -258,39 +269,35 @@ export class ClientFlowsBenchmark {
|
|
|
258
269
|
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
|
|
259
270
|
const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
|
|
260
271
|
await behchysDeployMethod.send({
|
|
261
|
-
from:
|
|
272
|
+
from: NO_FROM,
|
|
262
273
|
fee: {
|
|
263
274
|
paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim)
|
|
264
275
|
}
|
|
265
|
-
})
|
|
276
|
+
});
|
|
266
277
|
// Register benchy on the user's Wallet, where we're going to be interacting from
|
|
267
278
|
const accountManager = await this.userWallet.createAccount({
|
|
268
279
|
secret: benchysAccount.getSecretKey(),
|
|
269
|
-
salt: new Fr(
|
|
280
|
+
salt: new Fr(benchysAccountManager.getInstance().salt),
|
|
270
281
|
contract: benchysAccountManager.getAccountContract()
|
|
271
282
|
});
|
|
272
283
|
return accountManager.address;
|
|
273
284
|
}
|
|
274
|
-
async
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}).wait();
|
|
286
|
-
return {
|
|
287
|
-
ammAddress: amm.address,
|
|
288
|
-
liquidityTokenAddress: liquidityToken.address
|
|
289
|
-
};
|
|
290
|
-
}, async ({ ammAddress, liquidityTokenAddress })=>{
|
|
291
|
-
this.liquidityToken = await TokenContract.at(liquidityTokenAddress, this.adminWallet);
|
|
292
|
-
this.amm = await AMMContract.at(ammAddress, this.adminWallet);
|
|
285
|
+
async applyDeployAmm() {
|
|
286
|
+
this.logger.info('Applying AMM deployment');
|
|
287
|
+
const { contract: liquidityToken, instance: liquidityTokenInstance } = await TokenContract.deploy(this.adminWallet, this.adminAddress, 'LPT', 'LPT', 18n).send({
|
|
288
|
+
from: this.adminAddress
|
|
289
|
+
});
|
|
290
|
+
const { contract: amm, instance: ammInstance } = await AMMContract.deploy(this.adminWallet, this.bananaCoin.address, this.candyBarCoin.address, liquidityToken.address).send({
|
|
291
|
+
from: this.adminAddress
|
|
292
|
+
});
|
|
293
|
+
this.logger.info(`AMM deployed at ${amm.address}`);
|
|
294
|
+
await liquidityToken.methods.set_minter(amm.address, true).send({
|
|
295
|
+
from: this.adminAddress
|
|
293
296
|
});
|
|
297
|
+
this.liquidityToken = liquidityToken;
|
|
298
|
+
this.liquidityTokenInstance = liquidityTokenInstance;
|
|
299
|
+
this.amm = amm;
|
|
300
|
+
this.ammInstance = ammInstance;
|
|
294
301
|
}
|
|
295
302
|
async getBridgedFeeJuicePaymentMethodForWallet(_wallet, sender) {
|
|
296
303
|
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(sender);
|
|
@@ -299,8 +306,8 @@ export class ClientFlowsBenchmark {
|
|
|
299
306
|
async getPrivateFPCPaymentMethodForWallet(wallet, sender) {
|
|
300
307
|
// The private fee paying method assembled on the app side requires knowledge of the maximum
|
|
301
308
|
// fee the user is willing to pay
|
|
302
|
-
const maxFeesPerGas =
|
|
303
|
-
const gasSettings = GasSettings.
|
|
309
|
+
const maxFeesPerGas = await getPaddedMaxFeesPerGas(this.aztecNode);
|
|
310
|
+
const gasSettings = GasSettings.fallback({
|
|
304
311
|
maxFeesPerGas
|
|
305
312
|
});
|
|
306
313
|
return new PrivateFeePaymentMethod(this.bananaFPC.address, sender, wallet, gasSettings);
|
|
@@ -4,11 +4,11 @@ export type ClientFlowConfig = {
|
|
|
4
4
|
feePaymentMethods: BenchmarkingFeePaymentMethod[];
|
|
5
5
|
recursions?: number[];
|
|
6
6
|
};
|
|
7
|
-
type ClientFlows = 'accountDeployments' | 'deployments' | 'transfers' | 'bridging' | 'amm';
|
|
7
|
+
type ClientFlows = 'accountDeployments' | 'deployments' | 'transfers' | 'bridging' | 'amm' | 'storageProof';
|
|
8
8
|
export type ClientFlowsConfig = {
|
|
9
9
|
[key in ClientFlows]: ClientFlowConfig;
|
|
10
10
|
};
|
|
11
11
|
export declare const KEY_FLOWS_CONFIG: ClientFlowsConfig;
|
|
12
12
|
export declare const FULL_FLOWS_CONFIG: ClientFlowsConfig;
|
|
13
13
|
export {};
|
|
14
|
-
//# sourceMappingURL=
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYmVuY2gvY2xpZW50X2Zsb3dzL2NvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsNEJBQTRCLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUU3RixNQUFNLE1BQU0sZ0JBQWdCLEdBQUc7SUFDN0IsUUFBUSxFQUFFLFdBQVcsRUFBRSxDQUFDO0lBQ3hCLGlCQUFpQixFQUFFLDRCQUE0QixFQUFFLENBQUM7SUFDbEQsVUFBVSxDQUFDLEVBQUUsTUFBTSxFQUFFLENBQUM7Q0FDdkIsQ0FBQztBQUVGLEtBQUssV0FBVyxHQUFHLG9CQUFvQixHQUFHLGFBQWEsR0FBRyxXQUFXLEdBQUcsVUFBVSxHQUFHLEtBQUssR0FBRyxjQUFjLENBQUM7QUFFNUcsTUFBTSxNQUFNLGlCQUFpQixHQUFHO0tBQzdCLEdBQUcsSUFBSSxXQUFXLEdBQUcsZ0JBQWdCO0NBQ3ZDLENBQUM7QUFFRixlQUFPLE1BQU0sZ0JBQWdCLEVBQUUsaUJBMEI5QixDQUFDO0FBRUYsZUFBTyxNQUFNLGlCQUFpQixFQUFFLGlCQTBCL0IsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAE7F,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,iBAAiB,EAAE,4BAA4B,EAAE,CAAC;IAClD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,KAAK,WAAW,GAAG,oBAAoB,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAE7F,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,iBAAiB,EAAE,4BAA4B,EAAE,CAAC;IAClD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,KAAK,WAAW,GAAG,oBAAoB,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,KAAK,GAAG,cAAc,CAAC;AAE5G,MAAM,MAAM,iBAAiB,GAAG;KAC7B,GAAG,IAAI,WAAW,GAAG,gBAAgB;CACvC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,iBA0B9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,iBA0B/B,CAAC"}
|
|
@@ -45,6 +45,14 @@ export const KEY_FLOWS_CONFIG = {
|
|
|
45
45
|
0,
|
|
46
46
|
1
|
|
47
47
|
]
|
|
48
|
+
},
|
|
49
|
+
storageProof: {
|
|
50
|
+
accounts: [
|
|
51
|
+
'ecdsar1'
|
|
52
|
+
],
|
|
53
|
+
feePaymentMethods: [
|
|
54
|
+
'sponsored_fpc'
|
|
55
|
+
]
|
|
48
56
|
}
|
|
49
57
|
};
|
|
50
58
|
export const FULL_FLOWS_CONFIG = {
|
|
@@ -102,5 +110,15 @@ export const FULL_FLOWS_CONFIG = {
|
|
|
102
110
|
1,
|
|
103
111
|
2
|
|
104
112
|
]
|
|
113
|
+
},
|
|
114
|
+
storageProof: {
|
|
115
|
+
accounts: [
|
|
116
|
+
'ecdsar1',
|
|
117
|
+
'schnorr'
|
|
118
|
+
],
|
|
119
|
+
feePaymentMethods: [
|
|
120
|
+
'sponsored_fpc',
|
|
121
|
+
'private_fpc'
|
|
122
|
+
]
|
|
105
123
|
}
|
|
106
124
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YV9leHRyYWN0b3IuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9iZW5jaC9jbGllbnRfZmxvd3MvZGF0YV9leHRyYWN0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BBWASMBundlePrivateKernelProver } from '@aztec/bb-prover/client/wasm/bundle';
|
|
1
|
+
import { BBBundlePrivateKernelProver } from '@aztec/bb-prover/client/bundle';
|
|
3
2
|
import { createLogger, logger } from '@aztec/foundation/log';
|
|
4
3
|
import { Timer } from '@aztec/foundation/timer';
|
|
5
4
|
import { WASMSimulator } from '@aztec/simulator/client';
|
|
@@ -7,26 +6,6 @@ import { Decoder } from 'msgpackr';
|
|
|
7
6
|
import { readFile, readdir, writeFile } from 'node:fs/promises';
|
|
8
7
|
import { join } from 'node:path';
|
|
9
8
|
import { ProxyLogger, generateBenchmark } from './benchmark.js';
|
|
10
|
-
async function createProver(config = {}, log) {
|
|
11
|
-
const simulator = new WASMSimulator();
|
|
12
|
-
if (!config.bbBinaryPath || !config.bbWorkingDirectory) {
|
|
13
|
-
return {
|
|
14
|
-
prover: new BBWASMBundlePrivateKernelProver(simulator, 16, log),
|
|
15
|
-
type: 'wasm'
|
|
16
|
-
};
|
|
17
|
-
} else {
|
|
18
|
-
const bbConfig = config;
|
|
19
|
-
return {
|
|
20
|
-
prover: await BBNativePrivateKernelProver.new({
|
|
21
|
-
bbSkipCleanup: false,
|
|
22
|
-
numConcurrentIVCVerifiers: 1,
|
|
23
|
-
bbIVCConcurrency: 1,
|
|
24
|
-
...bbConfig
|
|
25
|
-
}, simulator, log),
|
|
26
|
-
type: 'native'
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
9
|
async function main() {
|
|
31
10
|
ProxyLogger.create();
|
|
32
11
|
const proxyLogger = ProxyLogger.getInstance();
|
|
@@ -36,10 +15,11 @@ async function main() {
|
|
|
36
15
|
}
|
|
37
16
|
const flows = await readdir(ivcFolder);
|
|
38
17
|
logger.info(`Flows in ${ivcFolder}: \n${flows.map((flowName)=>`\t- ${flowName}`).join('\n')}`);
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
18
|
+
const simulator = new WASMSimulator();
|
|
19
|
+
const log = proxyLogger.createLogger('bb:prover');
|
|
20
|
+
const prover = new BBBundlePrivateKernelProver(simulator, {
|
|
21
|
+
logger: log
|
|
22
|
+
});
|
|
43
23
|
const userLog = createLogger('chonk_flows:data_processor');
|
|
44
24
|
for (const flow of flows){
|
|
45
25
|
userLog.info(`Processing flow ${flow}`);
|
|
@@ -85,7 +65,7 @@ async function main() {
|
|
|
85
65
|
if (!profile.stats.timings.proving) {
|
|
86
66
|
profile.stats.timings.proving = provingTime;
|
|
87
67
|
}
|
|
88
|
-
const benchmark = generateBenchmark(flow, currentLogs, profile.stats, privateExecutionSteps,
|
|
68
|
+
const benchmark = generateBenchmark(flow, currentLogs, profile.stats, privateExecutionSteps, 'native', error);
|
|
89
69
|
await writeFile(join(ivcFolder, flow, 'benchmark.json'), JSON.stringify(benchmark, null, 2));
|
|
90
70
|
proxyLogger.flushLogs();
|
|
91
71
|
}
|
package/dest/bench/utils.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type WaitOpts } from '@aztec/aztec.js/contracts';
|
|
2
2
|
import { BenchmarkingContract } from '@aztec/noir-test-contracts.js/Benchmarking';
|
|
3
|
-
import type {
|
|
3
|
+
import type { TxHash } from '@aztec/stdlib/tx';
|
|
4
|
+
import type { MetricDefinition } from '@aztec/telemetry-client';
|
|
4
5
|
import type { BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
|
|
5
6
|
import { type EndToEndContext, type SetupOptions } from '../fixtures/utils.js';
|
|
6
7
|
/**
|
|
7
8
|
* Setup for benchmarks. Initializes a remote node with a single account and deploys a benchmark contract.
|
|
8
9
|
*/
|
|
9
10
|
export declare function benchmarkSetup(opts: Partial<SetupOptions> & {
|
|
10
|
-
/** What metrics to export */ metrics: (
|
|
11
|
+
/** What metrics to export */ metrics: (MetricDefinition | MetricFilter)[];
|
|
11
12
|
/** Where to output the benchmark data (defaults to BENCH_OUTPUT or bench.json) */
|
|
12
13
|
benchOutput?: string;
|
|
13
14
|
}): Promise<{
|
|
@@ -17,7 +18,7 @@ export declare function benchmarkSetup(opts: Partial<SetupOptions> & {
|
|
|
17
18
|
sequencer: import("@aztec/sequencer-client").SequencerClient;
|
|
18
19
|
}>;
|
|
19
20
|
type MetricFilter = {
|
|
20
|
-
source:
|
|
21
|
+
source: MetricDefinition;
|
|
21
22
|
transform: (value: number) => number;
|
|
22
23
|
name: string;
|
|
23
24
|
unit?: string;
|
|
@@ -38,7 +39,7 @@ export type GithubActionBenchmarkResult = {
|
|
|
38
39
|
* @param heavyPublicCompute - Whether the transactions include heavy public compute (like a big sha256).
|
|
39
40
|
* @returns Array of sent txs.
|
|
40
41
|
*/
|
|
41
|
-
export declare function sendTxs(txCount: number, context: EndToEndContext, contract: BenchmarkingContract, heavyPublicCompute?: boolean):
|
|
42
|
-
export declare function waitTxs(txs:
|
|
42
|
+
export declare function sendTxs(txCount: number, context: EndToEndContext, contract: BenchmarkingContract, heavyPublicCompute?: boolean): Promise<TxHash[]>;
|
|
43
|
+
export declare function waitTxs(txs: TxHash[], context: EndToEndContext, txWaitOpts?: WaitOpts): Promise<void>;
|
|
43
44
|
export {};
|
|
44
|
-
//# sourceMappingURL=
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9iZW5jaC91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEVBQXNCLEtBQUssUUFBUSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFHOUUsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sNENBQTRDLENBQUM7QUFDbEYsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDL0MsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBNEMsd0JBQXdCLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQU14SCxPQUFPLEVBQUUsS0FBSyxlQUFlLEVBQUUsS0FBSyxZQUFZLEVBQVMsTUFBTSxzQkFBc0IsQ0FBQztBQUV0Rjs7R0FFRztBQUNILHdCQUFzQixjQUFjLENBQ2xDLElBQUksRUFBRSxPQUFPLENBQUMsWUFBWSxDQUFDLEdBQUc7SUFDNUIsNkJBQTZCLENBQUMsT0FBTyxFQUFFLENBQUMsZ0JBQWdCLEdBQUcsWUFBWSxDQUFDLEVBQUUsQ0FBQztJQUMzRSxrRkFBa0Y7SUFDbEYsV0FBVyxDQUFDLEVBQUUsTUFBTSxDQUFDO0NBQ3RCOzs7OztHQXlCRjtBQUVELEtBQUssWUFBWSxHQUFHO0lBQ2xCLE1BQU0sRUFBRSxnQkFBZ0IsQ0FBQztJQUN6QixTQUFTLEVBQUUsQ0FBQyxLQUFLLEVBQUUsTUFBTSxLQUFLLE1BQU0sQ0FBQztJQUNyQyxJQUFJLEVBQUUsTUFBTSxDQUFDO0lBQ2IsSUFBSSxDQUFDLEVBQUUsTUFBTSxDQUFDO0NBQ2YsQ0FBQztBQUdGLE1BQU0sTUFBTSwyQkFBMkIsR0FBRztJQUN4QyxJQUFJLEVBQUUsTUFBTSxDQUFDO0lBQ2IsS0FBSyxFQUFFLE1BQU0sQ0FBQztJQUNkLEtBQUssQ0FBQyxFQUFFLE1BQU0sQ0FBQztJQUNmLElBQUksRUFBRSxNQUFNLENBQUM7SUFDYixLQUFLLENBQUMsRUFBRSxNQUFNLENBQUM7Q0FDaEIsQ0FBQztBQW9FRjs7Ozs7Ozs7R0FRRztBQUNILHdCQUFzQixPQUFPLENBQzNCLE9BQU8sRUFBRSxNQUFNLEVBQ2YsT0FBTyxFQUFFLGVBQWUsRUFDeEIsUUFBUSxFQUFFLG9CQUFvQixFQUM5QixrQkFBa0IsR0FBRSxPQUFlLEdBQ2xDLE9BQU8sQ0FBQyxNQUFNLEVBQUUsQ0FBQyxDQVduQjtBQUVELHdCQUFzQixPQUFPLENBQUMsR0FBRyxFQUFFLE1BQU0sRUFBRSxFQUFFLE9BQU8sRUFBRSxlQUFlLEVBQUUsVUFBVSxDQUFDLEVBQUUsUUFBUSxpQkFJM0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/bench/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/bench/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAG9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAA4C,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAMxH,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAS,MAAM,sBAAsB,CAAC;AAEtF;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG;IAC5B,6BAA6B,CAAC,OAAO,EAAE,CAAC,gBAAgB,GAAG,YAAY,CAAC,EAAE,CAAC;IAC3E,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;;;;;GAyBF;AAED,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,gBAAgB,CAAC;IACzB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAGF,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAoEF;;;;;;;;GAQG;AACH,wBAAsB,OAAO,CAC3B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,oBAAoB,EAC9B,kBAAkB,GAAE,OAAe,GAClC,OAAO,CAAC,MAAM,EAAE,CAAC,CAWnB;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC,EAAE,QAAQ,iBAI3F"}
|