@aztec/end-to-end 0.82.3 → 0.83.0
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/client_flows_benchmark.d.ts +16 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +59 -6
- 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 +87 -0
- package/dest/bench/client_flows/data_extractor.js +1 -2
- package/dest/bench/utils.js +2 -2
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +2 -4
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +2 -1
- package/dest/fixtures/l1_to_l2_messaging.d.ts +2 -2
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +2 -1
- package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
- package/dest/fixtures/setup_l1_contracts.js +1 -2
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +7 -2
- package/dest/fixtures/utils.d.ts +0 -4
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +216 -238
- package/dest/shared/cross_chain_test_harness.d.ts +1 -1
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +2 -2
- package/dest/shared/uniswap_l1_l2.js +8 -6
- package/package.json +32 -32
- package/src/bench/client_flows/client_flows_benchmark.ts +79 -5
- package/src/bench/client_flows/config.ts +53 -0
- package/src/bench/client_flows/data_extractor.ts +2 -2
- package/src/bench/utils.ts +2 -2
- package/src/e2e_fees/fees_test.ts +1 -4
- package/src/e2e_p2p/p2p_network.ts +2 -1
- package/src/fixtures/l1_to_l2_messaging.ts +12 -3
- package/src/fixtures/setup_l1_contracts.ts +1 -2
- package/src/fixtures/snapshot_manager.ts +7 -2
- package/src/fixtures/utils.ts +235 -261
- package/src/shared/cross_chain_test_harness.ts +2 -2
- package/src/shared/uniswap_l1_l2.ts +8 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.83.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -26,37 +26,37 @@
|
|
|
26
26
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@aztec/accounts": "0.
|
|
30
|
-
"@aztec/archiver": "0.
|
|
31
|
-
"@aztec/aztec": "0.
|
|
32
|
-
"@aztec/aztec-node": "0.
|
|
33
|
-
"@aztec/aztec.js": "0.
|
|
34
|
-
"@aztec/bb-prover": "0.
|
|
35
|
-
"@aztec/blob-lib": "0.
|
|
36
|
-
"@aztec/blob-sink": "0.
|
|
37
|
-
"@aztec/bot": "0.
|
|
38
|
-
"@aztec/constants": "0.
|
|
39
|
-
"@aztec/entrypoints": "0.
|
|
40
|
-
"@aztec/epoch-cache": "0.
|
|
41
|
-
"@aztec/ethereum": "0.
|
|
42
|
-
"@aztec/foundation": "0.
|
|
43
|
-
"@aztec/kv-store": "0.
|
|
44
|
-
"@aztec/l1-artifacts": "0.
|
|
45
|
-
"@aztec/merkle-tree": "0.
|
|
46
|
-
"@aztec/noir-contracts.js": "0.
|
|
47
|
-
"@aztec/noir-noirc_abi": "0.
|
|
48
|
-
"@aztec/noir-protocol-circuits-types": "0.
|
|
49
|
-
"@aztec/p2p": "0.
|
|
50
|
-
"@aztec/protocol-contracts": "0.
|
|
51
|
-
"@aztec/prover-client": "0.
|
|
52
|
-
"@aztec/prover-node": "0.
|
|
53
|
-
"@aztec/pxe": "0.
|
|
54
|
-
"@aztec/sequencer-client": "0.
|
|
55
|
-
"@aztec/simulator": "0.
|
|
56
|
-
"@aztec/stdlib": "0.
|
|
57
|
-
"@aztec/telemetry-client": "0.
|
|
58
|
-
"@aztec/validator-client": "0.
|
|
59
|
-
"@aztec/world-state": "0.
|
|
29
|
+
"@aztec/accounts": "0.83.0",
|
|
30
|
+
"@aztec/archiver": "0.83.0",
|
|
31
|
+
"@aztec/aztec": "0.83.0",
|
|
32
|
+
"@aztec/aztec-node": "0.83.0",
|
|
33
|
+
"@aztec/aztec.js": "0.83.0",
|
|
34
|
+
"@aztec/bb-prover": "0.83.0",
|
|
35
|
+
"@aztec/blob-lib": "0.83.0",
|
|
36
|
+
"@aztec/blob-sink": "0.83.0",
|
|
37
|
+
"@aztec/bot": "0.83.0",
|
|
38
|
+
"@aztec/constants": "0.83.0",
|
|
39
|
+
"@aztec/entrypoints": "0.83.0",
|
|
40
|
+
"@aztec/epoch-cache": "0.83.0",
|
|
41
|
+
"@aztec/ethereum": "0.83.0",
|
|
42
|
+
"@aztec/foundation": "0.83.0",
|
|
43
|
+
"@aztec/kv-store": "0.83.0",
|
|
44
|
+
"@aztec/l1-artifacts": "0.83.0",
|
|
45
|
+
"@aztec/merkle-tree": "0.83.0",
|
|
46
|
+
"@aztec/noir-contracts.js": "0.83.0",
|
|
47
|
+
"@aztec/noir-noirc_abi": "0.83.0",
|
|
48
|
+
"@aztec/noir-protocol-circuits-types": "0.83.0",
|
|
49
|
+
"@aztec/p2p": "0.83.0",
|
|
50
|
+
"@aztec/protocol-contracts": "0.83.0",
|
|
51
|
+
"@aztec/prover-client": "0.83.0",
|
|
52
|
+
"@aztec/prover-node": "0.83.0",
|
|
53
|
+
"@aztec/pxe": "0.83.0",
|
|
54
|
+
"@aztec/sequencer-client": "0.83.0",
|
|
55
|
+
"@aztec/simulator": "0.83.0",
|
|
56
|
+
"@aztec/stdlib": "0.83.0",
|
|
57
|
+
"@aztec/telemetry-client": "0.83.0",
|
|
58
|
+
"@aztec/validator-client": "0.83.0",
|
|
59
|
+
"@aztec/world-state": "0.83.0",
|
|
60
60
|
"@iarna/toml": "^2.2.5",
|
|
61
61
|
"@jest/globals": "^29.5.0",
|
|
62
62
|
"@msgpack/msgpack": "^3.0.0-beta2",
|
|
@@ -4,9 +4,14 @@ import {
|
|
|
4
4
|
type AccountWallet,
|
|
5
5
|
AztecAddress,
|
|
6
6
|
type AztecNode,
|
|
7
|
+
FeeJuicePaymentMethod,
|
|
7
8
|
FeeJuicePaymentMethodWithClaim,
|
|
9
|
+
type FeePaymentMethod,
|
|
8
10
|
type Logger,
|
|
9
11
|
type PXE,
|
|
12
|
+
PrivateFeePaymentMethod,
|
|
13
|
+
SponsoredFeePaymentMethod,
|
|
14
|
+
type Wallet,
|
|
10
15
|
createLogger,
|
|
11
16
|
} from '@aztec/aztec.js';
|
|
12
17
|
import { CheatCodes } from '@aztec/aztec.js/testing';
|
|
@@ -21,6 +26,7 @@ import { TestERC20Bytecode } from '@aztec/l1-artifacts/TestERC20Bytecode';
|
|
|
21
26
|
import { AMMContract } from '@aztec/noir-contracts.js/AMM';
|
|
22
27
|
import { FPCContract } from '@aztec/noir-contracts.js/FPC';
|
|
23
28
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
29
|
+
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
24
30
|
import { TokenContract as BananaCoin, TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
25
31
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
26
32
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
@@ -35,16 +41,19 @@ import {
|
|
|
35
41
|
deployAccounts,
|
|
36
42
|
} from '../../fixtures/snapshot_manager.js';
|
|
37
43
|
import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
|
|
38
|
-
import { type SetupOptions,
|
|
44
|
+
import { type SetupOptions, setupSponsoredFPC } from '../../fixtures/utils.js';
|
|
39
45
|
import { CrossChainTestHarness } from '../../shared/cross_chain_test_harness.js';
|
|
40
46
|
import {
|
|
41
47
|
FeeJuicePortalTestingHarnessFactory,
|
|
42
48
|
type GasBridgingTestHarness,
|
|
43
49
|
} from '../../shared/gas_portal_test_harness.js';
|
|
50
|
+
import { type ClientFlowsConfig, FULL_FLOWS_CONFIG, KEY_FLOWS_CONFIG } from './config.js';
|
|
44
51
|
|
|
45
|
-
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
52
|
+
const { E2E_DATA_PATH: dataPath, BENCHMARK_CONFIG } = process.env;
|
|
46
53
|
|
|
47
54
|
export type AccountType = 'ecdsar1' | 'schnorr';
|
|
55
|
+
export type FeePaymentMethodGetter = (wallet: Wallet) => Promise<FeePaymentMethod>;
|
|
56
|
+
export type BenchmarkingFeePaymentMethod = 'bridged_fee_juice' | 'private_fpc' | 'sponsored_fpc' | 'fee_juice';
|
|
48
57
|
|
|
49
58
|
export class ClientFlowsBenchmark {
|
|
50
59
|
private snapshotManager: ISnapshotManager;
|
|
@@ -76,10 +85,42 @@ export class ClientFlowsBenchmark {
|
|
|
76
85
|
public amm!: AMMContract;
|
|
77
86
|
// Liquidity token for AMM
|
|
78
87
|
public liquidityToken!: TokenContract;
|
|
88
|
+
// Sponsored FPC contract
|
|
89
|
+
public sponsoredFPC!: SponsoredFPCContract;
|
|
79
90
|
|
|
80
91
|
// PXE used by the benchmarking user. It can be set up with client-side proving enabled
|
|
81
92
|
public userPXE!: PXE;
|
|
82
93
|
|
|
94
|
+
public paymentMethods: Record<BenchmarkingFeePaymentMethod, { forWallet: FeePaymentMethodGetter; circuits: number }> =
|
|
95
|
+
{
|
|
96
|
+
// eslint-disable-next-line camelcase
|
|
97
|
+
bridged_fee_juice: {
|
|
98
|
+
forWallet: this.getBridgedFeeJuicePaymentMethodForWallet.bind(this),
|
|
99
|
+
circuits: 2, // FeeJuice claim + kernel inner
|
|
100
|
+
},
|
|
101
|
+
// eslint-disable-next-line camelcase
|
|
102
|
+
private_fpc: {
|
|
103
|
+
forWallet: this.getPrivateFPCPaymentMethodForWallet.bind(this),
|
|
104
|
+
circuits:
|
|
105
|
+
2 + // FPC entrypoint + kernel inner
|
|
106
|
+
2 + // BananaCoin transfer_to_public + kernel inner
|
|
107
|
+
2 + // Account verify_private_authwit + kernel inner
|
|
108
|
+
2, // BananaCoin prepare_private_balance_increase + kernel inner
|
|
109
|
+
},
|
|
110
|
+
// eslint-disable-next-line camelcase
|
|
111
|
+
sponsored_fpc: {
|
|
112
|
+
forWallet: this.getSponsoredFPCPaymentMethodForWallet.bind(this),
|
|
113
|
+
circuits: 2, // Sponsored FPC sponsor_unconditionally + kernel inner
|
|
114
|
+
},
|
|
115
|
+
// eslint-disable-next-line camelcase
|
|
116
|
+
fee_juice: {
|
|
117
|
+
forWallet: this.getFeeJuicePaymentMethodForWallet.bind(this),
|
|
118
|
+
circuits: 0,
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
public config: ClientFlowsConfig;
|
|
123
|
+
|
|
83
124
|
constructor(testName?: string, setupOptions: Partial<SetupOptions & DeployL1ContractsArgs> = {}) {
|
|
84
125
|
this.logger = createLogger(`bench:client_flows${testName ? `:${testName}` : ''}`);
|
|
85
126
|
this.snapshotManager = createSnapshotManager(
|
|
@@ -88,6 +129,7 @@ export class ClientFlowsBenchmark {
|
|
|
88
129
|
{ startProverNode: true, ...setupOptions },
|
|
89
130
|
{ ...setupOptions },
|
|
90
131
|
);
|
|
132
|
+
this.config = BENCHMARK_CONFIG === 'key_flows' ? KEY_FLOWS_CONFIG : FULL_FLOWS_CONFIG;
|
|
91
133
|
}
|
|
92
134
|
|
|
93
135
|
async setup() {
|
|
@@ -182,9 +224,7 @@ export class ClientFlowsBenchmark {
|
|
|
182
224
|
async applySetupFeeJuiceSnapshot() {
|
|
183
225
|
await this.snapshotManager.snapshot(
|
|
184
226
|
'setup_fee_juice',
|
|
185
|
-
async
|
|
186
|
-
await setupCanonicalFeeJuice(context.pxe);
|
|
187
|
-
},
|
|
227
|
+
async () => {},
|
|
188
228
|
async (_data, context) => {
|
|
189
229
|
this.context = context;
|
|
190
230
|
|
|
@@ -259,6 +299,20 @@ export class ClientFlowsBenchmark {
|
|
|
259
299
|
);
|
|
260
300
|
}
|
|
261
301
|
|
|
302
|
+
async applyDeploySponsoredFPCSnapshot() {
|
|
303
|
+
await this.snapshotManager.snapshot(
|
|
304
|
+
'deploy_sponsored_fpc',
|
|
305
|
+
async () => {
|
|
306
|
+
const sponsoredFPC = await setupSponsoredFPC(this.pxe);
|
|
307
|
+
this.logger.info(`SponsoredFPC deployed at ${sponsoredFPC.address}`);
|
|
308
|
+
return { sponsoredFPCAddress: sponsoredFPC.address };
|
|
309
|
+
},
|
|
310
|
+
async ({ sponsoredFPCAddress }) => {
|
|
311
|
+
this.sponsoredFPC = await SponsoredFPCContract.at(sponsoredFPCAddress, this.adminWallet);
|
|
312
|
+
},
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
|
|
262
316
|
public async createCrossChainTestHarness(owner: AccountWallet) {
|
|
263
317
|
const { publicClient, walletClient } = createL1Clients(this.context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
264
318
|
|
|
@@ -328,4 +382,24 @@ export class ClientFlowsBenchmark {
|
|
|
328
382
|
},
|
|
329
383
|
);
|
|
330
384
|
}
|
|
385
|
+
|
|
386
|
+
public async getBridgedFeeJuicePaymentMethodForWallet(wallet: Wallet) {
|
|
387
|
+
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(
|
|
388
|
+
FEE_FUNDING_FOR_TESTER_ACCOUNT,
|
|
389
|
+
wallet.getAddress(),
|
|
390
|
+
);
|
|
391
|
+
return new FeeJuicePaymentMethodWithClaim(wallet, claim);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
public getPrivateFPCPaymentMethodForWallet(wallet: Wallet) {
|
|
395
|
+
return Promise.resolve(new PrivateFeePaymentMethod(this.bananaFPC.address, wallet));
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
public getSponsoredFPCPaymentMethodForWallet(_wallet: Wallet) {
|
|
399
|
+
return Promise.resolve(new SponsoredFeePaymentMethod(this.sponsoredFPC.address));
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
public getFeeJuicePaymentMethodForWallet(wallet: Wallet) {
|
|
403
|
+
return Promise.resolve(new FeeJuicePaymentMethod(wallet.getAddress()));
|
|
404
|
+
}
|
|
331
405
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { AccountType, BenchmarkingFeePaymentMethod } from './client_flows_benchmark.js';
|
|
2
|
+
|
|
3
|
+
export type ClientFlowConfig = {
|
|
4
|
+
accounts: AccountType[];
|
|
5
|
+
feePaymentMethods: BenchmarkingFeePaymentMethod[];
|
|
6
|
+
recursions?: number[];
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type ClientFlows = 'deployments' | 'transfers' | 'bridging' | 'amm';
|
|
10
|
+
|
|
11
|
+
export type ClientFlowsConfig = {
|
|
12
|
+
[key in ClientFlows]: ClientFlowConfig;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const KEY_FLOWS_CONFIG: ClientFlowsConfig = {
|
|
16
|
+
deployments: {
|
|
17
|
+
accounts: ['ecdsar1', 'schnorr'],
|
|
18
|
+
feePaymentMethods: ['sponsored_fpc'],
|
|
19
|
+
},
|
|
20
|
+
amm: {
|
|
21
|
+
accounts: ['ecdsar1'],
|
|
22
|
+
feePaymentMethods: ['sponsored_fpc'],
|
|
23
|
+
},
|
|
24
|
+
bridging: {
|
|
25
|
+
accounts: ['ecdsar1'],
|
|
26
|
+
feePaymentMethods: ['sponsored_fpc'],
|
|
27
|
+
},
|
|
28
|
+
transfers: {
|
|
29
|
+
accounts: ['ecdsar1', 'schnorr'],
|
|
30
|
+
feePaymentMethods: ['sponsored_fpc', 'fee_juice'],
|
|
31
|
+
recursions: [1],
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const FULL_FLOWS_CONFIG: ClientFlowsConfig = {
|
|
36
|
+
deployments: {
|
|
37
|
+
accounts: ['ecdsar1', 'schnorr'],
|
|
38
|
+
feePaymentMethods: ['bridged_fee_juice', 'sponsored_fpc'],
|
|
39
|
+
},
|
|
40
|
+
amm: {
|
|
41
|
+
accounts: ['ecdsar1', 'schnorr'],
|
|
42
|
+
feePaymentMethods: ['sponsored_fpc', 'private_fpc'],
|
|
43
|
+
},
|
|
44
|
+
bridging: {
|
|
45
|
+
accounts: ['ecdsar1', 'schnorr'],
|
|
46
|
+
feePaymentMethods: ['sponsored_fpc', 'private_fpc'],
|
|
47
|
+
},
|
|
48
|
+
transfers: {
|
|
49
|
+
accounts: ['ecdsar1', 'schnorr'],
|
|
50
|
+
feePaymentMethods: ['sponsored_fpc', 'private_fpc'],
|
|
51
|
+
recursions: [0, 1, 2],
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -163,7 +163,6 @@ async function main() {
|
|
|
163
163
|
bytecode: acirStack[i],
|
|
164
164
|
witness: witnessStack[i],
|
|
165
165
|
}));
|
|
166
|
-
let minimumTrace: StructuredTrace | undefined;
|
|
167
166
|
let stats: { duration: number; eventName: string; proofSize: number } | undefined;
|
|
168
167
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
169
168
|
let error: any | undefined;
|
|
@@ -179,10 +178,11 @@ async function main() {
|
|
|
179
178
|
await writeFile(join(ivcFolder, flow, 'logs.json'), JSON.stringify(currentLogs, null, 2));
|
|
180
179
|
|
|
181
180
|
if (!error) {
|
|
182
|
-
minimumTrace = getMinimumTrace(currentLogs, proverType);
|
|
183
181
|
stats = currentLogs[0].data as { duration: number; eventName: string; proofSize: number };
|
|
184
182
|
}
|
|
185
183
|
|
|
184
|
+
const minimumTrace = getMinimumTrace(currentLogs, proverType);
|
|
185
|
+
|
|
186
186
|
const steps = executionSteps.reduce<Step[]>((acc, step, i) => {
|
|
187
187
|
const previousAccGateCount = i === 0 ? 0 : acc[i - 1].accGateCount!;
|
|
188
188
|
return [
|
package/src/bench/utils.ts
CHANGED
|
@@ -160,7 +160,7 @@ export async function createNewPXE(
|
|
|
160
160
|
startingBlock: number = INITIAL_L2_BLOCK_NUM,
|
|
161
161
|
): Promise<PXEService> {
|
|
162
162
|
const l1Contracts = await node.getL1ContractAddresses();
|
|
163
|
-
const { l1ChainId,
|
|
163
|
+
const { l1ChainId, rollupVersion } = await node.getNodeInfo();
|
|
164
164
|
const pxeConfig = {
|
|
165
165
|
l2StartingBlock: startingBlock,
|
|
166
166
|
l2BlockPollingIntervalMS: 100,
|
|
@@ -168,7 +168,7 @@ export async function createNewPXE(
|
|
|
168
168
|
dataStoreMapSizeKB: 1024 * 1024,
|
|
169
169
|
l1Contracts,
|
|
170
170
|
l1ChainId,
|
|
171
|
-
|
|
171
|
+
rollupVersion,
|
|
172
172
|
} as PXEServiceConfig;
|
|
173
173
|
const pxe = await createPXEService(node, pxeConfig);
|
|
174
174
|
await pxe.registerContract(contract);
|
|
@@ -39,7 +39,6 @@ import {
|
|
|
39
39
|
type SetupOptions,
|
|
40
40
|
ensureAccountsPubliclyDeployed,
|
|
41
41
|
getBalancesFn,
|
|
42
|
-
setupCanonicalFeeJuice,
|
|
43
42
|
setupSponsoredFPC,
|
|
44
43
|
} from '../fixtures/utils.js';
|
|
45
44
|
import { FeeJuicePortalTestingHarnessFactory, type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.js';
|
|
@@ -198,9 +197,7 @@ export class FeesTest {
|
|
|
198
197
|
async applySetupFeeJuiceSnapshot() {
|
|
199
198
|
await this.snapshotManager.snapshot(
|
|
200
199
|
'setup_fee_juice',
|
|
201
|
-
async
|
|
202
|
-
await setupCanonicalFeeJuice(context.pxe);
|
|
203
|
-
},
|
|
200
|
+
async () => {},
|
|
204
201
|
async (_data, context) => {
|
|
205
202
|
this.context = context;
|
|
206
203
|
|
|
@@ -97,9 +97,10 @@ export class P2PNetworkTest {
|
|
|
97
97
|
initialValidatorConfig.aztecProofSubmissionWindow ?? l1ContractsConfig.aztecProofSubmissionWindow,
|
|
98
98
|
salt: 420,
|
|
99
99
|
metricsPort: metricsPort,
|
|
100
|
-
numberOfInitialFundedAccounts:
|
|
100
|
+
numberOfInitialFundedAccounts: 2,
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
|
+
...initialValidatorConfig,
|
|
103
104
|
aztecEpochDuration: initialValidatorConfig.aztecEpochDuration ?? l1ContractsConfig.aztecEpochDuration,
|
|
104
105
|
ethereumSlotDuration: initialValidatorConfig.ethereumSlotDuration ?? l1ContractsConfig.ethereumSlotDuration,
|
|
105
106
|
aztecSlotDuration: initialValidatorConfig.aztecSlotDuration ?? l1ContractsConfig.aztecSlotDuration,
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
type L1ContractAddresses,
|
|
3
|
+
RollupContract,
|
|
4
|
+
type ViemPublicClient,
|
|
5
|
+
type ViemWalletClient,
|
|
6
|
+
} from '@aztec/ethereum';
|
|
2
7
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
8
|
import { InboxAbi } from '@aztec/l1-artifacts';
|
|
4
9
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
@@ -11,7 +16,7 @@ export async function sendL1ToL2Message(
|
|
|
11
16
|
ctx: {
|
|
12
17
|
walletClient: ViemWalletClient;
|
|
13
18
|
publicClient: ViemPublicClient;
|
|
14
|
-
l1ContractAddresses: Pick<L1ContractAddresses, 'inboxAddress'>;
|
|
19
|
+
l1ContractAddresses: Pick<L1ContractAddresses, 'inboxAddress' | 'rollupAddress'>;
|
|
15
20
|
},
|
|
16
21
|
) {
|
|
17
22
|
const inbox = getContract({
|
|
@@ -21,7 +26,11 @@ export async function sendL1ToL2Message(
|
|
|
21
26
|
});
|
|
22
27
|
|
|
23
28
|
const { recipient, content, secretHash } = message;
|
|
24
|
-
|
|
29
|
+
|
|
30
|
+
const version = await new RollupContract(
|
|
31
|
+
ctx.publicClient,
|
|
32
|
+
ctx.l1ContractAddresses.rollupAddress.toString(),
|
|
33
|
+
).getVersion();
|
|
25
34
|
|
|
26
35
|
// We inject the message to Inbox
|
|
27
36
|
const txHash = await inbox.write.sendL2Message([
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Logger } from '@aztec/aztec.js';
|
|
2
2
|
import { type DeployL1ContractsArgs, type L1ContractsConfig, deployL1Contracts } from '@aztec/ethereum';
|
|
3
3
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
4
|
-
import {
|
|
4
|
+
import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
5
5
|
|
|
6
6
|
import type { HDAccount, PrivateKeyAccount } from 'viem';
|
|
7
7
|
import { foundry } from 'viem/chains';
|
|
@@ -16,7 +16,6 @@ export const setupL1Contracts = async (
|
|
|
16
16
|
L1ContractsConfig,
|
|
17
17
|
) => {
|
|
18
18
|
const l1Data = await deployL1Contracts([l1RpcUrl], account, foundry, logger, {
|
|
19
|
-
l2FeeJuiceAddress: ProtocolContractAddress.FeeJuice.toField(),
|
|
20
19
|
vkTreeRoot: getVKTreeRoot(),
|
|
21
20
|
protocolContractTreeRoot,
|
|
22
21
|
salt: undefined,
|
|
@@ -308,6 +308,9 @@ async function setupFromFresh(
|
|
|
308
308
|
aztecNodeConfig.peerCheckIntervalMS = TEST_PEER_CHECK_INTERVAL_MS;
|
|
309
309
|
// Only enable proving if specifically requested.
|
|
310
310
|
aztecNodeConfig.realProofs = !!opts.realProofs;
|
|
311
|
+
// Only enforce the time table if requested
|
|
312
|
+
aztecNodeConfig.enforceTimeTable = !!opts.enforceTimeTable;
|
|
313
|
+
aztecNodeConfig.listenAddress = '127.0.0.1';
|
|
311
314
|
|
|
312
315
|
// Create a temp directory for all ephemeral state and cleanup afterwards
|
|
313
316
|
const directoryToCleanup = path.join(tmpdir(), randomBytes(8).toString('hex'));
|
|
@@ -317,7 +320,7 @@ async function setupFromFresh(
|
|
|
317
320
|
} else {
|
|
318
321
|
aztecNodeConfig.dataDirectory = statePath;
|
|
319
322
|
}
|
|
320
|
-
aztecNodeConfig.blobSinkUrl = `http://
|
|
323
|
+
aztecNodeConfig.blobSinkUrl = `http://127.0.0.1:${blobSinkPort}`;
|
|
321
324
|
|
|
322
325
|
// Start anvil. We go via a wrapper script to ensure if the parent dies, anvil dies.
|
|
323
326
|
logger.verbose('Starting anvil...');
|
|
@@ -345,7 +348,7 @@ async function setupFromFresh(
|
|
|
345
348
|
|
|
346
349
|
const initialFundedAccounts = await generateSchnorrAccounts(numberOfInitialFundedAccounts);
|
|
347
350
|
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
348
|
-
const { genesisArchiveRoot, genesisBlockHash, prefilledPublicData } = await getGenesisValues(
|
|
351
|
+
const { genesisArchiveRoot, genesisBlockHash, prefilledPublicData, fundingNeeded } = await getGenesisValues(
|
|
349
352
|
initialFundedAccounts.map(a => a.address).concat(sponsoredFPCAddress),
|
|
350
353
|
opts.initialAccountFeeJuice,
|
|
351
354
|
);
|
|
@@ -354,6 +357,7 @@ async function setupFromFresh(
|
|
|
354
357
|
...getL1ContractsConfigEnvVars(),
|
|
355
358
|
genesisArchiveRoot,
|
|
356
359
|
genesisBlockHash,
|
|
360
|
+
feeJuicePortalInitialBalance: fundingNeeded,
|
|
357
361
|
salt: opts.salt,
|
|
358
362
|
...deployL1ContractsArgs,
|
|
359
363
|
initialValidators: opts.initialValidators,
|
|
@@ -490,6 +494,7 @@ async function setupFromState(statePath: string, logger: Logger): Promise<Subsys
|
|
|
490
494
|
);
|
|
491
495
|
aztecNodeConfig.dataDirectory = statePath;
|
|
492
496
|
aztecNodeConfig.blobSinkUrl = `http://127.0.0.1:${blobSinkPort}`;
|
|
497
|
+
aztecNodeConfig.listenAddress = '127.0.0.1';
|
|
493
498
|
|
|
494
499
|
const initialFundedAccounts: InitialAccountData[] =
|
|
495
500
|
JSON.parse(readFileSync(`${statePath}/accounts.json`, 'utf-8'), reviver) || [];
|