@aztec/end-to-end 4.0.0-nightly.20250907 → 4.0.0-nightly.20260107
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 +4 -3
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +2 -2
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +26 -15
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +111 -90
- package/dest/bench/client_flows/config.d.ts +1 -1
- package/dest/bench/client_flows/data_extractor.d.ts +1 -1
- package/dest/bench/client_flows/data_extractor.js +10 -30
- package/dest/bench/utils.d.ts +3 -12
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +17 -37
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +8 -8
- 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 +42 -42
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +13 -10
- 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 +35 -35
- package/dest/e2e_deploy_contract/deploy_test.d.ts +12 -6
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +9 -18
- package/dest/e2e_epochs/epochs_test.d.ts +20 -12
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +36 -27
- package/dest/e2e_fees/bridging_race.notest.d.ts +1 -1
- package/dest/e2e_fees/bridging_race.notest.js +14 -11
- package/dest/e2e_fees/fees_test.d.ts +13 -9
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +38 -39
- package/dest/e2e_l1_publisher/write_json.d.ts +4 -2
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +9 -8
- package/dest/e2e_multi_validator/utils.d.ts +2 -2
- package/dest/e2e_multi_validator/utils.d.ts.map +1 -1
- package/dest/e2e_multi_validator/utils.js +4 -10
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +7 -4
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +11 -12
- 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 +238 -18
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +50 -25
- package/dest/e2e_p2p/shared.d.ts +16 -17
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +57 -56
- package/dest/e2e_token_contract/token_contract_test.d.ts +6 -5
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +14 -17
- package/dest/fixtures/e2e_prover_test.d.ts +13 -11
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +57 -66
- package/dest/fixtures/fixtures.d.ts +2 -3
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +2 -3
- 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 +1 -1
- 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 +2 -2
- package/dest/fixtures/index.d.ts +1 -1
- 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/setup_p2p_test.d.ts +12 -11
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +50 -24
- package/dest/fixtures/snapshot_manager.d.ts +16 -15
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +84 -88
- package/dest/fixtures/token_utils.d.ts +10 -5
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +17 -18
- package/dest/fixtures/utils.d.ts +44 -47
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +128 -185
- 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/alert_checker.d.ts +2 -2
- package/dest/quality_of_service/alert_checker.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.d.ts +20 -23
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +14 -16
- package/dest/shared/gas_portal_test_harness.d.ts +10 -17
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +11 -8
- package/dest/shared/index.d.ts +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 +13 -9
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +44 -58
- package/dest/simulators/index.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts +4 -7
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +8 -5
- package/dest/simulators/token_simulator.d.ts +4 -2
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +2 -2
- package/dest/spartan/setup_test_wallets.d.ts +22 -14
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +144 -86
- 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 +101 -16
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +414 -52
- package/package.json +43 -40
- package/src/bench/client_flows/benchmark.ts +8 -8
- package/src/bench/client_flows/client_flows_benchmark.ts +143 -115
- package/src/bench/client_flows/data_extractor.ts +9 -31
- package/src/bench/utils.ts +15 -39
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +46 -63
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +46 -55
- package/src/e2e_deploy_contract/deploy_test.ts +18 -36
- package/src/e2e_epochs/epochs_test.ts +59 -42
- package/src/e2e_fees/bridging_race.notest.ts +16 -11
- package/src/e2e_fees/fees_test.ts +47 -51
- package/src/e2e_l1_publisher/write_json.ts +12 -9
- package/src/e2e_multi_validator/utils.ts +5 -11
- package/src/e2e_nested_contract/nested_contract_test.ts +15 -13
- package/src/e2e_p2p/inactivity_slash_test.ts +179 -0
- package/src/e2e_p2p/p2p_network.ts +125 -89
- package/src/e2e_p2p/shared.ts +69 -60
- package/src/e2e_token_contract/token_contract_test.ts +17 -17
- package/src/fixtures/e2e_prover_test.ts +65 -105
- package/src/fixtures/fixtures.ts +2 -5
- package/src/fixtures/get_acvm_config.ts +2 -2
- package/src/fixtures/get_bb_config.ts +3 -2
- package/src/fixtures/l1_to_l2_messaging.ts +4 -2
- package/src/fixtures/setup_p2p_test.ts +79 -32
- package/src/fixtures/snapshot_manager.ts +120 -131
- package/src/fixtures/token_utils.ts +16 -24
- package/src/fixtures/utils.ts +175 -269
- package/src/fixtures/web3signer.ts +63 -0
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/guides/up_quick_start.sh +3 -11
- package/src/quality_of_service/alert_checker.ts +1 -1
- package/src/shared/cross_chain_test_harness.ts +23 -31
- package/src/shared/gas_portal_test_harness.ts +14 -21
- package/src/shared/jest_setup.ts +1 -1
- package/src/shared/submit-transactions.ts +12 -8
- package/src/shared/uniswap_l1_l2.ts +80 -88
- package/src/simulators/lending_simulator.ts +9 -6
- package/src/simulators/token_simulator.ts +5 -2
- package/src/spartan/DEVELOP.md +15 -3
- package/src/spartan/setup_test_wallets.ts +171 -127
- package/src/spartan/tx_metrics.ts +130 -0
- package/src/spartan/utils.ts +543 -45
- 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/src/fixtures/setup_l1_contracts.ts +0 -26
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type
|
|
1
|
+
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
3
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
3
4
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
4
5
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
6
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
5
7
|
|
|
6
8
|
import { jest } from '@jest/globals';
|
|
7
9
|
|
|
@@ -28,11 +30,9 @@ export class TokenContractTest {
|
|
|
28
30
|
node!: AztecNode;
|
|
29
31
|
|
|
30
32
|
badAccount!: InvalidAccountContract;
|
|
31
|
-
|
|
33
|
+
wallet!: TestWallet;
|
|
32
34
|
adminAddress!: AztecAddress;
|
|
33
|
-
account1!: AccountWallet;
|
|
34
35
|
account1Address!: AztecAddress;
|
|
35
|
-
account2!: AccountWallet;
|
|
36
36
|
account2Address!: AztecAddress;
|
|
37
37
|
|
|
38
38
|
constructor(testName: string) {
|
|
@@ -54,11 +54,11 @@ export class TokenContractTest {
|
|
|
54
54
|
await this.snapshotManager.snapshot(
|
|
55
55
|
'3_accounts',
|
|
56
56
|
deployAccounts(3, this.logger),
|
|
57
|
-
|
|
57
|
+
({ deployedAccounts }, { wallet, aztecNode }) => {
|
|
58
58
|
this.node = aztecNode;
|
|
59
|
-
|
|
60
|
-
[this.
|
|
61
|
-
|
|
59
|
+
this.wallet = wallet;
|
|
60
|
+
[this.adminAddress, this.account1Address, this.account2Address] = deployedAccounts.map(acc => acc.address);
|
|
61
|
+
return Promise.resolve();
|
|
62
62
|
},
|
|
63
63
|
);
|
|
64
64
|
|
|
@@ -68,11 +68,11 @@ export class TokenContractTest {
|
|
|
68
68
|
// Create the token contract state.
|
|
69
69
|
// Move this account thing to addAccounts above?
|
|
70
70
|
this.logger.verbose(`Public deploy accounts...`);
|
|
71
|
-
await publicDeployAccounts(this.
|
|
71
|
+
await publicDeployAccounts(this.wallet, [this.adminAddress, this.account1Address]);
|
|
72
72
|
|
|
73
73
|
this.logger.verbose(`Deploying TokenContract...`);
|
|
74
74
|
const asset = await TokenContract.deploy(
|
|
75
|
-
this.
|
|
75
|
+
this.wallet,
|
|
76
76
|
this.adminAddress,
|
|
77
77
|
TokenContractTest.TOKEN_NAME,
|
|
78
78
|
TokenContractTest.TOKEN_SYMBOL,
|
|
@@ -83,22 +83,22 @@ export class TokenContractTest {
|
|
|
83
83
|
this.logger.verbose(`Token deployed to ${asset.address}`);
|
|
84
84
|
|
|
85
85
|
this.logger.verbose(`Deploying bad account...`);
|
|
86
|
-
this.badAccount = await InvalidAccountContract.deploy(this.
|
|
86
|
+
this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress }).deployed();
|
|
87
87
|
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
88
88
|
|
|
89
89
|
return { tokenContractAddress: asset.address, badAccountAddress: this.badAccount.address };
|
|
90
90
|
},
|
|
91
91
|
async ({ tokenContractAddress, badAccountAddress }) => {
|
|
92
92
|
// Restore the token contract state.
|
|
93
|
-
this.asset =
|
|
93
|
+
this.asset = TokenContract.at(tokenContractAddress, this.wallet);
|
|
94
94
|
this.logger.verbose(`Token contract address: ${this.asset.address}`);
|
|
95
95
|
|
|
96
|
-
this.tokenSim = new TokenSimulator(this.asset, this.
|
|
96
|
+
this.tokenSim = new TokenSimulator(this.asset, this.wallet, this.adminAddress, this.logger, [
|
|
97
97
|
this.adminAddress,
|
|
98
98
|
this.account1Address,
|
|
99
99
|
]);
|
|
100
100
|
|
|
101
|
-
this.badAccount =
|
|
101
|
+
this.badAccount = InvalidAccountContract.at(badAccountAddress, this.wallet);
|
|
102
102
|
this.logger.verbose(`Bad account address: ${this.badAccount.address}`);
|
|
103
103
|
|
|
104
104
|
expect(await this.asset.methods.get_admin().simulate({ from: this.adminAddress })).toBe(
|
|
@@ -131,14 +131,14 @@ export class TokenContractTest {
|
|
|
131
131
|
await this.snapshotManager.snapshot(
|
|
132
132
|
'mint',
|
|
133
133
|
async () => {
|
|
134
|
-
const { asset,
|
|
134
|
+
const { asset, adminAddress } = this;
|
|
135
135
|
const amount = 10000n;
|
|
136
136
|
|
|
137
137
|
this.logger.verbose(`Minting ${amount} publicly...`);
|
|
138
138
|
await asset.methods.mint_to_public(adminAddress, amount).send({ from: adminAddress }).wait();
|
|
139
139
|
|
|
140
140
|
this.logger.verbose(`Minting ${amount} privately...`);
|
|
141
|
-
await mintTokensToPrivate(asset, adminAddress,
|
|
141
|
+
await mintTokensToPrivate(asset, adminAddress, adminAddress, amount);
|
|
142
142
|
this.logger.verbose(`Minting complete.`);
|
|
143
143
|
|
|
144
144
|
return { amount };
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SchnorrAccountContractArtifact,
|
|
3
|
-
getSchnorrAccount,
|
|
4
|
-
getSchnorrWalletWithSecretKey,
|
|
5
|
-
} from '@aztec/accounts/schnorr';
|
|
6
1
|
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
7
2
|
import { type Archiver, createArchiver } from '@aztec/archiver';
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type CompleteAddress,
|
|
12
|
-
EthAddress,
|
|
13
|
-
type Logger,
|
|
14
|
-
type PXE,
|
|
15
|
-
createLogger,
|
|
16
|
-
} from '@aztec/aztec.js';
|
|
3
|
+
import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
4
|
+
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
5
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
17
6
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
18
7
|
import {
|
|
19
8
|
BBCircuitVerifier,
|
|
@@ -21,16 +10,17 @@ import {
|
|
|
21
10
|
QueuedIVCVerifier,
|
|
22
11
|
TestCircuitVerifier,
|
|
23
12
|
} from '@aztec/bb-prover';
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
26
|
-
import type {
|
|
13
|
+
import { BackendType, Barretenberg } from '@aztec/bb.js';
|
|
14
|
+
import { createBlobClientWithFileStores } from '@aztec/blob-client/client';
|
|
15
|
+
import type { DeployAztecL1ContractsReturnType } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
27
16
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
28
17
|
import { SecretValue } from '@aztec/foundation/config';
|
|
29
18
|
import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
|
|
30
19
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
31
20
|
import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
|
|
32
|
-
import type {
|
|
21
|
+
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
33
22
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
23
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
34
24
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
35
25
|
|
|
36
26
|
import { type Hex, getContract } from 'viem';
|
|
@@ -46,12 +36,12 @@ import {
|
|
|
46
36
|
deployAccounts,
|
|
47
37
|
publicDeployAccounts,
|
|
48
38
|
} from './snapshot_manager.js';
|
|
49
|
-
import { getPrivateKeyFromIndex, getSponsoredFPCAddress,
|
|
39
|
+
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEAndGetWallet } from './utils.js';
|
|
50
40
|
|
|
51
41
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
52
42
|
|
|
53
43
|
type ProvenSetup = {
|
|
54
|
-
|
|
44
|
+
wallet: TestWallet;
|
|
55
45
|
teardown: () => Promise<void>;
|
|
56
46
|
};
|
|
57
47
|
|
|
@@ -68,25 +58,25 @@ export class FullProverTest {
|
|
|
68
58
|
static TOKEN_DECIMALS = 18n;
|
|
69
59
|
private snapshotManager: ISnapshotManager;
|
|
70
60
|
logger: Logger;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
accounts:
|
|
61
|
+
wallet!: TestWallet;
|
|
62
|
+
provenWallet!: TestWallet;
|
|
63
|
+
accounts: AztecAddress[] = [];
|
|
64
|
+
deployedAccounts!: InitialAccountData[];
|
|
74
65
|
fakeProofsAsset!: TokenContract;
|
|
66
|
+
fakeProofsAssetInstance!: ContractInstanceWithAddress;
|
|
75
67
|
tokenSim!: TokenSimulator;
|
|
76
68
|
aztecNode!: AztecNode;
|
|
77
69
|
aztecNodeAdmin!: AztecNodeAdmin;
|
|
78
|
-
pxe!: PXEService;
|
|
79
70
|
cheatCodes!: CheatCodes;
|
|
80
|
-
blobSink!: BlobSinkServer;
|
|
81
71
|
private provenComponents: ProvenSetup[] = [];
|
|
82
72
|
private bbConfigCleanup?: () => Promise<void>;
|
|
83
73
|
private acvmConfigCleanup?: () => Promise<void>;
|
|
84
74
|
circuitProofVerifier?: ClientProtocolCircuitVerifier;
|
|
85
|
-
|
|
75
|
+
provenAsset!: TokenContract;
|
|
86
76
|
private context!: SubsystemsContext;
|
|
87
77
|
private proverNode!: ProverNode;
|
|
88
78
|
private simulatedProverNode!: ProverNode;
|
|
89
|
-
public l1Contracts!:
|
|
79
|
+
public l1Contracts!: DeployAztecL1ContractsReturnType;
|
|
90
80
|
public proverAddress!: EthAddress;
|
|
91
81
|
|
|
92
82
|
constructor(
|
|
@@ -99,7 +89,7 @@ export class FullProverTest {
|
|
|
99
89
|
this.snapshotManager = createSnapshotManager(
|
|
100
90
|
`full_prover_integration/${testName}`,
|
|
101
91
|
dataPath,
|
|
102
|
-
{ startProverNode: true,
|
|
92
|
+
{ startProverNode: true, coinbase },
|
|
103
93
|
{
|
|
104
94
|
realVerifier: realProofs,
|
|
105
95
|
},
|
|
@@ -115,13 +105,11 @@ export class FullProverTest {
|
|
|
115
105
|
await this.snapshotManager.snapshot(
|
|
116
106
|
'2_accounts',
|
|
117
107
|
deployAccounts(2, this.logger),
|
|
118
|
-
|
|
108
|
+
({ deployedAccounts }, { wallet }) => {
|
|
119
109
|
this.deployedAccounts = deployedAccounts;
|
|
120
|
-
this.
|
|
121
|
-
|
|
122
|
-
);
|
|
123
|
-
this.accounts = this.wallets.map(w => w.getCompleteAddress());
|
|
124
|
-
this.wallets.forEach((w, i) => this.logger.verbose(`Wallet ${i} address: ${w.getAddress()}`));
|
|
110
|
+
this.accounts = deployedAccounts.map(a => a.address);
|
|
111
|
+
this.wallet = wallet;
|
|
112
|
+
return Promise.resolve();
|
|
125
113
|
},
|
|
126
114
|
);
|
|
127
115
|
|
|
@@ -131,37 +119,38 @@ export class FullProverTest {
|
|
|
131
119
|
// Create the token contract state.
|
|
132
120
|
// Move this account thing to addAccounts above?
|
|
133
121
|
this.logger.verbose(`Public deploy accounts...`);
|
|
134
|
-
await publicDeployAccounts(this.
|
|
122
|
+
await publicDeployAccounts(this.wallet, this.accounts.slice(0, 2));
|
|
135
123
|
|
|
136
124
|
this.logger.verbose(`Deploying TokenContract...`);
|
|
137
|
-
const asset = await TokenContract.deploy(
|
|
138
|
-
this.
|
|
125
|
+
const { contract: asset, instance } = await TokenContract.deploy(
|
|
126
|
+
this.wallet,
|
|
139
127
|
this.accounts[0],
|
|
140
128
|
FullProverTest.TOKEN_NAME,
|
|
141
129
|
FullProverTest.TOKEN_SYMBOL,
|
|
142
130
|
FullProverTest.TOKEN_DECIMALS,
|
|
143
131
|
)
|
|
144
|
-
.send({ from: this.
|
|
145
|
-
.
|
|
132
|
+
.send({ from: this.accounts[0] })
|
|
133
|
+
.wait();
|
|
146
134
|
this.logger.verbose(`Token deployed to ${asset.address}`);
|
|
147
135
|
|
|
148
|
-
return { tokenContractAddress: asset.address };
|
|
136
|
+
return { tokenContractAddress: asset.address, tokenContractInstance: instance };
|
|
149
137
|
},
|
|
150
|
-
async ({ tokenContractAddress }) => {
|
|
138
|
+
async ({ tokenContractAddress, tokenContractInstance }) => {
|
|
151
139
|
// Restore the token contract state.
|
|
152
|
-
this.fakeProofsAsset =
|
|
140
|
+
this.fakeProofsAsset = TokenContract.at(tokenContractAddress, this.wallet);
|
|
141
|
+
this.fakeProofsAssetInstance = tokenContractInstance;
|
|
153
142
|
this.logger.verbose(`Token contract address: ${this.fakeProofsAsset.address}`);
|
|
154
143
|
|
|
155
144
|
this.tokenSim = new TokenSimulator(
|
|
156
145
|
this.fakeProofsAsset,
|
|
157
|
-
this.
|
|
158
|
-
this.
|
|
146
|
+
this.wallet,
|
|
147
|
+
this.accounts[0],
|
|
159
148
|
this.logger,
|
|
160
|
-
this.accounts
|
|
149
|
+
this.accounts,
|
|
161
150
|
);
|
|
162
151
|
|
|
163
|
-
expect(await this.fakeProofsAsset.methods.get_admin().simulate({ from: this.accounts[0]
|
|
164
|
-
this.accounts[0].
|
|
152
|
+
expect(await this.fakeProofsAsset.methods.get_admin().simulate({ from: this.accounts[0] })).toBe(
|
|
153
|
+
this.accounts[0].toBigInt(),
|
|
165
154
|
);
|
|
166
155
|
},
|
|
167
156
|
);
|
|
@@ -175,15 +164,14 @@ export class FullProverTest {
|
|
|
175
164
|
|
|
176
165
|
this.simulatedProverNode = this.context.proverNode!;
|
|
177
166
|
({
|
|
178
|
-
pxe: this.pxe,
|
|
179
167
|
aztecNode: this.aztecNode,
|
|
180
168
|
deployL1ContractsValues: this.l1Contracts,
|
|
181
169
|
cheatCodes: this.cheatCodes,
|
|
182
|
-
blobSink: this.blobSink,
|
|
183
170
|
} = this.context);
|
|
184
171
|
this.aztecNodeAdmin = this.context.aztecNode;
|
|
185
172
|
|
|
186
|
-
const
|
|
173
|
+
const config = this.context.aztecNodeConfig;
|
|
174
|
+
const blobClient = await createBlobClientWithFileStores(config, this.logger);
|
|
187
175
|
|
|
188
176
|
// Configure a full prover PXE
|
|
189
177
|
let acvmConfig: Awaited<ReturnType<typeof getACVMConfig>> | undefined;
|
|
@@ -197,9 +185,7 @@ export class FullProverTest {
|
|
|
197
185
|
this.acvmConfigCleanup = acvmConfig.cleanup;
|
|
198
186
|
this.bbConfigCleanup = bbConfig.cleanup;
|
|
199
187
|
|
|
200
|
-
|
|
201
|
-
throw new Error(`Test must be run with BB native configuration`);
|
|
202
|
-
}
|
|
188
|
+
await Barretenberg.initSingleton({ backend: BackendType.NativeUnixSocket });
|
|
203
189
|
|
|
204
190
|
const verifier = await BBCircuitVerifier.new(bbConfig);
|
|
205
191
|
this.circuitProofVerifier = new QueuedIVCVerifier(bbConfig, verifier);
|
|
@@ -224,51 +210,27 @@ export class FullProverTest {
|
|
|
224
210
|
await this.context.cheatCodes.rollup.markAsProven();
|
|
225
211
|
|
|
226
212
|
this.logger.verbose(`Main setup completed, initializing full prover PXE, Node, and Prover Node`);
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
undefined,
|
|
236
|
-
true,
|
|
237
|
-
);
|
|
238
|
-
this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
|
|
239
|
-
await result.pxe.registerContract(this.fakeProofsAsset);
|
|
240
|
-
|
|
241
|
-
for (let i = 0; i < 2; i++) {
|
|
242
|
-
await result.pxe.registerAccount(
|
|
243
|
-
this.deployedAccounts[i].secret,
|
|
244
|
-
this.wallets[i].getCompleteAddress().partialAddress,
|
|
245
|
-
);
|
|
246
|
-
await this.pxe.registerAccount(
|
|
247
|
-
this.deployedAccounts[i].secret,
|
|
248
|
-
this.wallets[i].getCompleteAddress().partialAddress,
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
const account = await getSchnorrAccount(
|
|
253
|
-
result.pxe,
|
|
254
|
-
this.deployedAccounts[0].secret,
|
|
255
|
-
this.deployedAccounts[0].signingKey,
|
|
256
|
-
this.deployedAccounts[0].salt,
|
|
257
|
-
);
|
|
258
|
-
|
|
259
|
-
await result.pxe.registerContract({
|
|
260
|
-
instance: account.getInstance(),
|
|
261
|
-
artifact: SchnorrAccountContractArtifact,
|
|
262
|
-
});
|
|
213
|
+
const { wallet: provenWallet, teardown: provenTeardown } = await setupPXEAndGetWallet(
|
|
214
|
+
this.aztecNode,
|
|
215
|
+
{ proverEnabled: this.realProofs },
|
|
216
|
+
undefined,
|
|
217
|
+
true,
|
|
218
|
+
);
|
|
219
|
+
this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
|
|
220
|
+
await provenWallet.registerContract(this.fakeProofsAssetInstance, TokenContract.artifact);
|
|
263
221
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
this.
|
|
267
|
-
pxe: result.pxe,
|
|
268
|
-
teardown: result.teardown,
|
|
269
|
-
});
|
|
270
|
-
this.provenAssets.push(asset);
|
|
222
|
+
for (let i = 0; i < 2; i++) {
|
|
223
|
+
await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
224
|
+
await this.wallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
271
225
|
}
|
|
226
|
+
|
|
227
|
+
const asset = TokenContract.at(this.fakeProofsAsset.address, provenWallet);
|
|
228
|
+
this.provenComponents.push({
|
|
229
|
+
wallet: provenWallet,
|
|
230
|
+
teardown: provenTeardown,
|
|
231
|
+
});
|
|
232
|
+
this.provenAsset = asset;
|
|
233
|
+
this.provenWallet = provenWallet;
|
|
272
234
|
this.logger.info(`Full prover PXE started`);
|
|
273
235
|
|
|
274
236
|
// Shutdown the current, simulated prover node
|
|
@@ -279,7 +241,7 @@ export class FullProverTest {
|
|
|
279
241
|
this.logger.verbose('Starting archiver for new prover node');
|
|
280
242
|
const archiver = await createArchiver(
|
|
281
243
|
{ ...this.context.aztecNodeConfig, dataDirectory: undefined },
|
|
282
|
-
{
|
|
244
|
+
{ blobClient, dateProvider: this.context.dateProvider },
|
|
283
245
|
{ blockUntilSync: true },
|
|
284
246
|
);
|
|
285
247
|
|
|
@@ -308,6 +270,7 @@ export class FullProverTest {
|
|
|
308
270
|
txGatheringMaxParallelRequestsPerNode: 100,
|
|
309
271
|
txGatheringTimeoutMs: 24_000,
|
|
310
272
|
proverNodeFailedEpochStore: undefined,
|
|
273
|
+
proverNodeEpochProvingDelayMs: undefined,
|
|
311
274
|
};
|
|
312
275
|
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
313
276
|
const { prefilledPublicData } = await getGenesisValues(
|
|
@@ -318,7 +281,6 @@ export class FullProverTest {
|
|
|
318
281
|
{
|
|
319
282
|
aztecNodeTxProvider: this.aztecNode,
|
|
320
283
|
archiver: archiver as Archiver,
|
|
321
|
-
blobSinkClient,
|
|
322
284
|
},
|
|
323
285
|
{ prefilledPublicData },
|
|
324
286
|
);
|
|
@@ -354,6 +316,7 @@ export class FullProverTest {
|
|
|
354
316
|
// clean up the full prover node
|
|
355
317
|
await this.proverNode.stop();
|
|
356
318
|
|
|
319
|
+
await Barretenberg.destroySingleton();
|
|
357
320
|
await this.bbConfigCleanup?.();
|
|
358
321
|
await this.acvmConfigCleanup?.();
|
|
359
322
|
}
|
|
@@ -368,15 +331,12 @@ export class FullProverTest {
|
|
|
368
331
|
|
|
369
332
|
this.logger.verbose(`Minting ${privateAmount + publicAmount} publicly...`);
|
|
370
333
|
await asset.methods
|
|
371
|
-
.mint_to_public(accounts[0]
|
|
372
|
-
.send({ from: accounts[0]
|
|
334
|
+
.mint_to_public(accounts[0], privateAmount + publicAmount)
|
|
335
|
+
.send({ from: accounts[0] })
|
|
373
336
|
.wait();
|
|
374
337
|
|
|
375
338
|
this.logger.verbose(`Transferring ${privateAmount} to private...`);
|
|
376
|
-
await asset.methods
|
|
377
|
-
.transfer_to_private(accounts[0].address, privateAmount)
|
|
378
|
-
.send({ from: accounts[0].address })
|
|
379
|
-
.wait();
|
|
339
|
+
await asset.methods.transfer_to_private(accounts[0], privateAmount).send({ from: accounts[0] }).wait();
|
|
380
340
|
|
|
381
341
|
this.logger.verbose(`Minting complete.`);
|
|
382
342
|
|
|
@@ -385,7 +345,7 @@ export class FullProverTest {
|
|
|
385
345
|
async ({ amount }) => {
|
|
386
346
|
const {
|
|
387
347
|
fakeProofsAsset: asset,
|
|
388
|
-
accounts: [
|
|
348
|
+
accounts: [address],
|
|
389
349
|
tokenSim,
|
|
390
350
|
} = this;
|
|
391
351
|
tokenSim.mintPublic(address, amount);
|
package/src/fixtures/fixtures.ts
CHANGED
|
@@ -8,7 +8,7 @@ export const shouldCollectMetrics = () => {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export const TEST_PEER_CHECK_INTERVAL_MS = 1000;
|
|
11
|
-
export const
|
|
11
|
+
export const TEST_MAX_PENDING_TX_POOL_COUNT = 10_000; // Number of max pending TXs ~ 1.56GB
|
|
12
12
|
|
|
13
13
|
export const MNEMONIC = 'test test test test test test test test test test test junk';
|
|
14
14
|
export const privateKey = Buffer.from('ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', 'hex');
|
|
@@ -22,8 +22,5 @@ export const BITSIZE_TOO_BIG_ERROR = "Assertion failed: call to assert_max_bit_s
|
|
|
22
22
|
export const DUPLICATE_NULLIFIER_ERROR = /dropped|nullifier|reverted/i;
|
|
23
23
|
export const NO_L1_TO_L2_MSG_ERROR =
|
|
24
24
|
/No non-nullified L1 to L2 message found for message hash|Tried to consume nonexistent L1-to-L2 message/;
|
|
25
|
-
export const STATIC_CALL_STATE_MODIFICATION_ERROR =
|
|
26
|
-
/Static call cannot update the state, emit L2->L1 messages or generate logs.*/;
|
|
25
|
+
export const STATIC_CALL_STATE_MODIFICATION_ERROR = /Static call cannot update the state.*/;
|
|
27
26
|
export const STATIC_CONTEXT_ASSERTION_ERROR = /Assertion failed: Function .* can only be called statically.*/;
|
|
28
|
-
|
|
29
|
-
export const DEFAULT_BLOB_SINK_PORT = '5052';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Logger } from '@aztec/aztec.js';
|
|
1
|
+
import type { Logger } from '@aztec/aztec.js/log';
|
|
2
2
|
import { parseBooleanEnv } from '@aztec/foundation/config';
|
|
3
|
-
import { randomBytes } from '@aztec/foundation/crypto';
|
|
3
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
4
4
|
import { tryRmDir } from '@aztec/foundation/fs';
|
|
5
5
|
|
|
6
6
|
import { promises as fs } from 'fs';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Logger } from '@aztec/aztec.js/log';
|
|
2
2
|
import type { BBConfig } from '@aztec/bb-prover';
|
|
3
3
|
import { tryRmDir } from '@aztec/foundation/fs';
|
|
4
4
|
|
|
5
5
|
import fs from 'node:fs/promises';
|
|
6
6
|
import { tmpdir } from 'node:os';
|
|
7
7
|
import path from 'path';
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
8
9
|
|
|
9
10
|
const {
|
|
10
11
|
BB_RELEASE_DIR = 'barretenberg/cpp/build/bin',
|
|
@@ -22,7 +23,7 @@ export const getBBConfig = async (
|
|
|
22
23
|
try {
|
|
23
24
|
const bbBinaryPath =
|
|
24
25
|
BB_BINARY_PATH ??
|
|
25
|
-
path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../', BB_RELEASE_DIR, 'bb');
|
|
26
|
+
path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../', BB_RELEASE_DIR, 'bb-avm');
|
|
26
27
|
await fs.access(bbBinaryPath, fs.constants.R_OK);
|
|
27
28
|
|
|
28
29
|
let bbWorkingDirectory: string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
2
|
+
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
3
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
4
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
5
|
import { tryJsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
6
|
import { InboxAbi } from '@aztec/l1-artifacts';
|
|
5
7
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|