@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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds a proxy forwarding call from an action, selecting the right forward_private_N method.
|
|
3
|
+
*/ async function buildProxyCall(proxy, action) {
|
|
4
|
+
const call = await action.getFunctionCall();
|
|
5
|
+
const argCount = call.args.length;
|
|
6
|
+
if (argCount === 2) {
|
|
7
|
+
return proxy.methods.forward_private_2(call.to, call.selector, call.args);
|
|
8
|
+
} else if (argCount === 3) {
|
|
9
|
+
return proxy.methods.forward_private_3(call.to, call.selector, call.args);
|
|
10
|
+
} else if (argCount === 4) {
|
|
11
|
+
return proxy.methods.forward_private_4(call.to, call.selector, call.args);
|
|
12
|
+
} else if (argCount === 5) {
|
|
13
|
+
return proxy.methods.forward_private_5(call.to, call.selector, call.args);
|
|
14
|
+
} else if (argCount === 6) {
|
|
15
|
+
return proxy.methods.forward_private_6(call.to, call.selector, call.args);
|
|
16
|
+
}
|
|
17
|
+
throw new Error(`No forward_private_${argCount} method on proxy`);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Sends a contract call through the authwit proxy.
|
|
21
|
+
* The proxy becomes msg_sender in the target (triggering authwit validation),
|
|
22
|
+
* while the actual tx sender retains their keys in scope.
|
|
23
|
+
*/ export async function sendThroughAuthwitProxy(proxy, action, options) {
|
|
24
|
+
const proxyCall = await buildProxyCall(proxy, action);
|
|
25
|
+
return proxyCall.send(options);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Simulates a contract call through the authwit proxy.
|
|
29
|
+
* The proxy becomes msg_sender in the target (triggering authwit validation),
|
|
30
|
+
* while the actual tx sender retains their keys in scope.
|
|
31
|
+
*/ export async function simulateThroughAuthwitProxy(proxy, action, options) {
|
|
32
|
+
const proxyCall = await buildProxyCall(proxy, action);
|
|
33
|
+
return proxyCall.simulate(options);
|
|
34
|
+
}
|
|
@@ -3,14 +3,14 @@ import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
|
3
3
|
import { type Logger } from '@aztec/aztec.js/log';
|
|
4
4
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
5
5
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
6
|
-
import {
|
|
7
|
-
import type {
|
|
8
|
-
import type { DeployL1ContractsReturnType } from '@aztec/ethereum';
|
|
6
|
+
import type { ClientProtocolCircuitVerifier } from '@aztec/bb-prover';
|
|
7
|
+
import type { DeployAztecL1ContractsReturnType } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
9
8
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
9
|
+
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
10
10
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
11
|
-
import { TestWallet } from '@aztec/test-wallet/server';
|
|
12
11
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
13
|
-
import {
|
|
12
|
+
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
13
|
+
import { type EndToEndContext, type SetupOptions } from './setup.js';
|
|
14
14
|
/**
|
|
15
15
|
* Largely taken from the e2e_token_contract test file. We deploy 2 accounts and a token contract.
|
|
16
16
|
* However, we then setup a second PXE with a full prover instance.
|
|
@@ -18,44 +18,39 @@ import { type SubsystemsContext } from './snapshot_manager.js';
|
|
|
18
18
|
* We then prove and verify transactions created via this full prover PXE.
|
|
19
19
|
*/
|
|
20
20
|
export declare class FullProverTest {
|
|
21
|
-
private minNumberOfTxsPerBlock;
|
|
22
|
-
private realProofs;
|
|
23
21
|
static TOKEN_NAME: string;
|
|
24
22
|
static TOKEN_SYMBOL: string;
|
|
25
23
|
static TOKEN_DECIMALS: bigint;
|
|
26
|
-
private snapshotManager;
|
|
27
24
|
logger: Logger;
|
|
28
25
|
wallet: TestWallet;
|
|
29
26
|
provenWallet: TestWallet;
|
|
30
27
|
accounts: AztecAddress[];
|
|
31
28
|
deployedAccounts: InitialAccountData[];
|
|
32
29
|
fakeProofsAsset: TokenContract;
|
|
30
|
+
fakeProofsAssetInstance: ContractInstanceWithAddress;
|
|
33
31
|
tokenSim: TokenSimulator;
|
|
34
32
|
aztecNode: AztecNode;
|
|
35
33
|
aztecNodeAdmin: AztecNodeAdmin;
|
|
36
34
|
cheatCodes: CheatCodes;
|
|
37
|
-
blobSink: BlobSinkServer;
|
|
38
35
|
private provenComponents;
|
|
39
36
|
private bbConfigCleanup?;
|
|
40
37
|
private acvmConfigCleanup?;
|
|
41
|
-
|
|
38
|
+
/** Returns the proof verifier from the prover node (for test assertions). */
|
|
39
|
+
get circuitProofVerifier(): ClientProtocolCircuitVerifier | undefined;
|
|
42
40
|
provenAsset: TokenContract;
|
|
43
|
-
|
|
44
|
-
private
|
|
45
|
-
private
|
|
46
|
-
l1Contracts:
|
|
41
|
+
context: EndToEndContext;
|
|
42
|
+
private proverAztecNode;
|
|
43
|
+
private simulatedProverAztecNode;
|
|
44
|
+
l1Contracts: DeployAztecL1ContractsReturnType;
|
|
47
45
|
proverAddress: EthAddress;
|
|
46
|
+
private minNumberOfTxsPerBlock;
|
|
47
|
+
private coinbase;
|
|
48
|
+
private realProofs;
|
|
48
49
|
constructor(testName: string, minNumberOfTxsPerBlock: number, coinbase: EthAddress, realProofs?: boolean);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
* 1. Add 2 accounts.
|
|
52
|
-
* 2. Publicly deploy accounts, deploy token contract
|
|
53
|
-
*/
|
|
54
|
-
applyBaseSnapshots(): Promise<void>;
|
|
55
|
-
setup(): Promise<this>;
|
|
50
|
+
private applyBaseSetup;
|
|
51
|
+
setup(opts?: Partial<SetupOptions>): Promise<this>;
|
|
56
52
|
private mintFeeJuice;
|
|
57
|
-
snapshot: <T>(name: string, apply: (context: SubsystemsContext) => Promise<T>, restore?: (snapshotData: T, context: SubsystemsContext) => Promise<void>) => Promise<void>;
|
|
58
53
|
teardown(): Promise<void>;
|
|
59
|
-
|
|
54
|
+
private applyMint;
|
|
60
55
|
}
|
|
61
|
-
//# sourceMappingURL=
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZTJlX3Byb3Zlcl90ZXN0LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZml4dHVyZXMvZTJlX3Byb3Zlcl90ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFFbEUsT0FBTyxFQUFFLFlBQVksRUFBRSxVQUFVLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUNyRSxPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQWdCLE1BQU0scUJBQXFCLENBQUM7QUFDaEUsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDdEQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ2xELE9BQU8sS0FBSyxFQUFFLDZCQUE2QixFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFdEUsT0FBTyxLQUFLLEVBQUUsZ0NBQWdDLEVBQUUsTUFBTSwyQ0FBMkMsQ0FBQztBQUlsRyxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDL0QsT0FBTyxLQU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E2QixHQUFHLFNBQVMsQ0FFcEU7SUFDRCxXQUFXLEVBQUcsYUFBYSxDQUFDO0lBQzVCLE9BQU8sRUFBRyxlQUFlLENBQUM7SUFDMUIsT0FBTyxDQUFDLGVBQWUsQ0FBb0I7SUFDM0MsT0FBTyxDQUFDLHdCQUF3QixDQUFvQjtJQUM3QyxXQUFXLEVBQUcsZ0NBQWdDLENBQUM7SUFDL0MsYUFBYSxFQUFHLFVBQVUsQ0FBQztJQUNsQyxPQUFPLENBQUMsc0JBQXNCLENBQVM7SUFDdkMsT0FBTyxDQUFDLFFBQVEsQ0FBYTtJQUM3QixPQUFPLENBQUMsVUFBVSxDQUFVO0lBRTVCLFlBQVksUUFBUSxFQUFFLE1BQU0sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLEVBQUUsUUFBUSxFQUFFLFVBQVUsRUFBRSxVQUFVLFVBQU8sRUFLcEc7WUFLYSxjQUFjO0lBcUN0QixLQUFLLENBQUMsSUFBSSxHQUFFLE9BQU8sQ0FBQyxZQUFZLENBQU0saUJBd0kzQztZQUVhLFlBQVk7SUFTcEIsUUFBUSxrQkFjYjtZQUVhLFNBQVM7Q0FzQ3hCIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e_prover_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/e2e_prover_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"e2e_prover_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/e2e_prover_test.ts"],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U,EAAG,UAAU,CAAC;IACxB,OAAO,CAAC,gBAAgB,CAAqB;IAC7C,OAAO,CAAC,eAAe,CAAC,CAAsB;IAC9C,OAAO,CAAC,iBAAiB,CAAC,CAAsB;IAChD,6EAA6E;IAC7E,IAAI,oBAAoB,IAAI,6BAA6B,GAAG,SAAS,CAEpE;IACD,WAAW,EAAG,aAAa,CAAC;IAC5B,OAAO,EAAG,eAAe,CAAC;IAC1B,OAAO,CAAC,eAAe,CAAoB;IAC3C,OAAO,CAAC,wBAAwB,CAAoB;IAC7C,WAAW,EAAG,gCAAgC,CAAC;IAC/C,aAAa,EAAG,UAAU,CAAC;IAClC,OAAO,CAAC,sBAAsB,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,UAAU,CAAU;IAE5B,YAAY,QAAQ,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,UAAO,EAKpG;YAKa,cAAc;IAqCtB,KAAK,CAAC,IAAI,GAAE,OAAO,CAAC,YAAY,CAAM,iBAwI3C;YAEa,YAAY;IASpB,QAAQ,kBAcb;YAEa,SAAS;CAsCxB"}
|
|
@@ -1,114 +1,108 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AztecNodeService } from '@aztec/aztec-node';
|
|
2
2
|
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
3
3
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
4
|
-
import {
|
|
5
|
-
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
4
|
+
import { BackendType, Barretenberg } from '@aztec/bb.js';
|
|
6
5
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
7
6
|
import { SecretValue } from '@aztec/foundation/config';
|
|
8
7
|
import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
|
|
9
8
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
10
|
-
import { createProverNode } from '@aztec/prover-node';
|
|
11
9
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
12
10
|
import { getContract } from 'viem';
|
|
13
11
|
import { privateKeyToAddress } from 'viem/accounts';
|
|
14
12
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
15
13
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
16
14
|
import { getBBConfig } from './get_bb_config.js';
|
|
17
|
-
import {
|
|
18
|
-
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEAndGetWallet } from './utils.js';
|
|
19
|
-
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
15
|
+
import { deployAccounts, getPrivateKeyFromIndex, getSponsoredFPCAddress, publicDeployAccounts, setup, setupPXEAndGetWallet, teardown } from './setup.js';
|
|
20
16
|
/**
|
|
21
17
|
* Largely taken from the e2e_token_contract test file. We deploy 2 accounts and a token contract.
|
|
22
18
|
* However, we then setup a second PXE with a full prover instance.
|
|
23
19
|
* We configure this instance with all of the accounts and contracts.
|
|
24
20
|
* We then prove and verify transactions created via this full prover PXE.
|
|
25
21
|
*/ export class FullProverTest {
|
|
26
|
-
minNumberOfTxsPerBlock;
|
|
27
|
-
realProofs;
|
|
28
22
|
static TOKEN_NAME = 'USDC';
|
|
29
23
|
static TOKEN_SYMBOL = 'USD';
|
|
30
24
|
static TOKEN_DECIMALS = 18n;
|
|
31
|
-
snapshotManager;
|
|
32
25
|
logger;
|
|
33
26
|
wallet;
|
|
34
27
|
provenWallet;
|
|
35
|
-
accounts;
|
|
28
|
+
accounts = [];
|
|
36
29
|
deployedAccounts;
|
|
37
30
|
fakeProofsAsset;
|
|
31
|
+
fakeProofsAssetInstance;
|
|
38
32
|
tokenSim;
|
|
39
33
|
aztecNode;
|
|
40
34
|
aztecNodeAdmin;
|
|
41
35
|
cheatCodes;
|
|
42
|
-
|
|
43
|
-
provenComponents;
|
|
36
|
+
provenComponents = [];
|
|
44
37
|
bbConfigCleanup;
|
|
45
38
|
acvmConfigCleanup;
|
|
46
|
-
circuitProofVerifier
|
|
39
|
+
/** Returns the proof verifier from the prover node (for test assertions). */ get circuitProofVerifier() {
|
|
40
|
+
return this.proverAztecNode?.getProofVerifier();
|
|
41
|
+
}
|
|
47
42
|
provenAsset;
|
|
48
43
|
context;
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
proverAztecNode;
|
|
45
|
+
simulatedProverAztecNode;
|
|
51
46
|
l1Contracts;
|
|
52
47
|
proverAddress;
|
|
48
|
+
minNumberOfTxsPerBlock;
|
|
49
|
+
coinbase;
|
|
50
|
+
realProofs;
|
|
53
51
|
constructor(testName, minNumberOfTxsPerBlock, coinbase, realProofs = true){
|
|
52
|
+
this.logger = createLogger(`e2e:full_prover_test:${testName}`);
|
|
54
53
|
this.minNumberOfTxsPerBlock = minNumberOfTxsPerBlock;
|
|
54
|
+
this.coinbase = coinbase;
|
|
55
55
|
this.realProofs = realProofs;
|
|
56
|
-
this.accounts = [];
|
|
57
|
-
this.provenComponents = [];
|
|
58
|
-
this.snapshot = (name, apply, restore = ()=>Promise.resolve())=>this.snapshotManager.snapshot(name, apply, restore);
|
|
59
|
-
this.logger = createLogger(`e2e:full_prover_test:${testName}`);
|
|
60
|
-
this.snapshotManager = createSnapshotManager(`full_prover_integration/${testName}`, dataPath, {
|
|
61
|
-
startProverNode: true,
|
|
62
|
-
fundRewardDistributor: true,
|
|
63
|
-
coinbase
|
|
64
|
-
}, {
|
|
65
|
-
realVerifier: realProofs
|
|
66
|
-
});
|
|
67
56
|
}
|
|
68
57
|
/**
|
|
69
|
-
*
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
this.
|
|
75
|
-
this.accounts = deployedAccounts.map((a)=>a.address);
|
|
76
|
-
this.wallet = wallet;
|
|
77
|
-
return Promise.resolve();
|
|
58
|
+
* Applies base setup: deploys 2 accounts and token contract.
|
|
59
|
+
*/ async applyBaseSetup() {
|
|
60
|
+
this.logger.info('Applying base setup: deploying accounts');
|
|
61
|
+
const { deployedAccounts } = await deployAccounts(2, this.logger)({
|
|
62
|
+
wallet: this.context.wallet,
|
|
63
|
+
initialFundedAccounts: this.context.initialFundedAccounts
|
|
78
64
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}).deployed();
|
|
88
|
-
this.logger.verbose(`Token deployed to ${asset.address}`);
|
|
89
|
-
return {
|
|
90
|
-
tokenContractAddress: asset.address
|
|
91
|
-
};
|
|
92
|
-
}, async ({ tokenContractAddress })=>{
|
|
93
|
-
// Restore the token contract state.
|
|
94
|
-
this.fakeProofsAsset = await TokenContract.at(tokenContractAddress, this.wallet);
|
|
95
|
-
this.logger.verbose(`Token contract address: ${this.fakeProofsAsset.address}`);
|
|
96
|
-
this.tokenSim = new TokenSimulator(this.fakeProofsAsset, this.wallet, this.accounts[0], this.logger, this.accounts);
|
|
97
|
-
expect(await this.fakeProofsAsset.methods.get_admin().simulate({
|
|
98
|
-
from: this.accounts[0]
|
|
99
|
-
})).toBe(this.accounts[0].toBigInt());
|
|
65
|
+
this.deployedAccounts = deployedAccounts;
|
|
66
|
+
this.accounts = deployedAccounts.map((a)=>a.address);
|
|
67
|
+
this.wallet = this.context.wallet;
|
|
68
|
+
this.logger.info('Applying base setup: publicly deploying accounts');
|
|
69
|
+
await publicDeployAccounts(this.wallet, this.accounts.slice(0, 2));
|
|
70
|
+
this.logger.info('Applying base setup: deploying token contract');
|
|
71
|
+
const { contract: asset, instance } = await TokenContract.deploy(this.wallet, this.accounts[0], FullProverTest.TOKEN_NAME, FullProverTest.TOKEN_SYMBOL, FullProverTest.TOKEN_DECIMALS).send({
|
|
72
|
+
from: this.accounts[0]
|
|
100
73
|
});
|
|
74
|
+
this.logger.verbose(`Token deployed to ${asset.address}`);
|
|
75
|
+
this.fakeProofsAsset = asset;
|
|
76
|
+
this.fakeProofsAssetInstance = instance;
|
|
77
|
+
this.logger.verbose(`Token contract address: ${this.fakeProofsAsset.address}`);
|
|
78
|
+
this.tokenSim = new TokenSimulator(this.fakeProofsAsset, this.wallet, this.accounts[0], this.logger, this.accounts);
|
|
79
|
+
expect((await this.fakeProofsAsset.methods.get_admin().simulate({
|
|
80
|
+
from: this.accounts[0]
|
|
81
|
+
})).result).toBe(this.accounts[0].toBigInt());
|
|
101
82
|
}
|
|
102
|
-
async setup() {
|
|
103
|
-
this.
|
|
83
|
+
async setup(opts = {}) {
|
|
84
|
+
this.logger.info('Setting up subsystems from fresh');
|
|
85
|
+
this.context = await setup(0, {
|
|
86
|
+
...opts,
|
|
87
|
+
startProverNode: true,
|
|
88
|
+
coinbase: this.coinbase,
|
|
89
|
+
fundSponsoredFPC: true,
|
|
90
|
+
skipAccountDeployment: true,
|
|
91
|
+
l1ContractsArgs: {
|
|
92
|
+
realVerifier: this.realProofs
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
await this.applyBaseSetup();
|
|
96
|
+
await this.applyMint();
|
|
97
|
+
this.logger.info(`Enabling proving`, {
|
|
98
|
+
realProofs: this.realProofs
|
|
99
|
+
});
|
|
104
100
|
// We don't wish to mark as proven automatically, so we set the flag to false
|
|
105
101
|
this.context.watcher.setIsMarkingAsProven(false);
|
|
106
|
-
this.
|
|
107
|
-
({ aztecNode: this.aztecNode, deployL1ContractsValues: this.l1Contracts, cheatCodes: this.cheatCodes
|
|
108
|
-
this.aztecNodeAdmin = this.context.
|
|
109
|
-
const
|
|
110
|
-
blobSinkUrl: `http://localhost:${this.blobSink.port}`
|
|
111
|
-
});
|
|
102
|
+
this.simulatedProverAztecNode = this.context.proverNode;
|
|
103
|
+
({ aztecNode: this.aztecNode, deployL1ContractsValues: this.l1Contracts, cheatCodes: this.cheatCodes } = this.context);
|
|
104
|
+
this.aztecNodeAdmin = this.context.aztecNodeService;
|
|
105
|
+
const config = this.context.aztecNodeConfig;
|
|
112
106
|
// Configure a full prover PXE
|
|
113
107
|
let acvmConfig;
|
|
114
108
|
let bbConfig;
|
|
@@ -122,11 +116,9 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
122
116
|
}
|
|
123
117
|
this.acvmConfigCleanup = acvmConfig.cleanup;
|
|
124
118
|
this.bbConfigCleanup = bbConfig.cleanup;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
const verifier = await BBCircuitVerifier.new(bbConfig);
|
|
129
|
-
this.circuitProofVerifier = new QueuedIVCVerifier(bbConfig, verifier);
|
|
119
|
+
await Barretenberg.initSingleton({
|
|
120
|
+
backend: BackendType.NativeUnixSocket
|
|
121
|
+
});
|
|
130
122
|
this.logger.debug(`Configuring the node for real proofs...`);
|
|
131
123
|
await this.aztecNodeAdmin.setConfig({
|
|
132
124
|
realProofs: true,
|
|
@@ -134,7 +126,6 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
134
126
|
});
|
|
135
127
|
} else {
|
|
136
128
|
this.logger.debug(`Configuring the node min txs per block ${this.minNumberOfTxsPerBlock}...`);
|
|
137
|
-
this.circuitProofVerifier = new TestCircuitVerifier();
|
|
138
129
|
await this.aztecNodeAdmin.setConfig({
|
|
139
130
|
minTxsPerBlock: this.minNumberOfTxsPerBlock
|
|
140
131
|
});
|
|
@@ -145,17 +136,15 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
145
136
|
await this.context.cheatCodes.rollup.markAsProven();
|
|
146
137
|
this.logger.verbose(`Main setup completed, initializing full prover PXE, Node, and Prover Node`);
|
|
147
138
|
const { wallet: provenWallet, teardown: provenTeardown } = await setupPXEAndGetWallet(this.aztecNode, {
|
|
148
|
-
proverEnabled: this.realProofs
|
|
149
|
-
|
|
150
|
-
bbWorkingDirectory: bbConfig?.bbWorkingDirectory
|
|
151
|
-
}, undefined, true);
|
|
139
|
+
proverEnabled: this.realProofs
|
|
140
|
+
}, undefined, 'pxe-proven');
|
|
152
141
|
this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
|
|
153
|
-
await provenWallet.registerContract(this.
|
|
142
|
+
await provenWallet.registerContract(this.fakeProofsAssetInstance, TokenContract.artifact);
|
|
154
143
|
for(let i = 0; i < 2; i++){
|
|
155
144
|
await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
156
145
|
await this.wallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
157
146
|
}
|
|
158
|
-
const asset =
|
|
147
|
+
const asset = TokenContract.at(this.fakeProofsAsset.address, provenWallet);
|
|
159
148
|
this.provenComponents.push({
|
|
160
149
|
wallet: provenWallet,
|
|
161
150
|
teardown: provenTeardown
|
|
@@ -163,35 +152,30 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
163
152
|
this.provenAsset = asset;
|
|
164
153
|
this.provenWallet = provenWallet;
|
|
165
154
|
this.logger.info(`Full prover PXE started`);
|
|
166
|
-
// Shutdown the current, simulated prover node
|
|
155
|
+
// Shutdown the current, simulated prover node (by stopping its hosting aztec node)
|
|
167
156
|
this.logger.verbose('Shutting down simulated prover node');
|
|
168
|
-
await this.
|
|
169
|
-
// Creating temp store and archiver for fully proven prover node
|
|
170
|
-
this.logger.verbose('Starting archiver for new prover node');
|
|
171
|
-
const archiver = await createArchiver({
|
|
172
|
-
...this.context.aztecNodeConfig,
|
|
173
|
-
dataDirectory: undefined
|
|
174
|
-
}, {
|
|
175
|
-
blobSinkClient
|
|
176
|
-
}, {
|
|
177
|
-
blockUntilSync: true
|
|
178
|
-
});
|
|
157
|
+
await this.simulatedProverAztecNode.stop();
|
|
179
158
|
// The simulated prover node (now shutdown) used private key index 2
|
|
180
159
|
const proverNodePrivateKey = getPrivateKeyFromIndex(2);
|
|
160
|
+
const proverNodePrivateKeyHex = `0x${proverNodePrivateKey.toString('hex')}`;
|
|
181
161
|
const proverNodeSenderAddress = privateKeyToAddress(new Buffer32(proverNodePrivateKey).toString());
|
|
182
162
|
this.proverAddress = EthAddress.fromString(proverNodeSenderAddress);
|
|
183
163
|
this.logger.verbose(`Funding prover node at ${proverNodeSenderAddress}`);
|
|
184
164
|
await this.mintFeeJuice(proverNodeSenderAddress);
|
|
185
165
|
this.logger.verbose('Starting prover node');
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
166
|
+
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
167
|
+
const { genesis } = await getGenesisValues(this.context.initialFundedAccounts.map((a)=>a.address).concat(sponsoredFPCAddress), undefined, undefined, this.context.genesis.genesisTimestamp);
|
|
168
|
+
const proverNodeConfig = {
|
|
169
|
+
...config,
|
|
170
|
+
enableProverNode: true,
|
|
171
|
+
disableValidator: true,
|
|
189
172
|
dataDirectory: undefined,
|
|
173
|
+
txCollectionNodeRpcUrls: [],
|
|
190
174
|
proverId: this.proverAddress,
|
|
191
175
|
realProofs: this.realProofs,
|
|
192
176
|
proverAgentCount: 2,
|
|
193
|
-
|
|
194
|
-
new SecretValue(
|
|
177
|
+
proverPublisherPrivateKeys: [
|
|
178
|
+
new SecretValue(proverNodePrivateKeyHex)
|
|
195
179
|
],
|
|
196
180
|
proverNodeMaxPendingJobs: 100,
|
|
197
181
|
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
@@ -201,19 +185,22 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
201
185
|
txGatheringMaxParallelRequestsPerNode: 100,
|
|
202
186
|
txGatheringTimeoutMs: 24_000,
|
|
203
187
|
proverNodeFailedEpochStore: undefined,
|
|
204
|
-
proverNodeEpochProvingDelayMs: undefined
|
|
188
|
+
proverNodeEpochProvingDelayMs: undefined,
|
|
189
|
+
validatorPrivateKeys: new SecretValue([])
|
|
205
190
|
};
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
191
|
+
this.proverAztecNode = await AztecNodeService.createAndSync(proverNodeConfig, {
|
|
192
|
+
dateProvider: this.context.dateProvider,
|
|
193
|
+
p2pClientDeps: {
|
|
194
|
+
rpcTxProviders: [
|
|
195
|
+
this.aztecNode
|
|
196
|
+
]
|
|
197
|
+
}
|
|
212
198
|
}, {
|
|
213
|
-
|
|
199
|
+
genesis
|
|
200
|
+
});
|
|
201
|
+
this.logger.warn(`Proofs are now enabled`, {
|
|
202
|
+
realProofs: this.realProofs
|
|
214
203
|
});
|
|
215
|
-
await this.proverNode.start();
|
|
216
|
-
this.logger.warn(`Proofs are now enabled`);
|
|
217
204
|
return this;
|
|
218
205
|
}
|
|
219
206
|
async mintFeeJuice(recipient) {
|
|
@@ -232,55 +219,49 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
232
219
|
hash
|
|
233
220
|
});
|
|
234
221
|
}
|
|
235
|
-
snapshot;
|
|
236
222
|
async teardown() {
|
|
237
|
-
await this.snapshotManager.teardown();
|
|
238
223
|
// Cleanup related to the full prover PXEs
|
|
239
224
|
for(let i = 0; i < this.provenComponents.length; i++){
|
|
240
225
|
await this.provenComponents[i].teardown();
|
|
241
226
|
}
|
|
242
|
-
// clean up the full prover node
|
|
243
|
-
await this.
|
|
227
|
+
// clean up the full prover node (by stopping its hosting aztec node)
|
|
228
|
+
await this.proverAztecNode.stop();
|
|
229
|
+
await Barretenberg.destroySingleton();
|
|
244
230
|
await this.bbConfigCleanup?.();
|
|
245
231
|
await this.acvmConfigCleanup?.();
|
|
232
|
+
await teardown(this.context);
|
|
246
233
|
}
|
|
247
|
-
async
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
|
|
277
|
-
expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(address));
|
|
278
|
-
const totalSupply = await asset.methods.total_supply().simulate({
|
|
279
|
-
from: address
|
|
280
|
-
});
|
|
281
|
-
this.logger.verbose(`Total supply: ${totalSupply}`);
|
|
282
|
-
expect(totalSupply).toEqual(tokenSim.totalSupply);
|
|
283
|
-
return Promise.resolve();
|
|
234
|
+
async applyMint() {
|
|
235
|
+
this.logger.info('Applying mint setup');
|
|
236
|
+
const { fakeProofsAsset: asset, accounts } = this;
|
|
237
|
+
const privateAmount = 10000n;
|
|
238
|
+
const publicAmount = 10000n;
|
|
239
|
+
this.logger.verbose(`Minting ${privateAmount + publicAmount} publicly...`);
|
|
240
|
+
await asset.methods.mint_to_public(accounts[0], privateAmount + publicAmount).send({
|
|
241
|
+
from: accounts[0]
|
|
242
|
+
});
|
|
243
|
+
this.logger.verbose(`Transferring ${privateAmount} to private...`);
|
|
244
|
+
await asset.methods.transfer_to_private(accounts[0], privateAmount).send({
|
|
245
|
+
from: accounts[0]
|
|
246
|
+
});
|
|
247
|
+
this.logger.info(`Minting complete`);
|
|
248
|
+
const { fakeProofsAsset, accounts: [address], tokenSim } = this;
|
|
249
|
+
tokenSim.mintPublic(address, publicAmount);
|
|
250
|
+
const { result: publicBalance } = await fakeProofsAsset.methods.balance_of_public(address).simulate({
|
|
251
|
+
from: address
|
|
252
|
+
});
|
|
253
|
+
this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
|
|
254
|
+
expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(address));
|
|
255
|
+
tokenSim.mintPrivate(address, publicAmount);
|
|
256
|
+
const { result: privateBalance } = await fakeProofsAsset.methods.balance_of_private(address).simulate({
|
|
257
|
+
from: address
|
|
258
|
+
});
|
|
259
|
+
this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
|
|
260
|
+
expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(address));
|
|
261
|
+
const { result: totalSupply } = await fakeProofsAsset.methods.total_supply().simulate({
|
|
262
|
+
from: address
|
|
284
263
|
});
|
|
264
|
+
this.logger.verbose(`Total supply: ${totalSupply}`);
|
|
265
|
+
expect(totalSupply).toEqual(tokenSim.totalSupply);
|
|
285
266
|
}
|
|
286
267
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Samples event-loop utilization, delay histogram, and heap usage per test, writing columnar text to a file. */
|
|
2
|
+
export declare class EluMonitor {
|
|
3
|
+
private filePath;
|
|
4
|
+
private intervalMs;
|
|
5
|
+
private timer;
|
|
6
|
+
private lastELU;
|
|
7
|
+
private histogram;
|
|
8
|
+
private testName;
|
|
9
|
+
private testStart;
|
|
10
|
+
private eluSamples;
|
|
11
|
+
constructor(filePath: string, intervalMs?: number);
|
|
12
|
+
/** Begin sampling for a test. Writes a header line and starts the periodic sampler. */
|
|
13
|
+
startTest(testName: string): void;
|
|
14
|
+
/** Stop sampling and write a summary line. */
|
|
15
|
+
stopTest(): void;
|
|
16
|
+
/** Alias for stopTest — call on process exit to flush any remaining data. */
|
|
17
|
+
stop(): void;
|
|
18
|
+
private sample;
|
|
19
|
+
private writeSummary;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWx1X21vbml0b3IuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maXh0dXJlcy9lbHVfbW9uaXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLQSxpSEFBaUg7QUFDakgscUJBQWEsVUFBVTtJQUNyQixPQUFPLENBQUMsUUFBUSxDQUFTO0lBQ3pCLE9BQU8sQ0FBQyxVQUFVLENBQVM7SUFDM0IsT0FBTyxDQUFDLEtBQUssQ0FBNkM7SUFDMUQsT0FBTyxDQUFDLE9BQU8sQ0FBbUM7SUFDbEQsT0FBTyxDQUFDLFNBQVMsQ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|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { appendFileSync } from 'node:fs';
|
|
2
|
+
import { monitorEventLoopDelay, performance } from 'node:perf_hooks';
|
|
3
|
+
const NANOS_PER_MS = 1_000_000;
|
|
4
|
+
/** Samples event-loop utilization, delay histogram, and heap usage per test, writing columnar text to a file. */ export class EluMonitor {
|
|
5
|
+
filePath;
|
|
6
|
+
intervalMs;
|
|
7
|
+
timer;
|
|
8
|
+
lastELU;
|
|
9
|
+
histogram;
|
|
10
|
+
testName;
|
|
11
|
+
testStart;
|
|
12
|
+
eluSamples = [];
|
|
13
|
+
constructor(filePath, intervalMs){
|
|
14
|
+
this.filePath = filePath;
|
|
15
|
+
this.intervalMs = intervalMs ?? 2000;
|
|
16
|
+
this.histogram = monitorEventLoopDelay({
|
|
17
|
+
resolution: 20
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/** Begin sampling for a test. Writes a header line and starts the periodic sampler. */ startTest(testName) {
|
|
21
|
+
this.stopTest();
|
|
22
|
+
this.testName = testName;
|
|
23
|
+
this.testStart = performance.now();
|
|
24
|
+
this.eluSamples = [];
|
|
25
|
+
appendFileSync(this.filePath, `\n=== Test: ${testName} ===\n`);
|
|
26
|
+
appendFileSync(this.filePath, padColumns('TIME', 'ELU', 'EL_DLY_P50', 'EL_DLY_P99', 'EL_DLY_MAX', 'HEAP_MB') + '\n');
|
|
27
|
+
this.lastELU = performance.eventLoopUtilization();
|
|
28
|
+
this.histogram.enable();
|
|
29
|
+
this.timer = setInterval(()=>this.sample(), this.intervalMs);
|
|
30
|
+
// Allow the process to exit even if the timer is still running.
|
|
31
|
+
this.timer.unref();
|
|
32
|
+
}
|
|
33
|
+
/** Stop sampling and write a summary line. */ stopTest() {
|
|
34
|
+
if (!this.timer) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
// Take a final sample before stopping.
|
|
38
|
+
this.sample();
|
|
39
|
+
clearInterval(this.timer);
|
|
40
|
+
this.timer = undefined;
|
|
41
|
+
this.histogram.disable();
|
|
42
|
+
this.histogram.reset();
|
|
43
|
+
this.writeSummary();
|
|
44
|
+
this.lastELU = undefined;
|
|
45
|
+
this.testName = undefined;
|
|
46
|
+
this.testStart = undefined;
|
|
47
|
+
this.eluSamples = [];
|
|
48
|
+
}
|
|
49
|
+
/** Alias for stopTest — call on process exit to flush any remaining data. */ stop() {
|
|
50
|
+
this.stopTest();
|
|
51
|
+
}
|
|
52
|
+
sample() {
|
|
53
|
+
const newELU = performance.eventLoopUtilization();
|
|
54
|
+
const delta = performance.eventLoopUtilization(newELU, this.lastELU);
|
|
55
|
+
this.lastELU = newELU;
|
|
56
|
+
const elu = delta.utilization;
|
|
57
|
+
this.eluSamples.push(elu);
|
|
58
|
+
const p50 = this.histogram.percentile(50) / NANOS_PER_MS;
|
|
59
|
+
const p99 = this.histogram.percentile(99) / NANOS_PER_MS;
|
|
60
|
+
const max = this.histogram.max / NANOS_PER_MS;
|
|
61
|
+
const heapMb = Math.round(process.memoryUsage().heapUsed / (1024 * 1024));
|
|
62
|
+
const now = new Date();
|
|
63
|
+
const time = [
|
|
64
|
+
now.getHours(),
|
|
65
|
+
now.getMinutes(),
|
|
66
|
+
now.getSeconds()
|
|
67
|
+
].map((n)=>String(n).padStart(2, '0')).join(':');
|
|
68
|
+
const line = padColumns(time, elu.toFixed(2), `${p50.toFixed(1)}ms`, `${p99.toFixed(1)}ms`, `${max.toFixed(1)}ms`, String(heapMb));
|
|
69
|
+
appendFileSync(this.filePath, line + '\n');
|
|
70
|
+
// Reset histogram so next sample only reflects the new interval.
|
|
71
|
+
this.histogram.reset();
|
|
72
|
+
}
|
|
73
|
+
writeSummary() {
|
|
74
|
+
if (this.eluSamples.length === 0 || this.testStart === undefined) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const mean = this.eluSamples.reduce((a, b)=>a + b, 0) / this.eluSamples.length;
|
|
78
|
+
const maxElu = Math.max(...this.eluSamples);
|
|
79
|
+
const sorted = [
|
|
80
|
+
...this.eluSamples
|
|
81
|
+
].sort((a, b)=>a - b);
|
|
82
|
+
const p90Elu = sorted[Math.floor(sorted.length * 0.9)] ?? maxElu;
|
|
83
|
+
const durationS = ((performance.now() - this.testStart) / 1000).toFixed(1);
|
|
84
|
+
let summary = `--- Summary: mean_elu=${mean.toFixed(2)} max_elu=${maxElu.toFixed(2)} p90_elu=${p90Elu.toFixed(2)} duration=${durationS}s`;
|
|
85
|
+
if (maxElu > 0.85) {
|
|
86
|
+
summary += ' WARNING:ELU>0.85';
|
|
87
|
+
}
|
|
88
|
+
summary += ' ---\n';
|
|
89
|
+
appendFileSync(this.filePath, summary);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function padColumns(...cols) {
|
|
93
|
+
const widths = [
|
|
94
|
+
11,
|
|
95
|
+
7,
|
|
96
|
+
12,
|
|
97
|
+
12,
|
|
98
|
+
12,
|
|
99
|
+
8
|
|
100
|
+
];
|
|
101
|
+
return cols.map((col, i)=>col.padEnd(widths[i] ?? 10)).join('');
|
|
102
|
+
}
|