@aztec/end-to-end 0.0.1-commit.b6e433891 → 0.0.1-commit.b8a057fa
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 +217 -14
- 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/onchain_delivery_harness.d.ts +17 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts.map +1 -0
- package/dest/automine/delivery/onchain_delivery_harness.js +123 -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 +23 -36
- 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 +24 -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 +15 -1
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +19 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +5 -5
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +53 -52
- 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 +97 -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/authwit_proxy.d.ts +1 -1
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -1
- package/dest/fixtures/authwit_proxy.js +4 -0
- package/dest/fixtures/e2e_prover_test.d.ts +15 -11
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +55 -40
- package/dest/fixtures/fixtures.d.ts +78 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +78 -0
- package/dest/fixtures/get_bb_config.d.ts +1 -1
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +5 -5
- package/dest/fixtures/ha_setup.d.ts +4 -4
- package/dest/fixtures/ha_setup.d.ts.map +1 -1
- package/dest/fixtures/ha_setup.js +5 -2
- package/dest/fixtures/index.d.ts +2 -1
- package/dest/fixtures/index.d.ts.map +1 -1
- package/dest/fixtures/index.js +1 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
- package/dest/fixtures/setup.d.ts +71 -41
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +283 -201
- package/dest/fixtures/setup_p2p_test.d.ts +10 -6
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +11 -11
- 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 +23 -6
- 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_rpc_client.d.ts +7 -0
- package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
- package/dest/forward-compatibility/wallet_service.d.ts +3 -0
- package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_service.js +109 -0
- package/dest/install_legacy_contracts.d.cts +10 -0
- package/dest/install_legacy_contracts.d.cts.map +1 -0
- package/dest/legacy-jest-resolver.d.cts +3 -0
- package/dest/legacy-jest-resolver.d.cts.map +1 -0
- package/dest/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 +19 -10
- package/dest/p2p/p2p_network.d.ts.map +1 -0
- package/dest/{e2e_p2p → p2p}/p2p_network.js +81 -38
- 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 +32 -29
- 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 +6 -4
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +25 -20
- package/dest/shared/gas_portal_test_harness.d.ts +8 -5
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +24 -12
- 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 +50 -37
- package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
- package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
- package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
- package/dest/simulators/lending_simulator.d.ts +10 -3
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +25 -13
- 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 +78 -59
- 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 +83 -49
- package/dest/spartan/tx_metrics.d.ts +27 -4
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +105 -20
- package/dest/spartan/utils/config.d.ts +9 -35
- package/dest/spartan/utils/config.d.ts.map +1 -1
- package/dest/spartan/utils/nodes.js +2 -2
- package/dest/test-wallet/test_wallet.d.ts +38 -9
- package/dest/test-wallet/test_wallet.d.ts.map +1 -1
- package/dest/test-wallet/test_wallet.js +186 -77
- package/dest/test-wallet/utils.d.ts +38 -3
- package/dest/test-wallet/utils.d.ts.map +1 -1
- package/dest/test-wallet/utils.js +65 -10
- package/dest/test-wallet/wallet_worker_script.js +10 -2
- package/dest/test-wallet/worker_wallet.d.ts +7 -6
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet.js +6 -2
- package/dest/test-wallet/worker_wallet_schema.d.ts +3 -273
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet_schema.js +14 -2
- package/package.json +47 -42
- package/src/automine/README.md +60 -0
- package/src/automine/automine_test_context.ts +153 -0
- package/src/automine/delivery/onchain_delivery_harness.ts +177 -0
- package/src/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.ts +24 -47
- package/src/{e2e_token_contract → automine/token}/token_contract_test.ts +25 -48
- package/src/automine/token/token_test_helpers.ts +138 -0
- package/src/bench/client_flows/benchmark.ts +21 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +103 -73
- package/src/bench/client_flows/data_extractor.ts +1 -0
- package/src/bench/utils.ts +110 -6
- package/src/composed/ha/ha_full_setup.ts +466 -0
- package/src/fixtures/authwit_proxy.ts +4 -0
- package/src/fixtures/e2e_prover_test.ts +66 -63
- package/src/fixtures/fixtures.ts +98 -0
- package/src/fixtures/get_bb_config.ts +7 -6
- package/src/fixtures/ha_setup.ts +11 -5
- package/src/fixtures/index.ts +1 -0
- package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +342 -258
- package/src/fixtures/setup_p2p_test.ts +15 -11
- package/src/fixtures/timing.ts +97 -0
- package/src/fixtures/token_utils.ts +40 -8
- package/src/fixtures/utils.ts +2 -3
- package/src/fixtures/wait_helpers.ts +333 -0
- package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
- package/src/forward-compatibility/wallet_service.ts +106 -0
- package/src/guides/up_quick_start.sh +5 -2
- package/src/infra/README.md +12 -0
- package/src/install_legacy_contracts.cjs +75 -0
- package/src/legacy-jest-resolver.cjs +112 -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 +92 -49
- package/src/{e2e_p2p → p2p}/reqresp/utils.ts +35 -28
- package/src/p2p/shared.ts +329 -0
- package/src/shared/cross_chain_test_harness.ts +35 -14
- package/src/shared/gas_portal_test_harness.ts +32 -14
- 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 +80 -43
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +29 -13
- 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 +103 -66
- 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 +79 -44
- package/src/spartan/tx_metrics.ts +107 -23
- package/src/spartan/utils/nodes.ts +2 -2
- package/src/test-wallet/test_wallet.ts +213 -78
- package/src/test-wallet/utils.ts +104 -11
- package/src/test-wallet/wallet_worker_script.ts +8 -2
- package/src/test-wallet/worker_wallet.ts +12 -11
- package/src/test-wallet/worker_wallet_schema.ts +4 -3
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +0 -55
- 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 -47
- 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 -129
- 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 -50
- package/dest/e2e_epochs/epochs_test.d.ts +0 -104
- package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
- package/dest/e2e_epochs/epochs_test.js +0 -389
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.d.ts +0 -88
- 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 -54
- 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 -136
- 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 -66
- package/dest/e2e_p2p/shared.d.ts.map +0 -1
- package/dest/e2e_p2p/shared.js +0 -212
- 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 -193
- package/src/e2e_deploy_contract/deploy_test.ts +0 -85
- package/src/e2e_epochs/epochs_test.ts +0 -499
- package/src/e2e_l1_publisher/write_json.ts +0 -77
- package/src/e2e_nested_contract/nested_contract_test.ts +0 -75
- package/src/e2e_p2p/inactivity_slash_test.ts +0 -179
- package/src/e2e_p2p/shared.ts +0 -343
- /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,15 +1,10 @@
|
|
|
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
|
-
import {
|
|
8
|
-
BBCircuitVerifier,
|
|
9
|
-
type ClientProtocolCircuitVerifier,
|
|
10
|
-
QueuedIVCVerifier,
|
|
11
|
-
TestCircuitVerifier,
|
|
12
|
-
} from '@aztec/bb-prover';
|
|
7
|
+
import type { ClientProtocolCircuitVerifier } from '@aztec/bb-prover';
|
|
13
8
|
import { BackendType, Barretenberg } from '@aztec/bb.js';
|
|
14
9
|
import type { DeployAztecL1ContractsReturnType } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
15
10
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
@@ -24,19 +19,11 @@ import { type Hex, getContract } from 'viem';
|
|
|
24
19
|
import { privateKeyToAddress } from 'viem/accounts';
|
|
25
20
|
|
|
26
21
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
22
|
+
import { SingleNodeTestContext, type SingleNodeTestOpts } from '../single-node/single_node_test_context.js';
|
|
27
23
|
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
28
24
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
29
25
|
import { getBBConfig } from './get_bb_config.js';
|
|
30
|
-
import {
|
|
31
|
-
type EndToEndContext,
|
|
32
|
-
deployAccounts,
|
|
33
|
-
getPrivateKeyFromIndex,
|
|
34
|
-
getSponsoredFPCAddress,
|
|
35
|
-
publicDeployAccounts,
|
|
36
|
-
setup,
|
|
37
|
-
setupPXEAndGetWallet,
|
|
38
|
-
teardown,
|
|
39
|
-
} from './setup.js';
|
|
26
|
+
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setup, setupPXEAndGetWallet } from './setup.js';
|
|
40
27
|
|
|
41
28
|
type ProvenSetup = {
|
|
42
29
|
wallet: TestWallet;
|
|
@@ -48,17 +35,21 @@ type ProvenSetup = {
|
|
|
48
35
|
* However, we then setup a second PXE with a full prover instance.
|
|
49
36
|
* We configure this instance with all of the accounts and contracts.
|
|
50
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.
|
|
51
43
|
*/
|
|
52
44
|
|
|
53
|
-
export class FullProverTest {
|
|
45
|
+
export class FullProverTest extends SingleNodeTestContext {
|
|
54
46
|
static TOKEN_NAME = 'USDC';
|
|
55
47
|
static TOKEN_SYMBOL = 'USD';
|
|
56
48
|
static TOKEN_DECIMALS = 18n;
|
|
57
|
-
logger: Logger;
|
|
58
49
|
wallet!: TestWallet;
|
|
59
50
|
provenWallet!: TestWallet;
|
|
60
51
|
accounts: AztecAddress[] = [];
|
|
61
|
-
|
|
52
|
+
fundedAccounts!: InitialAccountData[];
|
|
62
53
|
fakeProofsAsset!: TokenContract;
|
|
63
54
|
fakeProofsAssetInstance!: ContractInstanceWithAddress;
|
|
64
55
|
tokenSim!: TokenSimulator;
|
|
@@ -68,18 +59,23 @@ export class FullProverTest {
|
|
|
68
59
|
private provenComponents: ProvenSetup[] = [];
|
|
69
60
|
private bbConfigCleanup?: () => Promise<void>;
|
|
70
61
|
private acvmConfigCleanup?: () => Promise<void>;
|
|
71
|
-
|
|
62
|
+
/** Returns the proof verifier from the prover node (for test assertions). */
|
|
63
|
+
get circuitProofVerifier(): ClientProtocolCircuitVerifier | undefined {
|
|
64
|
+
return this.proverAztecNode?.getProofVerifier();
|
|
65
|
+
}
|
|
72
66
|
provenAsset!: TokenContract;
|
|
73
|
-
context!: EndToEndContext;
|
|
74
67
|
private proverAztecNode!: AztecNodeService;
|
|
75
68
|
private simulatedProverAztecNode!: AztecNodeService;
|
|
76
69
|
public l1Contracts!: DeployAztecL1ContractsReturnType;
|
|
77
70
|
public proverAddress!: EthAddress;
|
|
71
|
+
private testName: string;
|
|
78
72
|
private minNumberOfTxsPerBlock: number;
|
|
79
73
|
private coinbase: EthAddress;
|
|
80
74
|
private realProofs: boolean;
|
|
81
75
|
|
|
82
76
|
constructor(testName: string, minNumberOfTxsPerBlock: number, coinbase: EthAddress, realProofs = true) {
|
|
77
|
+
super();
|
|
78
|
+
this.testName = testName;
|
|
83
79
|
this.logger = createLogger(`e2e:full_prover_test:${testName}`);
|
|
84
80
|
this.minNumberOfTxsPerBlock = minNumberOfTxsPerBlock;
|
|
85
81
|
this.coinbase = coinbase;
|
|
@@ -90,31 +86,22 @@ export class FullProverTest {
|
|
|
90
86
|
* Applies base setup: deploys 2 accounts and token contract.
|
|
91
87
|
*/
|
|
92
88
|
private async applyBaseSetup() {
|
|
93
|
-
this.logger.info('Applying base setup:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
this.logger,
|
|
97
|
-
)({
|
|
98
|
-
wallet: this.context.wallet,
|
|
99
|
-
initialFundedAccounts: this.context.initialFundedAccounts,
|
|
100
|
-
});
|
|
101
|
-
this.deployedAccounts = deployedAccounts;
|
|
102
|
-
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);
|
|
103
92
|
this.wallet = this.context.wallet;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
93
|
+
for (const { secret, salt, signingKey } of this.fundedAccounts) {
|
|
94
|
+
await this.wallet.createSchnorrInitializerlessAccount(secret, salt, signingKey);
|
|
95
|
+
}
|
|
107
96
|
|
|
108
97
|
this.logger.info('Applying base setup: deploying token contract');
|
|
109
|
-
const {
|
|
110
|
-
receipt: { contract: asset, instance },
|
|
111
|
-
} = await TokenContract.deploy(
|
|
98
|
+
const { contract: asset, instance } = await TokenContract.deploy(
|
|
112
99
|
this.wallet,
|
|
113
100
|
this.accounts[0],
|
|
114
101
|
FullProverTest.TOKEN_NAME,
|
|
115
102
|
FullProverTest.TOKEN_SYMBOL,
|
|
116
103
|
FullProverTest.TOKEN_DECIMALS,
|
|
117
|
-
).send({ from: this.accounts[0]
|
|
104
|
+
).send({ from: this.accounts[0] });
|
|
118
105
|
this.logger.verbose(`Token deployed to ${asset.address}`);
|
|
119
106
|
|
|
120
107
|
this.fakeProofsAsset = asset;
|
|
@@ -128,24 +115,28 @@ export class FullProverTest {
|
|
|
128
115
|
);
|
|
129
116
|
}
|
|
130
117
|
|
|
131
|
-
async setup() {
|
|
118
|
+
override async setup(opts: SingleNodeTestOpts = {}) {
|
|
132
119
|
this.logger.info('Setting up subsystems from fresh');
|
|
133
|
-
|
|
120
|
+
const context = await setup(0, {
|
|
121
|
+
...opts,
|
|
134
122
|
startProverNode: true,
|
|
135
123
|
coinbase: this.coinbase,
|
|
136
124
|
fundSponsoredFPC: true,
|
|
137
|
-
|
|
125
|
+
additionallyFundedAccounts: await generateSchnorrAccounts(2),
|
|
138
126
|
l1ContractsArgs: { realVerifier: this.realProofs },
|
|
139
127
|
});
|
|
140
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
|
+
|
|
141
135
|
await this.applyBaseSetup();
|
|
142
136
|
await this.applyMint();
|
|
143
137
|
|
|
144
138
|
this.logger.info(`Enabling proving`, { realProofs: this.realProofs });
|
|
145
139
|
|
|
146
|
-
// We don't wish to mark as proven automatically, so we set the flag to false
|
|
147
|
-
this.context.watcher.setIsMarkingAsProven(false);
|
|
148
|
-
|
|
149
140
|
this.simulatedProverAztecNode = this.context.proverNode!;
|
|
150
141
|
({
|
|
151
142
|
aztecNode: this.aztecNode,
|
|
@@ -170,9 +161,6 @@ export class FullProverTest {
|
|
|
170
161
|
|
|
171
162
|
await Barretenberg.initSingleton({ backend: BackendType.NativeUnixSocket });
|
|
172
163
|
|
|
173
|
-
const verifier = await BBCircuitVerifier.new(bbConfig);
|
|
174
|
-
this.circuitProofVerifier = new QueuedIVCVerifier(bbConfig, verifier);
|
|
175
|
-
|
|
176
164
|
this.logger.debug(`Configuring the node for real proofs...`);
|
|
177
165
|
await this.aztecNodeAdmin.setConfig({
|
|
178
166
|
realProofs: true,
|
|
@@ -180,7 +168,6 @@ export class FullProverTest {
|
|
|
180
168
|
});
|
|
181
169
|
} else {
|
|
182
170
|
this.logger.debug(`Configuring the node min txs per block ${this.minNumberOfTxsPerBlock}...`);
|
|
183
|
-
this.circuitProofVerifier = new TestCircuitVerifier();
|
|
184
171
|
await this.aztecNodeAdmin.setConfig({
|
|
185
172
|
minTxsPerBlock: this.minNumberOfTxsPerBlock,
|
|
186
173
|
});
|
|
@@ -195,6 +182,7 @@ export class FullProverTest {
|
|
|
195
182
|
this.logger.verbose(`Main setup completed, initializing full prover PXE, Node, and Prover Node`);
|
|
196
183
|
const { wallet: provenWallet, teardown: provenTeardown } = await setupPXEAndGetWallet(
|
|
197
184
|
this.aztecNode,
|
|
185
|
+
this.context.aztecNode,
|
|
198
186
|
{ proverEnabled: this.realProofs },
|
|
199
187
|
undefined,
|
|
200
188
|
'pxe-proven',
|
|
@@ -203,8 +191,13 @@ export class FullProverTest {
|
|
|
203
191
|
await provenWallet.registerContract(this.fakeProofsAssetInstance, TokenContract.artifact);
|
|
204
192
|
|
|
205
193
|
for (let i = 0; i < 2; i++) {
|
|
206
|
-
|
|
207
|
-
|
|
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
|
+
);
|
|
200
|
+
await this.wallet.createSchnorrInitializerlessAccount(this.fundedAccounts[i].secret, this.fundedAccounts[i].salt);
|
|
208
201
|
}
|
|
209
202
|
|
|
210
203
|
const asset = TokenContract.at(this.fakeProofsAsset.address, provenWallet);
|
|
@@ -231,11 +224,14 @@ export class FullProverTest {
|
|
|
231
224
|
|
|
232
225
|
this.logger.verbose('Starting prover node');
|
|
233
226
|
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
234
|
-
const {
|
|
235
|
-
this.context.
|
|
227
|
+
const { genesis } = await getGenesisValues(
|
|
228
|
+
this.context.additionallyFundedAccounts.map(a => a.address).concat(sponsoredFPCAddress),
|
|
229
|
+
undefined,
|
|
230
|
+
undefined,
|
|
231
|
+
this.context.genesis!.genesisTimestamp,
|
|
236
232
|
);
|
|
237
233
|
|
|
238
|
-
const proverNodeConfig: Parameters<typeof
|
|
234
|
+
const proverNodeConfig: Parameters<typeof createAztecNodeService>[0] = {
|
|
239
235
|
...config,
|
|
240
236
|
enableProverNode: true,
|
|
241
237
|
disableValidator: true,
|
|
@@ -251,19 +247,24 @@ export class FullProverTest {
|
|
|
251
247
|
txGatheringIntervalMs: 1000,
|
|
252
248
|
txGatheringBatchSize: 10,
|
|
253
249
|
txGatheringMaxParallelRequestsPerNode: 100,
|
|
254
|
-
|
|
250
|
+
// The test warps the L1 clock forward a full epoch via cheatcodes; the prover-node
|
|
251
|
+
// tracks L1 time, so an in-flight tx-gather would see its deadline jump into the
|
|
252
|
+
// past. Use a generous window so the deadline survives the warp.
|
|
253
|
+
txGatheringTimeoutMs: 10 * 60 * 1000,
|
|
255
254
|
proverNodeFailedEpochStore: undefined,
|
|
256
255
|
proverNodeEpochProvingDelayMs: undefined,
|
|
257
256
|
validatorPrivateKeys: new SecretValue([]),
|
|
258
257
|
};
|
|
259
258
|
|
|
260
|
-
this.proverAztecNode = await
|
|
259
|
+
this.proverAztecNode = await createAztecNodeService(
|
|
261
260
|
proverNodeConfig,
|
|
262
261
|
{ dateProvider: this.context.dateProvider, p2pClientDeps: { rpcTxProviders: [this.aztecNode] } },
|
|
263
|
-
{
|
|
262
|
+
{ genesis },
|
|
264
263
|
);
|
|
264
|
+
// Track the real prover node so the base teardown stops it (the simulated one created by `setup`
|
|
265
|
+
// was already stopped above).
|
|
266
|
+
this.proverNodes = [this.proverAztecNode];
|
|
265
267
|
this.logger.warn(`Proofs are now enabled`, { realProofs: this.realProofs });
|
|
266
|
-
return this;
|
|
267
268
|
}
|
|
268
269
|
|
|
269
270
|
private async mintFeeJuice(recipient: Hex) {
|
|
@@ -275,20 +276,22 @@ export class FullProverTest {
|
|
|
275
276
|
await this.context.deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash });
|
|
276
277
|
}
|
|
277
278
|
|
|
278
|
-
async teardown() {
|
|
279
|
+
override async teardown() {
|
|
279
280
|
// Cleanup related to the full prover PXEs
|
|
280
281
|
for (let i = 0; i < this.provenComponents.length; i++) {
|
|
281
282
|
await this.provenComponents[i].teardown();
|
|
282
283
|
}
|
|
283
284
|
|
|
284
|
-
//
|
|
285
|
+
// Stop the prover node before destroying the BB singleton it proves with.
|
|
285
286
|
await this.proverAztecNode.stop();
|
|
286
287
|
|
|
287
288
|
await Barretenberg.destroySingleton();
|
|
288
289
|
await this.bbConfigCleanup?.();
|
|
289
290
|
await this.acvmConfigCleanup?.();
|
|
290
291
|
|
|
291
|
-
|
|
292
|
+
// Stops the chain monitor, the tracked nodes (main node + the already-stopped prover node, a
|
|
293
|
+
// safe no-op), and the context.
|
|
294
|
+
await super.teardown();
|
|
292
295
|
}
|
|
293
296
|
|
|
294
297
|
private async applyMint() {
|
package/src/fixtures/fixtures.ts
CHANGED
|
@@ -1,5 +1,95 @@
|
|
|
1
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
2
|
+
import type { GasFees } from '@aztec/stdlib/gas';
|
|
3
|
+
|
|
1
4
|
export const METRICS_PORT = 4318;
|
|
2
5
|
|
|
6
|
+
/** Default fee padding applied to predicted min fees in e2e tests. */
|
|
7
|
+
export const DEFAULT_MIN_FEE_PADDING = 5;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Large fee padding for txs that may be mined significantly later than when they were created,
|
|
11
|
+
* such as cloned txs in throughput/capacity benchmarks, where fees may spike between creation and mining.
|
|
12
|
+
*/
|
|
13
|
+
export const LARGE_MIN_FEE_PADDING = 15;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Fee padding used by tests running under proposer pipelining. Under pipelining the fee-asset
|
|
17
|
+
* price modifier evolves faster across the build/publish gap, so client-set maxFeesPerGas (sized
|
|
18
|
+
* for the default 5x padding) was getting bumped past by the time the tx mined a few slots later.
|
|
19
|
+
* Observed worst case in CI: fee evolved ~20x between PXE snapshot and inclusion, exceeding even
|
|
20
|
+
* LARGE_MIN_FEE_PADDING (15x).
|
|
21
|
+
*/
|
|
22
|
+
export const PIPELINED_FEE_PADDING = 30;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Setup option preset that opts a test into proposer pipelining. Use with `setup()`:
|
|
26
|
+
*
|
|
27
|
+
* await setup(N, { ...PIPELINING_SETUP_OPTS, ...otherOpts });
|
|
28
|
+
*
|
|
29
|
+
* The preset runs the production Sequencer with the always-enforced timetable at real (wall-clock)
|
|
30
|
+
* timing, yielding exactly 2 blocks per slot. It sets:
|
|
31
|
+
* - `inboxLag: 2` so the sequencer sources L1->L2 messages from checkpoint N-1 (already sealed),
|
|
32
|
+
* avoiding `L1ToL2MessagesNotReadyError` when building for slot N during slot N-1.
|
|
33
|
+
* - `minTxsPerBlock: 0` so empty checkpoints land even when a tx arrives late in the build window
|
|
34
|
+
* (otherwise the chain stalls on alternating slots).
|
|
35
|
+
* - `aztecSlotDuration: 12` / `ethereumSlotDuration: 4` so the pipelined cycle fits inside the
|
|
36
|
+
* default 300s Jest hook budget. Tests that depend on the env-default 72s/12s should override.
|
|
37
|
+
* - `blockDurationMs: 3000` to cut exactly 2 blocks per slot. With `ethereumSlotDuration < 8` the
|
|
38
|
+
* timing model normalizes to `init=0.5`, `assemble=0.5`, `P=0`, `minExec=1`, so
|
|
39
|
+
* `maxBlocks = floor((S - init - (assemble + 2P + D)) / D) = floor((12 - 0.5 - (0.5 + 0 + 3)) / 3)
|
|
40
|
+
* = floor(8/3) = 2`. (`blockDurationMs: 2000` would give 4 blocks/slot; 3000 also matches the
|
|
41
|
+
* production default.)
|
|
42
|
+
* - `walletMinFeePadding: PIPELINED_FEE_PADDING` (30x) to absorb the wider fee evolution window.
|
|
43
|
+
*/
|
|
44
|
+
export const PIPELINING_SETUP_OPTS = {
|
|
45
|
+
inboxLag: 2,
|
|
46
|
+
minTxsPerBlock: 0,
|
|
47
|
+
aztecSlotDuration: 12,
|
|
48
|
+
ethereumSlotDuration: 4,
|
|
49
|
+
blockDurationMs: 3000,
|
|
50
|
+
walletMinFeePadding: PIPELINED_FEE_PADDING,
|
|
51
|
+
} as const;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Setup option preset that opts a test into the deterministic AutomineSequencer path.
|
|
55
|
+
* Use only for single-sequencer tests that don't exercise block-building or consensus
|
|
56
|
+
* (e.g. e2e_token, e2e_amm, e2e_authwit). Not compatible with `p2p/*`,
|
|
57
|
+
* `multi-node/*`, `e2e_block_building`, or any multi-validator suite.
|
|
58
|
+
*
|
|
59
|
+
* await setup(N, { ...AUTOMINE_E2E_OPTS, ...otherOpts });
|
|
60
|
+
*
|
|
61
|
+
* The preset:
|
|
62
|
+
* - Swaps the production Sequencer for an AutomineSequencer that builds one block per
|
|
63
|
+
* submitted tx, publishes synchronously to L1, and owns all time control through a
|
|
64
|
+
* serial queue (see `sequencer-client/src/sequencer/automine/automine_sequencer.ts`).
|
|
65
|
+
* - Disables the validator client (the AutomineSequencer needs none).
|
|
66
|
+
* - Uses `inboxLag: 1` (synchronous) since the AutomineSequencer publishes one block per tx.
|
|
67
|
+
* - Runs anvil at a 4s interval (`ethereumSlotDuration: 4`); at runtime the AutomineSequencer
|
|
68
|
+
* flips anvil into automine so each submitted tx mines its L1 block immediately. Initial L1
|
|
69
|
+
* contract deployment (which runs before the sequencer starts) is mined immediately too via the
|
|
70
|
+
* global `automineL1Setup` default in `setup()`, instead of stalling on the 4s interval.
|
|
71
|
+
*
|
|
72
|
+
* Requires `aztecTargetCommitteeSize: 0`, which is the e2e default at `setup.ts:317`.
|
|
73
|
+
*/
|
|
74
|
+
export const AUTOMINE_E2E_OPTS = {
|
|
75
|
+
useAutomineSequencer: true,
|
|
76
|
+
inboxLag: 1,
|
|
77
|
+
minTxsPerBlock: 0,
|
|
78
|
+
aztecSlotDuration: 12,
|
|
79
|
+
ethereumSlotDuration: 4,
|
|
80
|
+
walletMinFeePadding: PIPELINED_FEE_PADDING,
|
|
81
|
+
} as const;
|
|
82
|
+
|
|
83
|
+
/** Returns worst-case predicted min fees with padding applied, mirroring the BaseWallet pattern. */
|
|
84
|
+
export async function getPaddedMaxFeesPerGas(node: AztecNode, padding = DEFAULT_MIN_FEE_PADDING): Promise<GasFees> {
|
|
85
|
+
const predicted = await node.getPredictedMinFees();
|
|
86
|
+
const worstCase =
|
|
87
|
+
predicted.length > 0
|
|
88
|
+
? predicted.reduce((worst, fees) => (fees.feePerL2Gas > worst.feePerL2Gas ? fees : worst))
|
|
89
|
+
: await node.getCurrentMinFees();
|
|
90
|
+
return worstCase.mul(1 + padding);
|
|
91
|
+
}
|
|
92
|
+
|
|
3
93
|
export const shouldCollectMetrics = () => {
|
|
4
94
|
if (process.env.COLLECT_METRICS) {
|
|
5
95
|
return METRICS_PORT;
|
|
@@ -21,6 +111,14 @@ export const TEST_PEER_CHECK_INTERVAL_MS = 1000;
|
|
|
21
111
|
export const TEST_MAX_PENDING_TX_POOL_COUNT = 10_000; // Number of max pending TXs ~ 1.56GB
|
|
22
112
|
|
|
23
113
|
export const MNEMONIC = 'test test test test test test test test test test test junk';
|
|
114
|
+
|
|
115
|
+
// Mnemonic account index for tests that issue direct L1 writes (e.g. bridging fee juice) while a
|
|
116
|
+
// sequencer is running. The deployer/sequencer publisher uses index 0, the prover index 2, and
|
|
117
|
+
// validators index 3+. Test-side viem writes and the publisher's l1-tx-utils track nonces
|
|
118
|
+
// independently, so sharing an account causes "replacement transaction underpriced" races; index 1
|
|
119
|
+
// is otherwise unused, so issuing those writes from it keeps them off the publisher's nonce stream.
|
|
120
|
+
export const L1_DIRECT_WRITE_ACCOUNT_INDEX = 1;
|
|
121
|
+
|
|
24
122
|
export const privateKey = Buffer.from('ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', 'hex');
|
|
25
123
|
export const privateKey2 = Buffer.from('59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', 'hex');
|
|
26
124
|
|
|
@@ -13,8 +13,10 @@ const {
|
|
|
13
13
|
BB_SKIP_CLEANUP = '',
|
|
14
14
|
TEMP_DIR = tmpdir(),
|
|
15
15
|
BB_WORKING_DIRECTORY = '',
|
|
16
|
-
BB_NUM_IVC_VERIFIERS = '
|
|
16
|
+
BB_NUM_IVC_VERIFIERS = '8',
|
|
17
17
|
BB_IVC_CONCURRENCY = '1',
|
|
18
|
+
BB_CHONK_VERIFY_MAX_BATCH = '16',
|
|
19
|
+
BB_CHONK_VERIFY_BATCH_CONCURRENCY = '6',
|
|
18
20
|
} = process.env;
|
|
19
21
|
|
|
20
22
|
export const getBBConfig = async (
|
|
@@ -41,16 +43,15 @@ export const getBBConfig = async (
|
|
|
41
43
|
const bbSkipCleanup = ['1', 'true'].includes(BB_SKIP_CLEANUP);
|
|
42
44
|
const cleanup = bbSkipCleanup ? () => Promise.resolve() : () => tryRmDir(directoryToCleanup);
|
|
43
45
|
|
|
44
|
-
const numIvcVerifiers = Number(BB_NUM_IVC_VERIFIERS);
|
|
45
|
-
const ivcConcurrency = Number(BB_IVC_CONCURRENCY);
|
|
46
|
-
|
|
47
46
|
return {
|
|
48
47
|
bbSkipCleanup,
|
|
49
48
|
bbBinaryPath,
|
|
50
49
|
bbWorkingDirectory,
|
|
51
50
|
cleanup,
|
|
52
|
-
numConcurrentIVCVerifiers:
|
|
53
|
-
bbIVCConcurrency:
|
|
51
|
+
numConcurrentIVCVerifiers: Number(BB_NUM_IVC_VERIFIERS),
|
|
52
|
+
bbIVCConcurrency: Number(BB_IVC_CONCURRENCY),
|
|
53
|
+
bbChonkVerifyMaxBatch: Number(BB_CHONK_VERIFY_MAX_BATCH),
|
|
54
|
+
bbChonkVerifyConcurrency: Number(BB_CHONK_VERIFY_BATCH_CONCURRENCY),
|
|
54
55
|
};
|
|
55
56
|
} catch (err) {
|
|
56
57
|
logger.error(`Native BB not available, error: ${err}`);
|
package/src/fixtures/ha_setup.ts
CHANGED
|
@@ -11,15 +11,15 @@ import { privateKeyToAccount } from 'viem/accounts';
|
|
|
11
11
|
*/
|
|
12
12
|
export interface HADatabaseConfig {
|
|
13
13
|
/** PostgreSQL connection URL */
|
|
14
|
-
databaseUrl: string
|
|
14
|
+
databaseUrl: SecretValue<string>;
|
|
15
15
|
/** Node ID for HA coordination */
|
|
16
16
|
nodeId: string;
|
|
17
17
|
/** Enable HA signing */
|
|
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
|
}
|
|
@@ -28,14 +28,16 @@ export interface HADatabaseConfig {
|
|
|
28
28
|
* Get database configuration from environment variables
|
|
29
29
|
*/
|
|
30
30
|
export function createHADatabaseConfig(nodeId: string): HADatabaseConfig {
|
|
31
|
-
const databaseUrl =
|
|
31
|
+
const databaseUrl = new SecretValue(
|
|
32
|
+
process.env.DATABASE_URL || 'postgresql://aztec:aztec@localhost:5432/aztec_ha_test',
|
|
33
|
+
);
|
|
32
34
|
|
|
33
35
|
return {
|
|
34
36
|
databaseUrl,
|
|
35
37
|
nodeId,
|
|
36
38
|
haSigningEnabled: true,
|
|
37
39
|
pollingIntervalMs: 100,
|
|
38
|
-
|
|
40
|
+
peerSigningTimeoutMs: 3000,
|
|
39
41
|
maxStuckDutiesAgeMs: 72000,
|
|
40
42
|
};
|
|
41
43
|
}
|
|
@@ -52,6 +54,10 @@ export function setupHADatabase(databaseUrl: string, logger?: Logger): Pool {
|
|
|
52
54
|
// Migrations are already run by docker-compose entrypoint before tests start
|
|
53
55
|
const pool = new Pool({ connectionString: databaseUrl });
|
|
54
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
|
+
|
|
55
61
|
logger?.info('Connected to HA database (migrations should already be applied)');
|
|
56
62
|
|
|
57
63
|
return pool;
|
package/src/fixtures/index.ts
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { DefaultAccountContract } from '@aztec/accounts/defaults';
|
|
2
|
+
import type { ContractArtifact } from '@aztec/aztec.js/abi';
|
|
3
|
+
import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
4
|
+
import type { CompleteAddress } from '@aztec/aztec.js/addresses';
|
|
5
|
+
import { AuthWitness } from '@aztec/aztec.js/authorization';
|
|
6
|
+
import type { Fr } from '@aztec/aztec.js/fields';
|
|
7
|
+
import { Schnorr } from '@aztec/foundation/crypto/schnorr';
|
|
8
|
+
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
9
|
+
import { SchnorrHardcodedAccountContractArtifact } from '@aztec/noir-contracts.js/SchnorrHardcodedAccount';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The private key that matches the hardcoded public key in the SchnorrHardcodedAccountContract.
|
|
13
|
+
* The corresponding public key is baked into the Noir contract as a global constant.
|
|
14
|
+
*/
|
|
15
|
+
export const SCHNORR_HARDCODED_PRIVATE_KEY = GrumpkinScalar.fromHexString(
|
|
16
|
+
'0xd35d743ac0dfe3d6dbe6be8c877cb524a00ab1e3d52d7bada095dfc8894ccfa',
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Account contract backed by the SchnorrHardcodedAccount Noir contract.
|
|
21
|
+
* This contract verifies Schnorr signatures against a public key that is hardcoded
|
|
22
|
+
* in the contract artifact (not stored in a note), so it does not require on-chain
|
|
23
|
+
* deployment or initialization. Useful for tests that need a working account without
|
|
24
|
+
* mining any blocks.
|
|
25
|
+
*/
|
|
26
|
+
export class SchnorrHardcodedKeyAccountContract extends DefaultAccountContract {
|
|
27
|
+
constructor(private privateKey: GrumpkinScalar = SCHNORR_HARDCODED_PRIVATE_KEY) {
|
|
28
|
+
super();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
override getContractArtifact(): Promise<ContractArtifact> {
|
|
32
|
+
return Promise.resolve(SchnorrHardcodedAccountContractArtifact);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
getInitializationFunctionAndArgs() {
|
|
36
|
+
return Promise.resolve(undefined);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
getAuthWitnessProvider(_address: CompleteAddress): AuthWitnessProvider {
|
|
40
|
+
const privateKey = this.privateKey;
|
|
41
|
+
return {
|
|
42
|
+
async createAuthWit(messageHash: Fr): Promise<AuthWitness> {
|
|
43
|
+
const signer = new Schnorr();
|
|
44
|
+
const signature = await signer.constructSignature(messageHash, privateKey);
|
|
45
|
+
return new AuthWitness(messageHash, signature.toLimbFields());
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|