@aztec/end-to-end 3.0.0-nightly.20250922 → 3.0.0-nightly.20250924
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 +0 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +5 -9
- package/dest/bench/utils.d.ts +1 -10
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +0 -25
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +1 -2
- 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 +1 -3
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +1 -2
- 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 +6 -9
- 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 -3
- package/dest/e2e_fees/fees_test.d.ts +1 -2
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +5 -9
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +1 -2
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +1 -3
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +2 -4
- package/dest/e2e_p2p/shared.d.ts +5 -4
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +26 -14
- package/dest/fixtures/e2e_prover_test.d.ts +0 -2
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +6 -9
- package/dest/fixtures/snapshot_manager.d.ts +0 -2
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +9 -11
- package/dest/fixtures/utils.d.ts +12 -20
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +24 -42
- package/dest/shared/cross_chain_test_harness.d.ts +2 -6
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +3 -5
- package/dest/shared/gas_portal_test_harness.d.ts +5 -6
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +5 -5
- package/dest/shared/uniswap_l1_l2.d.ts +1 -3
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +3 -4
- package/dest/spartan/setup_test_wallets.d.ts +5 -5
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +19 -14
- package/package.json +37 -37
- package/src/bench/client_flows/client_flows_benchmark.ts +4 -8
- package/src/bench/utils.ts +1 -28
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +1 -4
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +5 -9
- package/src/e2e_deploy_contract/deploy_test.ts +4 -5
- package/src/e2e_fees/fees_test.ts +6 -9
- package/src/e2e_nested_contract/nested_contract_test.ts +2 -4
- package/src/e2e_p2p/p2p_network.ts +54 -60
- package/src/e2e_p2p/shared.ts +27 -15
- package/src/fixtures/e2e_prover_test.ts +7 -12
- package/src/fixtures/snapshot_manager.ts +12 -14
- package/src/fixtures/utils.ts +27 -53
- package/src/shared/cross_chain_test_harness.ts +0 -5
- package/src/shared/gas_portal_test_harness.ts +4 -6
- package/src/shared/uniswap_l1_l2.ts +1 -7
- package/src/spartan/setup_test_wallets.ts +13 -17
package/dest/e2e_p2p/shared.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Fr, TxStatus, getContractInstanceFromInstantiationParams, retryUntil } from '@aztec/aztec.js';
|
|
2
2
|
import { timesAsync, unique } from '@aztec/foundation/collection';
|
|
3
|
+
import { pluralize } from '@aztec/foundation/string';
|
|
3
4
|
import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.js/Test';
|
|
4
5
|
import { createPXEService, getPXEServiceConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
5
6
|
import { getRoundForOffense } from '@aztec/slasher';
|
|
@@ -104,34 +105,36 @@ export async function awaitCommitteeExists({ rollup, logger }) {
|
|
|
104
105
|
}, 'non-empty committee', 60);
|
|
105
106
|
return committee;
|
|
106
107
|
}
|
|
107
|
-
export async function awaitOffenseDetected({ logger, nodeAdmin, slashingRoundSize, epochDuration }) {
|
|
108
|
-
|
|
108
|
+
export async function awaitOffenseDetected({ logger, nodeAdmin, slashingRoundSize, epochDuration, waitUntilOffenseCount }) {
|
|
109
|
+
const targetOffenseCount = waitUntilOffenseCount ?? 1;
|
|
110
|
+
logger.warn(`Waiting for ${pluralize('offense', targetOffenseCount)} to be detected`);
|
|
109
111
|
const offenses = await retryUntil(async ()=>{
|
|
110
112
|
const offenses = await nodeAdmin.getSlashOffenses('all');
|
|
111
|
-
if (offenses.length
|
|
113
|
+
if (offenses.length >= targetOffenseCount) {
|
|
112
114
|
return offenses;
|
|
113
115
|
}
|
|
114
116
|
}, 'non-empty offenses', 60);
|
|
115
117
|
logger.info(`Hit ${offenses.length} offenses on rounds ${unique(offenses.map((o)=>getRoundForOffense(o, {
|
|
116
118
|
slashingRoundSize,
|
|
117
119
|
epochDuration
|
|
118
|
-
})))}`,
|
|
120
|
+
})))}`, {
|
|
121
|
+
offenses
|
|
122
|
+
});
|
|
119
123
|
return offenses;
|
|
120
124
|
}
|
|
121
125
|
/**
|
|
122
126
|
* Await the committee to be slashed out of the validator set.
|
|
123
127
|
* Currently assumes that the committee is the same size as the validator set.
|
|
124
|
-
*/ export async function awaitCommitteeKicked({ rollup, cheatCodes, committee, slashFactory, slashingProposer, slashingRoundSize, aztecSlotDuration, logger,
|
|
128
|
+
*/ export async function awaitCommitteeKicked({ rollup, cheatCodes, committee, slashFactory, slashingProposer, slashingRoundSize, aztecSlotDuration, aztecEpochDuration, logger, offenseEpoch }) {
|
|
125
129
|
if (!slashingProposer) {
|
|
126
130
|
throw new Error('No slashing proposer configured. Cannot test slashing.');
|
|
127
131
|
}
|
|
128
|
-
logger.info(`Advancing epochs so we start slashing`);
|
|
129
132
|
await cheatCodes.debugRollup();
|
|
130
|
-
await cheatCodes.advanceToEpoch(await cheatCodes.getEpoch() + await rollup.getLagInEpochs() + 1n, {
|
|
131
|
-
updateDateProvider: dateProvider
|
|
132
|
-
});
|
|
133
|
-
// Await for the slash payload to be created if empire (no payload is created on tally until execution time)
|
|
134
133
|
if (slashingProposer.type === 'empire') {
|
|
134
|
+
// Await for the slash payload to be created if empire (no payload is created on tally until execution time)
|
|
135
|
+
const targetEpoch = await cheatCodes.getEpoch() + await rollup.getLagInEpochs() + 1n;
|
|
136
|
+
logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
|
|
137
|
+
await cheatCodes.advanceToEpoch(targetEpoch);
|
|
135
138
|
const slashPayloadEvents = await retryUntil(async ()=>{
|
|
136
139
|
const events = await slashFactory.getSlashPayloadCreatedEvents();
|
|
137
140
|
return events.length > 0 ? events : undefined;
|
|
@@ -139,6 +142,17 @@ export async function awaitOffenseDetected({ logger, nodeAdmin, slashingRoundSiz
|
|
|
139
142
|
expect(slashPayloadEvents.length).toBe(1);
|
|
140
143
|
// The uniqueness check is needed since a validator may be slashed more than once on the same round (eg because they let two epochs be pruned)
|
|
141
144
|
expect(unique(slashPayloadEvents[0].slashes.map((slash)=>slash.validator.toString()))).toHaveLength(committee.length);
|
|
145
|
+
} else {
|
|
146
|
+
// Use the slash offset to ensure we are in the right epoch for tally
|
|
147
|
+
const slashOffsetInRounds = await slashingProposer.getSlashOffsetInRounds();
|
|
148
|
+
const slashingRoundSizeInEpochs = slashingRoundSize / aztecEpochDuration;
|
|
149
|
+
const slashingOffsetInEpochs = Number(slashOffsetInRounds) * slashingRoundSizeInEpochs;
|
|
150
|
+
const firstEpochInOffenseRound = offenseEpoch - offenseEpoch % slashingRoundSizeInEpochs;
|
|
151
|
+
const targetEpoch = firstEpochInOffenseRound + slashingOffsetInEpochs;
|
|
152
|
+
logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
|
|
153
|
+
await cheatCodes.advanceToEpoch(targetEpoch, {
|
|
154
|
+
offset: -aztecSlotDuration / 2
|
|
155
|
+
});
|
|
142
156
|
}
|
|
143
157
|
const attestersPre = await rollup.getAttesters();
|
|
144
158
|
expect(attestersPre.length).toBe(committee.length);
|
|
@@ -146,7 +160,7 @@ export async function awaitOffenseDetected({ logger, nodeAdmin, slashingRoundSiz
|
|
|
146
160
|
const attesterInfo = await rollup.getAttesterView(attester);
|
|
147
161
|
expect(attesterInfo.status).toEqual(1); // Validating
|
|
148
162
|
}
|
|
149
|
-
const timeout = slashingRoundSize * 2 * aztecSlotDuration;
|
|
163
|
+
const timeout = slashingRoundSize * 2 * aztecSlotDuration + 30;
|
|
150
164
|
logger.info(`Waiting for slash to be executed (timeout ${timeout}s)`);
|
|
151
165
|
await awaitProposalExecution(slashingProposer, timeout, logger);
|
|
152
166
|
// The attesters should still form the committee but they should be reduced to the "living" status
|
|
@@ -161,9 +175,7 @@ export async function awaitOffenseDetected({ logger, nodeAdmin, slashingRoundSiz
|
|
|
161
175
|
}
|
|
162
176
|
logger.info(`Advancing to check current committee`);
|
|
163
177
|
await cheatCodes.debugRollup();
|
|
164
|
-
await cheatCodes.advanceToEpoch(await cheatCodes.getEpoch() + await rollup.getLagInEpochs() + 1n
|
|
165
|
-
updateDateProvider: dateProvider
|
|
166
|
-
});
|
|
178
|
+
await cheatCodes.advanceToEpoch(await cheatCodes.getEpoch() + await rollup.getLagInEpochs() + 1n);
|
|
167
179
|
await cheatCodes.debugRollup();
|
|
168
180
|
const committeeNextEpoch = await rollup.getCurrentEpochCommittee();
|
|
169
181
|
// The committee should be undefined, since the validator set is empty
|
|
@@ -5,7 +5,6 @@ import { type ClientProtocolCircuitVerifier } from '@aztec/bb-prover';
|
|
|
5
5
|
import type { BlobSinkServer } from '@aztec/blob-sink/server';
|
|
6
6
|
import type { DeployL1ContractsReturnType } from '@aztec/ethereum';
|
|
7
7
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
8
|
-
import type { PXEService } from '@aztec/pxe/server';
|
|
9
8
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
10
9
|
import { TestWallet } from '@aztec/test-wallet';
|
|
11
10
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
@@ -31,7 +30,6 @@ export declare class FullProverTest {
|
|
|
31
30
|
tokenSim: TokenSimulator;
|
|
32
31
|
aztecNode: AztecNode;
|
|
33
32
|
aztecNodeAdmin: AztecNodeAdmin;
|
|
34
|
-
pxe: PXEService;
|
|
35
33
|
cheatCodes: CheatCodes;
|
|
36
34
|
blobSink: BlobSinkServer;
|
|
37
35
|
private provenComponents;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e_prover_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/e2e_prover_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"e2e_prover_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/e2e_prover_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,KAAK,MAAM,EAAgB,MAAM,iBAAiB,CAAC;AACtG,OAAO,EAAE,UAAU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AO,CAAqB;IACpC,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,mBAAmB,CAAc;IAClC,WAAW,EAAG,2BAA2B,CAAC;IAC1C,aAAa,EAAG,UAAU,CAAC;gBAGhC,QAAQ,EAAE,MAAM,EACR,sBAAsB,EAAE,MAAM,EACtC,QAAQ,EAAE,UAAU,EACZ,UAAU,UAAO;IAa3B;;;;OAIG;IACG,kBAAkB;IAsDlB,KAAK;YA8IG,YAAY;IAS1B,QAAQ,GAAI,CAAC,EACX,MAAM,MAAM,EACZ,OAAO,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,EACjD,UAAS,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAA2B,KAChG,OAAO,CAAC,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAeR,iBAAiB;CA8CxB"}
|
|
@@ -7,7 +7,6 @@ import { SecretValue } from '@aztec/foundation/config';
|
|
|
7
7
|
import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
|
|
8
8
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
9
9
|
import { createProverNode } from '@aztec/prover-node';
|
|
10
|
-
import { TestWallet } from '@aztec/test-wallet';
|
|
11
10
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
12
11
|
import { getContract } from 'viem';
|
|
13
12
|
import { privateKeyToAddress } from 'viem/accounts';
|
|
@@ -15,7 +14,7 @@ import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
|
15
14
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
16
15
|
import { getBBConfig } from './get_bb_config.js';
|
|
17
16
|
import { createSnapshotManager, deployAccounts, publicDeployAccounts } from './snapshot_manager.js';
|
|
18
|
-
import { getPrivateKeyFromIndex, getSponsoredFPCAddress,
|
|
17
|
+
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEServiceAndGetWallet } from './utils.js';
|
|
19
18
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
20
19
|
/**
|
|
21
20
|
* Largely taken from the e2e_token_contract test file. We deploy 2 accounts and a token contract.
|
|
@@ -37,7 +36,6 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
37
36
|
tokenSim;
|
|
38
37
|
aztecNode;
|
|
39
38
|
aztecNodeAdmin;
|
|
40
|
-
pxe;
|
|
41
39
|
cheatCodes;
|
|
42
40
|
blobSink;
|
|
43
41
|
provenComponents;
|
|
@@ -105,7 +103,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
105
103
|
// We don't wish to mark as proven automatically, so we set the flag to false
|
|
106
104
|
this.context.watcher.setIsMarkingAsProven(false);
|
|
107
105
|
this.simulatedProverNode = this.context.proverNode;
|
|
108
|
-
({
|
|
106
|
+
({ aztecNode: this.aztecNode, deployL1ContractsValues: this.l1Contracts, cheatCodes: this.cheatCodes, blobSink: this.blobSink } = this.context);
|
|
109
107
|
this.aztecNodeAdmin = this.context.aztecNode;
|
|
110
108
|
const blobSinkClient = createBlobSinkClient({
|
|
111
109
|
blobSinkUrl: `http://localhost:${this.blobSink.port}`
|
|
@@ -146,22 +144,21 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
146
144
|
await this.context.cheatCodes.rollup.markAsProven();
|
|
147
145
|
this.logger.verbose(`Main setup completed, initializing full prover PXE, Node, and Prover Node`);
|
|
148
146
|
for(let i = 0; i < 2; i++){
|
|
149
|
-
const
|
|
147
|
+
const { wallet: provenWallet, teardown: provenTeardown } = await setupPXEServiceAndGetWallet(this.aztecNode, {
|
|
150
148
|
proverEnabled: this.realProofs,
|
|
151
149
|
bbBinaryPath: bbConfig?.bbBinaryPath,
|
|
152
150
|
bbWorkingDirectory: bbConfig?.bbWorkingDirectory
|
|
153
151
|
}, undefined, true);
|
|
154
152
|
this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
|
|
155
|
-
await
|
|
156
|
-
const provenWallet = new TestWallet(result.pxe, this.aztecNode);
|
|
153
|
+
await provenWallet.registerContract(this.fakeProofsAsset);
|
|
157
154
|
for(let i = 0; i < 2; i++){
|
|
158
155
|
await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
159
156
|
await this.wallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
160
157
|
}
|
|
161
158
|
const asset = await TokenContract.at(this.fakeProofsAsset.address, provenWallet);
|
|
162
159
|
this.provenComponents.push({
|
|
163
|
-
|
|
164
|
-
teardown:
|
|
160
|
+
wallet: provenWallet,
|
|
161
|
+
teardown: provenTeardown
|
|
165
162
|
});
|
|
166
163
|
this.provenAssets.push(asset);
|
|
167
164
|
}
|
|
@@ -6,7 +6,6 @@ import { type BlobSinkServer } from '@aztec/blob-sink/server';
|
|
|
6
6
|
import { type DeployL1ContractsArgs, type DeployL1ContractsReturnType } from '@aztec/ethereum';
|
|
7
7
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
8
8
|
import type { ProverNode } from '@aztec/prover-node';
|
|
9
|
-
import { type PXEService } from '@aztec/pxe/server';
|
|
10
9
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
11
10
|
import { TestWallet } from '@aztec/test-wallet';
|
|
12
11
|
import type { Anvil } from '@viem/anvil';
|
|
@@ -17,7 +16,6 @@ export type SubsystemsContext = {
|
|
|
17
16
|
bbConfig: any;
|
|
18
17
|
aztecNode: AztecNodeService;
|
|
19
18
|
aztecNodeConfig: AztecNodeConfig;
|
|
20
|
-
pxe: PXEService;
|
|
21
19
|
wallet: TestWallet;
|
|
22
20
|
deployL1ContractsValues: DeployL1ContractsReturnType;
|
|
23
21
|
proverNode?: ProverNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot_manager.d.ts","sourceRoot":"","sources":["../../src/fixtures/snapshot_manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAA2B,M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;IA0BlB;;OAEG;IACU,QAAQ;CAKtB;AAsVD;;;GAGG;AACH,eAAO,MAAM,cAAc,GACxB,kBAAkB,MAAM,EAAE,QAAQ,MAAM,MAClC,mCAAmC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,qBAAqB,EAAE,kBAAkB,EAAE,CAAA;CAAE;;EAsB5G,CAAC;AAEJ;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,YAAY,EAAE,EAChC,eAAe,UAAQ,EACvB,IAAI,CAAC,EAAE,SAAS,iBAwBjB"}
|
|
@@ -119,7 +119,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
119
119
|
// Execute the restoration function.
|
|
120
120
|
await restore(snapshotData, context);
|
|
121
121
|
// Save the snapshot data.
|
|
122
|
-
const ethCheatCodes = new EthCheatCodesWithState(context.aztecNodeConfig.l1RpcUrls);
|
|
122
|
+
const ethCheatCodes = new EthCheatCodesWithState(context.aztecNodeConfig.l1RpcUrls, context.dateProvider);
|
|
123
123
|
const anvilStateFile = `${this.livePath}/anvil.dat`;
|
|
124
124
|
await ethCheatCodes.dumpChainState(anvilStateFile);
|
|
125
125
|
writeFileSync(`${this.livePath}/${name}.json`, JSON.stringify(snapshotData || {}, resolver));
|
|
@@ -262,7 +262,8 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
262
262
|
aztecNodeConfig.l1RpcUrls = [
|
|
263
263
|
res.rpcUrl
|
|
264
264
|
];
|
|
265
|
-
const
|
|
265
|
+
const dateProvider = new TestDateProvider();
|
|
266
|
+
const ethCheatCodes = new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls, dateProvider);
|
|
266
267
|
// Deploy our L1 contracts.
|
|
267
268
|
logger.verbose('Deploying L1 contracts...');
|
|
268
269
|
if (opts.l1StartTime) {
|
|
@@ -285,8 +286,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
285
286
|
aztecNodeConfig.l1Contracts = deployL1ContractsValues.l1ContractAddresses;
|
|
286
287
|
aztecNodeConfig.rollupVersion = deployL1ContractsValues.rollupVersion;
|
|
287
288
|
aztecNodeConfig.l1PublishRetryIntervalMS = 100;
|
|
288
|
-
const
|
|
289
|
-
const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls), deployL1ContractsValues.l1ContractAddresses.rollupAddress, deployL1ContractsValues.l1Client, dateProvider);
|
|
289
|
+
const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls, dateProvider), deployL1ContractsValues.l1ContractAddresses.rollupAddress, deployL1ContractsValues.l1Client, dateProvider);
|
|
290
290
|
await watcher.start();
|
|
291
291
|
const acvmConfig = await getACVMConfig(logger);
|
|
292
292
|
if (acvmConfig) {
|
|
@@ -332,7 +332,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
332
332
|
pxeConfig.proverEnabled = !!opts.realProofs;
|
|
333
333
|
const pxe = await createPXEService(aztecNode, pxeConfig);
|
|
334
334
|
const wallet = new TestWallet(pxe, aztecNode);
|
|
335
|
-
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls,
|
|
335
|
+
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, wallet, aztecNode, dateProvider);
|
|
336
336
|
if (statePath) {
|
|
337
337
|
writeFileSync(`${statePath}/aztec_node_config.json`, JSON.stringify(aztecNodeConfig, resolver));
|
|
338
338
|
writeFileSync(`${statePath}/accounts.json`, JSON.stringify(initialFundedAccounts, resolver));
|
|
@@ -341,7 +341,6 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
341
341
|
aztecNodeConfig,
|
|
342
342
|
anvil,
|
|
343
343
|
aztecNode,
|
|
344
|
-
pxe,
|
|
345
344
|
wallet,
|
|
346
345
|
sequencer: aztecNode.getSequencer(),
|
|
347
346
|
acvmConfig,
|
|
@@ -380,7 +379,8 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
380
379
|
];
|
|
381
380
|
// Load anvil state.
|
|
382
381
|
const anvilStateFile = `${statePath}/anvil.dat`;
|
|
383
|
-
const
|
|
382
|
+
const dateProvider = new TestDateProvider();
|
|
383
|
+
const ethCheatCodes = new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls, dateProvider);
|
|
384
384
|
await ethCheatCodes.loadChainState(anvilStateFile);
|
|
385
385
|
// TODO: Encapsulate this in a NativeAcvm impl.
|
|
386
386
|
const acvmConfig = await getACVMConfig(logger);
|
|
@@ -395,8 +395,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
395
395
|
}
|
|
396
396
|
logger.verbose('Creating ETH clients...');
|
|
397
397
|
const l1Client = createExtendedL1Client(aztecNodeConfig.l1RpcUrls, mnemonicToAccount(MNEMONIC));
|
|
398
|
-
const
|
|
399
|
-
const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls), aztecNodeConfig.l1Contracts.rollupAddress, l1Client, dateProvider);
|
|
398
|
+
const watcher = new AnvilTestWatcher(ethCheatCodes, aztecNodeConfig.l1Contracts.rollupAddress, l1Client, dateProvider);
|
|
400
399
|
await watcher.start();
|
|
401
400
|
const telemetry = initTelemetryClient(getTelemetryConfig());
|
|
402
401
|
const blobSink = await createBlobSinkServer({
|
|
@@ -431,12 +430,11 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
431
430
|
pxeConfig.dataDirectory = statePath;
|
|
432
431
|
const pxe = await createPXEService(aztecNode, pxeConfig);
|
|
433
432
|
const wallet = new TestWallet(pxe, aztecNode);
|
|
434
|
-
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls,
|
|
433
|
+
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, wallet, aztecNode, dateProvider);
|
|
435
434
|
return {
|
|
436
435
|
aztecNodeConfig,
|
|
437
436
|
anvil,
|
|
438
437
|
aztecNode,
|
|
439
|
-
pxe,
|
|
440
438
|
wallet,
|
|
441
439
|
sequencer: aztecNode.getSequencer(),
|
|
442
440
|
acvmConfig,
|
package/dest/fixtures/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type InitialAccountData } from '@aztec/accounts/testing';
|
|
2
2
|
import { type AztecNodeConfig } from '@aztec/aztec-node';
|
|
3
|
-
import { AztecAddress, type AztecNode, type ContractMethod, type Logger, type
|
|
3
|
+
import { AztecAddress, type AztecNode, type ContractMethod, type Logger, type Wallet } from '@aztec/aztec.js';
|
|
4
4
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec/testing';
|
|
5
5
|
import { type BlobSinkServer } from '@aztec/blob-sink/server';
|
|
6
6
|
import { type DeployL1ContractsArgs, type DeployL1ContractsReturnType, type Operator } from '@aztec/ethereum';
|
|
@@ -11,7 +11,7 @@ import { TestDateProvider } from '@aztec/foundation/timer';
|
|
|
11
11
|
import type { DataStoreConfig } from '@aztec/kv-store/config';
|
|
12
12
|
import { MockGossipSubNetwork } from '@aztec/p2p/test-helpers';
|
|
13
13
|
import { type ProverNode, type ProverNodeConfig, type ProverNodeDeps } from '@aztec/prover-node';
|
|
14
|
-
import { type
|
|
14
|
+
import { type PXEServiceConfig } from '@aztec/pxe/server';
|
|
15
15
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
16
16
|
import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
17
17
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
@@ -24,18 +24,18 @@ export { startAnvil };
|
|
|
24
24
|
export declare const getPrivateKeyFromIndex: (index: number) => Buffer | null;
|
|
25
25
|
export declare const setupL1Contracts: (l1RpcUrls: string[], account: HDAccount | PrivateKeyAccount, logger: Logger, args?: Partial<DeployL1ContractsArgs>, chain?: Chain) => Promise<DeployL1ContractsReturnType>;
|
|
26
26
|
/**
|
|
27
|
-
* Sets up Private eXecution Environment (PXE).
|
|
27
|
+
* Sets up Private eXecution Environment (PXE) and returns the corresponding test wallet.
|
|
28
28
|
* @param aztecNode - An instance of Aztec Node.
|
|
29
29
|
* @param opts - Partial configuration for the PXE service.
|
|
30
30
|
* @param logger - The logger to be used.
|
|
31
31
|
* @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
|
|
32
|
-
* @returns
|
|
32
|
+
* @returns A test wallet, logger and teardown function.
|
|
33
33
|
*/
|
|
34
|
-
export declare function
|
|
34
|
+
export declare function setupPXEServiceAndGetWallet(aztecNode: AztecNode, opts?: Partial<PXEServiceConfig>, logger?: Logger, useLogSuffix?: boolean): Promise<{
|
|
35
35
|
/**
|
|
36
|
-
* The
|
|
36
|
+
* The wallet instance.
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
wallet: TestWallet;
|
|
39
39
|
/**
|
|
40
40
|
* Logger instance named as the current test.
|
|
41
41
|
*/
|
|
@@ -106,8 +106,6 @@ export type EndToEndContext = {
|
|
|
106
106
|
proverNode: ProverNode | undefined;
|
|
107
107
|
/** A client to the sequencer service (undefined if connected to remote environment) */
|
|
108
108
|
sequencer: SequencerClient | undefined;
|
|
109
|
-
/** The Private eXecution Environment (PXE). */
|
|
110
|
-
pxe: PXE;
|
|
111
109
|
/** Return values from deployL1Contracts function. */
|
|
112
110
|
deployL1ContractsValues: DeployL1ContractsReturnType;
|
|
113
111
|
/** The Aztec Node configuration. */
|
|
@@ -153,12 +151,6 @@ export declare function setup(numberOfAccounts?: number, opts?: SetupOptions, px
|
|
|
153
151
|
* @param accountsToDeploy - Which accounts to publicly deploy.
|
|
154
152
|
*/
|
|
155
153
|
export declare function ensureAccountContractsPublished(wallet: Wallet, accountsToDeploy: AztecAddress[]): Promise<void>;
|
|
156
|
-
/**
|
|
157
|
-
* Sets the timestamp of the next block.
|
|
158
|
-
* @param rpcUrl - rpc url of the blockchain instance to connect to
|
|
159
|
-
* @param timestamp - the timestamp for the next block
|
|
160
|
-
*/
|
|
161
|
-
export declare function setNextBlockTimestamp(rpcUrl: string, timestamp: number): Promise<void>;
|
|
162
154
|
/**
|
|
163
155
|
* Returns a logger instance for the current test.
|
|
164
156
|
* @returns a logger instance for the current test.
|
|
@@ -171,13 +163,13 @@ export declare function getBalancesFn(symbol: string, method: ContractMethod, fr
|
|
|
171
163
|
export declare function expectMapping<K, V>(fn: (...k: K[]) => Promise<V[]>, inputs: K[], expectedOutputs: V[]): Promise<void>;
|
|
172
164
|
export declare function expectMappingDelta<K, V extends number | bigint>(initialValues: V[], fn: (...k: K[]) => Promise<V[]>, inputs: K[], expectedDiffs: V[]): Promise<void>;
|
|
173
165
|
/**
|
|
174
|
-
* Computes the address of the "canonical"
|
|
166
|
+
* Computes the address of the "canonical" SponsoredFPCContract. This is not a protocol contract
|
|
175
167
|
* but by conventions its address is computed with a salt of 0.
|
|
176
168
|
* @returns The address of the sponsored FPC contract
|
|
177
169
|
*/
|
|
178
170
|
export declare function getSponsoredFPCInstance(): Promise<ContractInstanceWithAddress>;
|
|
179
171
|
/**
|
|
180
|
-
* Computes the address of the "canonical"
|
|
172
|
+
* Computes the address of the "canonical" SponsoredFPCContract. This is not a protocol contract
|
|
181
173
|
* but by conventions its address is computed with a salt of 0.
|
|
182
174
|
* @returns The address of the sponsored FPC contract
|
|
183
175
|
*/
|
|
@@ -185,12 +177,12 @@ export declare function getSponsoredFPCAddress(): Promise<AztecAddress>;
|
|
|
185
177
|
/**
|
|
186
178
|
* Deploy a sponsored FPC contract to a running instance.
|
|
187
179
|
*/
|
|
188
|
-
export declare function setupSponsoredFPC(
|
|
180
|
+
export declare function setupSponsoredFPC(wallet: Wallet): Promise<ContractInstanceWithAddress>;
|
|
189
181
|
/**
|
|
190
182
|
* Registers the SponsoredFPC in this PXE instance
|
|
191
|
-
* @param
|
|
183
|
+
* @param wallet - The wallet
|
|
192
184
|
*/
|
|
193
|
-
export declare function registerSponsoredFPC(
|
|
185
|
+
export declare function registerSponsoredFPC(wallet: Wallet): Promise<void>;
|
|
194
186
|
export declare function waitForProvenChain(node: AztecNode, targetBlock?: number, timeoutSec?: number, intervalSec?: number): Promise<void>;
|
|
195
187
|
export declare function createAndSyncProverNode(proverNodePrivateKey: `0x${string}`, aztecNodeConfig: AztecNodeConfig, proverNodeConfig: Partial<ProverNodeConfig> & Pick<DataStoreConfig, 'dataDirectory'>, aztecNode: AztecNode | undefined, prefilledPublicData?: PublicDataTreeLeaf[], proverNodeDeps?: ProverNodeDeps): Promise<ProverNode>;
|
|
196
188
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fixtures/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAoD,MAAM,yBAAyB,CAAC;AAEpH,OAAO,EAAE,KAAK,eAAe,EAAsC,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EAEd,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fixtures/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAoD,MAAM,yBAAyB,CAAC;AAEpH,OAAO,EAAE,KAAK,eAAe,EAAsC,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EAEd,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,MAAM,EAOZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AAEpF,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAGhC,KAAK,QAAQ,EAOd,MAAM,iBAAiB,CAAC;AACzB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|
18
18
|
import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
19
19
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
20
|
-
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
20
|
+
import { DateProvider, TestDateProvider } from '@aztec/foundation/timer';
|
|
21
21
|
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
22
22
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
23
23
|
import { MockGossipSubNetwork, getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
@@ -84,13 +84,13 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
84
84
|
return l1Data;
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
87
|
-
* Sets up Private eXecution Environment (PXE).
|
|
87
|
+
* Sets up Private eXecution Environment (PXE) and returns the corresponding test wallet.
|
|
88
88
|
* @param aztecNode - An instance of Aztec Node.
|
|
89
89
|
* @param opts - Partial configuration for the PXE service.
|
|
90
90
|
* @param logger - The logger to be used.
|
|
91
91
|
* @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
|
|
92
|
-
* @returns
|
|
93
|
-
*/ export async function
|
|
92
|
+
* @returns A test wallet, logger and teardown function.
|
|
93
|
+
*/ export async function setupPXEServiceAndGetWallet(aztecNode, opts = {}, logger = getLogger(), useLogSuffix = false) {
|
|
94
94
|
const pxeServiceConfig = {
|
|
95
95
|
...getPXEServiceConfig(),
|
|
96
96
|
...opts
|
|
@@ -109,8 +109,9 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
109
109
|
useLogSuffix
|
|
110
110
|
});
|
|
111
111
|
const teardown = configuredDataDirectory ? ()=>Promise.resolve() : ()=>tryRmDir(pxeServiceConfig.dataDirectory);
|
|
112
|
+
const wallet = new TestWallet(pxe, aztecNode);
|
|
112
113
|
return {
|
|
113
|
-
|
|
114
|
+
wallet,
|
|
114
115
|
logger,
|
|
115
116
|
teardown
|
|
116
117
|
};
|
|
@@ -144,12 +145,12 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
144
145
|
l1Client,
|
|
145
146
|
rollupVersion
|
|
146
147
|
};
|
|
147
|
-
const ethCheatCodes = new EthCheatCodes(config.l1RpcUrls);
|
|
148
|
-
const
|
|
148
|
+
const ethCheatCodes = new EthCheatCodes(config.l1RpcUrls, new DateProvider());
|
|
149
|
+
const wallet = new TestWallet(pxeClient, aztecNode);
|
|
150
|
+
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, wallet, aztecNode, new DateProvider());
|
|
149
151
|
const teardown = ()=>Promise.resolve();
|
|
150
152
|
logger.verbose('Populating wallet from already registered accounts...');
|
|
151
|
-
const initialFundedAccounts = await getDeployedTestAccounts(
|
|
152
|
-
const wallet = new TestWallet(pxeClient, aztecNode);
|
|
153
|
+
const initialFundedAccounts = await getDeployedTestAccounts(wallet);
|
|
153
154
|
if (initialFundedAccounts.length < numberOfAccounts) {
|
|
154
155
|
throw new Error(`Required ${numberOfAccounts} accounts. Found ${initialFundedAccounts.length}.`);
|
|
155
156
|
// Deploy new accounts if there's a test that requires more funded accounts in the remote environment.
|
|
@@ -163,7 +164,6 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
163
164
|
aztecNodeAdmin: undefined,
|
|
164
165
|
sequencer: undefined,
|
|
165
166
|
proverNode: undefined,
|
|
166
|
-
pxe: pxeClient,
|
|
167
167
|
deployL1ContractsValues,
|
|
168
168
|
config,
|
|
169
169
|
initialFundedAccounts,
|
|
@@ -234,7 +234,8 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
234
234
|
logger.info(`Logging metrics to ${filename}`);
|
|
235
235
|
setupMetricsLogger(filename);
|
|
236
236
|
}
|
|
237
|
-
const
|
|
237
|
+
const dateProvider = new TestDateProvider();
|
|
238
|
+
const ethCheatCodes = new EthCheatCodesWithState(config.l1RpcUrls, dateProvider);
|
|
238
239
|
if (opts.stateLoad) {
|
|
239
240
|
await ethCheatCodes.loadChainState(opts.stateLoad);
|
|
240
241
|
}
|
|
@@ -305,6 +306,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
305
306
|
if (enableAutomine) {
|
|
306
307
|
await ethCheatCodes.setAutomine(false);
|
|
307
308
|
await ethCheatCodes.setIntervalMining(config.ethereumSlotDuration);
|
|
309
|
+
dateProvider.setTime(await ethCheatCodes.timestamp() * 1000);
|
|
308
310
|
}
|
|
309
311
|
if (opts.l2StartTime) {
|
|
310
312
|
// This should only be used in synching test or when you need to have a stable
|
|
@@ -313,9 +315,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
313
315
|
resetBlockInterval: true
|
|
314
316
|
});
|
|
315
317
|
}
|
|
316
|
-
const
|
|
317
|
-
dateProvider.setTime(await ethCheatCodes.timestamp() * 1000);
|
|
318
|
-
const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(config.l1RpcUrls), deployL1ContractsValues.l1ContractAddresses.rollupAddress, deployL1ContractsValues.l1Client, dateProvider);
|
|
318
|
+
const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(config.l1RpcUrls, dateProvider), deployL1ContractsValues.l1ContractAddresses.rollupAddress, deployL1ContractsValues.l1Client, dateProvider);
|
|
319
319
|
if (!opts.disableAnvilTestWatcher) {
|
|
320
320
|
await watcher.start();
|
|
321
321
|
}
|
|
@@ -409,17 +409,14 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
409
409
|
proverNode = await createAndSyncProverNode(proverNodePrivateKeyHex, config, proverNodeConfig, aztecNode, prefilledPublicData);
|
|
410
410
|
}
|
|
411
411
|
logger.verbose('Creating a pxe...');
|
|
412
|
-
const {
|
|
413
|
-
const cheatCodes = await CheatCodes.create(config.l1RpcUrls,
|
|
412
|
+
const { wallet, teardown: pxeTeardown } = await setupPXEServiceAndGetWallet(aztecNode, pxeOpts, logger);
|
|
413
|
+
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, wallet, aztecNode, dateProvider);
|
|
414
414
|
if (opts.aztecTargetCommitteeSize && opts.aztecTargetCommitteeSize > 0 || opts.initialValidators && opts.initialValidators.length > 0) {
|
|
415
415
|
// We need to advance such that the committee is set up.
|
|
416
|
-
await cheatCodes.rollup.advanceToEpoch(await cheatCodes.rollup.getEpoch() + BigInt(config.lagInEpochs + 1)
|
|
417
|
-
updateDateProvider: dateProvider
|
|
418
|
-
});
|
|
416
|
+
await cheatCodes.rollup.advanceToEpoch(await cheatCodes.rollup.getEpoch() + BigInt(config.lagInEpochs + 1));
|
|
419
417
|
await cheatCodes.rollup.setupEpoch();
|
|
420
418
|
await cheatCodes.rollup.debugRollup();
|
|
421
419
|
}
|
|
422
|
-
const wallet = new TestWallet(pxe, aztecNode);
|
|
423
420
|
let accounts = [];
|
|
424
421
|
// Below we continue with what we described in the long comment on line 571.
|
|
425
422
|
if (numberOfAccounts === 0) {
|
|
@@ -474,7 +471,6 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
474
471
|
mockGossipSubNetwork,
|
|
475
472
|
prefilledPublicData,
|
|
476
473
|
proverNode,
|
|
477
|
-
pxe,
|
|
478
474
|
sequencer: sequencerClient,
|
|
479
475
|
teardown,
|
|
480
476
|
telemetryClient: telemetry,
|
|
@@ -517,20 +513,6 @@ export async function ensureAccountContractsPublished(wallet, accountsToDeploy)
|
|
|
517
513
|
}).wait();
|
|
518
514
|
}
|
|
519
515
|
// docs:end:public_deploy_accounts
|
|
520
|
-
/**
|
|
521
|
-
* Sets the timestamp of the next block.
|
|
522
|
-
* @param rpcUrl - rpc url of the blockchain instance to connect to
|
|
523
|
-
* @param timestamp - the timestamp for the next block
|
|
524
|
-
*/ export async function setNextBlockTimestamp(rpcUrl, timestamp) {
|
|
525
|
-
const params = `[${timestamp}]`;
|
|
526
|
-
await fetch(rpcUrl, {
|
|
527
|
-
body: `{"jsonrpc":"2.0", "method": "evm_setNextBlockTimestamp", "params": ${params}, "id": 1}`,
|
|
528
|
-
method: 'POST',
|
|
529
|
-
headers: {
|
|
530
|
-
'Content-Type': 'application/json'
|
|
531
|
-
}
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
516
|
/** Returns the job name for the current test. */ function getJobName() {
|
|
535
517
|
return process.env.JOB_NAME ?? expect.getState().currentTestName?.split(' ')[0].replaceAll('/', '_') ?? 'unknown';
|
|
536
518
|
}
|
|
@@ -569,7 +551,7 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
|
|
|
569
551
|
expect(diffs).toEqual(expectedDiffs);
|
|
570
552
|
}
|
|
571
553
|
/**
|
|
572
|
-
* Computes the address of the "canonical"
|
|
554
|
+
* Computes the address of the "canonical" SponsoredFPCContract. This is not a protocol contract
|
|
573
555
|
* but by conventions its address is computed with a salt of 0.
|
|
574
556
|
* @returns The address of the sponsored FPC contract
|
|
575
557
|
*/ export function getSponsoredFPCInstance() {
|
|
@@ -578,7 +560,7 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
|
|
|
578
560
|
}));
|
|
579
561
|
}
|
|
580
562
|
/**
|
|
581
|
-
* Computes the address of the "canonical"
|
|
563
|
+
* Computes the address of the "canonical" SponsoredFPCContract. This is not a protocol contract
|
|
582
564
|
* but by conventions its address is computed with a salt of 0.
|
|
583
565
|
* @returns The address of the sponsored FPC contract
|
|
584
566
|
*/ export async function getSponsoredFPCAddress() {
|
|
@@ -587,11 +569,11 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
|
|
|
587
569
|
}
|
|
588
570
|
/**
|
|
589
571
|
* Deploy a sponsored FPC contract to a running instance.
|
|
590
|
-
*/ export async function setupSponsoredFPC(
|
|
572
|
+
*/ export async function setupSponsoredFPC(wallet) {
|
|
591
573
|
const instance = await getContractInstanceFromInstantiationParams(SponsoredFPCContract.artifact, {
|
|
592
574
|
salt: new Fr(SPONSORED_FPC_SALT)
|
|
593
575
|
});
|
|
594
|
-
await
|
|
576
|
+
await wallet.registerContract({
|
|
595
577
|
instance,
|
|
596
578
|
artifact: SponsoredFPCContract.artifact
|
|
597
579
|
});
|
|
@@ -600,9 +582,9 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
|
|
|
600
582
|
}
|
|
601
583
|
/**
|
|
602
584
|
* Registers the SponsoredFPC in this PXE instance
|
|
603
|
-
* @param
|
|
604
|
-
*/ export async function registerSponsoredFPC(
|
|
605
|
-
await
|
|
585
|
+
* @param wallet - The wallet
|
|
586
|
+
*/ export async function registerSponsoredFPC(wallet) {
|
|
587
|
+
await wallet.registerContract({
|
|
606
588
|
instance: await getSponsoredFPCInstance(),
|
|
607
589
|
artifact: SponsoredFPCContract.artifact
|
|
608
590
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthWitness, type AztecAddress, type AztecNode, EthAddress, type FieldsOf, Fr, type L2AmountClaim, type L2AmountClaimWithRecipient, type Logger, type
|
|
1
|
+
import { AuthWitness, type AztecAddress, type AztecNode, EthAddress, type FieldsOf, Fr, type L2AmountClaim, type L2AmountClaimWithRecipient, type Logger, type SiblingPath, type TxReceipt, type Wallet } from '@aztec/aztec.js';
|
|
2
2
|
import { type ExtendedViemWalletClient, type L1ContractAddresses } from '@aztec/ethereum';
|
|
3
3
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
4
4
|
import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
|
|
@@ -52,8 +52,6 @@ export type CrossChainContext = {
|
|
|
52
52
|
export declare class CrossChainTestHarness {
|
|
53
53
|
/** Aztec node instance. */
|
|
54
54
|
aztecNode: AztecNode;
|
|
55
|
-
/** Private eXecution Environment (PXE). */
|
|
56
|
-
pxeService: PXE;
|
|
57
55
|
/** Logger. */
|
|
58
56
|
logger: Logger;
|
|
59
57
|
/** L2 Token contract. */
|
|
@@ -74,14 +72,12 @@ export declare class CrossChainTestHarness {
|
|
|
74
72
|
readonly wallet: Wallet;
|
|
75
73
|
/** Owner of the l2 token and bridge */
|
|
76
74
|
readonly ownerAddress: AztecAddress;
|
|
77
|
-
static new(aztecNode: AztecNode,
|
|
75
|
+
static new(aztecNode: AztecNode, l1Client: ExtendedViemWalletClient, wallet: Wallet, ownerAddress: AztecAddress, logger: Logger, underlyingERC20Address: EthAddress): Promise<CrossChainTestHarness>;
|
|
78
76
|
private readonly l1TokenManager;
|
|
79
77
|
private readonly l1TokenPortalManager;
|
|
80
78
|
constructor(
|
|
81
79
|
/** Aztec node instance. */
|
|
82
80
|
aztecNode: AztecNode,
|
|
83
|
-
/** Private eXecution Environment (PXE). */
|
|
84
|
-
pxeService: PXE,
|
|
85
81
|
/** Logger. */
|
|
86
82
|
logger: Logger,
|
|
87
83
|
/** L2 Token contract. */
|