@aztec/end-to-end 3.0.0-canary.a9708bd → 3.0.0-devnet.20251212
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 +4 -3
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +2 -2
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +25 -14
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +111 -90
- package/dest/bench/client_flows/config.d.ts +1 -1
- package/dest/bench/client_flows/data_extractor.d.ts +1 -1
- package/dest/bench/client_flows/data_extractor.js +8 -30
- package/dest/bench/utils.d.ts +4 -13
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +10 -34
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +8 -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 +42 -42
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +12 -9
- 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 +35 -35
- package/dest/e2e_deploy_contract/deploy_test.d.ts +12 -6
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +9 -18
- package/dest/e2e_epochs/epochs_test.d.ts +19 -12
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +30 -22
- package/dest/e2e_fees/bridging_race.notest.d.ts +1 -1
- package/dest/e2e_fees/bridging_race.notest.js +14 -11
- package/dest/e2e_fees/fees_test.d.ts +10 -8
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +35 -38
- package/dest/e2e_l1_publisher/write_json.d.ts +4 -2
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +9 -8
- package/dest/e2e_multi_validator/utils.d.ts +2 -2
- package/dest/e2e_multi_validator/utils.d.ts.map +1 -1
- package/dest/e2e_multi_validator/utils.js +4 -10
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +7 -4
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +11 -12
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +31 -0
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -0
- package/dest/e2e_p2p/inactivity_slash_test.js +139 -0
- package/dest/e2e_p2p/p2p_network.d.ts +238 -17
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +46 -19
- package/dest/e2e_p2p/shared.d.ts +16 -17
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +56 -55
- package/dest/e2e_token_contract/token_contract_test.d.ts +6 -5
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +14 -17
- package/dest/fixtures/e2e_prover_test.d.ts +12 -8
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +53 -58
- package/dest/fixtures/fixtures.d.ts +1 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +1 -1
- package/dest/fixtures/get_acvm_config.d.ts +2 -2
- package/dest/fixtures/get_acvm_config.d.ts.map +1 -1
- package/dest/fixtures/get_acvm_config.js +1 -1
- package/dest/fixtures/get_bb_config.d.ts +2 -2
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +2 -2
- package/dest/fixtures/index.d.ts +1 -1
- 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/setup_l1_contracts.d.ts +476 -5
- package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
- package/dest/fixtures/setup_l1_contracts.js +3 -3
- package/dest/fixtures/setup_p2p_test.d.ts +12 -11
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +50 -24
- package/dest/fixtures/snapshot_manager.d.ts +13 -10
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +66 -51
- package/dest/fixtures/token_utils.d.ts +10 -5
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +17 -18
- package/dest/fixtures/utils.d.ts +479 -35
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +106 -125
- package/dest/fixtures/web3signer.d.ts +5 -0
- package/dest/fixtures/web3signer.d.ts.map +1 -0
- package/dest/fixtures/web3signer.js +53 -0
- 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/index.d.ts +1 -1
- package/dest/quality_of_service/alert_checker.d.ts +2 -2
- package/dest/quality_of_service/alert_checker.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.d.ts +20 -23
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +14 -16
- package/dest/shared/gas_portal_test_harness.d.ts +10 -17
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +11 -8
- package/dest/shared/index.d.ts +1 -1
- package/dest/shared/jest_setup.d.ts +1 -1
- package/dest/shared/jest_setup.js +1 -1
- package/dest/shared/submit-transactions.d.ts +6 -4
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +8 -7
- package/dest/shared/uniswap_l1_l2.d.ts +12 -8
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +44 -58
- package/dest/simulators/index.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts +4 -7
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +8 -5
- package/dest/simulators/token_simulator.d.ts +4 -2
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +2 -2
- package/dest/spartan/setup_test_wallets.d.ts +22 -14
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +144 -86
- package/dest/spartan/tx_metrics.d.ts +39 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +95 -0
- package/dest/spartan/utils.d.ts +92 -17
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +386 -63
- package/package.json +43 -40
- package/src/bench/client_flows/benchmark.ts +8 -8
- package/src/bench/client_flows/client_flows_benchmark.ts +141 -114
- package/src/bench/client_flows/data_extractor.ts +9 -31
- package/src/bench/utils.ts +9 -37
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +46 -63
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +38 -51
- package/src/e2e_deploy_contract/deploy_test.ts +18 -36
- package/src/e2e_epochs/epochs_test.ts +41 -35
- package/src/e2e_fees/bridging_race.notest.ts +16 -11
- package/src/e2e_fees/fees_test.ts +42 -47
- package/src/e2e_l1_publisher/write_json.ts +12 -9
- package/src/e2e_multi_validator/utils.ts +5 -11
- package/src/e2e_nested_contract/nested_contract_test.ts +15 -13
- package/src/e2e_p2p/inactivity_slash_test.ts +184 -0
- package/src/e2e_p2p/p2p_network.ts +124 -82
- package/src/e2e_p2p/shared.ts +66 -58
- package/src/e2e_token_contract/token_contract_test.ts +17 -17
- package/src/fixtures/e2e_prover_test.ts +60 -97
- package/src/fixtures/fixtures.ts +1 -2
- package/src/fixtures/get_acvm_config.ts +2 -2
- package/src/fixtures/get_bb_config.ts +3 -2
- package/src/fixtures/l1_to_l2_messaging.ts +4 -2
- package/src/fixtures/setup_l1_contracts.ts +5 -4
- package/src/fixtures/setup_p2p_test.ts +79 -32
- package/src/fixtures/snapshot_manager.ts +87 -82
- package/src/fixtures/token_utils.ts +16 -24
- package/src/fixtures/utils.ts +142 -172
- package/src/fixtures/web3signer.ts +63 -0
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/guides/up_quick_start.sh +3 -11
- package/src/quality_of_service/alert_checker.ts +1 -1
- package/src/shared/cross_chain_test_harness.ts +23 -31
- package/src/shared/gas_portal_test_harness.ts +14 -21
- package/src/shared/jest_setup.ts +1 -1
- package/src/shared/submit-transactions.ts +12 -8
- package/src/shared/uniswap_l1_l2.ts +77 -86
- package/src/simulators/lending_simulator.ts +9 -6
- package/src/simulators/token_simulator.ts +5 -2
- package/src/spartan/DEVELOP.md +15 -3
- package/src/spartan/setup_test_wallets.ts +171 -127
- package/src/spartan/tx_metrics.ts +130 -0
- package/src/spartan/utils.ts +463 -64
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-devnet.20251212",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"./package.local.json"
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "yarn clean && tsc
|
|
12
|
-
"build:dev": "tsc
|
|
11
|
+
"build": "yarn clean && ../scripts/tsc.sh",
|
|
12
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
13
13
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
14
14
|
"test:with-alerts": "./scripts/test-with-alerts.sh",
|
|
15
15
|
"test:e2e": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000 --forceExit",
|
|
@@ -25,41 +25,43 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "3.0.0-
|
|
29
|
-
"@aztec/archiver": "3.0.0-
|
|
30
|
-
"@aztec/aztec": "3.0.0-
|
|
31
|
-
"@aztec/aztec-node": "3.0.0-
|
|
32
|
-
"@aztec/aztec.js": "3.0.0-
|
|
33
|
-
"@aztec/bb-prover": "3.0.0-
|
|
34
|
-
"@aztec/
|
|
35
|
-
"@aztec/blob-
|
|
36
|
-
"@aztec/
|
|
37
|
-
"@aztec/
|
|
38
|
-
"@aztec/
|
|
39
|
-
"@aztec/
|
|
40
|
-
"@aztec/
|
|
41
|
-
"@aztec/
|
|
42
|
-
"@aztec/
|
|
43
|
-
"@aztec/
|
|
44
|
-
"@aztec/
|
|
45
|
-
"@aztec/
|
|
46
|
-
"@aztec/
|
|
47
|
-
"@aztec/
|
|
48
|
-
"@aztec/noir-
|
|
49
|
-
"@aztec/noir-
|
|
50
|
-
"@aztec/noir-
|
|
51
|
-
"@aztec/
|
|
52
|
-
"@aztec/
|
|
53
|
-
"@aztec/
|
|
54
|
-
"@aztec/prover-
|
|
55
|
-
"@aztec/
|
|
56
|
-
"@aztec/
|
|
57
|
-
"@aztec/
|
|
58
|
-
"@aztec/
|
|
59
|
-
"@aztec/
|
|
60
|
-
"@aztec/
|
|
61
|
-
"@aztec/
|
|
62
|
-
"@aztec/
|
|
28
|
+
"@aztec/accounts": "3.0.0-devnet.20251212",
|
|
29
|
+
"@aztec/archiver": "3.0.0-devnet.20251212",
|
|
30
|
+
"@aztec/aztec": "3.0.0-devnet.20251212",
|
|
31
|
+
"@aztec/aztec-node": "3.0.0-devnet.20251212",
|
|
32
|
+
"@aztec/aztec.js": "3.0.0-devnet.20251212",
|
|
33
|
+
"@aztec/bb-prover": "3.0.0-devnet.20251212",
|
|
34
|
+
"@aztec/bb.js": "3.0.0-devnet.20251212",
|
|
35
|
+
"@aztec/blob-lib": "3.0.0-devnet.20251212",
|
|
36
|
+
"@aztec/blob-sink": "3.0.0-devnet.20251212",
|
|
37
|
+
"@aztec/bot": "3.0.0-devnet.20251212",
|
|
38
|
+
"@aztec/cli": "3.0.0-devnet.20251212",
|
|
39
|
+
"@aztec/constants": "3.0.0-devnet.20251212",
|
|
40
|
+
"@aztec/entrypoints": "3.0.0-devnet.20251212",
|
|
41
|
+
"@aztec/epoch-cache": "3.0.0-devnet.20251212",
|
|
42
|
+
"@aztec/ethereum": "3.0.0-devnet.20251212",
|
|
43
|
+
"@aztec/foundation": "3.0.0-devnet.20251212",
|
|
44
|
+
"@aztec/kv-store": "3.0.0-devnet.20251212",
|
|
45
|
+
"@aztec/l1-artifacts": "3.0.0-devnet.20251212",
|
|
46
|
+
"@aztec/merkle-tree": "3.0.0-devnet.20251212",
|
|
47
|
+
"@aztec/node-keystore": "3.0.0-devnet.20251212",
|
|
48
|
+
"@aztec/noir-contracts.js": "3.0.0-devnet.20251212",
|
|
49
|
+
"@aztec/noir-noirc_abi": "3.0.0-devnet.20251212",
|
|
50
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-devnet.20251212",
|
|
51
|
+
"@aztec/noir-test-contracts.js": "3.0.0-devnet.20251212",
|
|
52
|
+
"@aztec/p2p": "3.0.0-devnet.20251212",
|
|
53
|
+
"@aztec/protocol-contracts": "3.0.0-devnet.20251212",
|
|
54
|
+
"@aztec/prover-client": "3.0.0-devnet.20251212",
|
|
55
|
+
"@aztec/prover-node": "3.0.0-devnet.20251212",
|
|
56
|
+
"@aztec/pxe": "3.0.0-devnet.20251212",
|
|
57
|
+
"@aztec/sequencer-client": "3.0.0-devnet.20251212",
|
|
58
|
+
"@aztec/simulator": "3.0.0-devnet.20251212",
|
|
59
|
+
"@aztec/slasher": "3.0.0-devnet.20251212",
|
|
60
|
+
"@aztec/stdlib": "3.0.0-devnet.20251212",
|
|
61
|
+
"@aztec/telemetry-client": "3.0.0-devnet.20251212",
|
|
62
|
+
"@aztec/test-wallet": "3.0.0-devnet.20251212",
|
|
63
|
+
"@aztec/validator-client": "3.0.0-devnet.20251212",
|
|
64
|
+
"@aztec/world-state": "3.0.0-devnet.20251212",
|
|
63
65
|
"@iarna/toml": "^2.2.5",
|
|
64
66
|
"@jest/globals": "^30.0.0",
|
|
65
67
|
"@noble/curves": "=1.0.0",
|
|
@@ -91,12 +93,12 @@
|
|
|
91
93
|
"snappy": "^7.2.2",
|
|
92
94
|
"stream-browserify": "^3.0.0",
|
|
93
95
|
"string-argv": "^0.3.2",
|
|
94
|
-
"ts-loader": "^9.
|
|
96
|
+
"ts-loader": "^9.5.4",
|
|
95
97
|
"ts-node": "^10.9.1",
|
|
96
98
|
"tslib": "^2.4.0",
|
|
97
99
|
"typescript": "^5.3.3",
|
|
98
100
|
"util": "^0.12.5",
|
|
99
|
-
"viem": "2.
|
|
101
|
+
"viem": "npm:@aztec/viem@2.38.2",
|
|
100
102
|
"zod": "^3.23.8"
|
|
101
103
|
},
|
|
102
104
|
"devDependencies": {
|
|
@@ -105,6 +107,7 @@
|
|
|
105
107
|
"@types/jest": "^30.0.0",
|
|
106
108
|
"@types/js-yaml": "^4.0.9",
|
|
107
109
|
"@types/lodash.chunk": "^4.2.9",
|
|
110
|
+
"@typescript/native-preview": "7.0.0-dev.20251126.1",
|
|
108
111
|
"concurrently": "^7.6.0",
|
|
109
112
|
"jest": "^30.0.0",
|
|
110
113
|
"jest-extended": "^6.0.0",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
2
|
ContractFunctionInteraction,
|
|
3
3
|
DeployMethod,
|
|
4
|
-
DeployOptions,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from '@aztec/aztec.js';
|
|
4
|
+
type DeployOptions,
|
|
5
|
+
type ProfileInteractionOptions,
|
|
6
|
+
} from '@aztec/aztec.js/contracts';
|
|
7
|
+
import type { Logger } from '@aztec/aztec.js/log';
|
|
8
8
|
import { createLogger } from '@aztec/foundation/log';
|
|
9
9
|
import { type PrivateExecutionStep, serializePrivateExecutionSteps } from '@aztec/stdlib/kernel';
|
|
10
10
|
import type { ProvingStats, ProvingTimings, SimulationStats, SimulationTimings } from '@aztec/stdlib/tx';
|
|
@@ -301,7 +301,7 @@ export function convertProfileToGHBenchmark(benchmark: ClientFlowBenchmark): Git
|
|
|
301
301
|
export async function captureProfile(
|
|
302
302
|
label: string,
|
|
303
303
|
interaction: ContractFunctionInteraction | DeployMethod,
|
|
304
|
-
opts: Omit<
|
|
304
|
+
opts: Omit<ProfileInteractionOptions & DeployOptions, 'profileMode'>,
|
|
305
305
|
expectedSteps?: number,
|
|
306
306
|
) {
|
|
307
307
|
// Make sure the proxy logger starts from a clean slate
|
|
@@ -315,12 +315,12 @@ export async function captureProfile(
|
|
|
315
315
|
|
|
316
316
|
const ivcFolder = process.env.CAPTURE_IVC_FOLDER;
|
|
317
317
|
if (ivcFolder) {
|
|
318
|
-
logger.info(`Capturing
|
|
318
|
+
logger.info(`Capturing chonk execution profile for ${label}`);
|
|
319
319
|
|
|
320
320
|
const resultsDirectory = join(ivcFolder, label);
|
|
321
321
|
logger.info(`Writing private execution steps to ${resultsDirectory}`);
|
|
322
322
|
await mkdir(resultsDirectory, { recursive: true });
|
|
323
|
-
// Write the
|
|
323
|
+
// Write the chonk files read by the prover.
|
|
324
324
|
const ivcInputsPath = join(resultsDirectory, 'ivc-inputs.msgpack');
|
|
325
325
|
await writeFile(ivcInputsPath, serializePrivateExecutionSteps(result.executionSteps));
|
|
326
326
|
await writeFile(join(resultsDirectory, 'logs.json'), JSON.stringify(logs, null, 2));
|
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type AztecNode,
|
|
8
|
-
FeeJuicePaymentMethod,
|
|
9
|
-
FeeJuicePaymentMethodWithClaim,
|
|
10
|
-
type FeePaymentMethod,
|
|
11
|
-
type Logger,
|
|
12
|
-
type PXE,
|
|
13
|
-
PrivateFeePaymentMethod,
|
|
14
|
-
SponsoredFeePaymentMethod,
|
|
15
|
-
type Wallet,
|
|
16
|
-
createLogger,
|
|
17
|
-
} from '@aztec/aztec.js';
|
|
1
|
+
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { FeeJuicePaymentMethodWithClaim } from '@aztec/aztec.js/fee';
|
|
3
|
+
import { type FeePaymentMethod, PrivateFeePaymentMethod, SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee';
|
|
4
|
+
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
5
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
6
|
+
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
18
7
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
19
|
-
import {
|
|
8
|
+
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
9
|
+
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
10
|
+
import { type DeployL1ContractsArgs, deployL1Contract } from '@aztec/ethereum/deploy-l1-contracts';
|
|
20
11
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
21
|
-
import { randomBytes } from '@aztec/foundation/crypto';
|
|
12
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
13
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
22
14
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
23
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
24
15
|
import { TestERC20Abi } from '@aztec/l1-artifacts/TestERC20Abi';
|
|
25
16
|
import { TestERC20Bytecode } from '@aztec/l1-artifacts/TestERC20Bytecode';
|
|
26
17
|
import { AMMContract } from '@aztec/noir-contracts.js/AMM';
|
|
@@ -30,8 +21,11 @@ import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
|
30
21
|
import { TokenContract as BananaCoin, TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
31
22
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
32
23
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
33
|
-
import { type
|
|
24
|
+
import { type PXEConfig, getPXEConfig } from '@aztec/pxe/server';
|
|
25
|
+
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
26
|
+
import { GasSettings } from '@aztec/stdlib/gas';
|
|
34
27
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
28
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
35
29
|
|
|
36
30
|
import { MNEMONIC } from '../../fixtures/fixtures.js';
|
|
37
31
|
import {
|
|
@@ -53,22 +47,21 @@ import { type ClientFlowsConfig, FULL_FLOWS_CONFIG, KEY_FLOWS_CONFIG } from './c
|
|
|
53
47
|
const { E2E_DATA_PATH: dataPath, BENCHMARK_CONFIG } = process.env;
|
|
54
48
|
|
|
55
49
|
export type AccountType = 'ecdsar1' | 'schnorr';
|
|
56
|
-
export type FeePaymentMethodGetter = (wallet: Wallet) => Promise<FeePaymentMethod>;
|
|
50
|
+
export type FeePaymentMethodGetter = (wallet: Wallet, sender: AztecAddress) => Promise<FeePaymentMethod | undefined>;
|
|
57
51
|
export type BenchmarkingFeePaymentMethod = 'bridged_fee_juice' | 'private_fpc' | 'sponsored_fpc' | 'fee_juice';
|
|
58
52
|
|
|
59
53
|
export class ClientFlowsBenchmark {
|
|
60
54
|
private snapshotManager: ISnapshotManager;
|
|
61
55
|
|
|
62
56
|
public logger: Logger;
|
|
63
|
-
public pxe!: PXE;
|
|
64
57
|
public aztecNode!: AztecNode;
|
|
65
58
|
public cheatCodes!: CheatCodes;
|
|
66
59
|
public context!: SubsystemsContext;
|
|
67
60
|
public chainMonitor!: ChainMonitor;
|
|
68
61
|
public feeJuiceBridgeTestHarness!: GasBridgingTestHarness;
|
|
62
|
+
public adminWallet!: TestWallet;
|
|
69
63
|
|
|
70
64
|
// The admin that aids in the setup of the test
|
|
71
|
-
public adminWallet!: AccountWallet;
|
|
72
65
|
public adminAddress!: AztecAddress;
|
|
73
66
|
|
|
74
67
|
// Aztec Node config
|
|
@@ -79,18 +72,24 @@ export class ClientFlowsBenchmark {
|
|
|
79
72
|
public feeJuiceContract!: FeeJuiceContract;
|
|
80
73
|
// Asset in which fees are paid via FPC
|
|
81
74
|
public bananaCoin!: BananaCoin;
|
|
75
|
+
public bananaCoinInstance!: ContractInstanceWithAddress;
|
|
82
76
|
public bananaFPC!: FPCContract;
|
|
77
|
+
public bananaFPCInstance!: ContractInstanceWithAddress;
|
|
83
78
|
// Random asset we want to trade
|
|
84
79
|
public candyBarCoin!: TokenContract;
|
|
80
|
+
public candyBarCoinInstance!: ContractInstanceWithAddress;
|
|
85
81
|
// AMM contract
|
|
86
82
|
public amm!: AMMContract;
|
|
83
|
+
public ammInstance!: ContractInstanceWithAddress;
|
|
87
84
|
// Liquidity token for AMM
|
|
88
85
|
public liquidityToken!: TokenContract;
|
|
86
|
+
public liquidityTokenInstance!: ContractInstanceWithAddress;
|
|
89
87
|
// Sponsored FPC contract
|
|
90
88
|
public sponsoredFPC!: SponsoredFPCContract;
|
|
89
|
+
public sponsoredFPCInstance!: ContractInstanceWithAddress;
|
|
91
90
|
|
|
92
|
-
// PXE used by the benchmarking user. It can be set up with client-side proving enabled
|
|
93
|
-
public
|
|
91
|
+
// PXE and Wallet used by the benchmarking user. It can be set up with client-side proving enabled
|
|
92
|
+
public userWallet!: TestWallet;
|
|
94
93
|
|
|
95
94
|
public realProofs = ['true', '1'].includes(process.env.REAL_PROOFS ?? '');
|
|
96
95
|
|
|
@@ -117,7 +116,7 @@ export class ClientFlowsBenchmark {
|
|
|
117
116
|
},
|
|
118
117
|
// eslint-disable-next-line camelcase
|
|
119
118
|
fee_juice: {
|
|
120
|
-
forWallet:
|
|
119
|
+
forWallet: () => Promise.resolve(undefined),
|
|
121
120
|
circuits: 0,
|
|
122
121
|
},
|
|
123
122
|
};
|
|
@@ -169,7 +168,7 @@ export class ClientFlowsBenchmark {
|
|
|
169
168
|
.balance_of_private(address)
|
|
170
169
|
.simulate({ from: this.adminAddress });
|
|
171
170
|
|
|
172
|
-
await mintTokensToPrivate(this.bananaCoin, this.adminAddress,
|
|
171
|
+
await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
|
|
173
172
|
|
|
174
173
|
const balanceAfter = await this.bananaCoin.methods
|
|
175
174
|
.balance_of_private(address)
|
|
@@ -177,23 +176,20 @@ export class ClientFlowsBenchmark {
|
|
|
177
176
|
expect(balanceAfter).toEqual(balanceBefore + amount);
|
|
178
177
|
}
|
|
179
178
|
|
|
180
|
-
|
|
181
|
-
const
|
|
179
|
+
createBenchmarkingAccountManager(wallet: TestWallet, type: 'ecdsar1' | 'schnorr') {
|
|
180
|
+
const benchysSecret = Fr.random();
|
|
182
181
|
const salt = Fr.random();
|
|
183
182
|
|
|
184
183
|
let benchysPrivateSigningKey;
|
|
185
|
-
let benchysAccountManager;
|
|
186
184
|
if (type === 'schnorr') {
|
|
187
|
-
benchysPrivateSigningKey = deriveSigningKey(
|
|
188
|
-
|
|
185
|
+
benchysPrivateSigningKey = deriveSigningKey(benchysSecret);
|
|
186
|
+
return wallet.createSchnorrAccount(benchysSecret, salt, benchysPrivateSigningKey);
|
|
189
187
|
} else if (type === 'ecdsar1') {
|
|
190
188
|
benchysPrivateSigningKey = randomBytes(32);
|
|
191
|
-
|
|
189
|
+
return wallet.createECDSARAccount(benchysSecret, salt, benchysPrivateSigningKey);
|
|
192
190
|
} else {
|
|
193
191
|
throw new Error(`Unknown account type: ${type}`);
|
|
194
192
|
}
|
|
195
|
-
await benchysAccountManager.register();
|
|
196
|
-
return benchysAccountManager;
|
|
197
193
|
}
|
|
198
194
|
|
|
199
195
|
public async applyBaseSnapshots() {
|
|
@@ -205,32 +201,28 @@ export class ClientFlowsBenchmark {
|
|
|
205
201
|
await this.snapshotManager.snapshot(
|
|
206
202
|
'initial_accounts',
|
|
207
203
|
deployAccounts(2, this.logger),
|
|
208
|
-
async (
|
|
209
|
-
|
|
210
|
-
|
|
204
|
+
async (
|
|
205
|
+
{ deployedAccounts: [{ address: adminAddress }, { address: sequencerAddress }] },
|
|
206
|
+
{ wallet, aztecNode, cheatCodes },
|
|
207
|
+
) => {
|
|
208
|
+
this.adminWallet = wallet;
|
|
211
209
|
this.aztecNode = aztecNode;
|
|
212
|
-
this.cheatCodes =
|
|
210
|
+
this.cheatCodes = cheatCodes;
|
|
213
211
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
);
|
|
217
|
-
[this.adminWallet] = deployedWallets;
|
|
218
|
-
this.adminAddress = this.adminWallet.getAddress();
|
|
219
|
-
this.sequencerAddress = deployedWallets[1].getAddress();
|
|
212
|
+
this.adminAddress = adminAddress;
|
|
213
|
+
this.sequencerAddress = sequencerAddress;
|
|
220
214
|
|
|
221
215
|
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
222
|
-
this.feeJuiceContract =
|
|
216
|
+
this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
|
|
223
217
|
this.coinbase = EthAddress.random();
|
|
224
218
|
|
|
225
|
-
const userPXEConfig =
|
|
226
|
-
const l1Contracts = await aztecNode.getL1ContractAddresses();
|
|
219
|
+
const userPXEConfig = getPXEConfig();
|
|
227
220
|
const userPXEConfigWithContracts = {
|
|
228
221
|
...userPXEConfig,
|
|
229
222
|
proverEnabled: this.realProofs,
|
|
230
|
-
|
|
231
|
-
} as PXEServiceConfig;
|
|
223
|
+
} as PXEConfig;
|
|
232
224
|
|
|
233
|
-
this.
|
|
225
|
+
this.userWallet = await TestWallet.create(this.aztecNode, userPXEConfigWithContracts, {
|
|
234
226
|
loggers: {
|
|
235
227
|
prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied'),
|
|
236
228
|
},
|
|
@@ -246,12 +238,11 @@ export class ClientFlowsBenchmark {
|
|
|
246
238
|
async (_data, context) => {
|
|
247
239
|
this.context = context;
|
|
248
240
|
|
|
249
|
-
this.feeJuiceContract =
|
|
241
|
+
this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
|
|
250
242
|
|
|
251
243
|
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
252
244
|
aztecNode: context.aztecNode,
|
|
253
245
|
aztecNodeAdmin: context.aztecNode,
|
|
254
|
-
pxeService: context.pxe,
|
|
255
246
|
l1Client: context.deployL1ContractsValues.l1Client,
|
|
256
247
|
wallet: this.adminWallet,
|
|
257
248
|
logger: this.logger,
|
|
@@ -264,14 +255,22 @@ export class ClientFlowsBenchmark {
|
|
|
264
255
|
await this.snapshotManager.snapshot(
|
|
265
256
|
'deploy_banana_token',
|
|
266
257
|
async () => {
|
|
267
|
-
const bananaCoin = await BananaCoin.deploy(
|
|
258
|
+
const { contract: bananaCoin, instance: bananaCoinInstance } = await BananaCoin.deploy(
|
|
259
|
+
this.adminWallet,
|
|
260
|
+
this.adminAddress,
|
|
261
|
+
'BC',
|
|
262
|
+
'BC',
|
|
263
|
+
18n,
|
|
264
|
+
)
|
|
268
265
|
.send({ from: this.adminAddress })
|
|
269
|
-
.
|
|
266
|
+
.wait();
|
|
270
267
|
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
271
|
-
return { bananaCoinAddress: bananaCoin.address };
|
|
268
|
+
return { bananaCoinAddress: bananaCoin.address, bananaCoinInstance };
|
|
272
269
|
},
|
|
273
|
-
|
|
274
|
-
this.bananaCoin =
|
|
270
|
+
({ bananaCoinAddress, bananaCoinInstance }) => {
|
|
271
|
+
this.bananaCoin = BananaCoin.at(bananaCoinAddress, this.adminWallet);
|
|
272
|
+
this.bananaCoinInstance = bananaCoinInstance;
|
|
273
|
+
return Promise.resolve();
|
|
275
274
|
},
|
|
276
275
|
);
|
|
277
276
|
}
|
|
@@ -280,14 +279,22 @@ export class ClientFlowsBenchmark {
|
|
|
280
279
|
await this.snapshotManager.snapshot(
|
|
281
280
|
'deploy_candy_bar_token',
|
|
282
281
|
async () => {
|
|
283
|
-
const candyBarCoin = await TokenContract.deploy(
|
|
282
|
+
const { contract: candyBarCoin, instance: candyBarCoinInstance } = await TokenContract.deploy(
|
|
283
|
+
this.adminWallet,
|
|
284
|
+
this.adminAddress,
|
|
285
|
+
'CBC',
|
|
286
|
+
'CBC',
|
|
287
|
+
18n,
|
|
288
|
+
)
|
|
284
289
|
.send({ from: this.adminAddress })
|
|
285
|
-
.
|
|
290
|
+
.wait();
|
|
286
291
|
this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
|
|
287
|
-
return { candyBarCoinAddress: candyBarCoin.address };
|
|
292
|
+
return { candyBarCoinAddress: candyBarCoin.address, candyBarCoinInstance };
|
|
288
293
|
},
|
|
289
|
-
|
|
290
|
-
this.candyBarCoin =
|
|
294
|
+
({ candyBarCoinAddress, candyBarCoinInstance }) => {
|
|
295
|
+
this.candyBarCoin = TokenContract.at(candyBarCoinAddress, this.adminWallet);
|
|
296
|
+
this.candyBarCoinInstance = candyBarCoinInstance;
|
|
297
|
+
return Promise.resolve();
|
|
291
298
|
},
|
|
292
299
|
);
|
|
293
300
|
}
|
|
@@ -297,21 +304,27 @@ export class ClientFlowsBenchmark {
|
|
|
297
304
|
'fpc_setup',
|
|
298
305
|
async context => {
|
|
299
306
|
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
300
|
-
expect((await context.
|
|
307
|
+
expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
301
308
|
|
|
302
309
|
const bananaCoin = this.bananaCoin;
|
|
303
|
-
const bananaFPC = await FPCContract.deploy(
|
|
310
|
+
const { contract: bananaFPC, instance: bananaFPCInstance } = await FPCContract.deploy(
|
|
311
|
+
this.adminWallet,
|
|
312
|
+
bananaCoin.address,
|
|
313
|
+
this.adminAddress,
|
|
314
|
+
)
|
|
304
315
|
.send({ from: this.adminAddress })
|
|
305
|
-
.
|
|
316
|
+
.wait();
|
|
306
317
|
|
|
307
318
|
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
308
319
|
|
|
309
320
|
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.adminAddress);
|
|
310
321
|
|
|
311
|
-
return { bananaFPCAddress: bananaFPC.address };
|
|
322
|
+
return { bananaFPCAddress: bananaFPC.address, bananaFPCInstance };
|
|
312
323
|
},
|
|
313
|
-
|
|
314
|
-
this.bananaFPC =
|
|
324
|
+
data => {
|
|
325
|
+
this.bananaFPC = FPCContract.at(data.bananaFPCAddress, this.adminWallet);
|
|
326
|
+
this.bananaFPCInstance = data.bananaFPCInstance;
|
|
327
|
+
return Promise.resolve();
|
|
315
328
|
},
|
|
316
329
|
);
|
|
317
330
|
}
|
|
@@ -320,17 +333,19 @@ export class ClientFlowsBenchmark {
|
|
|
320
333
|
await this.snapshotManager.snapshot(
|
|
321
334
|
'deploy_sponsored_fpc',
|
|
322
335
|
async () => {
|
|
323
|
-
const
|
|
324
|
-
this.logger.info(`SponsoredFPC at ${
|
|
325
|
-
return { sponsoredFPCAddress:
|
|
336
|
+
const sponsoredFPCInstance = await setupSponsoredFPC(this.adminWallet);
|
|
337
|
+
this.logger.info(`SponsoredFPC at ${sponsoredFPCInstance.address}`);
|
|
338
|
+
return { sponsoredFPCAddress: sponsoredFPCInstance.address, sponsoredFPCInstance };
|
|
326
339
|
},
|
|
327
|
-
|
|
328
|
-
this.sponsoredFPC =
|
|
340
|
+
({ sponsoredFPCAddress, sponsoredFPCInstance }) => {
|
|
341
|
+
this.sponsoredFPC = SponsoredFPCContract.at(sponsoredFPCAddress, this.adminWallet);
|
|
342
|
+
this.sponsoredFPCInstance = sponsoredFPCInstance;
|
|
343
|
+
return Promise.resolve();
|
|
329
344
|
},
|
|
330
345
|
);
|
|
331
346
|
}
|
|
332
347
|
|
|
333
|
-
public async createCrossChainTestHarness(owner:
|
|
348
|
+
public async createCrossChainTestHarness(owner: AztecAddress) {
|
|
334
349
|
const l1Client = createExtendedL1Client(this.context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
335
350
|
|
|
336
351
|
const underlyingERC20Address = await deployL1Contract(l1Client, TestERC20Abi, TestERC20Bytecode, [
|
|
@@ -342,10 +357,9 @@ export class ClientFlowsBenchmark {
|
|
|
342
357
|
this.logger.verbose(`Setting up cross chain harness...`);
|
|
343
358
|
const crossChainTestHarness = await CrossChainTestHarness.new(
|
|
344
359
|
this.aztecNode,
|
|
345
|
-
this.pxe,
|
|
346
360
|
l1Client,
|
|
361
|
+
this.adminWallet,
|
|
347
362
|
owner,
|
|
348
|
-
owner.getAddress(),
|
|
349
363
|
this.logger,
|
|
350
364
|
underlyingERC20Address,
|
|
351
365
|
);
|
|
@@ -355,68 +369,81 @@ export class ClientFlowsBenchmark {
|
|
|
355
369
|
return crossChainTestHarness;
|
|
356
370
|
}
|
|
357
371
|
|
|
358
|
-
public async
|
|
359
|
-
const benchysAccountManager = await this.createBenchmarkingAccountManager(this.
|
|
360
|
-
const
|
|
361
|
-
const benchysAddress = benchysAccountManager.
|
|
372
|
+
public async createAndFundBenchmarkingAccountOnUserWallet(accountType: AccountType) {
|
|
373
|
+
const benchysAccountManager = await this.createBenchmarkingAccountManager(this.adminWallet, accountType);
|
|
374
|
+
const benchysAccount = await benchysAccountManager.getAccount();
|
|
375
|
+
const benchysAddress = benchysAccountManager.address;
|
|
362
376
|
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
|
|
363
|
-
const
|
|
364
|
-
await
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
377
|
+
const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
|
|
378
|
+
await behchysDeployMethod
|
|
379
|
+
.send({
|
|
380
|
+
from: AztecAddress.ZERO,
|
|
381
|
+
fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
|
|
382
|
+
})
|
|
383
|
+
.wait();
|
|
384
|
+
// Register benchy on the user's Wallet, where we're going to be interacting from
|
|
385
|
+
const accountManager = await this.userWallet.createAccount({
|
|
386
|
+
secret: benchysAccount.getSecretKey(),
|
|
387
|
+
salt: new Fr(benchysAccount.salt),
|
|
388
|
+
contract: benchysAccountManager.getAccountContract(),
|
|
369
389
|
});
|
|
370
|
-
|
|
371
|
-
const entrypoint = await benchysAccountManager.getAccount();
|
|
372
|
-
return new AccountWalletWithSecretKey(
|
|
373
|
-
this.userPXE,
|
|
374
|
-
entrypoint,
|
|
375
|
-
benchysWallet.getSecretKey(),
|
|
376
|
-
benchysAccountManager.salt,
|
|
377
|
-
);
|
|
390
|
+
return accountManager.address;
|
|
378
391
|
}
|
|
379
392
|
|
|
380
393
|
public async applyDeployAmmSnapshot() {
|
|
381
394
|
await this.snapshotManager.snapshot(
|
|
382
395
|
'deploy_amm',
|
|
383
396
|
async () => {
|
|
384
|
-
const liquidityToken = await TokenContract.deploy(
|
|
397
|
+
const { contract: liquidityToken, instance: liquidityTokenInstance } = await TokenContract.deploy(
|
|
398
|
+
this.adminWallet,
|
|
399
|
+
this.adminAddress,
|
|
400
|
+
'LPT',
|
|
401
|
+
'LPT',
|
|
402
|
+
18n,
|
|
403
|
+
)
|
|
385
404
|
.send({ from: this.adminAddress })
|
|
386
|
-
.
|
|
387
|
-
const amm = await AMMContract.deploy(
|
|
405
|
+
.wait();
|
|
406
|
+
const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
|
|
388
407
|
this.adminWallet,
|
|
389
408
|
this.bananaCoin.address,
|
|
390
409
|
this.candyBarCoin.address,
|
|
391
410
|
liquidityToken.address,
|
|
392
411
|
)
|
|
393
412
|
.send({ from: this.adminAddress })
|
|
394
|
-
.
|
|
413
|
+
.wait();
|
|
395
414
|
this.logger.info(`AMM deployed at ${amm.address}`);
|
|
396
415
|
await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress }).wait();
|
|
397
|
-
return {
|
|
416
|
+
return {
|
|
417
|
+
ammAddress: amm.address,
|
|
418
|
+
ammInstance,
|
|
419
|
+
liquidityTokenAddress: liquidityToken.address,
|
|
420
|
+
liquidityTokenInstance,
|
|
421
|
+
};
|
|
398
422
|
},
|
|
399
|
-
|
|
400
|
-
this.liquidityToken =
|
|
401
|
-
this.
|
|
423
|
+
({ ammAddress, ammInstance, liquidityTokenAddress, liquidityTokenInstance }) => {
|
|
424
|
+
this.liquidityToken = TokenContract.at(liquidityTokenAddress, this.adminWallet);
|
|
425
|
+
this.liquidityTokenInstance = liquidityTokenInstance;
|
|
426
|
+
this.amm = AMMContract.at(ammAddress, this.adminWallet);
|
|
427
|
+
this.ammInstance = ammInstance;
|
|
428
|
+
return Promise.resolve();
|
|
402
429
|
},
|
|
403
430
|
);
|
|
404
431
|
}
|
|
405
432
|
|
|
406
|
-
public async getBridgedFeeJuicePaymentMethodForWallet(
|
|
407
|
-
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(
|
|
408
|
-
return new FeeJuicePaymentMethodWithClaim(
|
|
433
|
+
public async getBridgedFeeJuicePaymentMethodForWallet(_wallet: Wallet, sender: AztecAddress) {
|
|
434
|
+
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(sender);
|
|
435
|
+
return new FeeJuicePaymentMethodWithClaim(sender, claim);
|
|
409
436
|
}
|
|
410
437
|
|
|
411
|
-
public getPrivateFPCPaymentMethodForWallet(wallet: Wallet) {
|
|
412
|
-
|
|
438
|
+
public async getPrivateFPCPaymentMethodForWallet(wallet: Wallet, sender: AztecAddress) {
|
|
439
|
+
// The private fee paying method assembled on the app side requires knowledge of the maximum
|
|
440
|
+
// fee the user is willing to pay
|
|
441
|
+
const maxFeesPerGas = (await this.aztecNode.getCurrentBaseFees()).mul(1.5);
|
|
442
|
+
const gasSettings = GasSettings.default({ maxFeesPerGas });
|
|
443
|
+
return new PrivateFeePaymentMethod(this.bananaFPC.address, sender, wallet, gasSettings);
|
|
413
444
|
}
|
|
414
445
|
|
|
415
|
-
public getSponsoredFPCPaymentMethodForWallet(_wallet: Wallet) {
|
|
446
|
+
public getSponsoredFPCPaymentMethodForWallet(_wallet: Wallet, _sender: AztecAddress) {
|
|
416
447
|
return Promise.resolve(new SponsoredFeePaymentMethod(this.sponsoredFPC.address));
|
|
417
448
|
}
|
|
418
|
-
|
|
419
|
-
public getFeeJuicePaymentMethodForWallet(wallet: Wallet) {
|
|
420
|
-
return Promise.resolve(new FeeJuicePaymentMethod(wallet.getAddress()));
|
|
421
|
-
}
|
|
422
449
|
}
|