@aztec/end-to-end 0.0.0-test.1 → 0.0.1-commit.1142ef1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/bench/client_flows/benchmark.d.ts +61 -0
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -0
- package/dest/bench/client_flows/benchmark.js +261 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +80 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -0
- package/dest/bench/client_flows/client_flows_benchmark.js +336 -0
- package/dest/bench/client_flows/config.d.ts +14 -0
- package/dest/bench/client_flows/config.d.ts.map +1 -0
- package/dest/bench/client_flows/config.js +106 -0
- package/dest/bench/client_flows/data_extractor.d.ts +2 -0
- package/dest/bench/client_flows/data_extractor.d.ts.map +1 -0
- package/dest/bench/client_flows/data_extractor.js +79 -0
- package/dest/bench/utils.d.ts +14 -40
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +37 -70
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +21 -13
- 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 +85 -57
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +29 -28
- 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 +79 -82
- package/dest/e2e_deploy_contract/deploy_test.d.ts +16 -8
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +13 -19
- package/dest/e2e_epochs/epochs_test.d.ts +65 -22
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +233 -49
- package/dest/e2e_fees/bridging_race.notest.d.ts +2 -0
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +1 -0
- package/dest/e2e_fees/bridging_race.notest.js +63 -0
- package/dest/e2e_fees/fees_test.d.ts +27 -12
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +107 -110
- package/dest/e2e_l1_publisher/write_json.d.ts +10 -0
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -0
- package/dest/e2e_l1_publisher/write_json.js +55 -0
- package/dest/e2e_multi_validator/utils.d.ts +12 -0
- package/dest/e2e_multi_validator/utils.d.ts.map +1 -0
- package/dest/e2e_multi_validator/utils.js +214 -0
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +10 -7
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +24 -20
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +31 -0
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -0
- package/dest/e2e_p2p/inactivity_slash_test.js +136 -0
- package/dest/e2e_p2p/p2p_network.d.ts +276 -23
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +188 -133
- package/dest/e2e_p2p/shared.d.ts +43 -7
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +164 -19
- package/dest/e2e_token_contract/token_contract_test.d.ts +12 -6
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +50 -26
- package/dest/fixtures/e2e_prover_test.d.ts +61 -0
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -0
- package/dest/{e2e_prover → fixtures}/e2e_prover_test.js +108 -113
- package/dest/fixtures/fixtures.d.ts +6 -8
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +5 -5
- package/dest/fixtures/get_acvm_config.d.ts +2 -2
- package/dest/fixtures/get_acvm_config.d.ts.map +1 -1
- package/dest/fixtures/get_acvm_config.js +3 -15
- package/dest/fixtures/get_bb_config.d.ts +2 -2
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +10 -17
- package/dest/fixtures/index.d.ts +1 -1
- package/dest/fixtures/l1_to_l2_messaging.d.ts +11 -7
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +45 -19
- package/dest/fixtures/logging.d.ts +1 -1
- package/dest/fixtures/setup_p2p_test.d.ts +15 -14
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +82 -22
- package/dest/fixtures/snapshot_manager.d.ts +20 -14
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +147 -138
- package/dest/fixtures/token_utils.d.ts +10 -4
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +28 -12
- package/dest/fixtures/utils.d.ts +92 -54
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +452 -389
- package/dest/fixtures/web3signer.d.ts +5 -0
- package/dest/fixtures/web3signer.d.ts.map +1 -0
- package/dest/fixtures/web3signer.js +53 -0
- package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
- package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
- package/dest/fixtures/with_telemetry_utils.js +2 -2
- package/dest/index.d.ts +1 -1
- package/dest/quality_of_service/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/shared/cross_chain_test_harness.d.ts +42 -35
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +106 -52
- package/dest/shared/gas_portal_test_harness.d.ts +29 -31
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +51 -30
- package/dest/shared/index.d.ts +2 -2
- package/dest/shared/index.d.ts.map +1 -1
- package/dest/shared/jest_setup.d.ts +1 -1
- package/dest/shared/jest_setup.js +1 -1
- package/dest/shared/submit-transactions.d.ts +6 -4
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +8 -7
- package/dest/shared/uniswap_l1_l2.d.ts +3 -25
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +170 -120
- package/dest/simulators/index.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts +7 -11
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +16 -17
- package/dest/simulators/token_simulator.d.ts +6 -3
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +16 -13
- package/dest/spartan/setup_test_wallets.d.ts +27 -11
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +202 -58
- package/dest/spartan/tx_metrics.d.ts +39 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +95 -0
- package/dest/spartan/utils.d.ts +151 -313
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +598 -151
- package/package.json +65 -58
- package/src/bench/client_flows/benchmark.ts +341 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +450 -0
- package/src/bench/client_flows/config.ts +61 -0
- package/src/bench/client_flows/data_extractor.ts +89 -0
- package/src/bench/utils.ts +35 -81
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +80 -77
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +103 -122
- package/src/e2e_deploy_contract/deploy_test.ts +24 -39
- package/src/e2e_epochs/epochs_test.ts +299 -65
- package/src/e2e_fees/bridging_race.notest.ts +80 -0
- package/src/e2e_fees/fees_test.ts +150 -142
- package/src/e2e_l1_publisher/write_json.ts +74 -0
- package/src/e2e_multi_validator/utils.ts +258 -0
- package/src/e2e_nested_contract/nested_contract_test.ts +29 -19
- package/src/e2e_p2p/inactivity_slash_test.ts +179 -0
- package/src/e2e_p2p/p2p_network.ts +274 -171
- package/src/e2e_p2p/shared.ts +252 -29
- package/src/e2e_token_contract/token_contract_test.ts +43 -39
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/{e2e_prover → fixtures}/e2e_prover_test.ts +112 -160
- package/src/fixtures/fixtures.ts +5 -7
- package/src/fixtures/get_acvm_config.ts +4 -12
- package/src/fixtures/get_bb_config.ts +18 -13
- package/src/fixtures/l1_to_l2_messaging.ts +56 -24
- package/src/fixtures/setup_p2p_test.ts +127 -39
- package/src/fixtures/snapshot_manager.ts +189 -160
- package/src/fixtures/token_utils.ts +32 -15
- package/src/fixtures/utils.ts +556 -475
- package/src/fixtures/web3signer.ts +63 -0
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/guides/up_quick_start.sh +7 -15
- package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +2 -2
- package/src/shared/cross_chain_test_harness.ts +113 -87
- package/src/shared/gas_portal_test_harness.ts +59 -50
- package/src/shared/index.ts +1 -1
- package/src/shared/jest_setup.ts +1 -1
- package/src/shared/submit-transactions.ts +12 -8
- package/src/shared/uniswap_l1_l2.ts +194 -211
- package/src/simulators/lending_simulator.ts +15 -16
- package/src/simulators/token_simulator.ts +21 -13
- package/src/spartan/DEVELOP.md +128 -0
- package/src/spartan/setup_test_wallets.ts +258 -93
- package/src/spartan/tx_metrics.ts +130 -0
- package/src/spartan/utils.ts +722 -146
- package/dest/e2e_prover/e2e_prover_test.d.ts +0 -56
- package/dest/e2e_prover/e2e_prover_test.d.ts.map +0 -1
- 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/quality_of_service/alert_checker.d.ts +0 -41
- package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
- package/dest/sample-dapp/connect.js +0 -12
- package/dest/sample-dapp/contracts.js +0 -10
- package/dest/sample-dapp/deploy.js +0 -35
- package/dest/sample-dapp/index.js +0 -98
- package/src/fixtures/setup_l1_contracts.ts +0 -27
- package/src/sample-dapp/connect.mjs +0 -16
- package/src/sample-dapp/contracts.mjs +0 -14
- package/src/sample-dapp/deploy.mjs +0 -40
- package/src/sample-dapp/index.mjs +0 -128
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { SchnorrAccountContractArtifact, getSchnorrAccount, getSchnorrWalletWithSecretKey } from '@aztec/accounts/schnorr';
|
|
2
1
|
import { createArchiver } from '@aztec/archiver';
|
|
3
|
-
import { EthAddress
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
+
import { createLogger } from '@aztec/aztec.js/log';
|
|
4
|
+
import { BBCircuitVerifier, QueuedIVCVerifier, TestCircuitVerifier } from '@aztec/bb-prover';
|
|
5
|
+
import { BackendType, Barretenberg } from '@aztec/bb.js';
|
|
6
|
+
import { createBlobClientWithFileStores } from '@aztec/blob-client/client';
|
|
6
7
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
7
|
-
import {
|
|
8
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
9
|
+
import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
|
|
8
10
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
9
11
|
import { createProverNode } from '@aztec/prover-node';
|
|
10
12
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
11
13
|
import { getContract } from 'viem';
|
|
12
14
|
import { privateKeyToAddress } from 'viem/accounts';
|
|
13
|
-
import { getACVMConfig } from '../fixtures/get_acvm_config.js';
|
|
14
|
-
import { getBBConfig } from '../fixtures/get_bb_config.js';
|
|
15
|
-
import { createSnapshotManager, deployAccounts, publicDeployAccounts } from '../fixtures/snapshot_manager.js';
|
|
16
|
-
import { getPrivateKeyFromIndex, setupPXEService } from '../fixtures/utils.js';
|
|
17
15
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
16
|
+
import { getACVMConfig } from './get_acvm_config.js';
|
|
17
|
+
import { getBBConfig } from './get_bb_config.js';
|
|
18
|
+
import { createSnapshotManager, deployAccounts, publicDeployAccounts } from './snapshot_manager.js';
|
|
19
|
+
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEAndGetWallet } from './utils.js';
|
|
18
20
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
19
21
|
/**
|
|
20
22
|
* Largely taken from the e2e_token_contract test file. We deploy 2 accounts and a token contract.
|
|
@@ -29,20 +31,21 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
29
31
|
static TOKEN_DECIMALS = 18n;
|
|
30
32
|
snapshotManager;
|
|
31
33
|
logger;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
wallet;
|
|
35
|
+
provenWallet;
|
|
34
36
|
accounts;
|
|
37
|
+
deployedAccounts;
|
|
35
38
|
fakeProofsAsset;
|
|
39
|
+
fakeProofsAssetInstance;
|
|
36
40
|
tokenSim;
|
|
37
41
|
aztecNode;
|
|
38
|
-
|
|
42
|
+
aztecNodeAdmin;
|
|
39
43
|
cheatCodes;
|
|
40
|
-
blobSink;
|
|
41
44
|
provenComponents;
|
|
42
45
|
bbConfigCleanup;
|
|
43
46
|
acvmConfigCleanup;
|
|
44
47
|
circuitProofVerifier;
|
|
45
|
-
|
|
48
|
+
provenAsset;
|
|
46
49
|
context;
|
|
47
50
|
proverNode;
|
|
48
51
|
simulatedProverNode;
|
|
@@ -51,47 +54,51 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
51
54
|
constructor(testName, minNumberOfTxsPerBlock, coinbase, realProofs = true){
|
|
52
55
|
this.minNumberOfTxsPerBlock = minNumberOfTxsPerBlock;
|
|
53
56
|
this.realProofs = realProofs;
|
|
54
|
-
this.deployedAccounts = [];
|
|
55
|
-
this.wallets = [];
|
|
56
57
|
this.accounts = [];
|
|
57
58
|
this.provenComponents = [];
|
|
58
|
-
this.provenAssets = [];
|
|
59
59
|
this.snapshot = (name, apply, restore = ()=>Promise.resolve())=>this.snapshotManager.snapshot(name, apply, restore);
|
|
60
60
|
this.logger = createLogger(`e2e:full_prover_test:${testName}`);
|
|
61
61
|
this.snapshotManager = createSnapshotManager(`full_prover_integration/${testName}`, dataPath, {
|
|
62
62
|
startProverNode: true,
|
|
63
|
-
fundRewardDistributor: true,
|
|
64
63
|
coinbase
|
|
65
|
-
}, {
|
|
64
|
+
}, {
|
|
65
|
+
realVerifier: realProofs
|
|
66
|
+
});
|
|
66
67
|
}
|
|
67
68
|
/**
|
|
68
69
|
* Adds two state shifts to snapshot manager.
|
|
69
70
|
* 1. Add 2 accounts.
|
|
70
71
|
* 2. Publicly deploy accounts, deploy token contract
|
|
71
72
|
*/ async applyBaseSnapshots() {
|
|
72
|
-
await this.snapshotManager.snapshot('2_accounts', deployAccounts(2, this.logger),
|
|
73
|
+
await this.snapshotManager.snapshot('2_accounts', deployAccounts(2, this.logger), ({ deployedAccounts }, { wallet })=>{
|
|
73
74
|
this.deployedAccounts = deployedAccounts;
|
|
74
|
-
this.
|
|
75
|
-
this.
|
|
76
|
-
|
|
75
|
+
this.accounts = deployedAccounts.map((a)=>a.address);
|
|
76
|
+
this.wallet = wallet;
|
|
77
|
+
return Promise.resolve();
|
|
77
78
|
});
|
|
78
79
|
await this.snapshotManager.snapshot('client_prover_integration', async ()=>{
|
|
79
80
|
// Create the token contract state.
|
|
80
81
|
// Move this account thing to addAccounts above?
|
|
81
82
|
this.logger.verbose(`Public deploy accounts...`);
|
|
82
|
-
await publicDeployAccounts(this.
|
|
83
|
+
await publicDeployAccounts(this.wallet, this.accounts.slice(0, 2));
|
|
83
84
|
this.logger.verbose(`Deploying TokenContract...`);
|
|
84
|
-
const asset = await TokenContract.deploy(this.
|
|
85
|
+
const { contract: asset, instance } = await TokenContract.deploy(this.wallet, this.accounts[0], FullProverTest.TOKEN_NAME, FullProverTest.TOKEN_SYMBOL, FullProverTest.TOKEN_DECIMALS).send({
|
|
86
|
+
from: this.accounts[0]
|
|
87
|
+
}).wait();
|
|
85
88
|
this.logger.verbose(`Token deployed to ${asset.address}`);
|
|
86
89
|
return {
|
|
87
|
-
tokenContractAddress: asset.address
|
|
90
|
+
tokenContractAddress: asset.address,
|
|
91
|
+
tokenContractInstance: instance
|
|
88
92
|
};
|
|
89
|
-
}, async ({ tokenContractAddress })=>{
|
|
93
|
+
}, async ({ tokenContractAddress, tokenContractInstance })=>{
|
|
90
94
|
// Restore the token contract state.
|
|
91
|
-
this.fakeProofsAsset =
|
|
95
|
+
this.fakeProofsAsset = TokenContract.at(tokenContractAddress, this.wallet);
|
|
96
|
+
this.fakeProofsAssetInstance = tokenContractInstance;
|
|
92
97
|
this.logger.verbose(`Token contract address: ${this.fakeProofsAsset.address}`);
|
|
93
|
-
this.tokenSim = new TokenSimulator(this.fakeProofsAsset, this.
|
|
94
|
-
expect(await this.fakeProofsAsset.methods.get_admin().simulate(
|
|
98
|
+
this.tokenSim = new TokenSimulator(this.fakeProofsAsset, this.wallet, this.accounts[0], this.logger, this.accounts);
|
|
99
|
+
expect(await this.fakeProofsAsset.methods.get_admin().simulate({
|
|
100
|
+
from: this.accounts[0]
|
|
101
|
+
})).toBe(this.accounts[0].toBigInt());
|
|
95
102
|
});
|
|
96
103
|
}
|
|
97
104
|
async setup() {
|
|
@@ -99,10 +106,10 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
99
106
|
// We don't wish to mark as proven automatically, so we set the flag to false
|
|
100
107
|
this.context.watcher.setIsMarkingAsProven(false);
|
|
101
108
|
this.simulatedProverNode = this.context.proverNode;
|
|
102
|
-
({
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
109
|
+
({ aztecNode: this.aztecNode, deployL1ContractsValues: this.l1Contracts, cheatCodes: this.cheatCodes } = this.context);
|
|
110
|
+
this.aztecNodeAdmin = this.context.aztecNode;
|
|
111
|
+
const config = this.context.aztecNodeConfig;
|
|
112
|
+
const blobClient = await createBlobClientWithFileStores(config, this.logger);
|
|
106
113
|
// Configure a full prover PXE
|
|
107
114
|
let acvmConfig;
|
|
108
115
|
let bbConfig;
|
|
@@ -116,19 +123,20 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
116
123
|
}
|
|
117
124
|
this.acvmConfigCleanup = acvmConfig.cleanup;
|
|
118
125
|
this.bbConfigCleanup = bbConfig.cleanup;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
126
|
+
await Barretenberg.initSingleton({
|
|
127
|
+
backend: BackendType.NativeUnixSocket
|
|
128
|
+
});
|
|
129
|
+
const verifier = await BBCircuitVerifier.new(bbConfig);
|
|
130
|
+
this.circuitProofVerifier = new QueuedIVCVerifier(bbConfig, verifier);
|
|
123
131
|
this.logger.debug(`Configuring the node for real proofs...`);
|
|
124
|
-
await this.
|
|
132
|
+
await this.aztecNodeAdmin.setConfig({
|
|
125
133
|
realProofs: true,
|
|
126
134
|
minTxsPerBlock: this.minNumberOfTxsPerBlock
|
|
127
135
|
});
|
|
128
136
|
} else {
|
|
129
137
|
this.logger.debug(`Configuring the node min txs per block ${this.minNumberOfTxsPerBlock}...`);
|
|
130
138
|
this.circuitProofVerifier = new TestCircuitVerifier();
|
|
131
|
-
await this.
|
|
139
|
+
await this.aztecNodeAdmin.setConfig({
|
|
132
140
|
minTxsPerBlock: this.minNumberOfTxsPerBlock
|
|
133
141
|
});
|
|
134
142
|
}
|
|
@@ -137,31 +145,22 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
137
145
|
this.logger.verbose(`Marking current block as proven`);
|
|
138
146
|
await this.context.cheatCodes.rollup.markAsProven();
|
|
139
147
|
this.logger.verbose(`Main setup completed, initializing full prover PXE, Node, and Prover Node`);
|
|
148
|
+
const { wallet: provenWallet, teardown: provenTeardown } = await setupPXEAndGetWallet(this.aztecNode, {
|
|
149
|
+
proverEnabled: this.realProofs
|
|
150
|
+
}, undefined, true);
|
|
151
|
+
this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
|
|
152
|
+
await provenWallet.registerContract(this.fakeProofsAssetInstance, TokenContract.artifact);
|
|
140
153
|
for(let i = 0; i < 2; i++){
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
bbBinaryPath: bbConfig?.bbBinaryPath,
|
|
144
|
-
bbWorkingDirectory: bbConfig?.bbWorkingDirectory
|
|
145
|
-
}, undefined, true);
|
|
146
|
-
this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
|
|
147
|
-
await result.pxe.registerContract(this.fakeProofsAsset);
|
|
148
|
-
for(let i = 0; i < 2; i++){
|
|
149
|
-
await result.pxe.registerAccount(this.deployedAccounts[i].secret, this.wallets[i].getCompleteAddress().partialAddress);
|
|
150
|
-
await this.pxe.registerAccount(this.deployedAccounts[i].secret, this.wallets[i].getCompleteAddress().partialAddress);
|
|
151
|
-
}
|
|
152
|
-
const account = await getSchnorrAccount(result.pxe, this.deployedAccounts[0].secret, this.deployedAccounts[0].signingKey, this.deployedAccounts[0].salt);
|
|
153
|
-
await result.pxe.registerContract({
|
|
154
|
-
instance: account.getInstance(),
|
|
155
|
-
artifact: SchnorrAccountContractArtifact
|
|
156
|
-
});
|
|
157
|
-
const provenWallet = await account.getWallet();
|
|
158
|
-
const asset = await TokenContract.at(this.fakeProofsAsset.address, provenWallet);
|
|
159
|
-
this.provenComponents.push({
|
|
160
|
-
pxe: result.pxe,
|
|
161
|
-
teardown: result.teardown
|
|
162
|
-
});
|
|
163
|
-
this.provenAssets.push(asset);
|
|
154
|
+
await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
155
|
+
await this.wallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
164
156
|
}
|
|
157
|
+
const asset = TokenContract.at(this.fakeProofsAsset.address, provenWallet);
|
|
158
|
+
this.provenComponents.push({
|
|
159
|
+
wallet: provenWallet,
|
|
160
|
+
teardown: provenTeardown
|
|
161
|
+
});
|
|
162
|
+
this.provenAsset = asset;
|
|
163
|
+
this.provenWallet = provenWallet;
|
|
165
164
|
this.logger.info(`Full prover PXE started`);
|
|
166
165
|
// Shutdown the current, simulated prover node
|
|
167
166
|
this.logger.verbose('Shutting down simulated prover node');
|
|
@@ -171,7 +170,10 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
171
170
|
const archiver = await createArchiver({
|
|
172
171
|
...this.context.aztecNodeConfig,
|
|
173
172
|
dataDirectory: undefined
|
|
174
|
-
},
|
|
173
|
+
}, {
|
|
174
|
+
blobClient,
|
|
175
|
+
dateProvider: this.context.dateProvider
|
|
176
|
+
}, {
|
|
175
177
|
blockUntilSync: true
|
|
176
178
|
});
|
|
177
179
|
// The simulated prover node (now shutdown) used private key index 2
|
|
@@ -179,48 +181,53 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
179
181
|
const proverNodeSenderAddress = privateKeyToAddress(new Buffer32(proverNodePrivateKey).toString());
|
|
180
182
|
this.proverAddress = EthAddress.fromString(proverNodeSenderAddress);
|
|
181
183
|
this.logger.verbose(`Funding prover node at ${proverNodeSenderAddress}`);
|
|
182
|
-
await this.
|
|
184
|
+
await this.mintFeeJuice(proverNodeSenderAddress);
|
|
183
185
|
this.logger.verbose('Starting prover node');
|
|
184
186
|
const proverConfig = {
|
|
185
187
|
...this.context.aztecNodeConfig,
|
|
186
|
-
|
|
188
|
+
txCollectionNodeRpcUrls: [],
|
|
187
189
|
dataDirectory: undefined,
|
|
188
|
-
proverId: this.proverAddress
|
|
190
|
+
proverId: this.proverAddress,
|
|
189
191
|
realProofs: this.realProofs,
|
|
190
192
|
proverAgentCount: 2,
|
|
191
|
-
|
|
193
|
+
publisherPrivateKeys: [
|
|
194
|
+
new SecretValue(`0x${proverNodePrivateKey.toString('hex')}`)
|
|
195
|
+
],
|
|
192
196
|
proverNodeMaxPendingJobs: 100,
|
|
193
197
|
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
194
198
|
proverNodePollingIntervalMs: 100,
|
|
195
|
-
txGatheringTimeoutMs: 60000,
|
|
196
199
|
txGatheringIntervalMs: 1000,
|
|
197
|
-
|
|
200
|
+
txGatheringBatchSize: 10,
|
|
201
|
+
txGatheringMaxParallelRequestsPerNode: 100,
|
|
202
|
+
txGatheringTimeoutMs: 24_000,
|
|
203
|
+
proverNodeFailedEpochStore: undefined,
|
|
204
|
+
proverNodeEpochProvingDelayMs: undefined
|
|
198
205
|
};
|
|
199
|
-
const
|
|
206
|
+
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
207
|
+
const { prefilledPublicData } = await getGenesisValues(this.context.initialFundedAccounts.map((a)=>a.address).concat(sponsoredFPCAddress));
|
|
200
208
|
this.proverNode = await createProverNode(proverConfig, {
|
|
201
209
|
aztecNodeTxProvider: this.aztecNode,
|
|
202
|
-
archiver: archiver
|
|
203
|
-
blobSinkClient
|
|
210
|
+
archiver: archiver
|
|
204
211
|
}, {
|
|
205
212
|
prefilledPublicData
|
|
206
213
|
});
|
|
207
|
-
this.proverNode.start();
|
|
214
|
+
await this.proverNode.start();
|
|
208
215
|
this.logger.warn(`Proofs are now enabled`);
|
|
209
216
|
return this;
|
|
210
217
|
}
|
|
211
|
-
async
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
218
|
+
async mintFeeJuice(recipient) {
|
|
219
|
+
const handlerAddress = this.context.deployL1ContractsValues.l1ContractAddresses.feeAssetHandlerAddress;
|
|
220
|
+
this.logger.verbose(`Minting fee juice to ${recipient} using handler at ${handlerAddress}`);
|
|
221
|
+
const client = this.context.deployL1ContractsValues.l1Client;
|
|
222
|
+
const handler = getContract({
|
|
223
|
+
abi: FeeAssetHandlerAbi,
|
|
224
|
+
address: handlerAddress.toString(),
|
|
217
225
|
client
|
|
218
226
|
});
|
|
219
|
-
const hash = await
|
|
220
|
-
recipient
|
|
221
|
-
amount
|
|
227
|
+
const hash = await handler.write.mint([
|
|
228
|
+
recipient
|
|
222
229
|
]);
|
|
223
|
-
await this.context.deployL1ContractsValues.
|
|
230
|
+
await this.context.deployL1ContractsValues.l1Client.waitForTransactionReceipt({
|
|
224
231
|
hash
|
|
225
232
|
});
|
|
226
233
|
}
|
|
@@ -233,6 +240,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
233
240
|
}
|
|
234
241
|
// clean up the full prover node
|
|
235
242
|
await this.proverNode.stop();
|
|
243
|
+
await Barretenberg.destroySingleton();
|
|
236
244
|
await this.bbConfigCleanup?.();
|
|
237
245
|
await this.acvmConfigCleanup?.();
|
|
238
246
|
}
|
|
@@ -241,51 +249,38 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
241
249
|
const { fakeProofsAsset: asset, accounts } = this;
|
|
242
250
|
const privateAmount = 10000n;
|
|
243
251
|
const publicAmount = 10000n;
|
|
244
|
-
const waitOpts = {
|
|
245
|
-
proven: false
|
|
246
|
-
};
|
|
247
252
|
this.logger.verbose(`Minting ${privateAmount + publicAmount} publicly...`);
|
|
248
|
-
await asset.methods.mint_to_public(accounts[0]
|
|
253
|
+
await asset.methods.mint_to_public(accounts[0], privateAmount + publicAmount).send({
|
|
254
|
+
from: accounts[0]
|
|
255
|
+
}).wait();
|
|
249
256
|
this.logger.verbose(`Transferring ${privateAmount} to private...`);
|
|
250
|
-
await asset.methods.transfer_to_private(accounts[0]
|
|
257
|
+
await asset.methods.transfer_to_private(accounts[0], privateAmount).send({
|
|
258
|
+
from: accounts[0]
|
|
259
|
+
}).wait();
|
|
251
260
|
this.logger.verbose(`Minting complete.`);
|
|
252
261
|
return {
|
|
253
262
|
amount: publicAmount
|
|
254
263
|
};
|
|
255
264
|
}, async ({ amount })=>{
|
|
256
|
-
const { fakeProofsAsset: asset, accounts: [
|
|
265
|
+
const { fakeProofsAsset: asset, accounts: [address], tokenSim } = this;
|
|
257
266
|
tokenSim.mintPublic(address, amount);
|
|
258
|
-
const publicBalance = await asset.methods.balance_of_public(address).simulate(
|
|
267
|
+
const publicBalance = await asset.methods.balance_of_public(address).simulate({
|
|
268
|
+
from: address
|
|
269
|
+
});
|
|
259
270
|
this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
|
|
260
271
|
expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(address));
|
|
261
272
|
tokenSim.mintPrivate(address, amount);
|
|
262
|
-
const privateBalance = await asset.methods.balance_of_private(address).simulate(
|
|
273
|
+
const privateBalance = await asset.methods.balance_of_private(address).simulate({
|
|
274
|
+
from: address
|
|
275
|
+
});
|
|
263
276
|
this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
|
|
264
277
|
expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(address));
|
|
265
|
-
const totalSupply = await asset.methods.total_supply().simulate(
|
|
278
|
+
const totalSupply = await asset.methods.total_supply().simulate({
|
|
279
|
+
from: address
|
|
280
|
+
});
|
|
266
281
|
this.logger.verbose(`Total supply: ${totalSupply}`);
|
|
267
282
|
expect(totalSupply).toEqual(tokenSim.totalSupply);
|
|
268
283
|
return Promise.resolve();
|
|
269
284
|
});
|
|
270
285
|
}
|
|
271
|
-
async deployVerifier() {
|
|
272
|
-
if (!this.realProofs) {
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
if (!this.circuitProofVerifier) {
|
|
276
|
-
throw new Error('No verifier');
|
|
277
|
-
}
|
|
278
|
-
const { walletClient, publicClient, l1ContractAddresses } = this.context.deployL1ContractsValues;
|
|
279
|
-
const rollup = getContract({
|
|
280
|
-
abi: RollupAbi,
|
|
281
|
-
address: l1ContractAddresses.rollupAddress.toString(),
|
|
282
|
-
client: walletClient
|
|
283
|
-
});
|
|
284
|
-
const { address: verifierAddress } = await deployL1Contract(walletClient, publicClient, HonkVerifierAbi, HonkVerifierBytecode);
|
|
285
|
-
this.logger.info(`Deployed honk verifier at ${verifierAddress}`);
|
|
286
|
-
await rollup.write.setEpochVerifier([
|
|
287
|
-
verifierAddress.toString()
|
|
288
|
-
]);
|
|
289
|
-
this.logger.info('Rollup only accepts valid proofs now');
|
|
290
|
-
}
|
|
291
286
|
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
export declare const METRICS_PORT = 4318;
|
|
4
2
|
export declare const shouldCollectMetrics: () => 4318 | undefined;
|
|
5
3
|
export declare const TEST_PEER_CHECK_INTERVAL_MS = 1000;
|
|
4
|
+
export declare const TEST_MAX_PENDING_TX_POOL_COUNT = 10000;
|
|
6
5
|
export declare const MNEMONIC = "test test test test test test test test test test test junk";
|
|
7
|
-
export declare const privateKey: Buffer
|
|
8
|
-
export declare const privateKey2: Buffer
|
|
9
|
-
export declare const U128_UNDERFLOW_ERROR = "Assertion failed: attempt to subtract with overflow
|
|
10
|
-
export declare const U128_OVERFLOW_ERROR = "Assertion failed: attempt to add with overflow
|
|
6
|
+
export declare const privateKey: Buffer<ArrayBuffer>;
|
|
7
|
+
export declare const privateKey2: Buffer<ArrayBuffer>;
|
|
8
|
+
export declare const U128_UNDERFLOW_ERROR = "Assertion failed: attempt to subtract with overflow";
|
|
9
|
+
export declare const U128_OVERFLOW_ERROR = "Assertion failed: attempt to add with overflow";
|
|
11
10
|
export declare const BITSIZE_TOO_BIG_ERROR = "Assertion failed: call to assert_max_bit_size 'self.__assert_max_bit_size'";
|
|
12
11
|
export declare const DUPLICATE_NULLIFIER_ERROR: RegExp;
|
|
13
12
|
export declare const NO_L1_TO_L2_MSG_ERROR: RegExp;
|
|
14
13
|
export declare const STATIC_CALL_STATE_MODIFICATION_ERROR: RegExp;
|
|
15
14
|
export declare const STATIC_CONTEXT_ASSERTION_ERROR: RegExp;
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=fixtures.d.ts.map
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZml4dHVyZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maXh0dXJlcy9maXh0dXJlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxlQUFPLE1BQU0sWUFBWSxPQUFPLENBQUM7QUFFakMsZUFBTyxNQUFNLG9CQUFvQix3QkFLaEMsQ0FBQztBQUVGLGVBQU8sTUFBTSwyQkFBMkIsT0FBTyxDQUFDO0FBQ2hELGVBQU8sTUFBTSw4QkFBOEIsUUFBUyxDQUFDO0FBRXJELGVBQU8sTUFBTSxRQUFRLGdFQUFnRSxDQUFDO0FBQ3RGLGVBQU8sTUFBTSxVQUFVLHFCQUF5RixDQUFDO0FBQ2pILGVBQU8sTUFBTSxXQUFXLHFCQUF5RixDQUFDO0FBR2xILGVBQU8sTUFBTSxvQkFBb0Isd0RBQXdELENBQUM7QUFDMUYsZUFBTyxNQUFNLG1CQUFtQixtREFBbUQsQ0FBQztBQUNwRixlQUFPLE1BQU0scUJBQXFCLCtFQUErRSxDQUFDO0FBRWxILGVBQU8sTUFBTSx5QkFBeUIsUUFBZ0MsQ0FBQztBQUN2RSxlQUFPLE1BQU0scUJBQXFCLFFBQ3dFLENBQUM7QUFDM0csZUFBTyxNQUFNLG9DQUFvQyxRQUEwQyxDQUFDO0FBQzVGLGVBQU8sTUFBTSw4QkFBOEIsUUFBa0UsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/fixtures/fixtures.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/fixtures/fixtures.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,OAAO,CAAC;AAEjC,eAAO,MAAM,oBAAoB,wBAKhC,CAAC;AAEF,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAChD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AAErD,eAAO,MAAM,QAAQ,gEAAgE,CAAC;AACtF,eAAO,MAAM,UAAU,qBAAyF,CAAC;AACjH,eAAO,MAAM,WAAW,qBAAyF,CAAC;AAGlH,eAAO,MAAM,oBAAoB,wDAAwD,CAAC;AAC1F,eAAO,MAAM,mBAAmB,mDAAmD,CAAC;AACpF,eAAO,MAAM,qBAAqB,+EAA+E,CAAC;AAElH,eAAO,MAAM,yBAAyB,QAAgC,CAAC;AACvE,eAAO,MAAM,qBAAqB,QACwE,CAAC;AAC3G,eAAO,MAAM,oCAAoC,QAA0C,CAAC;AAC5F,eAAO,MAAM,8BAA8B,QAAkE,CAAC"}
|
|
@@ -6,16 +6,16 @@ export const shouldCollectMetrics = ()=>{
|
|
|
6
6
|
return undefined;
|
|
7
7
|
};
|
|
8
8
|
export const TEST_PEER_CHECK_INTERVAL_MS = 1000;
|
|
9
|
+
export const TEST_MAX_PENDING_TX_POOL_COUNT = 10_000; // Number of max pending TXs ~ 1.56GB
|
|
9
10
|
export const MNEMONIC = 'test test test test test test test test test test test junk';
|
|
10
11
|
export const privateKey = Buffer.from('ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', 'hex');
|
|
11
12
|
export const privateKey2 = Buffer.from('59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', 'hex');
|
|
12
13
|
/// Common errors
|
|
13
|
-
export const U128_UNDERFLOW_ERROR =
|
|
14
|
-
export const U128_OVERFLOW_ERROR =
|
|
14
|
+
export const U128_UNDERFLOW_ERROR = 'Assertion failed: attempt to subtract with overflow';
|
|
15
|
+
export const U128_OVERFLOW_ERROR = 'Assertion failed: attempt to add with overflow';
|
|
15
16
|
export const BITSIZE_TOO_BIG_ERROR = "Assertion failed: call to assert_max_bit_size 'self.__assert_max_bit_size'";
|
|
16
17
|
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/5818): Make these a fixed error after transition.
|
|
17
|
-
export const DUPLICATE_NULLIFIER_ERROR = /dropped|
|
|
18
|
+
export const DUPLICATE_NULLIFIER_ERROR = /dropped|nullifier|reverted/i;
|
|
18
19
|
export const NO_L1_TO_L2_MSG_ERROR = /No non-nullified L1 to L2 message found for message hash|Tried to consume nonexistent L1-to-L2 message/;
|
|
19
|
-
export const STATIC_CALL_STATE_MODIFICATION_ERROR = /Static call cannot update the state
|
|
20
|
+
export const STATIC_CALL_STATE_MODIFICATION_ERROR = /Static call cannot update the state.*/;
|
|
20
21
|
export const STATIC_CONTEXT_ASSERTION_ERROR = /Assertion failed: Function .* can only be called statically.*/;
|
|
21
|
-
export const DEFAULT_BLOB_SINK_PORT = '5052';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Logger } from '@aztec/aztec.js';
|
|
1
|
+
import type { Logger } from '@aztec/aztec.js/log';
|
|
2
2
|
export { deployAndInitializeTokenAndBridgeContracts } from '../shared/cross_chain_test_harness.js';
|
|
3
3
|
export declare function getACVMConfig(logger: Logger): Promise<{
|
|
4
4
|
acvmWorkingDirectory: string;
|
|
5
5
|
acvmBinaryPath: string;
|
|
6
6
|
cleanup: () => Promise<void>;
|
|
7
7
|
} | undefined>;
|
|
8
|
-
//# sourceMappingURL=
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X2Fjdm1fY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZml4dHVyZXMvZ2V0X2Fjdm1fY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBT2xELE9BQU8sRUFBRSwwQ0FBMEMsRUFBRSxNQUFNLHVDQUF1QyxDQUFDO0FBV25HLHdCQUFzQixhQUFhLENBQUMsTUFBTSxFQUFFLE1BQU0sR0FBRyxPQUFPLENBQ3hEO0lBQ0Usb0JBQW9CLEVBQUUsTUFBTSxDQUFDO0lBQzdCLGNBQWMsRUFBRSxNQUFNLENBQUM7SUFDdkIsT0FBTyxFQUFFLE1BQU0sT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0NBQzlCLEdBQ0QsU0FBUyxDQUNaLENBeUJBIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_acvm_config.d.ts","sourceRoot":"","sources":["../../src/fixtures/get_acvm_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"get_acvm_config.d.ts","sourceRoot":"","sources":["../../src/fixtures/get_acvm_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAOlD,OAAO,EAAE,0CAA0C,EAAE,MAAM,uCAAuC,CAAC;AAWnG,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CACxD;IACE,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,GACD,SAAS,CACZ,CAyBA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { parseBooleanEnv } from '@aztec/foundation/config';
|
|
2
|
-
import { randomBytes } from '@aztec/foundation/crypto';
|
|
2
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
3
|
+
import { tryRmDir } from '@aztec/foundation/fs';
|
|
3
4
|
import { promises as fs } from 'fs';
|
|
4
5
|
export { deployAndInitializeTokenAndBridgeContracts } from '../shared/cross_chain_test_harness.js';
|
|
5
6
|
const { NOIR_RELEASE_DIR = 'noir-repo/target/release', TEMP_DIR = '/tmp', ACVM_BINARY_PATH = '', ACVM_WORKING_DIRECTORY = '', ACVM_FORCE_WASM = '' } = process.env;
|
|
@@ -18,20 +19,7 @@ export async function getACVMConfig(logger) {
|
|
|
18
19
|
});
|
|
19
20
|
logger.verbose(`Using native ACVM binary at ${acvmBinaryPath} with working directory ${acvmWorkingDirectory}`);
|
|
20
21
|
const directoryToCleanup = ACVM_WORKING_DIRECTORY ? undefined : tempWorkingDirectory;
|
|
21
|
-
const cleanup =
|
|
22
|
-
if (directoryToCleanup) {
|
|
23
|
-
try {
|
|
24
|
-
logger.info(`Cleaning up ACVM temp directory ${directoryToCleanup}`);
|
|
25
|
-
await fs.rm(directoryToCleanup, {
|
|
26
|
-
recursive: true,
|
|
27
|
-
force: true,
|
|
28
|
-
maxRetries: 3
|
|
29
|
-
});
|
|
30
|
-
} catch (err) {
|
|
31
|
-
logger.warn(`Failed to delete ACVM temp directory at ${directoryToCleanup}: ${err}`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
22
|
+
const cleanup = ()=>tryRmDir(directoryToCleanup, logger);
|
|
35
23
|
return {
|
|
36
24
|
acvmWorkingDirectory,
|
|
37
25
|
acvmBinaryPath,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Logger } from '@aztec/aztec.js/log';
|
|
2
2
|
import type { BBConfig } from '@aztec/bb-prover';
|
|
3
3
|
export declare const getBBConfig: (logger: Logger) => Promise<(BBConfig & {
|
|
4
4
|
cleanup: () => Promise<void>;
|
|
5
5
|
}) | undefined>;
|
|
6
|
-
//# sourceMappingURL=
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X2JiX2NvbmZpZy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ZpeHR1cmVzL2dldF9iYl9jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDbEQsT0FBTyxLQUFLLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFrQmpELGVBQU8sTUFBTSxXQUFXOztlQXVDdkIsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_bb_config.d.ts","sourceRoot":"","sources":["../../src/fixtures/get_bb_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"get_bb_config.d.ts","sourceRoot":"","sources":["../../src/fixtures/get_bb_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAkBjD,eAAO,MAAM,WAAW;;eAuCvB,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { tryRmDir } from '@aztec/foundation/fs';
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
import { tmpdir } from 'node:os';
|
|
4
4
|
import path from 'path';
|
|
5
|
-
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
const { BB_RELEASE_DIR = 'barretenberg/cpp/build/bin', BB_BINARY_PATH, BB_SKIP_CLEANUP = '', TEMP_DIR = tmpdir(), BB_WORKING_DIRECTORY = '', BB_NUM_IVC_VERIFIERS = '1', BB_IVC_CONCURRENCY = '1' } = process.env;
|
|
6
7
|
export const getBBConfig = async (logger)=>{
|
|
7
8
|
try {
|
|
8
|
-
const bbBinaryPath = BB_BINARY_PATH ?? path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../', BB_RELEASE_DIR, 'bb');
|
|
9
|
+
const bbBinaryPath = BB_BINARY_PATH ?? path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../', BB_RELEASE_DIR, 'bb-avm');
|
|
9
10
|
await fs.access(bbBinaryPath, fs.constants.R_OK);
|
|
10
11
|
let bbWorkingDirectory;
|
|
11
12
|
let directoryToCleanup;
|
|
@@ -22,24 +23,16 @@ export const getBBConfig = async (logger)=>{
|
|
|
22
23
|
'1',
|
|
23
24
|
'true'
|
|
24
25
|
].includes(BB_SKIP_CLEANUP);
|
|
25
|
-
const cleanup =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
await fs.rm(directoryToCleanup, {
|
|
29
|
-
recursive: true,
|
|
30
|
-
force: true,
|
|
31
|
-
maxRetries: 3
|
|
32
|
-
});
|
|
33
|
-
} catch (err) {
|
|
34
|
-
logger.warn(`Failed to delete bb working directory at ${directoryToCleanup}: ${err}`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
};
|
|
26
|
+
const cleanup = bbSkipCleanup ? ()=>Promise.resolve() : ()=>tryRmDir(directoryToCleanup);
|
|
27
|
+
const numIvcVerifiers = Number(BB_NUM_IVC_VERIFIERS);
|
|
28
|
+
const ivcConcurrency = Number(BB_IVC_CONCURRENCY);
|
|
38
29
|
return {
|
|
39
30
|
bbSkipCleanup,
|
|
40
31
|
bbBinaryPath,
|
|
41
32
|
bbWorkingDirectory,
|
|
42
|
-
cleanup
|
|
33
|
+
cleanup,
|
|
34
|
+
numConcurrentIVCVerifiers: numIvcVerifiers,
|
|
35
|
+
bbIVCConcurrency: ivcConcurrency
|
|
43
36
|
};
|
|
44
37
|
} catch (err) {
|
|
45
38
|
logger.error(`Native BB not available, error: ${err}`);
|
package/dest/fixtures/index.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export * from './logging.js';
|
|
|
3
3
|
export * from './utils.js';
|
|
4
4
|
export * from './token_utils.js';
|
|
5
5
|
export * from './with_telemetry_utils.js';
|
|
6
|
-
//# sourceMappingURL=
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maXh0dXJlcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGVBQWUsQ0FBQztBQUM5QixjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLFlBQVksQ0FBQztBQUMzQixjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsMkJBQTJCLENBQUMifQ==
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import type { L1ContractAddresses
|
|
2
|
-
import {
|
|
1
|
+
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
2
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
3
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
4
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
5
|
export declare function sendL1ToL2Message(message: {
|
|
5
6
|
recipient: AztecAddress;
|
|
6
7
|
content: Fr;
|
|
7
8
|
secretHash: Fr;
|
|
8
9
|
}, ctx: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
l1Client: ExtendedViemWalletClient;
|
|
11
|
+
l1ContractAddresses: Pick<L1ContractAddresses, 'inboxAddress' | 'rollupAddress'>;
|
|
12
|
+
}): Promise<{
|
|
13
|
+
msgHash: Fr;
|
|
14
|
+
globalLeafIndex: Fr;
|
|
15
|
+
txReceipt: import("viem").TransactionReceipt;
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibDFfdG9fbDJfbWVzc2FnaW5nLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZml4dHVyZXMvbDFfdG9fbDJfbWVzc2FnaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sdUNBQXVDLENBQUM7QUFDakYsT0FBTyxLQUFLLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUN0RSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFHcEQsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFNaEUsd0JBQXNCLGlCQUFpQixDQUNyQyxPQUFPLEVBQUU7SUFBRSxTQUFTLEVBQUUsWUFBWSxDQUFDO0lBQUMsT0FBTyxFQUFFLEVBQUUsQ0FBQztJQUFDLFVBQVUsRUFBRSxFQUFFLENBQUE7Q0FBRSxFQUNqRSxHQUFHLEVBQUU7SUFDSCxRQUFRLEVBQUUsd0JBQXdCLENBQUM7SUFDbkMsbUJBQW1CLEVBQUUsSUFBSSxDQUFDLG1CQUFtQixFQUFFLGNBQWMsR0FBRyxlQUFlLENBQUMsQ0FBQztDQUNsRjs7OztHQWdFRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l1_to_l2_messaging.d.ts","sourceRoot":"","sources":["../../src/fixtures/l1_to_l2_messaging.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"l1_to_l2_messaging.d.ts","sourceRoot":"","sources":["../../src/fixtures/l1_to_l2_messaging.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAMhE,wBAAsB,iBAAiB,CACrC,OAAO,EAAE;IAAE,SAAS,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;IAAC,UAAU,EAAE,EAAE,CAAA;CAAE,EACjE,GAAG,EAAE;IACH,QAAQ,EAAE,wBAAwB,CAAC;IACnC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,cAAc,GAAG,eAAe,CAAC,CAAC;CAClF;;;;GAgEF"}
|