@aztec/end-to-end 0.0.1-commit.24de95ac → 0.0.1-commit.2606882
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,5 +1,7 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
2
|
-
import {
|
|
2
|
+
import { getTokenAllowedSetupFunctions } from '@aztec/aztec/testing';
|
|
3
|
+
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
4
|
+
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
3
5
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
4
6
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
7
|
import { sleep } from '@aztec/foundation/sleep';
|
|
@@ -12,14 +14,13 @@ import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
|
12
14
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
13
15
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
14
16
|
import { getContract } from 'viem';
|
|
15
|
-
import { MNEMONIC } from '../fixtures/fixtures.js';
|
|
16
|
-
import {
|
|
17
|
+
import { MNEMONIC, getPaddedMaxFeesPerGas } from '../fixtures/fixtures.js';
|
|
18
|
+
import { deployAccounts, ensureAuthRegistryPublished, publicDeployAccounts, setup, teardown } from '../fixtures/setup.js';
|
|
17
19
|
import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
18
|
-
import {
|
|
20
|
+
import { getBalancesFn, setupSponsoredFPC } from '../fixtures/utils.js';
|
|
19
21
|
import { FeeJuicePortalTestingHarnessFactory } from '../shared/gas_portal_test_harness.js';
|
|
20
|
-
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
21
22
|
/**
|
|
22
|
-
* Test fixture for testing fees. Provides the following
|
|
23
|
+
* Test fixture for testing fees. Provides the following setup steps:
|
|
23
24
|
* InitialAccounts: Initializes 3 Schnorr account contracts.
|
|
24
25
|
* PublicDeployAccounts: Deploys the accounts publicly.
|
|
25
26
|
* DeployFeeJuice: Deploys the Fee Juice contract.
|
|
@@ -29,10 +30,12 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
29
30
|
* SetupSubscription: Deploys a counter contract and a subscription contract, and mints Fee Juice to the subscription contract.
|
|
30
31
|
*/ export class FeesTest {
|
|
31
32
|
numberOfAccounts;
|
|
32
|
-
|
|
33
|
+
setupOptions;
|
|
33
34
|
accounts;
|
|
35
|
+
context;
|
|
34
36
|
logger;
|
|
35
37
|
aztecNode;
|
|
38
|
+
aztecNodeAdmin;
|
|
36
39
|
cheatCodes;
|
|
37
40
|
wallet;
|
|
38
41
|
aliceAddress;
|
|
@@ -49,7 +52,6 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
49
52
|
counterContract;
|
|
50
53
|
subscriptionContract;
|
|
51
54
|
feeJuiceBridgeTestHarness;
|
|
52
|
-
context;
|
|
53
55
|
chainMonitor;
|
|
54
56
|
getCoinbaseBalance;
|
|
55
57
|
getCoinbaseSequencerRewards;
|
|
@@ -57,11 +59,14 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
57
59
|
getBananaPublicBalanceFn;
|
|
58
60
|
getBananaPrivateBalanceFn;
|
|
59
61
|
getProverFee;
|
|
62
|
+
getCommittedProverFee;
|
|
63
|
+
getCommittedBurn;
|
|
60
64
|
ALICE_INITIAL_BANANAS;
|
|
61
65
|
SUBSCRIPTION_AMOUNT;
|
|
62
66
|
APP_SPONSORED_TX_GAS_LIMIT;
|
|
63
67
|
constructor(testName, numberOfAccounts = 3, setupOptions = {}){
|
|
64
68
|
this.numberOfAccounts = numberOfAccounts;
|
|
69
|
+
this.setupOptions = setupOptions;
|
|
65
70
|
this.accounts = [];
|
|
66
71
|
this.ALICE_INITIAL_BANANAS = BigInt(1e22);
|
|
67
72
|
this.SUBSCRIPTION_AMOUNT = BigInt(1e19);
|
|
@@ -72,36 +77,47 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
72
77
|
setupOptions.coinbase ??= EthAddress.random();
|
|
73
78
|
this.coinbase = setupOptions.coinbase;
|
|
74
79
|
this.logger = createLogger(`e2e:e2e_fees:${testName}`);
|
|
75
|
-
|
|
80
|
+
}
|
|
81
|
+
async setup(opts = {}) {
|
|
82
|
+
this.logger.verbose('Setting up fresh context...');
|
|
83
|
+
// Token allowlist entries are test-only: FPC-based fee payment with custom tokens won't work on mainnet alpha.
|
|
84
|
+
const tokenAllowList = await getTokenAllowedSetupFunctions();
|
|
85
|
+
this.context = await setup(0, {
|
|
76
86
|
startProverNode: true,
|
|
77
|
-
...setupOptions
|
|
78
|
-
|
|
79
|
-
|
|
87
|
+
...this.setupOptions,
|
|
88
|
+
...opts,
|
|
89
|
+
fundSponsoredFPC: true,
|
|
90
|
+
skipAccountDeployment: true,
|
|
91
|
+
l1ContractsArgs: {
|
|
92
|
+
...this.setupOptions
|
|
93
|
+
},
|
|
94
|
+
txPublicSetupAllowListExtend: [
|
|
95
|
+
...this.setupOptions.txPublicSetupAllowListExtend ?? [],
|
|
96
|
+
...tokenAllowList
|
|
97
|
+
]
|
|
80
98
|
});
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
this.rollupContract = RollupContract.getFromConfig(context.aztecNodeConfig);
|
|
85
|
-
this.chainMonitor = new ChainMonitor(this.rollupContract, context.dateProvider, this.logger, 200).start();
|
|
99
|
+
this.rollupContract = RollupContract.getFromConfig(this.context.config);
|
|
100
|
+
this.chainMonitor = new ChainMonitor(this.rollupContract, this.context.dateProvider, this.logger, 200).start();
|
|
101
|
+
await this.applyBaseSetup();
|
|
86
102
|
return this;
|
|
87
103
|
}
|
|
88
104
|
async teardown() {
|
|
89
105
|
await this.chainMonitor.stop();
|
|
90
|
-
await this.
|
|
106
|
+
await teardown(this.context);
|
|
91
107
|
}
|
|
92
108
|
setIsMarkingAsProven(b) {
|
|
93
109
|
this.context.watcher.setIsMarkingAsProven(b);
|
|
94
110
|
}
|
|
95
111
|
async catchUpProvenChain() {
|
|
96
112
|
const bn = await this.aztecNode.getBlockNumber();
|
|
97
|
-
while(await this.aztecNode.
|
|
113
|
+
while(await this.aztecNode.getBlockNumber('proven') < bn){
|
|
98
114
|
await sleep(1000);
|
|
99
115
|
}
|
|
100
116
|
}
|
|
101
117
|
async getBlockRewards() {
|
|
102
|
-
const blockReward = await this.rollupContract.
|
|
118
|
+
const blockReward = await this.rollupContract.getCheckpointReward();
|
|
103
119
|
const rewardConfig = await this.rollupContract.getRewardConfig();
|
|
104
|
-
const balance = await this.feeJuiceBridgeTestHarness.getL1FeeJuiceBalance(
|
|
120
|
+
const balance = await this.feeJuiceBridgeTestHarness.getL1FeeJuiceBalance(rewardConfig.rewardDistributor);
|
|
105
121
|
const toDistribute = balance > blockReward ? blockReward : balance;
|
|
106
122
|
const sequencerBlockRewards = toDistribute * BigInt(rewardConfig.sequencerBps) / 10000n;
|
|
107
123
|
const proverBlockRewards = toDistribute - sequencerBlockRewards;
|
|
@@ -115,146 +131,151 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
115
131
|
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
116
132
|
await this.feeJuiceContract.methods.claim(recipient, claim.claimAmount, secret, index).send({
|
|
117
133
|
from: minter
|
|
118
|
-
})
|
|
134
|
+
});
|
|
119
135
|
}
|
|
120
136
|
/** Alice mints bananaCoin tokens privately to the target address and redeems them. */ async mintPrivateBananas(amount, address) {
|
|
121
|
-
const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
122
|
-
from:
|
|
137
|
+
const { result: balanceBefore } = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
138
|
+
from: address
|
|
123
139
|
});
|
|
124
140
|
await mintTokensToPrivate(this.bananaCoin, this.aliceAddress, address, amount);
|
|
125
|
-
const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
126
|
-
from:
|
|
141
|
+
const { result: balanceAfter } = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
142
|
+
from: address
|
|
127
143
|
});
|
|
128
144
|
expect(balanceAfter).toEqual(balanceBefore + amount);
|
|
129
145
|
}
|
|
130
|
-
async
|
|
131
|
-
await this.
|
|
132
|
-
await this.
|
|
133
|
-
await this.
|
|
134
|
-
await this.
|
|
146
|
+
async applyBaseSetup() {
|
|
147
|
+
await this.applyInitialAccounts();
|
|
148
|
+
await this.applyEnsureAuthRegistryPublished();
|
|
149
|
+
await this.applyPublicDeployAccounts();
|
|
150
|
+
await this.applySetupFeeJuice();
|
|
151
|
+
await this.applyDeployBananaToken();
|
|
135
152
|
}
|
|
136
|
-
async
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
this.
|
|
144
|
-
this.
|
|
145
|
-
this.accounts.forEach((a, i)=>this.logger.verbose(`Account ${i} address: ${a}`));
|
|
146
|
-
[this.aliceAddress, this.bobAddress, this.sequencerAddress] = this.accounts.slice(0, 3);
|
|
147
|
-
// We set Alice as the FPC admin to avoid the need for deployment of another account.
|
|
148
|
-
this.fpcAdmin = this.aliceAddress;
|
|
149
|
-
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
150
|
-
this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.wallet);
|
|
153
|
+
async applyEnsureAuthRegistryPublished() {
|
|
154
|
+
this.logger.info('Ensuring AuthRegistry published');
|
|
155
|
+
await ensureAuthRegistryPublished(this.wallet, this.aliceAddress);
|
|
156
|
+
}
|
|
157
|
+
async applyInitialAccounts() {
|
|
158
|
+
this.logger.info('Applying initial accounts setup');
|
|
159
|
+
const { deployedAccounts } = await deployAccounts(this.numberOfAccounts, this.logger)({
|
|
160
|
+
wallet: this.context.wallet,
|
|
161
|
+
initialFundedAccounts: this.context.initialFundedAccounts
|
|
151
162
|
});
|
|
163
|
+
this.wallet = this.context.wallet;
|
|
164
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
165
|
+
this.aztecNodeAdmin = this.context.aztecNodeService;
|
|
166
|
+
this.gasSettings = GasSettings.fallback({
|
|
167
|
+
maxFeesPerGas: await getPaddedMaxFeesPerGas(this.aztecNode)
|
|
168
|
+
});
|
|
169
|
+
this.cheatCodes = this.context.cheatCodes;
|
|
170
|
+
this.accounts = deployedAccounts.map((a)=>a.address);
|
|
171
|
+
this.accounts.forEach((a, i)=>this.logger.verbose(`Account ${i} address: ${a}`));
|
|
172
|
+
[this.aliceAddress, this.bobAddress, this.sequencerAddress] = this.accounts.slice(0, 3);
|
|
173
|
+
// We set Alice as the FPC admin to avoid the need for deployment of another account.
|
|
174
|
+
this.fpcAdmin = this.aliceAddress;
|
|
175
|
+
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
176
|
+
this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.wallet);
|
|
152
177
|
}
|
|
153
|
-
async
|
|
154
|
-
|
|
178
|
+
async applyPublicDeployAccounts() {
|
|
179
|
+
this.logger.info('Applying public deploy accounts setup');
|
|
180
|
+
await publicDeployAccounts(this.wallet, this.accounts);
|
|
155
181
|
}
|
|
156
|
-
async
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
this.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
logger: this.logger
|
|
167
|
-
});
|
|
182
|
+
async applySetupFeeJuice() {
|
|
183
|
+
this.logger.info('Applying fee juice setup');
|
|
184
|
+
this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.wallet);
|
|
185
|
+
this.getGasBalanceFn = getBalancesFn('⛽', this.feeJuiceContract.methods.balance_of_public, this.logger);
|
|
186
|
+
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
187
|
+
aztecNode: this.context.aztecNodeService,
|
|
188
|
+
aztecNodeAdmin: this.context.aztecNodeService,
|
|
189
|
+
l1Client: this.context.deployL1ContractsValues.l1Client,
|
|
190
|
+
wallet: this.wallet,
|
|
191
|
+
logger: this.logger
|
|
168
192
|
});
|
|
169
193
|
}
|
|
170
|
-
async
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}).deployed();
|
|
175
|
-
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
176
|
-
return {
|
|
177
|
-
bananaCoinAddress: bananaCoin.address
|
|
178
|
-
};
|
|
179
|
-
}, async ({ bananaCoinAddress })=>{
|
|
180
|
-
this.bananaCoin = await BananaCoin.at(bananaCoinAddress, this.wallet);
|
|
181
|
-
const logger = this.logger;
|
|
182
|
-
this.getBananaPublicBalanceFn = getBalancesFn('🍌.public', this.bananaCoin.methods.balance_of_public, this.aliceAddress, logger);
|
|
183
|
-
this.getBananaPrivateBalanceFn = getBalancesFn('🍌.private', this.bananaCoin.methods.balance_of_private, this.aliceAddress, logger);
|
|
194
|
+
async applyDeployBananaToken() {
|
|
195
|
+
this.logger.info('Applying deploy banana token setup');
|
|
196
|
+
const { contract: bananaCoin } = await BananaCoin.deploy(this.wallet, this.aliceAddress, 'BC', 'BC', 18n).send({
|
|
197
|
+
from: this.aliceAddress
|
|
184
198
|
});
|
|
199
|
+
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
200
|
+
this.bananaCoin = bananaCoin;
|
|
201
|
+
this.getBananaPublicBalanceFn = getBalancesFn('🍌.public', this.bananaCoin.methods.balance_of_public, this.logger);
|
|
202
|
+
this.getBananaPrivateBalanceFn = getBalancesFn('🍌.private', this.bananaCoin.methods.balance_of_private, this.logger);
|
|
185
203
|
}
|
|
186
|
-
async
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}).deployed();
|
|
194
|
-
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
195
|
-
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.aliceAddress);
|
|
196
|
-
return {
|
|
197
|
-
bananaFPCAddress: bananaFPC.address,
|
|
198
|
-
feeJuiceAddress: feeJuiceContract.address,
|
|
199
|
-
l1FeeJuiceAddress: this.feeJuiceBridgeTestHarness.l1FeeJuiceAddress,
|
|
200
|
-
rollupAddress: context.deployL1ContractsValues.l1ContractAddresses.rollupAddress
|
|
201
|
-
};
|
|
202
|
-
}, async (data, context)=>{
|
|
203
|
-
const bananaFPC = await FPCContract.at(data.bananaFPCAddress, this.wallet);
|
|
204
|
-
this.bananaFPC = bananaFPC;
|
|
205
|
-
this.getCoinbaseBalance = async ()=>{
|
|
206
|
-
const l1Client = createExtendedL1Client(context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
207
|
-
const gasL1 = getContract({
|
|
208
|
-
address: data.l1FeeJuiceAddress.toString(),
|
|
209
|
-
abi: TestERC20Abi,
|
|
210
|
-
client: l1Client
|
|
211
|
-
});
|
|
212
|
-
return await gasL1.read.balanceOf([
|
|
213
|
-
this.coinbase.toString()
|
|
214
|
-
]);
|
|
215
|
-
};
|
|
216
|
-
this.getCoinbaseSequencerRewards = async ()=>{
|
|
217
|
-
return await this.rollupContract.getSequencerRewards(this.coinbase);
|
|
218
|
-
};
|
|
219
|
-
this.getProverFee = async (blockNumber)=>{
|
|
220
|
-
const block = await this.aztecNode.getBlock(blockNumber);
|
|
221
|
-
// @todo @lherskind As we deal with #13601
|
|
222
|
-
// Right now the value is from `FeeLib.sol`
|
|
223
|
-
const L1_GAS_PER_EPOCH_VERIFIED = 1000000n;
|
|
224
|
-
// We round up
|
|
225
|
-
const mulDiv = (a, b, c)=>a * b / c + (a * b % c > 0n ? 1n : 0n);
|
|
226
|
-
const { baseFee } = await this.rollupContract.getL1FeesAt(block.header.globalVariables.timestamp);
|
|
227
|
-
const proverCost = mulDiv(mulDiv(L1_GAS_PER_EPOCH_VERIFIED, baseFee, await this.rollupContract.getEpochDuration()), 1n, await this.rollupContract.getManaTarget()) + await this.rollupContract.getProvingCostPerMana();
|
|
228
|
-
const price = await this.rollupContract.getFeeAssetPerEth();
|
|
229
|
-
const mana = block.header.totalManaUsed.toBigInt();
|
|
230
|
-
return mulDiv(mana * proverCost, price, 10n ** 9n);
|
|
231
|
-
};
|
|
204
|
+
async applyFPCSetup() {
|
|
205
|
+
this.logger.info('Applying FPC setup');
|
|
206
|
+
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
207
|
+
expect((await this.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
208
|
+
const bananaCoin = this.bananaCoin;
|
|
209
|
+
const { contract: bananaFPC } = await FPCContract.deploy(this.wallet, bananaCoin.address, this.fpcAdmin).send({
|
|
210
|
+
from: this.aliceAddress
|
|
232
211
|
});
|
|
212
|
+
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
213
|
+
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.aliceAddress);
|
|
214
|
+
this.bananaFPC = bananaFPC;
|
|
215
|
+
const l1FeeJuiceAddress = this.feeJuiceBridgeTestHarness.l1FeeJuiceAddress;
|
|
216
|
+
this.getCoinbaseBalance = async ()=>{
|
|
217
|
+
const l1Client = createExtendedL1Client(this.context.config.l1RpcUrls, MNEMONIC);
|
|
218
|
+
const gasL1 = getContract({
|
|
219
|
+
address: l1FeeJuiceAddress.toString(),
|
|
220
|
+
abi: TestERC20Abi,
|
|
221
|
+
client: l1Client
|
|
222
|
+
});
|
|
223
|
+
return await gasL1.read.balanceOf([
|
|
224
|
+
this.coinbase.toString()
|
|
225
|
+
]);
|
|
226
|
+
};
|
|
227
|
+
this.getCoinbaseSequencerRewards = async ()=>{
|
|
228
|
+
return await this.rollupContract.getSequencerRewards(this.coinbase);
|
|
229
|
+
};
|
|
230
|
+
this.getProverFee = async (blockNumber)=>{
|
|
231
|
+
const block = await this.aztecNode.getBlock(blockNumber);
|
|
232
|
+
// @todo @lherskind As we deal with #13601
|
|
233
|
+
// Right now the value is from `FeeLib.sol`
|
|
234
|
+
const L1_GAS_PER_EPOCH_VERIFIED = 3600000n;
|
|
235
|
+
// We round up
|
|
236
|
+
const mulDiv = (a, b, c)=>a * b / c + (a * b % c > 0n ? 1n : 0n);
|
|
237
|
+
const { baseFee } = await this.rollupContract.getL1FeesAt(block.header.globalVariables.timestamp);
|
|
238
|
+
const proverCost = mulDiv(mulDiv(L1_GAS_PER_EPOCH_VERIFIED, baseFee, BigInt(await this.rollupContract.getEpochDuration())), 1n, await this.rollupContract.getManaTarget()) + await this.rollupContract.getProvingCostPerMana();
|
|
239
|
+
const price = await this.rollupContract.getEthPerFeeAsset();
|
|
240
|
+
const mana = block.header.totalManaUsed.toBigInt();
|
|
241
|
+
return mulDiv(mana * proverCost, 10n ** 12n, price);
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* Reads the prover fee that the rollup actually committed for the block's checkpoint, which is what
|
|
245
|
+
* RewardLib uses to pay prover rewards. Unlike `getProverFee`, this does not re-derive the value
|
|
246
|
+
* from current L1 fees or current eth-per-fee-asset price, so it is robust to pipelined fee-asset-price
|
|
247
|
+
* drift between propose-time and reward-payout-time.
|
|
248
|
+
*/ this.getCommittedProverFee = async (blockNumber)=>{
|
|
249
|
+
const block = await this.aztecNode.getBlock(blockNumber);
|
|
250
|
+
const feeHeader = await this.rollupContract.getFeeHeader(BigInt(block.checkpointNumber));
|
|
251
|
+
return feeHeader.manaUsed * feeHeader.proverCost;
|
|
252
|
+
};
|
|
253
|
+
// RewardLib computes sequencerFee = checkpointFee - burn - proverFee where burn = manaUsed * congestionCost.
|
|
254
|
+
// The fixture's typical case keeps congestionCost at zero, but reading it explicitly avoids latent bugs
|
|
255
|
+
// when test load changes excess mana.
|
|
256
|
+
this.getCommittedBurn = async (blockNumber)=>{
|
|
257
|
+
const block = await this.aztecNode.getBlock(blockNumber);
|
|
258
|
+
const feeHeader = await this.rollupContract.getFeeHeader(BigInt(block.checkpointNumber));
|
|
259
|
+
return feeHeader.manaUsed * feeHeader.congestionCost;
|
|
260
|
+
};
|
|
233
261
|
}
|
|
234
|
-
async
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
sponsoredFPCAddress: sponsoredFPC.address
|
|
242
|
-
};
|
|
243
|
-
}, async (data)=>{
|
|
244
|
-
this.sponsoredFPC = await SponsoredFPCContract.at(data.sponsoredFPCAddress, this.wallet);
|
|
245
|
-
});
|
|
262
|
+
async applySponsoredFPCSetup() {
|
|
263
|
+
this.logger.info('Applying sponsored FPC setup');
|
|
264
|
+
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
265
|
+
expect((await this.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
266
|
+
const sponsoredFPCInstance = await setupSponsoredFPC(this.wallet);
|
|
267
|
+
this.logger.info(`SponsoredFPC at ${sponsoredFPCInstance.address}`);
|
|
268
|
+
this.sponsoredFPC = SponsoredFPCContract.at(sponsoredFPCInstance.address, this.wallet);
|
|
246
269
|
}
|
|
247
270
|
async applyFundAliceWithBananas() {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}, ()=>Promise.resolve());
|
|
271
|
+
this.logger.info('Applying fund Alice with bananas setup');
|
|
272
|
+
await this.mintPrivateBananas(this.ALICE_INITIAL_BANANAS, this.aliceAddress);
|
|
273
|
+
await this.bananaCoin.methods.mint_to_public(this.aliceAddress, this.ALICE_INITIAL_BANANAS).send({
|
|
274
|
+
from: this.aliceAddress
|
|
275
|
+
});
|
|
254
276
|
}
|
|
255
277
|
async applyFundAliceWithPrivateBananas() {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}, ()=>Promise.resolve());
|
|
278
|
+
this.logger.info('Applying fund Alice with private bananas setup');
|
|
279
|
+
await this.mintPrivateBananas(this.ALICE_INITIAL_BANANAS, this.aliceAddress);
|
|
259
280
|
}
|
|
260
281
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import type { L2Block } from '@aztec/aztec.js/block';
|
|
3
2
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
4
3
|
import { BatchedBlob, Blob } from '@aztec/blob-lib';
|
|
4
|
+
import { L2Block } from '@aztec/stdlib/block';
|
|
5
|
+
import { CheckpointHeader } from '@aztec/stdlib/rollup';
|
|
5
6
|
/**
|
|
6
7
|
* Creates a json object that can be used to test the solidity contract.
|
|
7
8
|
* The json object must be put into
|
|
8
9
|
*/
|
|
9
|
-
export declare function writeJson(fileName: string, block: L2Block, l1ToL2Content: Fr[], blobs: Blob[], batchedBlob: BatchedBlob, recipientAddress: AztecAddress, deployerAddress: `0x${string}`): Promise<void>;
|
|
10
|
-
//# sourceMappingURL=
|
|
10
|
+
export declare function writeJson(fileName: string, checkpointHeader: CheckpointHeader, block: L2Block, l1ToL2Content: Fr[], blobs: Blob[], batchedBlob: BatchedBlob, recipientAddress: AztecAddress, deployerAddress: `0x${string}`): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid3JpdGVfanNvbi5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2UyZV9sMV9wdWJsaXNoZXIvd3JpdGVfanNvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFDekQsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQzVDLE9BQU8sRUFBRSxXQUFXLEVBQUUsSUFBSSxFQUE2RCxNQUFNLGlCQUFpQixDQUFDO0FBRS9HLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUM5QyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQU14RDs7O0dBR0c7QUFDSCx3QkFBc0IsU0FBUyxDQUM3QixRQUFRLEVBQUUsTUFBTSxFQUNoQixnQkFBZ0IsRUFBRSxnQkFBZ0IsRUFDbEMsS0FBSyxFQUFFLE9BQU8sRUFDZCxhQUFhLEVBQUUsRUFBRSxFQUFFLEVBQ25CLEtBQUssRUFBRSxJQUFJLEVBQUUsRUFDYixXQUFXLEVBQUUsV0FBVyxFQUN4QixnQkFBZ0IsRUFBRSxZQUFZLEVBQzlCLGVBQWUsRUFBRSxLQUFLLE1BQU0sRUFBRSxHQUM3QixPQUFPLENBQUMsSUFBSSxDQUFDLENBb0RmIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write_json.d.ts","sourceRoot":"","sources":["../../src/e2e_l1_publisher/write_json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"write_json.d.ts","sourceRoot":"","sources":["../../src/e2e_l1_publisher/write_json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,IAAI,EAA6D,MAAM,iBAAiB,CAAC;AAE/G,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAMxD;;;GAGG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,EAAE,EAAE,EACnB,KAAK,EAAE,IAAI,EAAE,EACb,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,YAAY,EAC9B,eAAe,EAAE,KAAK,MAAM,EAAE,GAC7B,OAAO,CAAC,IAAI,CAAC,CAoDf"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { getPrefixedEthBlobCommitments } from '@aztec/blob-lib';
|
|
1
|
+
import { getEthBlobEvaluationInputs, getPrefixedEthBlobCommitments } from '@aztec/blob-lib';
|
|
2
2
|
import { writeFile } from 'fs/promises';
|
|
3
3
|
const AZTEC_GENERATE_TEST_DATA = !!process.env.AZTEC_GENERATE_TEST_DATA;
|
|
4
4
|
/**
|
|
5
5
|
* Creates a json object that can be used to test the solidity contract.
|
|
6
6
|
* The json object must be put into
|
|
7
|
-
*/ export async function writeJson(fileName, block, l1ToL2Content, blobs, batchedBlob, recipientAddress, deployerAddress) {
|
|
7
|
+
*/ export async function writeJson(fileName, checkpointHeader, block, l1ToL2Content, blobs, batchedBlob, recipientAddress, deployerAddress) {
|
|
8
8
|
if (!AZTEC_GENERATE_TEST_DATA) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
@@ -23,32 +23,31 @@ const AZTEC_GENERATE_TEST_DATA = !!process.env.AZTEC_GENERATE_TEST_DATA;
|
|
|
23
23
|
messages: {
|
|
24
24
|
l2ToL1Messages: block.body.txEffects.flatMap((txEffect)=>txEffect.l2ToL1Msgs).map((value)=>asHex(value))
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
checkpoint: {
|
|
27
27
|
// The json formatting in forge is a bit brittle, so we convert Fr to a number in the few values below.
|
|
28
28
|
// This should not be a problem for testing as long as the values are not larger than u32.
|
|
29
29
|
archive: asHex(block.archive.root),
|
|
30
30
|
blobCommitments: getPrefixedEthBlobCommitments(blobs),
|
|
31
|
-
batchedBlobInputs:
|
|
32
|
-
|
|
31
|
+
batchedBlobInputs: getEthBlobEvaluationInputs(batchedBlob),
|
|
32
|
+
checkpointNumber: block.number,
|
|
33
33
|
body: `0x${block.body.toBuffer().toString('hex')}`,
|
|
34
34
|
header: {
|
|
35
|
-
lastArchiveRoot: asHex(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
feeRecipient: asHex(block.header.globalVariables.feeRecipient),
|
|
35
|
+
lastArchiveRoot: asHex(checkpointHeader.lastArchiveRoot),
|
|
36
|
+
blockHeadersHash: asHex(checkpointHeader.blockHeadersHash),
|
|
37
|
+
blobsHash: asHex(checkpointHeader.blobsHash),
|
|
38
|
+
inHash: asHex(checkpointHeader.inHash),
|
|
39
|
+
outHash: asHex(checkpointHeader.epochOutHash),
|
|
40
|
+
slotNumber: Number(checkpointHeader.slotNumber),
|
|
41
|
+
timestamp: Number(checkpointHeader.timestamp),
|
|
42
|
+
coinbase: asHex(checkpointHeader.coinbase, 40),
|
|
43
|
+
feeRecipient: asHex(checkpointHeader.feeRecipient),
|
|
45
44
|
gasFees: {
|
|
46
|
-
feePerDaGas: Number(
|
|
47
|
-
feePerL2Gas: Number(
|
|
45
|
+
feePerDaGas: Number(checkpointHeader.gasFees.feePerDaGas),
|
|
46
|
+
feePerL2Gas: Number(checkpointHeader.gasFees.feePerL2Gas)
|
|
48
47
|
},
|
|
49
|
-
totalManaUsed:
|
|
48
|
+
totalManaUsed: checkpointHeader.totalManaUsed.toNumber()
|
|
50
49
|
},
|
|
51
|
-
headerHash: asHex(
|
|
50
|
+
headerHash: asHex(checkpointHeader.hash()),
|
|
52
51
|
numTxs: block.body.txEffects.length
|
|
53
52
|
}
|
|
54
53
|
};
|
|
@@ -9,4 +9,4 @@ export declare function createKeyFile4(fileName: string, validator1Address: EthA
|
|
|
9
9
|
export declare function createKeyFile5(fileName: string, proverAddress: EthAddress, remoteSignerUrl: string): Promise<void>;
|
|
10
10
|
export declare function createKeyFile6(fileName: string, mnemonic: string, validator1Index: number, coinbase: EthAddress, feeRecipient: AztecAddress): Promise<void>;
|
|
11
11
|
export declare function addressForPrivateKey(privateKey: EthPrivateKey): EthAddress;
|
|
12
|
-
//# sourceMappingURL=
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9lMmVfbXVsdGlfdmFsaWRhdG9yL3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUV6RCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDM0QsT0FBTyxLQUFLLEVBQUUsYUFBYSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFXMUQsd0JBQWdCLG1CQUFtQixDQUFDLFNBQVMsRUFBRSxHQUFHLENBQUMsTUFBTSxFQUFFLGFBQWEsQ0FBQyxFQUFFLEtBQUssRUFBRSxHQUFHLENBQUMsTUFBTSxFQUFFLE1BQU0sQ0FBQyxzR0EwRXBHO0FBR0Qsd0JBQXNCLGNBQWMsQ0FDbEMsUUFBUSxFQUFFLE1BQU0sRUFDaEIsUUFBUSxFQUFFLE1BQU0sRUFDaEIsY0FBYyxFQUFFLE1BQU0sRUFDdEIsYUFBYSxFQUFFLGFBQWEsRUFDNUIsYUFBYSxFQUFFLGFBQWEsRUFDNUIsUUFBUSxFQUFFLFVBQVUsRUFDcEIsWUFBWSxFQUFFLFlBQVksaUJBbUIzQjtBQUVELHdCQUFzQixjQUFjLENBQ2xDLFFBQVEsRUFBRSxNQUFNLEVBQ2hCLFlBQVksRUFBRSxhQUFhLEVBQzNCLGlCQUFpQixFQUFFLE1BQU0sRUFDekIsZUFBZSxFQUFFLE1BQU0sRUFDdkIsUUFBUSxFQUFFLFVBQVUsRUFDcEIsWUFBWSxFQUFFLFlBQVksaUJBbUIzQjtBQUVELHdCQUFzQixjQUFjLENBQ2xDLFFBQVEsRUFBRSxNQUFNLEVBQ2hCLGdCQUFnQixFQUFFLFVBQVUsRUFDNUIsYUFBYSxFQUFFLGFBQWEsRUFDNUIsYUFBYSxFQUFFLGFBQWEsRUFDNUIsUUFBUSxFQUFFLFVBQVUsRUFDcEIsZUFBZSxFQUFFLE1BQU0sRUFDdkIsWUFBWSxFQUFFLFlBQVksaUJBaUIzQjtBQUVELHdCQUFzQixjQUFjLENBQ2xDLFFBQVEsRUFBRSxNQUFNLEVBQ2hCLGlCQUFpQixFQUFFLFVBQVUsRUFDN0IsaUJBQWlCLEVBQUUsVUFBVSxFQUM3QixlQUFlLEVBQUUsTUFBTSxFQUN2QixhQUFhLEVBQUUsYUFBYSxFQUM1QixRQUFRLEVBQUUsTUFBTSxFQUNoQixhQUFhLEVBQUUsYUFBYSxFQUM1QixTQUFTLEVBQUUsVUFBVSxFQUNyQixTQUFTLEVBQUUsVUFBVSxFQUNyQixlQUFlLEVBQUUsTUFBTSxFQUN2QixhQUFhLEVBQUUsWUFBWSxFQUMzQixhQUFhLEVBQUUsWUFBWSxpQkE0QjVCO0FBRUQsd0JBQXNCLGNBQWMsQ0FBQyxRQUFRLEVBQUUsTUFBTSxFQUFFLGFBQWEsRUFBRSxVQUFVLEVBQUUsZUFBZSxFQUFFLE1BQU0saUJBY3hHO0FBRUQsd0JBQXNCLGNBQWMsQ0FDbEMsUUFBUSxFQUFFLE1BQU0sRUFDaEIsUUFBUSxFQUFFLE1BQU0sRUFDaEIsZUFBZSxFQUFFLE1BQU0sRUFDdkIsUUFBUSxFQUFFLFVBQVUsRUFDcEIsWUFBWSxFQUFFLFlBQVksaUJBa0IzQjtBQUVELHdCQUFnQixvQkFBb0IsQ0FBQyxVQUFVLEVBQUUsYUFBYSxHQUFHLFVBQVUsQ0FFMUUifQ==
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getAddressFromPrivateKey } from '@aztec/ethereum';
|
|
1
|
+
import { getAddressFromPrivateKey } from '@aztec/ethereum/account';
|
|
2
2
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
import { writeFile } from 'fs/promises';
|
|
4
4
|
import { createServer } from 'http';
|
|
@@ -4,10 +4,10 @@ import type { AztecNode } from '@aztec/aztec.js/node';
|
|
|
4
4
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
5
5
|
import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
|
|
6
6
|
import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
|
|
7
|
-
import { type
|
|
7
|
+
import { type EndToEndContext, type SetupOptions } from '../fixtures/setup.js';
|
|
8
8
|
export declare class NestedContractTest {
|
|
9
9
|
private numberOfAccounts;
|
|
10
|
-
|
|
10
|
+
context: EndToEndContext;
|
|
11
11
|
logger: Logger;
|
|
12
12
|
wallet: Wallet;
|
|
13
13
|
defaultAccountAddress: AztecAddress;
|
|
@@ -16,14 +16,11 @@ export declare class NestedContractTest {
|
|
|
16
16
|
childContract: ChildContract;
|
|
17
17
|
constructor(testName: string, numberOfAccounts?: number);
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
* 1. Add 3 accounts.
|
|
21
|
-
* 2. Publicly deploy accounts
|
|
19
|
+
* Applies base setup by deploying accounts and publicly deploying them.
|
|
22
20
|
*/
|
|
23
|
-
|
|
24
|
-
setup(): Promise<void>;
|
|
21
|
+
applyBaseSetup(): Promise<void>;
|
|
22
|
+
setup(opts?: Partial<SetupOptions>): Promise<void>;
|
|
25
23
|
teardown(): Promise<void>;
|
|
26
|
-
|
|
27
|
-
applyManualSnapshots(): Promise<void>;
|
|
24
|
+
applyManual(): Promise<void>;
|
|
28
25
|
}
|
|
29
|
-
//# sourceMappingURL=
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmVzdGVkX2NvbnRyYWN0X3Rlc3QuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9lMmVfbmVzdGVkX2NvbnRyYWN0L25lc3RlZF9jb250cmFjdF90ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUN6RCxPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQWdCLE1BQU0scUJBQXFCLENBQUM7QUFDaEUsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDdEQsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDckQsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLHFDQUFxQyxDQUFDO0FBQ3BFLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxzQ0FBc0MsQ0FBQztBQUV0RSxPQUFPLEVBQ0wsS0FBSyxlQUFlLEVBQ3BCLEtBQUssWUFBWSxFQUtsQixNQUFNLHNCQUFzQixDQUFDO0FBRTlCLHFCQUFhLGtCQUFrQjtJQVkzQixPQUFPLENBQUMsZ0JBQWdCO0lBWDFCLE9BQU8sRUFBRyxlQUFlLENBQUM7SUFDMUIsTUFBTSxFQUFFLE1BQU0sQ0FBQztJQUNmLE1BQU0sRUFBRyxNQUFNLENBQUM7SUFDaEIscUJBQXFCLEVBQUcsWUFBWSxDQUFDO0lBQ3JDLFNBQVMsRUFBRyxTQUFTLENBQUM7SUFFdEIsY0FBYyxFQUFHLGNBQWMsQ0FBQztJQUNoQyxhQUFhLEVBQUcsYUFBYSxDQUFDO0lBRTlCLFlBQ0UsUUFBUSxFQUFFLE1BQU0sRUFDUixnQkFBZ0IsU0FBSSxFQUc3QjtJQUVEOztPQUVHO0lBQ0csY0FBYyxrQkFlbkI7SUFFSyxLQUFLLENBQUMsSUFBSSxHQUFFLE9BQU8sQ0FBQyxZQUFZLENBQU0saUJBUTNDO0lBRUssUUFBUSxrQkFFYjtJQUVLLFdBQVcsa0JBUWhCO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nested_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_nested_contract/nested_contract_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,
|
|
1
|
+
{"version":3,"file":"nested_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_nested_contract/nested_contract_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EAKlB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,kBAAkB;IAY3B,OAAO,CAAC,gBAAgB;IAX1B,OAAO,EAAG,eAAe,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAG,MAAM,CAAC;IAChB,qBAAqB,EAAG,YAAY,CAAC;IACrC,SAAS,EAAG,SAAS,CAAC;IAEtB,cAAc,EAAG,cAAc,CAAC;IAChC,aAAa,EAAG,aAAa,CAAC;IAE9B,YACE,QAAQ,EAAE,MAAM,EACR,gBAAgB,SAAI,EAG7B;IAED;;OAEG;IACG,cAAc,kBAenB;IAEK,KAAK,CAAC,IAAI,GAAE,OAAO,CAAC,YAAY,CAAM,iBAQ3C;IAEK,QAAQ,kBAEb;IAEK,WAAW,kBAQhB;CACF"}
|