@aztec/end-to-end 0.0.1-commit.b9865e97 → 0.0.1-commit.be03c316
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 +203 -27
- package/dest/automine/automine_test_context.d.ts +85 -0
- package/dest/automine/automine_test_context.d.ts.map +1 -0
- package/dest/automine/automine_test_context.js +98 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts +2 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts.map +1 -0
- package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.d.ts +1 -1
- package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts.map +1 -0
- package/dest/automine/delivery/interactive_handshake_responder.d.ts +48 -0
- package/dest/automine/delivery/interactive_handshake_responder.d.ts.map +1 -0
- package/dest/automine/delivery/interactive_handshake_responder.js +76 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts +19 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts.map +1 -0
- package/dest/automine/delivery/onchain_delivery_harness.js +141 -0
- package/dest/automine/token/blacklist_token_contract_test.d.ts +49 -0
- package/dest/automine/token/blacklist_token_contract_test.d.ts.map +1 -0
- package/dest/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.js +18 -40
- package/dest/automine/token/token_contract_test.d.ts +40 -0
- package/dest/automine/token/token_contract_test.d.ts.map +1 -0
- package/dest/{e2e_token_contract → automine/token}/token_contract_test.js +22 -39
- package/dest/automine/token/token_test_helpers.d.ts +73 -0
- package/dest/automine/token/token_test_helpers.d.ts.map +1 -0
- package/dest/automine/token/token_test_helpers.js +97 -0
- package/dest/bench/client_flows/benchmark.d.ts +1 -1
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +3 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +4 -4
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +31 -19
- package/dest/bench/client_flows/data_extractor.js +1 -0
- package/dest/bench/utils.d.ts +3 -3
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +95 -6
- package/dest/composed/ha/ha_full_setup.d.ts +77 -0
- package/dest/composed/ha/ha_full_setup.d.ts.map +1 -0
- package/dest/composed/ha/ha_full_setup.js +383 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts +12 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts.map +1 -0
- package/dest/fixtures/e2e_prover_test.d.ts +12 -9
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +47 -28
- package/dest/fixtures/fixtures.d.ts +19 -10
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +26 -11
- package/dest/fixtures/ha_setup.d.ts +3 -3
- package/dest/fixtures/ha_setup.d.ts.map +1 -1
- package/dest/fixtures/ha_setup.js +4 -1
- package/dest/fixtures/index.d.ts +2 -1
- package/dest/fixtures/index.d.ts.map +1 -1
- package/dest/fixtures/index.js +1 -0
- package/dest/fixtures/setup.d.ts +38 -41
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +181 -228
- package/dest/fixtures/setup_p2p_test.d.ts +1 -1
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +3 -3
- package/dest/fixtures/timing.d.ts +42 -0
- package/dest/fixtures/timing.d.ts.map +1 -0
- package/dest/fixtures/timing.js +72 -0
- package/dest/fixtures/token_utils.d.ts +22 -4
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +21 -1
- 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/fixtures/wait_helpers.d.ts +135 -0
- package/dest/fixtures/wait_helpers.d.ts.map +1 -0
- package/dest/fixtures/wait_helpers.js +154 -0
- package/dest/forward-compatibility/wallet_service.js +3 -3
- package/dest/multi-node/block-production/setup.d.ts +97 -0
- package/dest/multi-node/block-production/setup.d.ts.map +1 -0
- package/dest/multi-node/block-production/setup.js +158 -0
- package/dest/multi-node/governance/setup.d.ts +67 -0
- package/dest/multi-node/governance/setup.d.ts.map +1 -0
- package/dest/multi-node/governance/setup.js +126 -0
- package/dest/multi-node/multi_node_test_context.d.ts +212 -0
- package/dest/multi-node/multi_node_test_context.d.ts.map +1 -0
- package/dest/multi-node/multi_node_test_context.js +347 -0
- package/dest/multi-node/slashing/inactivity_setup.d.ts +27 -0
- package/dest/multi-node/slashing/inactivity_setup.d.ts.map +1 -0
- package/dest/multi-node/slashing/inactivity_setup.js +111 -0
- package/dest/multi-node/slashing/setup.d.ts +167 -0
- package/dest/multi-node/slashing/setup.d.ts.map +1 -0
- package/dest/multi-node/slashing/setup.js +275 -0
- package/dest/{e2e_p2p → p2p}/p2p_network.d.ts +10 -2
- package/dest/p2p/p2p_network.d.ts.map +1 -0
- package/dest/{e2e_p2p → p2p}/p2p_network.js +39 -15
- package/dest/p2p/reqresp/utils.d.ts +19 -0
- package/dest/p2p/reqresp/utils.d.ts.map +1 -0
- package/dest/{e2e_p2p → p2p}/reqresp/utils.js +4 -17
- package/dest/p2p/shared.d.ts +72 -0
- package/dest/p2p/shared.d.ts.map +1 -0
- package/dest/p2p/shared.js +212 -0
- package/dest/shared/cross_chain_test_harness.d.ts +3 -3
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +16 -15
- package/dest/shared/gas_portal_test_harness.d.ts +1 -1
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +8 -5
- package/dest/shared/submit-transactions.d.ts +1 -1
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +12 -5
- package/dest/shared/timing_env.d.js +5 -0
- package/dest/shared/timing_env.js +365 -0
- 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 +1 -6
- package/dest/shared/wait_for_l1_to_l2_message.js +1 -1
- package/dest/simulators/lending_simulator.js +1 -1
- package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts +75 -0
- package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts.map +1 -0
- package/dest/single-node/cross-chain/cross_chain_messaging_test.js +209 -0
- package/dest/single-node/cross-chain/message_test_helpers.d.ts +38 -0
- package/dest/single-node/cross-chain/message_test_helpers.d.ts.map +1 -0
- package/dest/single-node/cross-chain/message_test_helpers.js +70 -0
- package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.d.ts +1 -1
- package/dest/single-node/fees/bridging_race.notest.d.ts.map +1 -0
- package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.js +17 -4
- package/dest/single-node/fees/fees_test.d.ts +93 -0
- package/dest/single-node/fees/fees_test.d.ts.map +1 -0
- package/dest/{e2e_fees → single-node/fees}/fees_test.js +48 -55
- package/dest/single-node/l1-reorgs/setup.d.ts +42 -0
- package/dest/single-node/l1-reorgs/setup.d.ts.map +1 -0
- package/dest/single-node/l1-reorgs/setup.js +57 -0
- package/dest/single-node/partial-proofs/setup.d.ts +5 -0
- package/dest/single-node/partial-proofs/setup.d.ts.map +1 -0
- package/dest/single-node/partial-proofs/setup.js +5 -0
- package/dest/single-node/proving/setup.d.ts +5 -0
- package/dest/single-node/proving/setup.d.ts.map +1 -0
- package/dest/single-node/proving/setup.js +5 -0
- package/dest/single-node/recovery/setup.d.ts +5 -0
- package/dest/single-node/recovery/setup.d.ts.map +1 -0
- package/dest/single-node/recovery/setup.js +5 -0
- package/dest/single-node/setup.d.ts +49 -0
- package/dest/single-node/setup.d.ts.map +1 -0
- package/dest/single-node/setup.js +56 -0
- package/dest/single-node/single_node_test_context.d.ts +360 -0
- package/dest/single-node/single_node_test_context.d.ts.map +1 -0
- package/dest/single-node/single_node_test_context.js +833 -0
- package/dest/spartan/setup_test_wallets.d.ts +1 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +19 -9
- package/dest/spartan/tx_metrics.d.ts +10 -1
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +32 -0
- package/dest/test-wallet/test_wallet.d.ts +23 -3
- package/dest/test-wallet/test_wallet.d.ts.map +1 -1
- package/dest/test-wallet/test_wallet.js +56 -9
- package/dest/test-wallet/utils.d.ts +36 -1
- package/dest/test-wallet/utils.d.ts.map +1 -1
- package/dest/test-wallet/utils.js +64 -4
- package/dest/test-wallet/wallet_worker_script.js +5 -2
- package/dest/test-wallet/worker_wallet.d.ts +5 -5
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet.js +5 -3
- package/dest/test-wallet/worker_wallet_schema.d.ts +3 -159
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet_schema.js +2 -1
- package/package.json +41 -41
- package/src/automine/README.md +60 -0
- package/src/automine/automine_test_context.ts +153 -0
- package/src/automine/delivery/interactive_handshake_responder.ts +125 -0
- package/src/automine/delivery/onchain_delivery_harness.ts +213 -0
- package/src/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.ts +20 -57
- package/src/{e2e_token_contract → automine/token}/token_contract_test.ts +24 -57
- package/src/automine/token/token_test_helpers.ts +138 -0
- package/src/bench/client_flows/benchmark.ts +3 -1
- package/src/bench/client_flows/client_flows_benchmark.ts +45 -26
- package/src/bench/client_flows/data_extractor.ts +1 -0
- package/src/bench/utils.ts +109 -6
- package/src/composed/ha/ha_full_setup.ts +466 -0
- package/src/fixtures/e2e_prover_test.ts +58 -47
- package/src/fixtures/fixtures.ts +28 -11
- package/src/fixtures/ha_setup.ts +7 -3
- package/src/fixtures/index.ts +1 -0
- package/src/fixtures/setup.ts +220 -289
- package/src/fixtures/setup_p2p_test.ts +3 -3
- package/src/fixtures/timing.ts +97 -0
- package/src/fixtures/token_utils.ts +39 -4
- package/src/fixtures/utils.ts +0 -3
- package/src/fixtures/wait_helpers.ts +333 -0
- package/src/forward-compatibility/wallet_service.ts +6 -4
- package/src/guides/up_quick_start.sh +5 -0
- package/src/infra/README.md +12 -0
- package/src/multi-node/README.md +95 -0
- package/src/multi-node/block-production/setup.ts +272 -0
- package/src/multi-node/governance/setup.ts +172 -0
- package/src/multi-node/multi_node_test_context.ts +447 -0
- package/src/multi-node/slashing/inactivity_setup.ts +139 -0
- package/src/multi-node/slashing/setup.ts +433 -0
- package/src/p2p/README.md +78 -0
- package/src/{e2e_p2p → p2p}/p2p_network.ts +38 -13
- package/src/{e2e_p2p → p2p}/reqresp/utils.ts +5 -16
- package/src/p2p/shared.ts +329 -0
- package/src/shared/cross_chain_test_harness.ts +21 -10
- package/src/shared/gas_portal_test_harness.ts +13 -5
- package/src/shared/submit-transactions.ts +13 -5
- package/src/shared/timing_env.d.mts +39 -0
- package/src/shared/timing_env.mjs +363 -0
- package/src/shared/uniswap_l1_l2.ts +1 -8
- package/src/shared/wait_for_l1_to_l2_message.ts +1 -1
- package/src/simulators/lending_simulator.ts +1 -1
- package/src/single-node/README.md +60 -0
- package/src/single-node/cross-chain/cross_chain_messaging_test.ts +302 -0
- package/src/single-node/cross-chain/message_test_helpers.ts +125 -0
- package/src/{e2e_fees → single-node/fees}/bridging_race.notest.ts +19 -5
- package/src/{e2e_fees → single-node/fees}/fees_test.ts +69 -65
- package/src/single-node/l1-reorgs/setup.ts +93 -0
- package/src/single-node/partial-proofs/setup.ts +8 -0
- package/src/single-node/proving/setup.ts +15 -0
- package/src/single-node/recovery/setup.ts +8 -0
- package/src/single-node/setup.ts +63 -0
- package/src/single-node/single_node_test_context.ts +1041 -0
- package/src/spartan/setup_test_wallets.ts +24 -9
- package/src/spartan/tx_metrics.ts +26 -0
- package/src/test-wallet/test_wallet.ts +60 -10
- package/src/test-wallet/utils.ts +102 -5
- package/src/test-wallet/wallet_worker_script.ts +6 -3
- package/src/test-wallet/worker_wallet.ts +10 -12
- package/src/test-wallet/worker_wallet_schema.ts +3 -2
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +0 -56
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +0 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -58
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +0 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +0 -161
- package/dest/e2e_deploy_contract/deploy_test.d.ts +0 -37
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +0 -1
- package/dest/e2e_deploy_contract/deploy_test.js +0 -51
- package/dest/e2e_epochs/epochs_test.d.ts +0 -125
- package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
- package/dest/e2e_epochs/epochs_test.js +0 -460
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.d.ts +0 -91
- package/dest/e2e_fees/fees_test.d.ts.map +0 -1
- package/dest/e2e_l1_publisher/write_json.d.ts +0 -11
- package/dest/e2e_l1_publisher/write_json.d.ts.map +0 -1
- package/dest/e2e_l1_publisher/write_json.js +0 -56
- package/dest/e2e_multi_validator/utils.d.ts +0 -12
- package/dest/e2e_multi_validator/utils.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +0 -26
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +0 -55
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +0 -31
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +0 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +0 -137
- package/dest/e2e_p2p/p2p_network.d.ts.map +0 -1
- package/dest/e2e_p2p/reqresp/utils.d.ts +0 -22
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +0 -1
- package/dest/e2e_p2p/shared.d.ts +0 -75
- package/dest/e2e_p2p/shared.d.ts.map +0 -1
- package/dest/e2e_p2p/shared.js +0 -217
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +0 -2
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +0 -1
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +0 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts +0 -44
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +0 -1
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +0 -231
- package/src/e2e_deploy_contract/deploy_test.ts +0 -86
- package/src/e2e_epochs/epochs_test.ts +0 -575
- package/src/e2e_l1_publisher/write_json.ts +0 -77
- package/src/e2e_nested_contract/nested_contract_test.ts +0 -77
- package/src/e2e_p2p/inactivity_slash_test.ts +0 -180
- package/src/e2e_p2p/shared.ts +0 -332
- /package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fetcher.js +0 -0
- /package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.js +0 -0
- /package/dest/{e2e_multi_validator/utils.js → composed/web3signer/multi_validator_keystore_utils.js} +0 -0
- /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof.json +0 -0
- /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fetcher.ts +0 -0
- /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.ts +0 -0
- /package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { AztecNodeService } from '@aztec/aztec-node';
|
|
1
|
+
import { type InitialAccountData, generateSchnorrAccounts } from '@aztec/accounts/testing';
|
|
2
|
+
import { AztecNodeService, createAztecNodeService } from '@aztec/aztec-node';
|
|
3
3
|
import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
4
|
-
import {
|
|
4
|
+
import { createLogger } from '@aztec/aztec.js/log';
|
|
5
5
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
6
6
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
7
7
|
import type { ClientProtocolCircuitVerifier } from '@aztec/bb-prover';
|
|
@@ -19,20 +19,11 @@ import { type Hex, getContract } from 'viem';
|
|
|
19
19
|
import { privateKeyToAddress } from 'viem/accounts';
|
|
20
20
|
|
|
21
21
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
22
|
+
import { SingleNodeTestContext, type SingleNodeTestOpts } from '../single-node/single_node_test_context.js';
|
|
22
23
|
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
23
24
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
24
25
|
import { getBBConfig } from './get_bb_config.js';
|
|
25
|
-
import {
|
|
26
|
-
type EndToEndContext,
|
|
27
|
-
type SetupOptions,
|
|
28
|
-
deployAccounts,
|
|
29
|
-
getPrivateKeyFromIndex,
|
|
30
|
-
getSponsoredFPCAddress,
|
|
31
|
-
publicDeployAccounts,
|
|
32
|
-
setup,
|
|
33
|
-
setupPXEAndGetWallet,
|
|
34
|
-
teardown,
|
|
35
|
-
} from './setup.js';
|
|
26
|
+
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setup, setupPXEAndGetWallet } from './setup.js';
|
|
36
27
|
|
|
37
28
|
type ProvenSetup = {
|
|
38
29
|
wallet: TestWallet;
|
|
@@ -44,17 +35,21 @@ type ProvenSetup = {
|
|
|
44
35
|
* However, we then setup a second PXE with a full prover instance.
|
|
45
36
|
* We configure this instance with all of the accounts and contracts.
|
|
46
37
|
* We then prove and verify transactions created via this full prover PXE.
|
|
38
|
+
*
|
|
39
|
+
* The real-prover sub-base of the single-node topology: extends {@link SingleNodeTestContext} so it
|
|
40
|
+
* reuses the base node tracking / chain monitor / teardown machinery, but builds its environment with
|
|
41
|
+
* the bespoke prover opts below (real BB, `realVerifier` L1, the snapshot/account + TokenSimulator
|
|
42
|
+
* harness, and a hand-built prover node) rather than the base's default fake-prover config.
|
|
47
43
|
*/
|
|
48
44
|
|
|
49
|
-
export class FullProverTest {
|
|
45
|
+
export class FullProverTest extends SingleNodeTestContext {
|
|
50
46
|
static TOKEN_NAME = 'USDC';
|
|
51
47
|
static TOKEN_SYMBOL = 'USD';
|
|
52
48
|
static TOKEN_DECIMALS = 18n;
|
|
53
|
-
logger: Logger;
|
|
54
49
|
wallet!: TestWallet;
|
|
55
50
|
provenWallet!: TestWallet;
|
|
56
51
|
accounts: AztecAddress[] = [];
|
|
57
|
-
|
|
52
|
+
fundedAccounts!: InitialAccountData[];
|
|
58
53
|
fakeProofsAsset!: TokenContract;
|
|
59
54
|
fakeProofsAssetInstance!: ContractInstanceWithAddress;
|
|
60
55
|
tokenSim!: TokenSimulator;
|
|
@@ -69,16 +64,18 @@ export class FullProverTest {
|
|
|
69
64
|
return this.proverAztecNode?.getProofVerifier();
|
|
70
65
|
}
|
|
71
66
|
provenAsset!: TokenContract;
|
|
72
|
-
context!: EndToEndContext;
|
|
73
67
|
private proverAztecNode!: AztecNodeService;
|
|
74
68
|
private simulatedProverAztecNode!: AztecNodeService;
|
|
75
69
|
public l1Contracts!: DeployAztecL1ContractsReturnType;
|
|
76
70
|
public proverAddress!: EthAddress;
|
|
71
|
+
private testName: string;
|
|
77
72
|
private minNumberOfTxsPerBlock: number;
|
|
78
73
|
private coinbase: EthAddress;
|
|
79
74
|
private realProofs: boolean;
|
|
80
75
|
|
|
81
76
|
constructor(testName: string, minNumberOfTxsPerBlock: number, coinbase: EthAddress, realProofs = true) {
|
|
77
|
+
super();
|
|
78
|
+
this.testName = testName;
|
|
82
79
|
this.logger = createLogger(`e2e:full_prover_test:${testName}`);
|
|
83
80
|
this.minNumberOfTxsPerBlock = minNumberOfTxsPerBlock;
|
|
84
81
|
this.coinbase = coinbase;
|
|
@@ -89,20 +86,13 @@ export class FullProverTest {
|
|
|
89
86
|
* Applies base setup: deploys 2 accounts and token contract.
|
|
90
87
|
*/
|
|
91
88
|
private async applyBaseSetup() {
|
|
92
|
-
this.logger.info('Applying base setup:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
this.logger,
|
|
96
|
-
)({
|
|
97
|
-
wallet: this.context.wallet,
|
|
98
|
-
initialFundedAccounts: this.context.initialFundedAccounts,
|
|
99
|
-
});
|
|
100
|
-
this.deployedAccounts = deployedAccounts;
|
|
101
|
-
this.accounts = deployedAccounts.map(a => a.address);
|
|
89
|
+
this.logger.info('Applying base setup: registering funded accounts');
|
|
90
|
+
this.fundedAccounts = this.context.additionallyFundedAccounts;
|
|
91
|
+
this.accounts = this.fundedAccounts.map(a => a.address);
|
|
102
92
|
this.wallet = this.context.wallet;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
93
|
+
for (const { secret, salt, signingKey } of this.fundedAccounts) {
|
|
94
|
+
await this.wallet.createSchnorrInitializerlessAccount(secret, salt, signingKey);
|
|
95
|
+
}
|
|
106
96
|
|
|
107
97
|
this.logger.info('Applying base setup: deploying token contract');
|
|
108
98
|
const { contract: asset, instance } = await TokenContract.deploy(
|
|
@@ -125,25 +115,28 @@ export class FullProverTest {
|
|
|
125
115
|
);
|
|
126
116
|
}
|
|
127
117
|
|
|
128
|
-
async setup(opts:
|
|
118
|
+
override async setup(opts: SingleNodeTestOpts = {}) {
|
|
129
119
|
this.logger.info('Setting up subsystems from fresh');
|
|
130
|
-
|
|
120
|
+
const context = await setup(0, {
|
|
131
121
|
...opts,
|
|
132
122
|
startProverNode: true,
|
|
133
123
|
coinbase: this.coinbase,
|
|
134
124
|
fundSponsoredFPC: true,
|
|
135
|
-
|
|
125
|
+
additionallyFundedAccounts: await generateSchnorrAccounts(2),
|
|
136
126
|
l1ContractsArgs: { realVerifier: this.realProofs },
|
|
137
127
|
});
|
|
138
128
|
|
|
129
|
+
// Reuse the base context machinery (rollup, epoch cache, chain monitor, node tracking, teardown)
|
|
130
|
+
// over the environment built above. Restore the FullProverTest-named logger afterwards, since
|
|
131
|
+
// hydrateFromContext repoints `this.logger` at the context logger.
|
|
132
|
+
await this.hydrateFromContext(context);
|
|
133
|
+
this.logger = createLogger(`e2e:full_prover_test:${this.testName}`);
|
|
134
|
+
|
|
139
135
|
await this.applyBaseSetup();
|
|
140
136
|
await this.applyMint();
|
|
141
137
|
|
|
142
138
|
this.logger.info(`Enabling proving`, { realProofs: this.realProofs });
|
|
143
139
|
|
|
144
|
-
// We don't wish to mark as proven automatically, so we set the flag to false
|
|
145
|
-
this.context.watcher.setIsMarkingAsProven(false);
|
|
146
|
-
|
|
147
140
|
this.simulatedProverAztecNode = this.context.proverNode!;
|
|
148
141
|
({
|
|
149
142
|
aztecNode: this.aztecNode,
|
|
@@ -189,6 +182,7 @@ export class FullProverTest {
|
|
|
189
182
|
this.logger.verbose(`Main setup completed, initializing full prover PXE, Node, and Prover Node`);
|
|
190
183
|
const { wallet: provenWallet, teardown: provenTeardown } = await setupPXEAndGetWallet(
|
|
191
184
|
this.aztecNode,
|
|
185
|
+
this.context.aztecNode,
|
|
192
186
|
{ proverEnabled: this.realProofs },
|
|
193
187
|
undefined,
|
|
194
188
|
'pxe-proven',
|
|
@@ -197,8 +191,18 @@ export class FullProverTest {
|
|
|
197
191
|
await provenWallet.registerContract(this.fakeProofsAssetInstance, TokenContract.artifact);
|
|
198
192
|
|
|
199
193
|
for (let i = 0; i < 2; i++) {
|
|
200
|
-
|
|
201
|
-
|
|
194
|
+
// Mirror the initializerless funded accounts (created via createFundedAccounts) in both wallets so
|
|
195
|
+
// their addresses match the genesis-funded ones.
|
|
196
|
+
await provenWallet.createSchnorrInitializerlessAccount(
|
|
197
|
+
this.fundedAccounts[i].secret,
|
|
198
|
+
this.fundedAccounts[i].salt,
|
|
199
|
+
this.fundedAccounts[i].signingKey,
|
|
200
|
+
);
|
|
201
|
+
await this.wallet.createSchnorrInitializerlessAccount(
|
|
202
|
+
this.fundedAccounts[i].secret,
|
|
203
|
+
this.fundedAccounts[i].salt,
|
|
204
|
+
this.fundedAccounts[i].signingKey,
|
|
205
|
+
);
|
|
202
206
|
}
|
|
203
207
|
|
|
204
208
|
const asset = TokenContract.at(this.fakeProofsAsset.address, provenWallet);
|
|
@@ -226,13 +230,13 @@ export class FullProverTest {
|
|
|
226
230
|
this.logger.verbose('Starting prover node');
|
|
227
231
|
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
228
232
|
const { genesis } = await getGenesisValues(
|
|
229
|
-
this.context.
|
|
233
|
+
this.context.additionallyFundedAccounts.map(a => a.address).concat(sponsoredFPCAddress),
|
|
230
234
|
undefined,
|
|
231
235
|
undefined,
|
|
232
236
|
this.context.genesis!.genesisTimestamp,
|
|
233
237
|
);
|
|
234
238
|
|
|
235
|
-
const proverNodeConfig: Parameters<typeof
|
|
239
|
+
const proverNodeConfig: Parameters<typeof createAztecNodeService>[0] = {
|
|
236
240
|
...config,
|
|
237
241
|
enableProverNode: true,
|
|
238
242
|
disableValidator: true,
|
|
@@ -248,19 +252,24 @@ export class FullProverTest {
|
|
|
248
252
|
txGatheringIntervalMs: 1000,
|
|
249
253
|
txGatheringBatchSize: 10,
|
|
250
254
|
txGatheringMaxParallelRequestsPerNode: 100,
|
|
251
|
-
|
|
255
|
+
// The test warps the L1 clock forward a full epoch via cheatcodes; the prover-node
|
|
256
|
+
// tracks L1 time, so an in-flight tx-gather would see its deadline jump into the
|
|
257
|
+
// past. Use a generous window so the deadline survives the warp.
|
|
258
|
+
txGatheringTimeoutMs: 10 * 60 * 1000,
|
|
252
259
|
proverNodeFailedEpochStore: undefined,
|
|
253
260
|
proverNodeEpochProvingDelayMs: undefined,
|
|
254
261
|
validatorPrivateKeys: new SecretValue([]),
|
|
255
262
|
};
|
|
256
263
|
|
|
257
|
-
this.proverAztecNode = await
|
|
264
|
+
this.proverAztecNode = await createAztecNodeService(
|
|
258
265
|
proverNodeConfig,
|
|
259
266
|
{ dateProvider: this.context.dateProvider, p2pClientDeps: { rpcTxProviders: [this.aztecNode] } },
|
|
260
267
|
{ genesis },
|
|
261
268
|
);
|
|
269
|
+
// Track the real prover node so the base teardown stops it (the simulated one created by `setup`
|
|
270
|
+
// was already stopped above).
|
|
271
|
+
this.proverNodes = [this.proverAztecNode];
|
|
262
272
|
this.logger.warn(`Proofs are now enabled`, { realProofs: this.realProofs });
|
|
263
|
-
return this;
|
|
264
273
|
}
|
|
265
274
|
|
|
266
275
|
private async mintFeeJuice(recipient: Hex) {
|
|
@@ -272,20 +281,22 @@ export class FullProverTest {
|
|
|
272
281
|
await this.context.deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash });
|
|
273
282
|
}
|
|
274
283
|
|
|
275
|
-
async teardown() {
|
|
284
|
+
override async teardown() {
|
|
276
285
|
// Cleanup related to the full prover PXEs
|
|
277
286
|
for (let i = 0; i < this.provenComponents.length; i++) {
|
|
278
287
|
await this.provenComponents[i].teardown();
|
|
279
288
|
}
|
|
280
289
|
|
|
281
|
-
//
|
|
290
|
+
// Stop the prover node before destroying the BB singleton it proves with.
|
|
282
291
|
await this.proverAztecNode.stop();
|
|
283
292
|
|
|
284
293
|
await Barretenberg.destroySingleton();
|
|
285
294
|
await this.bbConfigCleanup?.();
|
|
286
295
|
await this.acvmConfigCleanup?.();
|
|
287
296
|
|
|
288
|
-
|
|
297
|
+
// Stops the chain monitor, the tracked nodes (main node + the already-stopped prover node, a
|
|
298
|
+
// safe no-op), and the context.
|
|
299
|
+
await super.teardown();
|
|
289
300
|
}
|
|
290
301
|
|
|
291
302
|
private async applyMint() {
|
package/src/fixtures/fixtures.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
2
|
+
import { TEST_FEE_PADDING } from '@aztec/aztec/testing';
|
|
2
3
|
import type { GasFees } from '@aztec/stdlib/gas';
|
|
3
4
|
|
|
4
5
|
export const METRICS_PORT = 4318;
|
|
@@ -17,22 +18,29 @@ export const LARGE_MIN_FEE_PADDING = 15;
|
|
|
17
18
|
* price modifier evolves faster across the build/publish gap, so client-set maxFeesPerGas (sized
|
|
18
19
|
* for the default 5x padding) was getting bumped past by the time the tx mined a few slots later.
|
|
19
20
|
* Observed worst case in CI: fee evolved ~20x between PXE snapshot and inclusion, exceeding even
|
|
20
|
-
* LARGE_MIN_FEE_PADDING (15x).
|
|
21
|
+
* LARGE_MIN_FEE_PADDING (15x). Same multiplier and same class of problem as the published
|
|
22
|
+
* {@link TEST_FEE_PADDING}, re-exported under a name that captures the pipelining rationale.
|
|
21
23
|
*/
|
|
22
|
-
export const PIPELINED_FEE_PADDING =
|
|
24
|
+
export const PIPELINED_FEE_PADDING = TEST_FEE_PADDING;
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
27
|
* Setup option preset that opts a test into proposer pipelining. Use with `setup()`:
|
|
26
28
|
*
|
|
27
29
|
* await setup(N, { ...PIPELINING_SETUP_OPTS, ...otherOpts });
|
|
28
30
|
*
|
|
29
|
-
* The preset
|
|
31
|
+
* The preset runs the production Sequencer with the always-enforced timetable at real (wall-clock)
|
|
32
|
+
* timing, yielding exactly 2 blocks per slot. It sets:
|
|
30
33
|
* - `inboxLag: 2` so the sequencer sources L1->L2 messages from checkpoint N-1 (already sealed),
|
|
31
34
|
* avoiding `L1ToL2MessagesNotReadyError` when building for slot N during slot N-1.
|
|
32
35
|
* - `minTxsPerBlock: 0` so empty checkpoints land even when a tx arrives late in the build window
|
|
33
36
|
* (otherwise the chain stalls on alternating slots).
|
|
34
37
|
* - `aztecSlotDuration: 12` / `ethereumSlotDuration: 4` so the pipelined cycle fits inside the
|
|
35
38
|
* default 300s Jest hook budget. Tests that depend on the env-default 72s/12s should override.
|
|
39
|
+
* - `blockDurationMs: 3000` to cut exactly 2 blocks per slot. With `ethereumSlotDuration < 8` the
|
|
40
|
+
* timing model normalizes to `init=0.5`, `assemble=0.5`, `P=0`, `minExec=1`, so
|
|
41
|
+
* `maxBlocks = floor((S - init - (assemble + 2P + D)) / D) = floor((12 - 0.5 - (0.5 + 0 + 3)) / 3)
|
|
42
|
+
* = floor(8/3) = 2`. (`blockDurationMs: 2000` would give 4 blocks/slot; 3000 also matches the
|
|
43
|
+
* production default.)
|
|
36
44
|
* - `walletMinFeePadding: PIPELINED_FEE_PADDING` (30x) to absorb the wider fee evolution window.
|
|
37
45
|
*/
|
|
38
46
|
export const PIPELINING_SETUP_OPTS = {
|
|
@@ -40,14 +48,15 @@ export const PIPELINING_SETUP_OPTS = {
|
|
|
40
48
|
minTxsPerBlock: 0,
|
|
41
49
|
aztecSlotDuration: 12,
|
|
42
50
|
ethereumSlotDuration: 4,
|
|
51
|
+
blockDurationMs: 3000,
|
|
43
52
|
walletMinFeePadding: PIPELINED_FEE_PADDING,
|
|
44
53
|
} as const;
|
|
45
54
|
|
|
46
55
|
/**
|
|
47
56
|
* Setup option preset that opts a test into the deterministic AutomineSequencer path.
|
|
48
57
|
* Use only for single-sequencer tests that don't exercise block-building or consensus
|
|
49
|
-
* (e.g. e2e_token, e2e_amm, e2e_authwit). Not compatible with `
|
|
50
|
-
* `
|
|
58
|
+
* (e.g. e2e_token, e2e_amm, e2e_authwit). Not compatible with `p2p/*`,
|
|
59
|
+
* `multi-node/*`, `e2e_block_building`, or any multi-validator suite.
|
|
51
60
|
*
|
|
52
61
|
* await setup(N, { ...AUTOMINE_E2E_OPTS, ...otherOpts });
|
|
53
62
|
*
|
|
@@ -55,22 +64,22 @@ export const PIPELINING_SETUP_OPTS = {
|
|
|
55
64
|
* - Swaps the production Sequencer for an AutomineSequencer that builds one block per
|
|
56
65
|
* submitted tx, publishes synchronously to L1, and owns all time control through a
|
|
57
66
|
* serial queue (see `sequencer-client/src/sequencer/automine/automine_sequencer.ts`).
|
|
58
|
-
* - Disables the validator client
|
|
59
|
-
* neither).
|
|
67
|
+
* - Disables the validator client (the AutomineSequencer needs none).
|
|
60
68
|
* - Uses `inboxLag: 1` (synchronous) since the AutomineSequencer publishes one block per tx.
|
|
61
|
-
* -
|
|
62
|
-
* mines
|
|
69
|
+
* - Runs anvil at a 4s interval (`ethereumSlotDuration: 4`); at runtime the AutomineSequencer
|
|
70
|
+
* flips anvil into automine so each submitted tx mines its L1 block immediately. Initial L1
|
|
71
|
+
* contract deployment (which runs before the sequencer starts) is mined immediately too via the
|
|
72
|
+
* global `automineL1Setup` default in `setup()`, instead of stalling on the 4s interval.
|
|
63
73
|
*
|
|
64
74
|
* Requires `aztecTargetCommitteeSize: 0`, which is the e2e default at `setup.ts:317`.
|
|
65
75
|
*/
|
|
66
76
|
export const AUTOMINE_E2E_OPTS = {
|
|
67
77
|
useAutomineSequencer: true,
|
|
68
|
-
disableAnvilTestWatcher: true,
|
|
69
78
|
inboxLag: 1,
|
|
70
79
|
minTxsPerBlock: 0,
|
|
71
80
|
aztecSlotDuration: 12,
|
|
72
81
|
ethereumSlotDuration: 4,
|
|
73
|
-
walletMinFeePadding:
|
|
82
|
+
walletMinFeePadding: TEST_FEE_PADDING,
|
|
74
83
|
} as const;
|
|
75
84
|
|
|
76
85
|
/** Returns worst-case predicted min fees with padding applied, mirroring the BaseWallet pattern. */
|
|
@@ -104,6 +113,14 @@ export const TEST_PEER_CHECK_INTERVAL_MS = 1000;
|
|
|
104
113
|
export const TEST_MAX_PENDING_TX_POOL_COUNT = 10_000; // Number of max pending TXs ~ 1.56GB
|
|
105
114
|
|
|
106
115
|
export const MNEMONIC = 'test test test test test test test test test test test junk';
|
|
116
|
+
|
|
117
|
+
// Mnemonic account index for tests that issue direct L1 writes (e.g. bridging fee juice) while a
|
|
118
|
+
// sequencer is running. The deployer/sequencer publisher uses index 0, the prover index 2, and
|
|
119
|
+
// validators index 3+. Test-side viem writes and the publisher's l1-tx-utils track nonces
|
|
120
|
+
// independently, so sharing an account causes "replacement transaction underpriced" races; index 1
|
|
121
|
+
// is otherwise unused, so issuing those writes from it keeps them off the publisher's nonce stream.
|
|
122
|
+
export const L1_DIRECT_WRITE_ACCOUNT_INDEX = 1;
|
|
123
|
+
|
|
107
124
|
export const privateKey = Buffer.from('ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', 'hex');
|
|
108
125
|
export const privateKey2 = Buffer.from('59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', 'hex');
|
|
109
126
|
|
package/src/fixtures/ha_setup.ts
CHANGED
|
@@ -18,8 +18,8 @@ export interface HADatabaseConfig {
|
|
|
18
18
|
haSigningEnabled: boolean;
|
|
19
19
|
/** Polling interval in ms */
|
|
20
20
|
pollingIntervalMs: number;
|
|
21
|
-
/**
|
|
22
|
-
|
|
21
|
+
/** How long to wait for a peer node's in-progress signing in ms */
|
|
22
|
+
peerSigningTimeoutMs: number;
|
|
23
23
|
/** Max stuck duties age in ms */
|
|
24
24
|
maxStuckDutiesAgeMs: number;
|
|
25
25
|
}
|
|
@@ -37,7 +37,7 @@ export function createHADatabaseConfig(nodeId: string): HADatabaseConfig {
|
|
|
37
37
|
nodeId,
|
|
38
38
|
haSigningEnabled: true,
|
|
39
39
|
pollingIntervalMs: 100,
|
|
40
|
-
|
|
40
|
+
peerSigningTimeoutMs: 3000,
|
|
41
41
|
maxStuckDutiesAgeMs: 72000,
|
|
42
42
|
};
|
|
43
43
|
}
|
|
@@ -54,6 +54,10 @@ export function setupHADatabase(databaseUrl: string, logger?: Logger): Pool {
|
|
|
54
54
|
// Migrations are already run by docker-compose entrypoint before tests start
|
|
55
55
|
const pool = new Pool({ connectionString: databaseUrl });
|
|
56
56
|
|
|
57
|
+
// pg-pool re-emits idle-client errors on the pool; with no listener the emit throws - in production this crashes
|
|
58
|
+
// the validator process.
|
|
59
|
+
pool.on('error', (err: Error) => logger?.warn(`HA database pool error: ${err.message}`));
|
|
60
|
+
|
|
57
61
|
logger?.info('Connected to HA database (migrations should already be applied)');
|
|
58
62
|
|
|
59
63
|
return pool;
|