@aztec/end-to-end 0.0.1-commit.7b97ef96e → 0.0.1-commit.7cbc774
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/dest/bench/client_flows/benchmark.d.ts +15 -1
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +17 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +2 -2
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +33 -36
- package/dest/bench/utils.d.ts +1 -1
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +8 -3
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +5 -4
- 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 +28 -19
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +15 -4
- 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 +39 -7
- package/dest/e2e_deploy_contract/deploy_test.d.ts +3 -3
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +2 -1
- package/dest/e2e_epochs/epochs_test.d.ts +25 -2
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +88 -14
- package/dest/e2e_fees/fees_test.d.ts +5 -2
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +45 -12
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +3 -3
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +6 -7
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +5 -3
- package/dest/e2e_p2p/p2p_network.d.ts +13 -11
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +65 -43
- package/dest/e2e_p2p/reqresp/utils.d.ts +1 -1
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -1
- package/dest/e2e_p2p/reqresp/utils.js +42 -13
- package/dest/e2e_p2p/shared.d.ts +25 -7
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +73 -50
- package/dest/e2e_token_contract/token_contract_test.d.ts +3 -3
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +15 -13
- package/dest/fixtures/authwit_proxy.d.ts +3 -3
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -1
- package/dest/fixtures/authwit_proxy.js +4 -0
- package/dest/fixtures/e2e_prover_test.d.ts +6 -5
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +13 -17
- package/dest/fixtures/elu_monitor.d.ts +21 -0
- package/dest/fixtures/elu_monitor.d.ts.map +1 -0
- package/dest/fixtures/elu_monitor.js +102 -0
- package/dest/fixtures/fixtures.d.ts +73 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +68 -0
- package/dest/fixtures/get_bb_config.d.ts +1 -1
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +5 -5
- package/dest/fixtures/ha_setup.d.ts +2 -2
- package/dest/fixtures/ha_setup.d.ts.map +1 -1
- package/dest/fixtures/ha_setup.js +1 -1
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
- package/dest/fixtures/setup.d.ts +45 -14
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +138 -29
- package/dest/fixtures/setup_p2p_test.d.ts +10 -6
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +8 -8
- package/dest/fixtures/token_utils.d.ts +1 -1
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +2 -5
- package/dest/fixtures/utils.d.ts +2 -2
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +1 -1
- package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
- package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
- package/dest/forward-compatibility/wallet_service.d.ts +3 -0
- package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_service.js +109 -0
- package/dest/install_legacy_contracts.d.cts +10 -0
- package/dest/install_legacy_contracts.d.cts.map +1 -0
- package/dest/legacy-jest-resolver.d.cts +3 -0
- package/dest/legacy-jest-resolver.d.cts.map +1 -0
- package/dest/shared/cross_chain_test_harness.d.ts +4 -2
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +22 -18
- package/dest/shared/gas_portal_test_harness.d.ts +8 -5
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +19 -10
- package/dest/shared/jest_setup.js +41 -1
- package/dest/shared/submit-transactions.d.ts +1 -1
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +60 -39
- package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
- package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
- package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
- package/dest/simulators/lending_simulator.d.ts +10 -3
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +26 -14
- package/dest/simulators/token_simulator.d.ts +1 -1
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +2 -2
- package/dest/spartan/setup_test_wallets.d.ts +4 -2
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +72 -39
- package/dest/spartan/tx_metrics.d.ts +18 -4
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +74 -21
- package/dest/spartan/utils/config.d.ts +10 -30
- package/dest/spartan/utils/config.d.ts.map +1 -1
- package/dest/spartan/utils/config.js +3 -1
- package/dest/spartan/utils/index.d.ts +3 -1
- package/dest/spartan/utils/index.d.ts.map +1 -1
- package/dest/spartan/utils/index.js +4 -0
- package/dest/spartan/utils/nodes.d.ts +4 -5
- package/dest/spartan/utils/nodes.d.ts.map +1 -1
- package/dest/spartan/utils/nodes.js +11 -11
- package/dest/spartan/utils/pod_logs.d.ts +25 -0
- package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
- package/dest/spartan/utils/pod_logs.js +74 -0
- package/dest/test-wallet/test_wallet.d.ts +25 -23
- package/dest/test-wallet/test_wallet.d.ts.map +1 -1
- package/dest/test-wallet/test_wallet.js +146 -87
- package/dest/test-wallet/utils.d.ts +3 -3
- package/dest/test-wallet/utils.d.ts.map +1 -1
- package/dest/test-wallet/utils.js +2 -7
- package/dest/test-wallet/wallet_worker_script.js +42 -34
- package/dest/test-wallet/worker_wallet.d.ts +5 -4
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet.js +56 -4
- package/dest/test-wallet/worker_wallet_schema.d.ts +110 -224
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet_schema.js +14 -2
- package/package.json +49 -46
- package/src/bench/client_flows/benchmark.ts +19 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +60 -41
- package/src/bench/utils.ts +9 -3
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +42 -24
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +49 -11
- package/src/e2e_deploy_contract/deploy_test.ts +3 -2
- package/src/e2e_epochs/epochs_test.ts +99 -11
- package/src/e2e_fees/fees_test.ts +50 -10
- package/src/e2e_nested_contract/nested_contract_test.ts +9 -5
- package/src/e2e_p2p/inactivity_slash_test.ts +5 -3
- package/src/e2e_p2p/p2p_network.ts +82 -60
- package/src/e2e_p2p/reqresp/utils.ts +51 -12
- package/src/e2e_p2p/shared.ts +92 -64
- package/src/e2e_token_contract/token_contract_test.ts +28 -10
- package/src/fixtures/authwit_proxy.ts +4 -0
- package/src/fixtures/e2e_prover_test.ts +22 -19
- package/src/fixtures/elu_monitor.ts +126 -0
- package/src/fixtures/fixtures.ts +86 -0
- package/src/fixtures/get_bb_config.ts +7 -6
- package/src/fixtures/ha_setup.ts +4 -2
- package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +179 -38
- package/src/fixtures/setup_p2p_test.ts +13 -9
- package/src/fixtures/token_utils.ts +1 -2
- package/src/fixtures/utils.ts +2 -0
- package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
- package/src/forward-compatibility/wallet_service.ts +104 -0
- package/src/guides/up_quick_start.sh +0 -2
- package/src/install_legacy_contracts.cjs +75 -0
- package/src/legacy-jest-resolver.cjs +112 -0
- package/src/shared/cross_chain_test_harness.ts +27 -13
- package/src/shared/gas_portal_test_harness.ts +21 -11
- package/src/shared/jest_setup.ts +51 -1
- package/src/shared/submit-transactions.ts +1 -4
- package/src/shared/uniswap_l1_l2.ts +77 -50
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +32 -14
- package/src/simulators/token_simulator.ts +6 -2
- package/src/spartan/setup_test_wallets.ts +91 -37
- package/src/spartan/tx_metrics.ts +82 -24
- package/src/spartan/utils/config.ts +2 -0
- package/src/spartan/utils/index.ts +6 -0
- package/src/spartan/utils/nodes.ts +17 -12
- package/src/spartan/utils/pod_logs.ts +99 -0
- package/src/test-wallet/test_wallet.ts +174 -104
- package/src/test-wallet/utils.ts +3 -7
- package/src/test-wallet/wallet_worker_script.ts +48 -31
- package/src/test-wallet/worker_wallet.ts +60 -7
- package/src/test-wallet/worker_wallet_schema.ts +2 -2
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
type ProfileInteractionOptions,
|
|
6
6
|
} from '@aztec/aztec.js/contracts';
|
|
7
7
|
import type { Logger } from '@aztec/aztec.js/log';
|
|
8
|
+
import { MAX_APPS_PER_KERNEL } from '@aztec/constants';
|
|
8
9
|
import { createLogger } from '@aztec/foundation/log';
|
|
9
10
|
import { type PrivateExecutionStep, serializePrivateExecutionSteps } from '@aztec/stdlib/kernel';
|
|
10
11
|
import type {
|
|
@@ -320,6 +321,24 @@ export function convertProfileToGHBenchmark(benchmark: ClientFlowBenchmark): Git
|
|
|
320
321
|
return benches;
|
|
321
322
|
}
|
|
322
323
|
|
|
324
|
+
/**
|
|
325
|
+
* Computes the expected number of `PrivateExecutionStep` entries the orchestrator will produce
|
|
326
|
+
* for a tx with `apps` private function calls.
|
|
327
|
+
*
|
|
328
|
+
* Step layout: `apps` app circuits + kernel iterations + 1 final reset + 1 tail + 1 hiding kernel.
|
|
329
|
+
* Each kernel iteration absorbs up to `MAX_APPS_PER_KERNEL` apps via the `init_K` / `inner_K`
|
|
330
|
+
* variants, so the kernel count is `ceil(apps / MAX_APPS_PER_KERNEL)`.
|
|
331
|
+
*
|
|
332
|
+
* Caveat: this assumes no mid-flow reset is triggered, which would split a batch into two kernels
|
|
333
|
+
* separated by a reset. For the flows currently exercised in this benchmark suite that holds, but
|
|
334
|
+
* a future flow that grows large enough to overflow per-tx limits before consuming all apps will
|
|
335
|
+
* not match this formula.
|
|
336
|
+
*/
|
|
337
|
+
export function expectedExecutionSteps(apps: number): number {
|
|
338
|
+
const kernels = Math.ceil(apps / MAX_APPS_PER_KERNEL);
|
|
339
|
+
return apps + kernels + 1 /* final reset */ + 1 /* tail */ + 1 /* hiding */;
|
|
340
|
+
}
|
|
341
|
+
|
|
323
342
|
export async function captureProfile(
|
|
324
343
|
label: string,
|
|
325
344
|
interaction: ContractFunctionInteraction | DeployMethod,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { NO_FROM } from '@aztec/aztec.js/account';
|
|
1
2
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
3
|
import { FeeJuicePaymentMethodWithClaim } from '@aztec/aztec.js/fee';
|
|
3
4
|
import { type FeePaymentMethod, PrivateFeePaymentMethod, SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee';
|
|
4
5
|
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
5
6
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
6
7
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
7
|
-
import { CheatCodes } from '@aztec/aztec/testing';
|
|
8
|
+
import { CheatCodes, getTokenAllowedSetupFunctions } from '@aztec/aztec/testing';
|
|
8
9
|
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
9
10
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
10
11
|
import type { DeployAztecL1ContractsArgs } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
@@ -27,7 +28,7 @@ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
|
27
28
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
28
29
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
29
30
|
|
|
30
|
-
import { MNEMONIC } from '../../fixtures/fixtures.js';
|
|
31
|
+
import { AUTOMINE_E2E_OPTS, MNEMONIC, getPaddedMaxFeesPerGas } from '../../fixtures/fixtures.js';
|
|
31
32
|
import { type EndToEndContext, type SetupOptions, deployAccounts, setup, teardown } from '../../fixtures/setup.js';
|
|
32
33
|
import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
|
|
33
34
|
import { setupSponsoredFPC } from '../../fixtures/utils.js';
|
|
@@ -87,33 +88,35 @@ export class ClientFlowsBenchmark {
|
|
|
87
88
|
|
|
88
89
|
public realProofs = ['true', '1'].includes(process.env.REAL_PROOFS ?? '');
|
|
89
90
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
//
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
//
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
91
|
+
// `apps` is the number of private function calls contributed by this payment method.
|
|
92
|
+
// Each app produces one execution step at proving time; the orchestrator additionally produces
|
|
93
|
+
// one kernel step per batch of N apps (see `expectedExecutionSteps` in `benchmark.ts`).
|
|
94
|
+
public paymentMethods: Record<BenchmarkingFeePaymentMethod, { forWallet: FeePaymentMethodGetter; apps: number }> = {
|
|
95
|
+
// eslint-disable-next-line camelcase
|
|
96
|
+
bridged_fee_juice: {
|
|
97
|
+
forWallet: this.getBridgedFeeJuicePaymentMethodForWallet.bind(this),
|
|
98
|
+
apps: 1, // FeeJuice claim
|
|
99
|
+
},
|
|
100
|
+
// eslint-disable-next-line camelcase
|
|
101
|
+
private_fpc: {
|
|
102
|
+
forWallet: this.getPrivateFPCPaymentMethodForWallet.bind(this),
|
|
103
|
+
apps:
|
|
104
|
+
1 + // FPC entrypoint
|
|
105
|
+
1 + // BananaCoin transfer_to_public
|
|
106
|
+
1 + // Account verify_private_authwit
|
|
107
|
+
1, // BananaCoin prepare_private_balance_increase
|
|
108
|
+
},
|
|
109
|
+
// eslint-disable-next-line camelcase
|
|
110
|
+
sponsored_fpc: {
|
|
111
|
+
forWallet: this.getSponsoredFPCPaymentMethodForWallet.bind(this),
|
|
112
|
+
apps: 1, // Sponsored FPC sponsor_unconditionally
|
|
113
|
+
},
|
|
114
|
+
// eslint-disable-next-line camelcase
|
|
115
|
+
fee_juice: {
|
|
116
|
+
forWallet: () => Promise.resolve(undefined),
|
|
117
|
+
apps: 0,
|
|
118
|
+
},
|
|
119
|
+
};
|
|
117
120
|
|
|
118
121
|
public config: ClientFlowsConfig;
|
|
119
122
|
|
|
@@ -122,7 +125,7 @@ export class ClientFlowsBenchmark {
|
|
|
122
125
|
|
|
123
126
|
constructor(testName?: string, setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs> = {}) {
|
|
124
127
|
this.logger = createLogger(`bench:client_flows${testName ? `:${testName}` : ''}`);
|
|
125
|
-
this.setupOptions = { startProverNode: true, ...setupOptions };
|
|
128
|
+
this.setupOptions = { ...AUTOMINE_E2E_OPTS, startProverNode: true, ...setupOptions };
|
|
126
129
|
this.config = BENCHMARK_CONFIG === 'key_flows' ? KEY_FLOWS_CONFIG : FULL_FLOWS_CONFIG;
|
|
127
130
|
ProxyLogger.create();
|
|
128
131
|
this.proxyLogger = ProxyLogger.getInstance();
|
|
@@ -130,11 +133,14 @@ export class ClientFlowsBenchmark {
|
|
|
130
133
|
|
|
131
134
|
async setup() {
|
|
132
135
|
this.logger.info('Setting up subsystems from fresh');
|
|
136
|
+
// Token allowlist entries are test-only: FPC-based fee payment with custom tokens won't work on mainnet alpha.
|
|
137
|
+
const tokenAllowList = await getTokenAllowedSetupFunctions();
|
|
133
138
|
this.context = await setup(0, {
|
|
134
139
|
...this.setupOptions,
|
|
135
140
|
fundSponsoredFPC: true,
|
|
136
141
|
skipAccountDeployment: true,
|
|
137
142
|
l1ContractsArgs: this.setupOptions,
|
|
143
|
+
txPublicSetupAllowListExtend: [...(this.setupOptions.txPublicSetupAllowListExtend ?? []), ...tokenAllowList],
|
|
138
144
|
});
|
|
139
145
|
await this.applyBaseSetup();
|
|
140
146
|
|
|
@@ -148,6 +154,7 @@ export class ClientFlowsBenchmark {
|
|
|
148
154
|
|
|
149
155
|
async teardown() {
|
|
150
156
|
await this.chainMonitor.stop();
|
|
157
|
+
await this.userWallet?.stop();
|
|
151
158
|
await teardown(this.context);
|
|
152
159
|
}
|
|
153
160
|
|
|
@@ -161,11 +168,15 @@ export class ClientFlowsBenchmark {
|
|
|
161
168
|
|
|
162
169
|
/** Admin mints bananaCoin tokens privately to the target address and redeems them. */
|
|
163
170
|
async mintPrivateBananas(amount: bigint, address: AztecAddress) {
|
|
164
|
-
const balanceBefore = await this.bananaCoin.methods
|
|
171
|
+
const { result: balanceBefore } = await this.bananaCoin.methods
|
|
172
|
+
.balance_of_private(address)
|
|
173
|
+
.simulate({ from: address });
|
|
165
174
|
|
|
166
175
|
await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
|
|
167
176
|
|
|
168
|
-
const balanceAfter = await this.bananaCoin.methods
|
|
177
|
+
const { result: balanceAfter } = await this.bananaCoin.methods
|
|
178
|
+
.balance_of_private(address)
|
|
179
|
+
.simulate({ from: address });
|
|
169
180
|
expect(balanceAfter).toEqual(balanceBefore + amount);
|
|
170
181
|
}
|
|
171
182
|
|
|
@@ -247,7 +258,9 @@ export class ClientFlowsBenchmark {
|
|
|
247
258
|
'BC',
|
|
248
259
|
'BC',
|
|
249
260
|
18n,
|
|
250
|
-
).send({
|
|
261
|
+
).send({
|
|
262
|
+
from: this.adminAddress,
|
|
263
|
+
});
|
|
251
264
|
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
252
265
|
this.bananaCoin = bananaCoin;
|
|
253
266
|
this.bananaCoinInstance = bananaCoinInstance;
|
|
@@ -261,7 +274,9 @@ export class ClientFlowsBenchmark {
|
|
|
261
274
|
'CBC',
|
|
262
275
|
'CBC',
|
|
263
276
|
18n,
|
|
264
|
-
).send({
|
|
277
|
+
).send({
|
|
278
|
+
from: this.adminAddress,
|
|
279
|
+
});
|
|
265
280
|
this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
|
|
266
281
|
this.candyBarCoin = candyBarCoin;
|
|
267
282
|
this.candyBarCoinInstance = candyBarCoinInstance;
|
|
@@ -277,7 +292,9 @@ export class ClientFlowsBenchmark {
|
|
|
277
292
|
this.adminWallet,
|
|
278
293
|
bananaCoin.address,
|
|
279
294
|
this.adminAddress,
|
|
280
|
-
).send({
|
|
295
|
+
).send({
|
|
296
|
+
from: this.adminAddress,
|
|
297
|
+
});
|
|
281
298
|
|
|
282
299
|
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
283
300
|
|
|
@@ -326,13 +343,13 @@ export class ClientFlowsBenchmark {
|
|
|
326
343
|
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
|
|
327
344
|
const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
|
|
328
345
|
await behchysDeployMethod.send({
|
|
329
|
-
from:
|
|
346
|
+
from: NO_FROM,
|
|
330
347
|
fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
|
|
331
348
|
});
|
|
332
349
|
// Register benchy on the user's Wallet, where we're going to be interacting from
|
|
333
350
|
const accountManager = await this.userWallet.createAccount({
|
|
334
351
|
secret: benchysAccount.getSecretKey(),
|
|
335
|
-
salt: new Fr(
|
|
352
|
+
salt: new Fr(benchysAccountManager.getInstance().salt),
|
|
336
353
|
contract: benchysAccountManager.getAccountContract(),
|
|
337
354
|
});
|
|
338
355
|
return accountManager.address;
|
|
@@ -346,13 +363,15 @@ export class ClientFlowsBenchmark {
|
|
|
346
363
|
'LPT',
|
|
347
364
|
'LPT',
|
|
348
365
|
18n,
|
|
349
|
-
).send({
|
|
366
|
+
).send({
|
|
367
|
+
from: this.adminAddress,
|
|
368
|
+
});
|
|
350
369
|
const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
|
|
351
370
|
this.adminWallet,
|
|
352
371
|
this.bananaCoin.address,
|
|
353
372
|
this.candyBarCoin.address,
|
|
354
373
|
liquidityToken.address,
|
|
355
|
-
).send({ from: this.adminAddress
|
|
374
|
+
).send({ from: this.adminAddress });
|
|
356
375
|
this.logger.info(`AMM deployed at ${amm.address}`);
|
|
357
376
|
await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress });
|
|
358
377
|
this.liquidityToken = liquidityToken;
|
|
@@ -369,8 +388,8 @@ export class ClientFlowsBenchmark {
|
|
|
369
388
|
public async getPrivateFPCPaymentMethodForWallet(wallet: Wallet, sender: AztecAddress) {
|
|
370
389
|
// The private fee paying method assembled on the app side requires knowledge of the maximum
|
|
371
390
|
// fee the user is willing to pay
|
|
372
|
-
const maxFeesPerGas =
|
|
373
|
-
const gasSettings = GasSettings.
|
|
391
|
+
const maxFeesPerGas = await getPaddedMaxFeesPerGas(this.aztecNode);
|
|
392
|
+
const gasSettings = GasSettings.fallback({ maxFeesPerGas });
|
|
374
393
|
return new PrivateFeePaymentMethod(this.bananaFPC.address, sender, wallet, gasSettings);
|
|
375
394
|
}
|
|
376
395
|
|
package/src/bench/utils.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { BenchmarkDataPoint, BenchmarkMetricsType, BenchmarkTelemetryClient
|
|
|
11
11
|
import { mkdirSync, writeFileSync } from 'fs';
|
|
12
12
|
import path from 'path';
|
|
13
13
|
|
|
14
|
+
import { PIPELINING_SETUP_OPTS } from '../fixtures/fixtures.js';
|
|
14
15
|
import { type EndToEndContext, type SetupOptions, setup } from '../fixtures/utils.js';
|
|
15
16
|
|
|
16
17
|
/**
|
|
@@ -23,9 +24,9 @@ export async function benchmarkSetup(
|
|
|
23
24
|
benchOutput?: string;
|
|
24
25
|
},
|
|
25
26
|
) {
|
|
26
|
-
const context = await setup(1, { ...opts, telemetryConfig: { benchmark: true } });
|
|
27
|
+
const context = await setup(1, { ...PIPELINING_SETUP_OPTS, ...opts, telemetryConfig: { benchmark: true } });
|
|
27
28
|
const defaultAccountAddress = context.accounts[0];
|
|
28
|
-
const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress });
|
|
29
|
+
const { contract } = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress });
|
|
29
30
|
context.logger.info(`Deployed benchmarking contract at ${contract.address}`);
|
|
30
31
|
const sequencer = (context.aztecNode as AztecNodeService).getSequencer()!;
|
|
31
32
|
const telemetry = context.telemetryClient as BenchmarkTelemetryClient;
|
|
@@ -149,7 +150,12 @@ export async function sendTxs(
|
|
|
149
150
|
context.logger.info(`Creating ${txCount} txs`);
|
|
150
151
|
const [from] = context.accounts;
|
|
151
152
|
context.logger.info(`Sending ${txCount} txs`);
|
|
152
|
-
return Promise.all(
|
|
153
|
+
return Promise.all(
|
|
154
|
+
calls.map(async call => {
|
|
155
|
+
const { txHash } = await call.send({ from, wait: NO_WAIT });
|
|
156
|
+
return txHash;
|
|
157
|
+
}),
|
|
158
|
+
);
|
|
153
159
|
}
|
|
154
160
|
|
|
155
161
|
export async function waitTxs(txs: TxHash[], context: EndToEndContext, txWaitOpts?: WaitOpts) {
|
|
@@ -10,10 +10,19 @@ import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist'
|
|
|
10
10
|
import { GenericProxyContract } from '@aztec/noir-test-contracts.js/GenericProxy';
|
|
11
11
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
12
12
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
13
|
+
import type { AztecNodeDebug } from '@aztec/stdlib/interfaces/client';
|
|
13
14
|
|
|
14
15
|
import { jest } from '@jest/globals';
|
|
15
16
|
|
|
16
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
type EndToEndContext,
|
|
19
|
+
type SetupOptions,
|
|
20
|
+
deployAccounts,
|
|
21
|
+
ensureAuthRegistryPublished,
|
|
22
|
+
publicDeployAccounts,
|
|
23
|
+
setup,
|
|
24
|
+
teardown,
|
|
25
|
+
} from '../fixtures/setup.js';
|
|
17
26
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
18
27
|
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
19
28
|
|
|
@@ -57,7 +66,7 @@ export class BlacklistTokenContractTest {
|
|
|
57
66
|
authwitProxy!: GenericProxyContract;
|
|
58
67
|
cheatCodes!: CheatCodes;
|
|
59
68
|
sequencer!: SequencerClient;
|
|
60
|
-
aztecNode!: AztecNode;
|
|
69
|
+
aztecNode!: AztecNode & AztecNodeDebug;
|
|
61
70
|
|
|
62
71
|
adminAddress!: AztecAddress;
|
|
63
72
|
otherAddress!: AztecAddress;
|
|
@@ -68,11 +77,13 @@ export class BlacklistTokenContractTest {
|
|
|
68
77
|
}
|
|
69
78
|
|
|
70
79
|
async crossTimestampOfChange() {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
80
|
+
// Under AUTOMINE_E2E_OPTS, the 86400s warp crosses many epochs without any proofs being
|
|
81
|
+
// submitted. Mark current pending checkpoints as proven first so the rollup contract's
|
|
82
|
+
// pruning window doesn't reset the chain tip to genesis (which would make the warp's
|
|
83
|
+
// own empty-checkpoint propose fail with Rollup__InvalidArchive). See the AutomineSequencer
|
|
84
|
+
// README "Epoch proving caveat" and the equivalent pattern in lending_simulator.progressSlots.
|
|
85
|
+
await this.cheatCodes.rollup.markAsProven();
|
|
86
|
+
await this.cheatCodes.warpL2TimeAtLeastBy(this.aztecNode, BlacklistTokenContractTest.CHANGE_ROLES_DELAY);
|
|
76
87
|
}
|
|
77
88
|
|
|
78
89
|
/**
|
|
@@ -81,8 +92,9 @@ export class BlacklistTokenContractTest {
|
|
|
81
92
|
* 2. Publicly deploy accounts, deploy token contract and a "bad account".
|
|
82
93
|
*/
|
|
83
94
|
async applyBaseSetup() {
|
|
84
|
-
//
|
|
85
|
-
|
|
95
|
+
// Bumped from 2 min: pipelined cadence (~24s/dependent-tx) makes the 3-account deploy plus token/bad-account/
|
|
96
|
+
// proxy deploys exceed the original window.
|
|
97
|
+
jest.setTimeout(600_000);
|
|
86
98
|
|
|
87
99
|
this.logger.info('Deploying 3 accounts');
|
|
88
100
|
const { deployedAccounts } = await deployAccounts(
|
|
@@ -102,25 +114,30 @@ export class BlacklistTokenContractTest {
|
|
|
102
114
|
this.blacklistedAddress = deployedAccounts[2].address;
|
|
103
115
|
|
|
104
116
|
this.logger.info('Setting up blacklist token contract');
|
|
117
|
+
await ensureAuthRegistryPublished(this.wallet, this.adminAddress);
|
|
105
118
|
// Create the token contract state.
|
|
106
119
|
this.logger.verbose(`Public deploy accounts...`);
|
|
107
120
|
await publicDeployAccounts(this.wallet, [this.adminAddress, this.otherAddress, this.blacklistedAddress]);
|
|
108
121
|
|
|
109
122
|
this.logger.verbose(`Deploying TokenContract...`);
|
|
110
|
-
this.asset = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress).send({
|
|
123
|
+
({ contract: this.asset } = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress).send({
|
|
111
124
|
from: this.adminAddress,
|
|
112
|
-
});
|
|
125
|
+
}));
|
|
113
126
|
this.logger.verbose(`Token deployed to ${this.asset.address}`);
|
|
114
127
|
|
|
115
128
|
this.logger.verbose(`Deploying bad account...`);
|
|
116
|
-
this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({
|
|
129
|
+
({ contract: this.badAccount } = await InvalidAccountContract.deploy(this.wallet).send({
|
|
130
|
+
from: this.adminAddress,
|
|
131
|
+
}));
|
|
117
132
|
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
118
133
|
|
|
119
134
|
// Deploy a proxy contract for "on behalf of other" tests. The note owner must be the tx sender
|
|
120
135
|
// (so their notes are in scope), but msg_sender in the target must differ from the note owner
|
|
121
136
|
// to trigger authwit validation. The proxy forwards calls so that msg_sender != tx sender.
|
|
122
137
|
this.logger.verbose(`Deploying generic proxy...`);
|
|
123
|
-
this.authwitProxy = await GenericProxyContract.deploy(this.wallet).send({
|
|
138
|
+
({ contract: this.authwitProxy } = await GenericProxyContract.deploy(this.wallet).send({
|
|
139
|
+
from: this.adminAddress,
|
|
140
|
+
}));
|
|
124
141
|
this.logger.verbose(`Deployed to ${this.authwitProxy.address}.`);
|
|
125
142
|
|
|
126
143
|
await this.crossTimestampOfChange();
|
|
@@ -133,14 +150,15 @@ export class BlacklistTokenContractTest {
|
|
|
133
150
|
[this.adminAddress, this.otherAddress, this.blacklistedAddress],
|
|
134
151
|
);
|
|
135
152
|
|
|
136
|
-
expect(
|
|
137
|
-
|
|
138
|
-
);
|
|
153
|
+
expect(
|
|
154
|
+
(await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).result,
|
|
155
|
+
).toEqual(new Role().withAdmin().toNoirStruct());
|
|
139
156
|
}
|
|
140
157
|
|
|
141
|
-
async setup() {
|
|
158
|
+
async setup(opts: Partial<SetupOptions> = {}) {
|
|
142
159
|
this.logger.info('Setting up fresh context');
|
|
143
160
|
this.context = await setup(0, {
|
|
161
|
+
...opts,
|
|
144
162
|
fundSponsoredFPC: true,
|
|
145
163
|
skipAccountDeployment: true,
|
|
146
164
|
});
|
|
@@ -189,9 +207,9 @@ export class BlacklistTokenContractTest {
|
|
|
189
207
|
|
|
190
208
|
await this.crossTimestampOfChange();
|
|
191
209
|
|
|
192
|
-
expect(
|
|
193
|
-
|
|
194
|
-
);
|
|
210
|
+
expect(
|
|
211
|
+
(await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).result,
|
|
212
|
+
).toEqual(adminMinterRole.toNoirStruct());
|
|
195
213
|
|
|
196
214
|
this.logger.verbose(`Minting ${amount} publicly...`);
|
|
197
215
|
await asset.methods.mint_public(this.adminAddress, amount).send({ from: this.adminAddress });
|
|
@@ -199,7 +217,7 @@ export class BlacklistTokenContractTest {
|
|
|
199
217
|
this.logger.verbose(`Minting ${amount} privately...`);
|
|
200
218
|
const secret = Fr.random();
|
|
201
219
|
const secretHash = await computeSecretHash(secret);
|
|
202
|
-
const receipt = await asset.methods.mint_private(amount, secretHash).send({ from: this.adminAddress });
|
|
220
|
+
const { receipt } = await asset.methods.mint_private(amount, secretHash).send({ from: this.adminAddress });
|
|
203
221
|
|
|
204
222
|
await this.addPendingShieldNoteToPXE(asset, this.adminAddress, amount, secretHash, receipt.txHash);
|
|
205
223
|
await asset.methods.redeem_shield(this.adminAddress, amount, secret).send({ from: this.adminAddress });
|
|
@@ -207,20 +225,20 @@ export class BlacklistTokenContractTest {
|
|
|
207
225
|
|
|
208
226
|
tokenSim.mintPublic(this.adminAddress, amount);
|
|
209
227
|
|
|
210
|
-
const publicBalance = await asset.methods
|
|
228
|
+
const { result: publicBalance } = await asset.methods
|
|
211
229
|
.balance_of_public(this.adminAddress)
|
|
212
230
|
.simulate({ from: this.adminAddress });
|
|
213
231
|
this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
|
|
214
232
|
expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(this.adminAddress));
|
|
215
233
|
|
|
216
234
|
tokenSim.mintPrivate(this.adminAddress, amount);
|
|
217
|
-
const privateBalance = await asset.methods
|
|
235
|
+
const { result: privateBalance } = await asset.methods
|
|
218
236
|
.balance_of_private(this.adminAddress)
|
|
219
237
|
.simulate({ from: this.adminAddress });
|
|
220
238
|
this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
|
|
221
239
|
expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(this.adminAddress));
|
|
222
240
|
|
|
223
|
-
const totalSupply = await asset.methods.total_supply().simulate({ from: this.adminAddress });
|
|
241
|
+
const { result: totalSupply } = await asset.methods.total_supply().simulate({ from: this.adminAddress });
|
|
224
242
|
this.logger.verbose(`Total supply: ${totalSupply}`);
|
|
225
243
|
expect(totalSupply).toEqual(tokenSim.totalSupply);
|
|
226
244
|
}
|
|
@@ -4,7 +4,7 @@ import { waitForProven } from '@aztec/aztec.js/contracts';
|
|
|
4
4
|
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
5
5
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
6
6
|
import type { TxReceipt } from '@aztec/aztec.js/tx';
|
|
7
|
-
import { CheatCodes } from '@aztec/aztec/testing';
|
|
7
|
+
import { CheatCodes, EpochTestSettler } from '@aztec/aztec/testing';
|
|
8
8
|
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
9
9
|
import { InboxContract, OutboxContract, RollupContract } from '@aztec/ethereum/contracts';
|
|
10
10
|
import type {
|
|
@@ -12,12 +12,14 @@ import type {
|
|
|
12
12
|
DeployAztecL1ContractsReturnType,
|
|
13
13
|
} from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
14
14
|
import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
|
|
15
|
+
import { pickL1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
15
16
|
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
16
17
|
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
17
18
|
import { sleep } from '@aztec/foundation/sleep';
|
|
18
19
|
import { TestERC20Abi, TestERC20Bytecode } from '@aztec/l1-artifacts';
|
|
19
20
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
20
21
|
import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
|
|
22
|
+
import type { PXEConfig } from '@aztec/pxe/server';
|
|
21
23
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
22
24
|
|
|
23
25
|
import { MNEMONIC } from '../fixtures/fixtures.js';
|
|
@@ -25,6 +27,7 @@ import {
|
|
|
25
27
|
type EndToEndContext,
|
|
26
28
|
type SetupOptions,
|
|
27
29
|
deployAccounts,
|
|
30
|
+
ensureAuthRegistryPublished,
|
|
28
31
|
publicDeployAccounts,
|
|
29
32
|
setup,
|
|
30
33
|
teardown,
|
|
@@ -36,6 +39,7 @@ export class CrossChainMessagingTest {
|
|
|
36
39
|
private requireEpochProven: boolean;
|
|
37
40
|
private setupOptions: SetupOptions;
|
|
38
41
|
private deployL1ContractsArgs: Partial<DeployAztecL1ContractsArgs>;
|
|
42
|
+
private pxeOpts: Partial<PXEConfig>;
|
|
39
43
|
logger: Logger;
|
|
40
44
|
context!: EndToEndContext;
|
|
41
45
|
aztecNode!: AztecNode;
|
|
@@ -58,12 +62,23 @@ export class CrossChainMessagingTest {
|
|
|
58
62
|
outbox!: OutboxContract;
|
|
59
63
|
cheatCodes!: CheatCodes;
|
|
60
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Background loop that marks each completed epoch as proven on L1. Started in `applyBaseSetup`
|
|
67
|
+
* when the test runs without a real prover node, because the e2e fixture uses L1 interval mining
|
|
68
|
+
* and the AnvilTestWatcher's auto-prove loop only runs under L1 automine. Without this, L1's
|
|
69
|
+
* `aztecProofSubmissionEpochs` window expires mid-test and triggers a chain prune that drops
|
|
70
|
+
* in-flight wallet txs. Tests that intentionally pause proving (e.g. inbox drift tests) can
|
|
71
|
+
* stop it via `await t.epochTestSettler?.stop()`.
|
|
72
|
+
*/
|
|
73
|
+
epochTestSettler?: EpochTestSettler;
|
|
74
|
+
|
|
61
75
|
deployL1ContractsValues!: DeployAztecL1ContractsReturnType;
|
|
62
76
|
|
|
63
77
|
constructor(
|
|
64
78
|
testName: string,
|
|
65
79
|
opts: SetupOptions = {},
|
|
66
80
|
deployL1ContractsArgs: Partial<DeployAztecL1ContractsArgs> = {},
|
|
81
|
+
pxeOpts: Partial<PXEConfig> = {},
|
|
67
82
|
) {
|
|
68
83
|
this.logger = createLogger(`e2e:e2e_cross_chain_messaging:${testName}`);
|
|
69
84
|
this.setupOptions = opts;
|
|
@@ -71,17 +86,25 @@ export class CrossChainMessagingTest {
|
|
|
71
86
|
initialValidators: [],
|
|
72
87
|
...deployL1ContractsArgs,
|
|
73
88
|
};
|
|
89
|
+
this.pxeOpts = pxeOpts;
|
|
74
90
|
this.requireEpochProven = opts.startProverNode ?? false;
|
|
75
91
|
}
|
|
76
92
|
|
|
77
|
-
async setup() {
|
|
93
|
+
async setup(opts: Partial<SetupOptions> = {}, pxeOpts: Partial<PXEConfig> = {}) {
|
|
78
94
|
this.logger.info('Setting up cross chain messaging test');
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
95
|
+
// Recompute requireEpochProven from the merged options so per-call startProverNode is honored.
|
|
96
|
+
this.requireEpochProven = opts.startProverNode ?? this.setupOptions.startProverNode ?? false;
|
|
97
|
+
this.context = await setup(
|
|
98
|
+
0,
|
|
99
|
+
{
|
|
100
|
+
...this.setupOptions,
|
|
101
|
+
...opts,
|
|
102
|
+
fundSponsoredFPC: true,
|
|
103
|
+
skipAccountDeployment: true,
|
|
104
|
+
l1ContractsArgs: { ...this.deployL1ContractsArgs, ...opts.l1ContractsArgs },
|
|
105
|
+
},
|
|
106
|
+
{ ...this.pxeOpts, ...pxeOpts },
|
|
107
|
+
);
|
|
85
108
|
await this.applyBaseSetup();
|
|
86
109
|
}
|
|
87
110
|
|
|
@@ -98,12 +121,13 @@ export class CrossChainMessagingTest {
|
|
|
98
121
|
|
|
99
122
|
async catchUpProvenChain() {
|
|
100
123
|
const bn = await this.aztecNode.getBlockNumber();
|
|
101
|
-
while ((await this.aztecNode.
|
|
124
|
+
while ((await this.aztecNode.getBlockNumber('proven')) < bn) {
|
|
102
125
|
await sleep(1000);
|
|
103
126
|
}
|
|
104
127
|
}
|
|
105
128
|
|
|
106
129
|
async teardown() {
|
|
130
|
+
await this.epochTestSettler?.stop();
|
|
107
131
|
await teardown(this.context);
|
|
108
132
|
}
|
|
109
133
|
|
|
@@ -119,6 +143,19 @@ export class CrossChainMessagingTest {
|
|
|
119
143
|
if (this.requireEpochProven) {
|
|
120
144
|
// Turn off the watcher to prevent it from keep marking blocks as proven.
|
|
121
145
|
this.context.watcher.setIsMarkingAsProven(false);
|
|
146
|
+
} else {
|
|
147
|
+
// When no real prover is running, the L1 proof window (aztecProofSubmissionEpochs) would
|
|
148
|
+
// otherwise expire mid-test and trigger a chain prune. The AnvilTestWatcher's auto-prove
|
|
149
|
+
// loop is dormant under L1 interval mining (it gates on `isAutoMining`), so start an
|
|
150
|
+
// EpochTestSettler to mark each completed epoch as proven on L1.
|
|
151
|
+
this.epochTestSettler = new EpochTestSettler(
|
|
152
|
+
this.context.ethCheatCodes,
|
|
153
|
+
this.context.deployL1ContractsValues.l1ContractAddresses.rollupAddress,
|
|
154
|
+
this.context.aztecNodeService.getBlockSource(),
|
|
155
|
+
this.logger.createChild('epoch-settler'),
|
|
156
|
+
{ pollingIntervalMs: 500 },
|
|
157
|
+
);
|
|
158
|
+
await this.epochTestSettler.start();
|
|
122
159
|
}
|
|
123
160
|
|
|
124
161
|
// Deploy 3 accounts
|
|
@@ -135,6 +172,7 @@ export class CrossChainMessagingTest {
|
|
|
135
172
|
// Set up cross chain messaging
|
|
136
173
|
this.logger.info('Applying e2e_cross_chain_messaging setup');
|
|
137
174
|
|
|
175
|
+
await ensureAuthRegistryPublished(this.wallet, this.ownerAddress);
|
|
138
176
|
// Create the token contract state.
|
|
139
177
|
this.logger.verbose(`Public deploy accounts...`);
|
|
140
178
|
await publicDeployAccounts(this.wallet, [this.ownerAddress, this.user1Address, this.user2Address]);
|
|
@@ -171,7 +209,7 @@ export class CrossChainMessagingTest {
|
|
|
171
209
|
const l1Client = createExtendedL1Client(this.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
172
210
|
this.l1Client = l1Client;
|
|
173
211
|
|
|
174
|
-
const l1Contracts = this.aztecNodeConfig
|
|
212
|
+
const l1Contracts = pickL1ContractAddresses(this.aztecNodeConfig);
|
|
175
213
|
this.rollup = new RollupContract(l1Client, l1Contracts.rollupAddress.toString());
|
|
176
214
|
this.inbox = new InboxContract(l1Client, l1Contracts.inboxAddress.toString());
|
|
177
215
|
this.outbox = new OutboxContract(l1Client, l1Contracts.outboxAddress.toString());
|
|
@@ -185,7 +223,7 @@ export class CrossChainMessagingTest {
|
|
|
185
223
|
tokenPortalAddress,
|
|
186
224
|
crossChainContext.underlying,
|
|
187
225
|
l1Client,
|
|
188
|
-
this.aztecNodeConfig
|
|
226
|
+
pickL1ContractAddresses(this.aztecNodeConfig),
|
|
189
227
|
this.wallet,
|
|
190
228
|
this.ownerAddress,
|
|
191
229
|
);
|
|
@@ -9,7 +9,7 @@ import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
|
9
9
|
import type { StatefulTestContract } from '@aztec/noir-test-contracts.js/StatefulTest';
|
|
10
10
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
11
11
|
|
|
12
|
-
import { type EndToEndContext, deployAccounts, setup, teardown } from '../fixtures/setup.js';
|
|
12
|
+
import { type EndToEndContext, type SetupOptions, deployAccounts, setup, teardown } from '../fixtures/setup.js';
|
|
13
13
|
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
14
14
|
|
|
15
15
|
export class DeployTest {
|
|
@@ -24,9 +24,10 @@ export class DeployTest {
|
|
|
24
24
|
this.logger = createLogger(`e2e:e2e_deploy_contract:${testName}`);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
async setup() {
|
|
27
|
+
async setup(opts: Partial<SetupOptions> = {}) {
|
|
28
28
|
this.logger.info('Setting up test environment');
|
|
29
29
|
this.context = await setup(0, {
|
|
30
|
+
...opts,
|
|
30
31
|
fundSponsoredFPC: true,
|
|
31
32
|
skipAccountDeployment: true,
|
|
32
33
|
});
|