@aztec/end-to-end 0.0.1-commit.e3c1de76 → 0.0.1-commit.e57c76e
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 +15 -1
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +17 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +3 -3
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +36 -39
- 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/utils.d.ts +1 -1
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +8 -3
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +8 -5
- 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 +36 -17
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +16 -5
- 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 +42 -9
- package/dest/e2e_deploy_contract/deploy_test.d.ts +4 -4
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +2 -1
- package/dest/e2e_epochs/epochs_test.d.ts +33 -8
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +143 -44
- package/dest/e2e_fees/fees_test.d.ts +6 -3
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +50 -17
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +3 -3
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +6 -7
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +4 -3
- package/dest/e2e_p2p/p2p_network.d.ts +14 -12
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +70 -34
- package/dest/e2e_p2p/reqresp/utils.d.ts +3 -3
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -1
- package/dest/e2e_p2p/reqresp/utils.js +67 -14
- package/dest/e2e_p2p/shared.d.ts +37 -8
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +91 -51
- 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 +6 -4
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +23 -11
- 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 +9 -8
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +39 -50
- 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 +74 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +71 -0
- 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/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 +86 -32
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +209 -169
- package/dest/fixtures/setup_p2p_test.d.ts +22 -10
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +23 -17
- 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 +5 -7
- package/dest/fixtures/utils.d.ts +2 -2
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +1 -1
- 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/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/shared/cross_chain_test_harness.d.ts +4 -2
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +22 -18
- package/dest/shared/gas_portal_test_harness.d.ts +8 -5
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +19 -10
- package/dest/shared/index.d.ts +2 -1
- package/dest/shared/index.d.ts.map +1 -1
- package/dest/shared/index.js +1 -0
- 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 +2 -2
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +1 -1
- 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 +57 -40
- 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/lending_simulator.d.ts +10 -3
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +26 -14
- 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 +12 -3
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +108 -41
- package/dest/spartan/tx_metrics.d.ts +18 -4
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +74 -21
- package/dest/spartan/utils/bot.d.ts +3 -2
- package/dest/spartan/utils/bot.d.ts.map +1 -1
- package/dest/spartan/utils/bot.js +2 -1
- package/dest/spartan/utils/config.d.ts +11 -28
- package/dest/spartan/utils/config.d.ts.map +1 -1
- package/dest/spartan/utils/config.js +4 -1
- package/dest/spartan/utils/index.d.ts +5 -3
- package/dest/spartan/utils/index.d.ts.map +1 -1
- package/dest/spartan/utils/index.js +5 -1
- package/dest/spartan/utils/k8s.d.ts +3 -1
- package/dest/spartan/utils/k8s.d.ts.map +1 -1
- package/dest/spartan/utils/k8s.js +6 -0
- package/dest/spartan/utils/nodes.d.ts +4 -5
- package/dest/spartan/utils/nodes.d.ts.map +1 -1
- package/dest/spartan/utils/nodes.js +11 -11
- 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 +18 -4
- package/dest/spartan/utils/scripts.d.ts.map +1 -1
- package/dest/spartan/utils/scripts.js +19 -4
- 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 +52 -45
- package/src/bench/client_flows/benchmark.ts +19 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +64 -49
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/utils.ts +10 -4
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +52 -25
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +56 -19
- package/src/e2e_deploy_contract/deploy_test.ts +6 -5
- package/src/e2e_epochs/epochs_test.ts +166 -68
- package/src/e2e_fees/bridging_race.notest.ts +1 -1
- package/src/e2e_fees/fees_test.ts +57 -32
- package/src/e2e_nested_contract/nested_contract_test.ts +10 -6
- package/src/e2e_p2p/inactivity_slash_test.ts +8 -7
- package/src/e2e_p2p/p2p_network.ts +93 -49
- package/src/e2e_p2p/reqresp/utils.ts +84 -17
- package/src/e2e_p2p/shared.ts +109 -65
- 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 +38 -11
- 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 +49 -56
- package/src/fixtures/elu_monitor.ts +126 -0
- package/src/fixtures/fixtures.ts +93 -0
- 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/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +272 -233
- package/src/fixtures/setup_p2p_test.ts +37 -32
- package/src/fixtures/token_utils.ts +3 -3
- package/src/fixtures/utils.ts +2 -0
- 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 +3 -5
- package/src/install_legacy_contracts.cjs +75 -0
- package/src/legacy-jest-resolver.cjs +112 -0
- package/src/shared/cross_chain_test_harness.ts +27 -13
- package/src/shared/gas_portal_test_harness.ts +21 -11
- package/src/shared/index.ts +1 -0
- package/src/shared/jest_setup.ts +51 -1
- package/src/shared/mock_state_view.ts +188 -0
- package/src/shared/submit-transactions.ts +3 -2
- package/src/shared/uniswap_l1_l2.ts +103 -54
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +32 -14
- package/src/simulators/token_simulator.ts +6 -30
- package/src/spartan/setup_test_wallets.ts +146 -35
- package/src/spartan/tx_metrics.ts +82 -24
- package/src/spartan/utils/bot.ts +4 -1
- package/src/spartan/utils/config.ts +3 -0
- package/src/spartan/utils/index.ts +8 -1
- package/src/spartan/utils/k8s.ts +8 -0
- package/src/spartan/utils/nodes.ts +17 -12
- package/src/spartan/utils/pod_logs.ts +99 -0
- package/src/spartan/utils/scripts.ts +43 -7
- 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
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { NO_FROM } from '@aztec/aztec.js/account';
|
|
1
2
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
3
|
import { FeeJuicePaymentMethodWithClaim } from '@aztec/aztec.js/fee';
|
|
3
4
|
import { type FeePaymentMethod, PrivateFeePaymentMethod, SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee';
|
|
4
5
|
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
5
6
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
6
7
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
7
|
-
import { CheatCodes } from '@aztec/aztec/testing';
|
|
8
|
+
import { CheatCodes, getTokenAllowedSetupFunctions } from '@aztec/aztec/testing';
|
|
8
9
|
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
9
10
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
10
11
|
import type { DeployAztecL1ContractsArgs } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
@@ -26,9 +27,8 @@ import { type PXEConfig, getPXEConfig } from '@aztec/pxe/server';
|
|
|
26
27
|
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
27
28
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
28
29
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
29
|
-
import { TestWallet } from '@aztec/test-wallet/server';
|
|
30
30
|
|
|
31
|
-
import { MNEMONIC } from '../../fixtures/fixtures.js';
|
|
31
|
+
import { AUTOMINE_E2E_OPTS, MNEMONIC, getPaddedMaxFeesPerGas } from '../../fixtures/fixtures.js';
|
|
32
32
|
import { type EndToEndContext, type SetupOptions, deployAccounts, setup, teardown } from '../../fixtures/setup.js';
|
|
33
33
|
import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
|
|
34
34
|
import { setupSponsoredFPC } from '../../fixtures/utils.js';
|
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
FeeJuicePortalTestingHarnessFactory,
|
|
38
38
|
type GasBridgingTestHarness,
|
|
39
39
|
} from '../../shared/gas_portal_test_harness.js';
|
|
40
|
+
import { TestWallet } from '../../test-wallet/test_wallet.js';
|
|
40
41
|
import { ProxyLogger } from './benchmark.js';
|
|
41
42
|
import { type ClientFlowsConfig, FULL_FLOWS_CONFIG, KEY_FLOWS_CONFIG } from './config.js';
|
|
42
43
|
|
|
@@ -87,33 +88,35 @@ export class ClientFlowsBenchmark {
|
|
|
87
88
|
|
|
88
89
|
public realProofs = ['true', '1'].includes(process.env.REAL_PROOFS ?? '');
|
|
89
90
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
//
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
//
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
91
|
+
// `apps` is the number of private function calls contributed by this payment method.
|
|
92
|
+
// Each app produces one execution step at proving time; the orchestrator additionally produces
|
|
93
|
+
// one kernel step per batch of N apps (see `expectedExecutionSteps` in `benchmark.ts`).
|
|
94
|
+
public paymentMethods: Record<BenchmarkingFeePaymentMethod, { forWallet: FeePaymentMethodGetter; apps: number }> = {
|
|
95
|
+
// eslint-disable-next-line camelcase
|
|
96
|
+
bridged_fee_juice: {
|
|
97
|
+
forWallet: this.getBridgedFeeJuicePaymentMethodForWallet.bind(this),
|
|
98
|
+
apps: 1, // FeeJuice claim
|
|
99
|
+
},
|
|
100
|
+
// eslint-disable-next-line camelcase
|
|
101
|
+
private_fpc: {
|
|
102
|
+
forWallet: this.getPrivateFPCPaymentMethodForWallet.bind(this),
|
|
103
|
+
apps:
|
|
104
|
+
1 + // FPC entrypoint
|
|
105
|
+
1 + // BananaCoin transfer_to_public
|
|
106
|
+
1 + // Account verify_private_authwit
|
|
107
|
+
1, // BananaCoin prepare_private_balance_increase
|
|
108
|
+
},
|
|
109
|
+
// eslint-disable-next-line camelcase
|
|
110
|
+
sponsored_fpc: {
|
|
111
|
+
forWallet: this.getSponsoredFPCPaymentMethodForWallet.bind(this),
|
|
112
|
+
apps: 1, // Sponsored FPC sponsor_unconditionally
|
|
113
|
+
},
|
|
114
|
+
// eslint-disable-next-line camelcase
|
|
115
|
+
fee_juice: {
|
|
116
|
+
forWallet: () => Promise.resolve(undefined),
|
|
117
|
+
apps: 0,
|
|
118
|
+
},
|
|
119
|
+
};
|
|
117
120
|
|
|
118
121
|
public config: ClientFlowsConfig;
|
|
119
122
|
|
|
@@ -122,7 +125,7 @@ export class ClientFlowsBenchmark {
|
|
|
122
125
|
|
|
123
126
|
constructor(testName?: string, setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs> = {}) {
|
|
124
127
|
this.logger = createLogger(`bench:client_flows${testName ? `:${testName}` : ''}`);
|
|
125
|
-
this.setupOptions = { startProverNode: true, ...setupOptions };
|
|
128
|
+
this.setupOptions = { ...AUTOMINE_E2E_OPTS, startProverNode: true, ...setupOptions };
|
|
126
129
|
this.config = BENCHMARK_CONFIG === 'key_flows' ? KEY_FLOWS_CONFIG : FULL_FLOWS_CONFIG;
|
|
127
130
|
ProxyLogger.create();
|
|
128
131
|
this.proxyLogger = ProxyLogger.getInstance();
|
|
@@ -130,24 +133,28 @@ export class ClientFlowsBenchmark {
|
|
|
130
133
|
|
|
131
134
|
async setup() {
|
|
132
135
|
this.logger.info('Setting up subsystems from fresh');
|
|
136
|
+
// Token allowlist entries are test-only: FPC-based fee payment with custom tokens won't work on mainnet alpha.
|
|
137
|
+
const tokenAllowList = await getTokenAllowedSetupFunctions();
|
|
133
138
|
this.context = await setup(0, {
|
|
134
139
|
...this.setupOptions,
|
|
135
140
|
fundSponsoredFPC: true,
|
|
136
141
|
skipAccountDeployment: true,
|
|
137
142
|
l1ContractsArgs: this.setupOptions,
|
|
143
|
+
txPublicSetupAllowListExtend: [...(this.setupOptions.txPublicSetupAllowListExtend ?? []), ...tokenAllowList],
|
|
138
144
|
});
|
|
139
145
|
await this.applyBaseSetup();
|
|
140
146
|
|
|
141
|
-
await this.context.aztecNodeService
|
|
147
|
+
await this.context.aztecNodeService.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
|
|
142
148
|
|
|
143
149
|
const rollupContract = RollupContract.getFromConfig(this.context.config);
|
|
144
|
-
this.chainMonitor = new ChainMonitor(rollupContract, this.context.dateProvider
|
|
150
|
+
this.chainMonitor = new ChainMonitor(rollupContract, this.context.dateProvider, this.logger, 200).start();
|
|
145
151
|
|
|
146
152
|
return this;
|
|
147
153
|
}
|
|
148
154
|
|
|
149
155
|
async teardown() {
|
|
150
156
|
await this.chainMonitor.stop();
|
|
157
|
+
await this.userWallet?.stop();
|
|
151
158
|
await teardown(this.context);
|
|
152
159
|
}
|
|
153
160
|
|
|
@@ -161,15 +168,15 @@ export class ClientFlowsBenchmark {
|
|
|
161
168
|
|
|
162
169
|
/** Admin mints bananaCoin tokens privately to the target address and redeems them. */
|
|
163
170
|
async mintPrivateBananas(amount: bigint, address: AztecAddress) {
|
|
164
|
-
const balanceBefore = await this.bananaCoin.methods
|
|
171
|
+
const { result: balanceBefore } = await this.bananaCoin.methods
|
|
165
172
|
.balance_of_private(address)
|
|
166
|
-
.simulate({ from:
|
|
173
|
+
.simulate({ from: address });
|
|
167
174
|
|
|
168
175
|
await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
|
|
169
176
|
|
|
170
|
-
const balanceAfter = await this.bananaCoin.methods
|
|
177
|
+
const { result: balanceAfter } = await this.bananaCoin.methods
|
|
171
178
|
.balance_of_private(address)
|
|
172
|
-
.simulate({ from:
|
|
179
|
+
.simulate({ from: address });
|
|
173
180
|
expect(balanceAfter).toEqual(balanceBefore + amount);
|
|
174
181
|
}
|
|
175
182
|
|
|
@@ -207,7 +214,7 @@ export class ClientFlowsBenchmark {
|
|
|
207
214
|
const [{ address: adminAddress }, { address: sequencerAddress }] = deployedAccounts;
|
|
208
215
|
|
|
209
216
|
this.adminWallet = this.context.wallet;
|
|
210
|
-
this.aztecNode = this.context.aztecNodeService
|
|
217
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
211
218
|
this.cheatCodes = this.context.cheatCodes;
|
|
212
219
|
|
|
213
220
|
this.adminAddress = adminAddress;
|
|
@@ -235,8 +242,8 @@ export class ClientFlowsBenchmark {
|
|
|
235
242
|
this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
|
|
236
243
|
|
|
237
244
|
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
238
|
-
aztecNode: this.context.aztecNodeService
|
|
239
|
-
aztecNodeAdmin: this.context.aztecNodeService
|
|
245
|
+
aztecNode: this.context.aztecNodeService,
|
|
246
|
+
aztecNodeAdmin: this.context.aztecNodeService,
|
|
240
247
|
l1Client: this.context.deployL1ContractsValues.l1Client,
|
|
241
248
|
wallet: this.adminWallet,
|
|
242
249
|
logger: this.logger,
|
|
@@ -251,7 +258,9 @@ export class ClientFlowsBenchmark {
|
|
|
251
258
|
'BC',
|
|
252
259
|
'BC',
|
|
253
260
|
18n,
|
|
254
|
-
).send({
|
|
261
|
+
).send({
|
|
262
|
+
from: this.adminAddress,
|
|
263
|
+
});
|
|
255
264
|
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
256
265
|
this.bananaCoin = bananaCoin;
|
|
257
266
|
this.bananaCoinInstance = bananaCoinInstance;
|
|
@@ -265,7 +274,9 @@ export class ClientFlowsBenchmark {
|
|
|
265
274
|
'CBC',
|
|
266
275
|
'CBC',
|
|
267
276
|
18n,
|
|
268
|
-
).send({
|
|
277
|
+
).send({
|
|
278
|
+
from: this.adminAddress,
|
|
279
|
+
});
|
|
269
280
|
this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
|
|
270
281
|
this.candyBarCoin = candyBarCoin;
|
|
271
282
|
this.candyBarCoinInstance = candyBarCoinInstance;
|
|
@@ -281,7 +292,9 @@ export class ClientFlowsBenchmark {
|
|
|
281
292
|
this.adminWallet,
|
|
282
293
|
bananaCoin.address,
|
|
283
294
|
this.adminAddress,
|
|
284
|
-
).send({
|
|
295
|
+
).send({
|
|
296
|
+
from: this.adminAddress,
|
|
297
|
+
});
|
|
285
298
|
|
|
286
299
|
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
287
300
|
|
|
@@ -330,13 +343,13 @@ export class ClientFlowsBenchmark {
|
|
|
330
343
|
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
|
|
331
344
|
const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
|
|
332
345
|
await behchysDeployMethod.send({
|
|
333
|
-
from:
|
|
346
|
+
from: NO_FROM,
|
|
334
347
|
fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
|
|
335
348
|
});
|
|
336
349
|
// Register benchy on the user's Wallet, where we're going to be interacting from
|
|
337
350
|
const accountManager = await this.userWallet.createAccount({
|
|
338
351
|
secret: benchysAccount.getSecretKey(),
|
|
339
|
-
salt: new Fr(
|
|
352
|
+
salt: new Fr(benchysAccountManager.getInstance().salt),
|
|
340
353
|
contract: benchysAccountManager.getAccountContract(),
|
|
341
354
|
});
|
|
342
355
|
return accountManager.address;
|
|
@@ -350,13 +363,15 @@ export class ClientFlowsBenchmark {
|
|
|
350
363
|
'LPT',
|
|
351
364
|
'LPT',
|
|
352
365
|
18n,
|
|
353
|
-
).send({
|
|
366
|
+
).send({
|
|
367
|
+
from: this.adminAddress,
|
|
368
|
+
});
|
|
354
369
|
const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
|
|
355
370
|
this.adminWallet,
|
|
356
371
|
this.bananaCoin.address,
|
|
357
372
|
this.candyBarCoin.address,
|
|
358
373
|
liquidityToken.address,
|
|
359
|
-
).send({ from: this.adminAddress
|
|
374
|
+
).send({ from: this.adminAddress });
|
|
360
375
|
this.logger.info(`AMM deployed at ${amm.address}`);
|
|
361
376
|
await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress });
|
|
362
377
|
this.liquidityToken = liquidityToken;
|
|
@@ -373,8 +388,8 @@ export class ClientFlowsBenchmark {
|
|
|
373
388
|
public async getPrivateFPCPaymentMethodForWallet(wallet: Wallet, sender: AztecAddress) {
|
|
374
389
|
// The private fee paying method assembled on the app side requires knowledge of the maximum
|
|
375
390
|
// fee the user is willing to pay
|
|
376
|
-
const maxFeesPerGas =
|
|
377
|
-
const gasSettings = GasSettings.
|
|
391
|
+
const maxFeesPerGas = await getPaddedMaxFeesPerGas(this.aztecNode);
|
|
392
|
+
const gasSettings = GasSettings.fallback({ maxFeesPerGas });
|
|
378
393
|
return new PrivateFeePaymentMethod(this.bananaFPC.address, sender, wallet, gasSettings);
|
|
379
394
|
}
|
|
380
395
|
|
|
@@ -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
|
};
|
package/src/bench/utils.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { BenchmarkDataPoint, BenchmarkMetricsType, BenchmarkTelemetryClient
|
|
|
11
11
|
import { mkdirSync, writeFileSync } from 'fs';
|
|
12
12
|
import path from 'path';
|
|
13
13
|
|
|
14
|
+
import { PIPELINING_SETUP_OPTS } from '../fixtures/fixtures.js';
|
|
14
15
|
import { type EndToEndContext, type SetupOptions, setup } from '../fixtures/utils.js';
|
|
15
16
|
|
|
16
17
|
/**
|
|
@@ -23,12 +24,12 @@ export async function benchmarkSetup(
|
|
|
23
24
|
benchOutput?: string;
|
|
24
25
|
},
|
|
25
26
|
) {
|
|
26
|
-
const context = await setup(1, { ...opts, telemetryConfig: { benchmark: true } });
|
|
27
|
+
const context = await setup(1, { ...PIPELINING_SETUP_OPTS, ...opts, telemetryConfig: { benchmark: true } });
|
|
27
28
|
const defaultAccountAddress = context.accounts[0];
|
|
28
|
-
const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress });
|
|
29
|
+
const { contract } = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress });
|
|
29
30
|
context.logger.info(`Deployed benchmarking contract at ${contract.address}`);
|
|
30
31
|
const sequencer = (context.aztecNode as AztecNodeService).getSequencer()!;
|
|
31
|
-
const telemetry = context.telemetryClient
|
|
32
|
+
const telemetry = context.telemetryClient as BenchmarkTelemetryClient;
|
|
32
33
|
context.logger.warn(`Cleared benchmark data points from setup`);
|
|
33
34
|
telemetry.clear();
|
|
34
35
|
const origTeardown = context.teardown.bind(context);
|
|
@@ -149,7 +150,12 @@ export async function sendTxs(
|
|
|
149
150
|
context.logger.info(`Creating ${txCount} txs`);
|
|
150
151
|
const [from] = context.accounts;
|
|
151
152
|
context.logger.info(`Sending ${txCount} txs`);
|
|
152
|
-
return Promise.all(
|
|
153
|
+
return Promise.all(
|
|
154
|
+
calls.map(async call => {
|
|
155
|
+
const { txHash } = await call.send({ from, wait: NO_WAIT });
|
|
156
|
+
return txHash;
|
|
157
|
+
}),
|
|
158
|
+
);
|
|
153
159
|
}
|
|
154
160
|
|
|
155
161
|
export async function waitTxs(txs: TxHash[], context: EndToEndContext, txWaitOpts?: WaitOpts) {
|
|
@@ -7,14 +7,24 @@ import type { TxHash } from '@aztec/aztec.js/tx';
|
|
|
7
7
|
import type { CheatCodes } from '@aztec/aztec/testing';
|
|
8
8
|
import type { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
9
9
|
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
10
|
+
import { GenericProxyContract } from '@aztec/noir-test-contracts.js/GenericProxy';
|
|
10
11
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
11
12
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
12
|
-
import type {
|
|
13
|
+
import type { AztecNodeDebug } from '@aztec/stdlib/interfaces/client';
|
|
13
14
|
|
|
14
15
|
import { jest } from '@jest/globals';
|
|
15
16
|
|
|
16
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
type EndToEndContext,
|
|
19
|
+
type SetupOptions,
|
|
20
|
+
deployAccounts,
|
|
21
|
+
ensureAuthRegistryPublished,
|
|
22
|
+
publicDeployAccounts,
|
|
23
|
+
setup,
|
|
24
|
+
teardown,
|
|
25
|
+
} from '../fixtures/setup.js';
|
|
17
26
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
27
|
+
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
18
28
|
|
|
19
29
|
export class Role {
|
|
20
30
|
private isAdmin = false;
|
|
@@ -53,9 +63,10 @@ export class BlacklistTokenContractTest {
|
|
|
53
63
|
asset!: TokenBlacklistContract;
|
|
54
64
|
tokenSim!: TokenSimulator;
|
|
55
65
|
badAccount!: InvalidAccountContract;
|
|
66
|
+
authwitProxy!: GenericProxyContract;
|
|
56
67
|
cheatCodes!: CheatCodes;
|
|
57
68
|
sequencer!: SequencerClient;
|
|
58
|
-
aztecNode!: AztecNode;
|
|
69
|
+
aztecNode!: AztecNode & AztecNodeDebug;
|
|
59
70
|
|
|
60
71
|
adminAddress!: AztecAddress;
|
|
61
72
|
otherAddress!: AztecAddress;
|
|
@@ -66,11 +77,13 @@ export class BlacklistTokenContractTest {
|
|
|
66
77
|
}
|
|
67
78
|
|
|
68
79
|
async crossTimestampOfChange() {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
80
|
+
// Under AUTOMINE_E2E_OPTS, the 86400s warp crosses many epochs without any proofs being
|
|
81
|
+
// submitted. Mark current pending checkpoints as proven first so the rollup contract's
|
|
82
|
+
// pruning window doesn't reset the chain tip to genesis (which would make the warp's
|
|
83
|
+
// own empty-checkpoint propose fail with Rollup__InvalidArchive). See the AutomineSequencer
|
|
84
|
+
// README "Epoch proving caveat" and the equivalent pattern in lending_simulator.progressSlots.
|
|
85
|
+
await this.cheatCodes.rollup.markAsProven();
|
|
86
|
+
await this.cheatCodes.warpL2TimeAtLeastBy(this.aztecNode, BlacklistTokenContractTest.CHANGE_ROLES_DELAY);
|
|
74
87
|
}
|
|
75
88
|
|
|
76
89
|
/**
|
|
@@ -79,8 +92,9 @@ export class BlacklistTokenContractTest {
|
|
|
79
92
|
* 2. Publicly deploy accounts, deploy token contract and a "bad account".
|
|
80
93
|
*/
|
|
81
94
|
async applyBaseSetup() {
|
|
82
|
-
//
|
|
83
|
-
|
|
95
|
+
// Bumped from 2 min: pipelined cadence (~24s/dependent-tx) makes the 3-account deploy plus token/bad-account/
|
|
96
|
+
// proxy deploys exceed the original window.
|
|
97
|
+
jest.setTimeout(600_000);
|
|
84
98
|
|
|
85
99
|
this.logger.info('Deploying 3 accounts');
|
|
86
100
|
const { deployedAccounts } = await deployAccounts(
|
|
@@ -92,7 +106,7 @@ export class BlacklistTokenContractTest {
|
|
|
92
106
|
});
|
|
93
107
|
|
|
94
108
|
this.cheatCodes = this.context.cheatCodes;
|
|
95
|
-
this.aztecNode = this.context.aztecNodeService
|
|
109
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
96
110
|
this.sequencer = this.context.sequencer!;
|
|
97
111
|
this.wallet = this.context.wallet;
|
|
98
112
|
this.adminAddress = deployedAccounts[0].address;
|
|
@@ -100,20 +114,32 @@ export class BlacklistTokenContractTest {
|
|
|
100
114
|
this.blacklistedAddress = deployedAccounts[2].address;
|
|
101
115
|
|
|
102
116
|
this.logger.info('Setting up blacklist token contract');
|
|
117
|
+
await ensureAuthRegistryPublished(this.wallet, this.adminAddress);
|
|
103
118
|
// Create the token contract state.
|
|
104
119
|
this.logger.verbose(`Public deploy accounts...`);
|
|
105
120
|
await publicDeployAccounts(this.wallet, [this.adminAddress, this.otherAddress, this.blacklistedAddress]);
|
|
106
121
|
|
|
107
122
|
this.logger.verbose(`Deploying TokenContract...`);
|
|
108
|
-
this.asset = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress).send({
|
|
123
|
+
({ contract: this.asset } = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress).send({
|
|
109
124
|
from: this.adminAddress,
|
|
110
|
-
});
|
|
125
|
+
}));
|
|
111
126
|
this.logger.verbose(`Token deployed to ${this.asset.address}`);
|
|
112
127
|
|
|
113
128
|
this.logger.verbose(`Deploying bad account...`);
|
|
114
|
-
this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({
|
|
129
|
+
({ contract: this.badAccount } = await InvalidAccountContract.deploy(this.wallet).send({
|
|
130
|
+
from: this.adminAddress,
|
|
131
|
+
}));
|
|
115
132
|
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
116
133
|
|
|
134
|
+
// Deploy a proxy contract for "on behalf of other" tests. The note owner must be the tx sender
|
|
135
|
+
// (so their notes are in scope), but msg_sender in the target must differ from the note owner
|
|
136
|
+
// to trigger authwit validation. The proxy forwards calls so that msg_sender != tx sender.
|
|
137
|
+
this.logger.verbose(`Deploying generic proxy...`);
|
|
138
|
+
({ contract: this.authwitProxy } = await GenericProxyContract.deploy(this.wallet).send({
|
|
139
|
+
from: this.adminAddress,
|
|
140
|
+
}));
|
|
141
|
+
this.logger.verbose(`Deployed to ${this.authwitProxy.address}.`);
|
|
142
|
+
|
|
117
143
|
await this.crossTimestampOfChange();
|
|
118
144
|
|
|
119
145
|
this.tokenSim = new TokenSimulator(
|
|
@@ -124,14 +150,15 @@ export class BlacklistTokenContractTest {
|
|
|
124
150
|
[this.adminAddress, this.otherAddress, this.blacklistedAddress],
|
|
125
151
|
);
|
|
126
152
|
|
|
127
|
-
expect(
|
|
128
|
-
|
|
129
|
-
);
|
|
153
|
+
expect(
|
|
154
|
+
(await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).result,
|
|
155
|
+
).toEqual(new Role().withAdmin().toNoirStruct());
|
|
130
156
|
}
|
|
131
157
|
|
|
132
|
-
async setup() {
|
|
158
|
+
async setup(opts: Partial<SetupOptions> = {}) {
|
|
133
159
|
this.logger.info('Setting up fresh context');
|
|
134
160
|
this.context = await setup(0, {
|
|
161
|
+
...opts,
|
|
135
162
|
fundSponsoredFPC: true,
|
|
136
163
|
skipAccountDeployment: true,
|
|
137
164
|
});
|
|
@@ -180,9 +207,9 @@ export class BlacklistTokenContractTest {
|
|
|
180
207
|
|
|
181
208
|
await this.crossTimestampOfChange();
|
|
182
209
|
|
|
183
|
-
expect(
|
|
184
|
-
|
|
185
|
-
);
|
|
210
|
+
expect(
|
|
211
|
+
(await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).result,
|
|
212
|
+
).toEqual(adminMinterRole.toNoirStruct());
|
|
186
213
|
|
|
187
214
|
this.logger.verbose(`Minting ${amount} publicly...`);
|
|
188
215
|
await asset.methods.mint_public(this.adminAddress, amount).send({ from: this.adminAddress });
|
|
@@ -190,7 +217,7 @@ export class BlacklistTokenContractTest {
|
|
|
190
217
|
this.logger.verbose(`Minting ${amount} privately...`);
|
|
191
218
|
const secret = Fr.random();
|
|
192
219
|
const secretHash = await computeSecretHash(secret);
|
|
193
|
-
const receipt = await asset.methods.mint_private(amount, secretHash).send({ from: this.adminAddress });
|
|
220
|
+
const { receipt } = await asset.methods.mint_private(amount, secretHash).send({ from: this.adminAddress });
|
|
194
221
|
|
|
195
222
|
await this.addPendingShieldNoteToPXE(asset, this.adminAddress, amount, secretHash, receipt.txHash);
|
|
196
223
|
await asset.methods.redeem_shield(this.adminAddress, amount, secret).send({ from: this.adminAddress });
|
|
@@ -198,20 +225,20 @@ export class BlacklistTokenContractTest {
|
|
|
198
225
|
|
|
199
226
|
tokenSim.mintPublic(this.adminAddress, amount);
|
|
200
227
|
|
|
201
|
-
const publicBalance = await asset.methods
|
|
228
|
+
const { result: publicBalance } = await asset.methods
|
|
202
229
|
.balance_of_public(this.adminAddress)
|
|
203
230
|
.simulate({ from: this.adminAddress });
|
|
204
231
|
this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
|
|
205
232
|
expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(this.adminAddress));
|
|
206
233
|
|
|
207
234
|
tokenSim.mintPrivate(this.adminAddress, amount);
|
|
208
|
-
const privateBalance = await asset.methods
|
|
235
|
+
const { result: privateBalance } = await asset.methods
|
|
209
236
|
.balance_of_private(this.adminAddress)
|
|
210
237
|
.simulate({ from: this.adminAddress });
|
|
211
238
|
this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
|
|
212
239
|
expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(this.adminAddress));
|
|
213
240
|
|
|
214
|
-
const totalSupply = await asset.methods.total_supply().simulate({ from: this.adminAddress });
|
|
241
|
+
const { result: totalSupply } = await asset.methods.total_supply().simulate({ from: this.adminAddress });
|
|
215
242
|
this.logger.verbose(`Total supply: ${totalSupply}`);
|
|
216
243
|
expect(totalSupply).toEqual(tokenSim.totalSupply);
|
|
217
244
|
}
|