@aztec/end-to-end 0.81.0 → 0.82.1-alpha-testnet.1
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/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +3 -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 +7 -7
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -1
- 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 +3 -18
- package/dest/e2e_deploy_contract/deploy_test.d.ts +2 -0
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +2 -0
- package/dest/e2e_epochs/epochs_test.d.ts +1 -2
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +7 -6
- package/dest/e2e_fees/fees_test.d.ts +4 -0
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +41 -33
- package/dest/e2e_prover/e2e_prover_test.d.ts +2 -0
- package/dest/e2e_prover/e2e_prover_test.d.ts.map +1 -1
- package/dest/e2e_prover/e2e_prover_test.js +10 -10
- package/dest/e2e_token_contract/token_contract_test.d.ts +2 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +3 -1
- package/dest/fixtures/snapshot_manager.d.ts +4 -2
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +24 -18
- package/dest/fixtures/utils.d.ts +17 -6
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +50 -11
- package/dest/shared/capture_private_execution_steps.d.ts +7 -0
- package/dest/shared/capture_private_execution_steps.d.ts.map +1 -0
- package/dest/shared/capture_private_execution_steps.js +40 -0
- package/dest/shared/cross_chain_test_harness.d.ts +2 -2
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +16 -4
- package/dest/shared/gas_portal_test_harness.d.ts +11 -1
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +27 -12
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +24 -16
- package/dest/simulators/lending_simulator.d.ts +3 -5
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +5 -13
- package/dest/spartan/setup_test_wallets.d.ts +1 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +6 -4
- package/dest/spartan/utils.d.ts +18 -5
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +8 -5
- package/package.json +33 -31
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +9 -5
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +3 -19
- package/src/e2e_deploy_contract/deploy_test.ts +3 -0
- package/src/e2e_epochs/epochs_test.ts +6 -5
- package/src/e2e_fees/fees_test.ts +53 -36
- package/src/e2e_prover/e2e_prover_test.ts +13 -9
- package/src/e2e_token_contract/token_contract_test.ts +4 -2
- package/src/fixtures/snapshot_manager.ts +37 -12
- package/src/fixtures/utils.ts +69 -12
- package/src/guides/up_quick_start.sh +2 -3
- package/src/shared/capture_private_execution_steps.ts +43 -0
- package/src/shared/cross_chain_test_harness.ts +14 -3
- package/src/shared/gas_portal_test_harness.ts +29 -9
- package/src/shared/uniswap_l1_l2.ts +16 -16
- package/src/simulators/lending_simulator.ts +7 -12
- package/src/spartan/setup_test_wallets.ts +7 -7
- package/src/spartan/utils.ts +8 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot_manager.d.ts","sourceRoot":"","sources":["../../src/fixtures/snapshot_manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAwD,MAAM,yBAAyB,CAAC;AACxH,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"snapshot_manager.d.ts","sourceRoot":"","sources":["../../src/fixtures/snapshot_manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAwD,MAAM,yBAAyB,CAAC;AACxH,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,eAAe,EAGpB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AACpF,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAIjC,MAAM,iBAAiB,CAAC;AAMzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,UAAU,EAAyC,MAAM,mBAAmB,CAAC;AAI3F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAczC,OAAO,EACL,KAAK,YAAY,EAKlB,MAAM,YAAY,CAAC;AAGpB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,GAAG,CAAC;IAChB,QAAQ,EAAE,GAAG,CAAC;IACd,SAAS,EAAE,gBAAg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EACvB,SAAS,CAAC,EAAE,GAAG,GAAG,SAAS,iBAyB5B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SchnorrAccountContractArtifact } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { deployFundedSchnorrAccounts, generateSchnorrAccounts } from '@aztec/accounts/testing';
|
|
3
3
|
import { AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
|
|
4
|
-
import { BatchCall, getContractClassFromArtifact } from '@aztec/aztec.js';
|
|
4
|
+
import { BatchCall, DefaultWaitForProvenOpts, getContractClassFromArtifact, waitForProven } from '@aztec/aztec.js';
|
|
5
5
|
import { deployInstance, registerContractClass } from '@aztec/aztec.js/deployment';
|
|
6
6
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
|
|
7
7
|
import { createBlobSinkServer } from '@aztec/blob-sink/server';
|
|
@@ -27,7 +27,7 @@ import { MNEMONIC, TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
|
|
|
27
27
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
28
28
|
import { getBBConfig } from './get_bb_config.js';
|
|
29
29
|
import { setupL1Contracts } from './setup_l1_contracts.js';
|
|
30
|
-
import { createAndSyncProverNode, getLogger, getPrivateKeyFromIndex } from './utils.js';
|
|
30
|
+
import { createAndSyncProverNode, getLogger, getPrivateKeyFromIndex, getSponsoredFPCAddress } from './utils.js';
|
|
31
31
|
import { getEndToEndTestTelemetryClient } from './with_telemetry_utils.js';
|
|
32
32
|
export function createSnapshotManager(testName, dataPath, config = {}, deployL1ContractsArgs = {
|
|
33
33
|
initialValidators: []
|
|
@@ -217,6 +217,8 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
217
217
|
...opts
|
|
218
218
|
};
|
|
219
219
|
aztecNodeConfig.peerCheckIntervalMS = TEST_PEER_CHECK_INTERVAL_MS;
|
|
220
|
+
// Only enable proving if specifically requested.
|
|
221
|
+
aztecNodeConfig.realProofs = !!opts.realProofs;
|
|
220
222
|
// Create a temp directory for all ephemeral state and cleanup afterwards
|
|
221
223
|
const directoryToCleanup = path.join(tmpdir(), randomBytes(8).toString('hex'));
|
|
222
224
|
await fs.mkdir(directoryToCleanup, {
|
|
@@ -253,7 +255,8 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
253
255
|
await ethCheatCodes.warp(opts.l1StartTime);
|
|
254
256
|
}
|
|
255
257
|
const initialFundedAccounts = await generateSchnorrAccounts(numberOfInitialFundedAccounts);
|
|
256
|
-
const
|
|
258
|
+
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
259
|
+
const { genesisArchiveRoot, genesisBlockHash, prefilledPublicData } = await getGenesisValues(initialFundedAccounts.map((a)=>a.address).concat(sponsoredFPCAddress), opts.initialAccountFeeJuice);
|
|
257
260
|
const deployL1ContractsValues = await setupL1Contracts(aztecNodeConfig.l1RpcUrls[0], hdAccount, logger, {
|
|
258
261
|
...getL1ContractsConfigEnvVars(),
|
|
259
262
|
genesisArchiveRoot,
|
|
@@ -306,10 +309,8 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
306
309
|
l1RpcUrls: aztecNodeConfig.l1RpcUrls,
|
|
307
310
|
rollupAddress: aztecNodeConfig.l1Contracts.rollupAddress,
|
|
308
311
|
port: blobSinkPort,
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
dataStoreMapSizeKB: aztecNodeConfig.dataStoreMapSizeKB
|
|
312
|
-
}
|
|
312
|
+
dataDirectory: aztecNodeConfig.dataDirectory,
|
|
313
|
+
dataStoreMapSizeKB: aztecNodeConfig.dataStoreMapSizeKB
|
|
313
314
|
}, telemetry);
|
|
314
315
|
await blobSink.start();
|
|
315
316
|
logger.verbose('Creating and synching an aztec node...');
|
|
@@ -328,6 +329,8 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
328
329
|
logger.verbose('Creating pxe...');
|
|
329
330
|
const pxeConfig = getPXEServiceConfig();
|
|
330
331
|
pxeConfig.dataDirectory = statePath ?? path.join(directoryToCleanup, randomBytes(8).toString('hex'));
|
|
332
|
+
// Only enable proving if specifically requested.
|
|
333
|
+
pxeConfig.proverEnabled = !!opts.realProofs;
|
|
331
334
|
const pxe = await createPXEService(aztecNode, pxeConfig);
|
|
332
335
|
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
|
|
333
336
|
if (statePath) {
|
|
@@ -398,10 +401,8 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
398
401
|
l1RpcUrls: aztecNodeConfig.l1RpcUrls,
|
|
399
402
|
rollupAddress: aztecNodeConfig.l1Contracts.rollupAddress,
|
|
400
403
|
port: blobSinkPort,
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
dataStoreMapSizeKB: aztecNodeConfig.dataStoreMapSizeKB
|
|
404
|
-
}
|
|
404
|
+
dataDirectory: statePath,
|
|
405
|
+
dataStoreMapSizeKB: aztecNodeConfig.dataStoreMapSizeKB
|
|
405
406
|
}, telemetry);
|
|
406
407
|
await blobSink.start();
|
|
407
408
|
logger.verbose('Creating aztec node...');
|
|
@@ -453,9 +454,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
453
454
|
}
|
|
454
455
|
logger.verbose('Deploying accounts funded with fee juice...');
|
|
455
456
|
const deployedAccounts = initialFundedAccounts.slice(0, numberOfAccounts);
|
|
456
|
-
await deployFundedSchnorrAccounts(pxe, deployedAccounts,
|
|
457
|
-
proven: waitUntilProven
|
|
458
|
-
});
|
|
457
|
+
await deployFundedSchnorrAccounts(pxe, deployedAccounts, undefined, waitUntilProven ? DefaultWaitForProvenOpts : undefined);
|
|
459
458
|
return {
|
|
460
459
|
deployedAccounts
|
|
461
460
|
};
|
|
@@ -465,7 +464,9 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
465
464
|
* Use this when you need to make a public call to an account contract, such as for requesting a public authwit.
|
|
466
465
|
* @param sender - Wallet to send the deployment tx.
|
|
467
466
|
* @param accountsToDeploy - Which accounts to publicly deploy.
|
|
468
|
-
|
|
467
|
+
* @param waitUntilProven - Whether to wait for the tx to be proven.
|
|
468
|
+
* @param pxeOrNode - PXE or AztecNode to wait for proven.
|
|
469
|
+
*/ export async function publicDeployAccounts(sender, accountsToDeploy, waitUntilProven = false, pxeOrNode) {
|
|
469
470
|
const accountAddressesToDeploy = accountsToDeploy.map((a)=>'address' in a ? a.address : a);
|
|
470
471
|
const instances = (await Promise.all(accountAddressesToDeploy.map((account)=>sender.getContractMetadata(account)))).map((metadata)=>metadata.contractInstance);
|
|
471
472
|
const contractClass = await getContractClassFromArtifact(SchnorrAccountContractArtifact);
|
|
@@ -477,7 +478,12 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
477
478
|
...instances.map((instance)=>deployInstance(sender, instance))
|
|
478
479
|
]);
|
|
479
480
|
const batch = new BatchCall(sender, calls);
|
|
480
|
-
await batch.send().wait(
|
|
481
|
-
|
|
482
|
-
|
|
481
|
+
const txReceipt = await batch.send().wait();
|
|
482
|
+
if (waitUntilProven) {
|
|
483
|
+
if (!pxeOrNode) {
|
|
484
|
+
throw new Error('Need to provide a PXE or AztecNode to wait for proven.');
|
|
485
|
+
} else {
|
|
486
|
+
await waitForProven(pxeOrNode, txReceipt);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
483
489
|
}
|
package/dest/fixtures/utils.d.ts
CHANGED
|
@@ -4,16 +4,17 @@ import { type InitialAccountData } from '@aztec/accounts/testing';
|
|
|
4
4
|
import { type AztecNodeConfig } from '@aztec/aztec-node';
|
|
5
5
|
import { type AccountWalletWithSecretKey, type AztecAddress, type AztecNode, type ContractMethod, type Logger, type PXE, type Wallet } from '@aztec/aztec.js';
|
|
6
6
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
|
|
7
|
-
import type { BBNativePrivateKernelProver } from '@aztec/bb-prover';
|
|
8
7
|
import { type BlobSinkServer } from '@aztec/blob-sink/server';
|
|
9
8
|
import { type DeployL1ContractsArgs, type DeployL1ContractsReturnType, ForwarderContract } from '@aztec/ethereum';
|
|
10
9
|
import { startAnvil } from '@aztec/ethereum/test';
|
|
11
10
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
12
11
|
import { Fr } from '@aztec/foundation/fields';
|
|
13
12
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
13
|
+
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
14
14
|
import { type ProverNode } from '@aztec/prover-node';
|
|
15
15
|
import { type PXEService, type PXEServiceConfig } from '@aztec/pxe/server';
|
|
16
16
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
17
|
+
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
17
18
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
18
19
|
import { type TelemetryClient, type TelemetryClientConfig } from '@aztec/telemetry-client';
|
|
19
20
|
import { type Chain, type HDAccount, type Hex, type PrivateKeyAccount } from 'viem';
|
|
@@ -25,13 +26,11 @@ export declare const setupL1Contracts: (l1RpcUrls: string[], account: HDAccount
|
|
|
25
26
|
* Sets up Private eXecution Environment (PXE).
|
|
26
27
|
* @param aztecNode - An instance of Aztec Node.
|
|
27
28
|
* @param opts - Partial configuration for the PXE service.
|
|
28
|
-
* @param firstPrivKey - The private key of the first account to be created.
|
|
29
29
|
* @param logger - The logger to be used.
|
|
30
30
|
* @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
|
|
31
|
-
* @
|
|
32
|
-
* @returns Private eXecution Environment (PXE), accounts, wallets and logger.
|
|
31
|
+
* @returns Private eXecution Environment (PXE), logger and teardown function.
|
|
33
32
|
*/
|
|
34
|
-
export declare function setupPXEService(aztecNode: AztecNode, opts?: Partial<PXEServiceConfig>, logger?: Logger, useLogSuffix?: boolean
|
|
33
|
+
export declare function setupPXEService(aztecNode: AztecNode, opts?: Partial<PXEServiceConfig>, logger?: Logger, useLogSuffix?: boolean): Promise<{
|
|
35
34
|
/**
|
|
36
35
|
* The PXE instance.
|
|
37
36
|
*/
|
|
@@ -84,6 +83,8 @@ export type SetupOptions = {
|
|
|
84
83
|
export type EndToEndContext = {
|
|
85
84
|
/** The Aztec Node service or client a connected to it. */
|
|
86
85
|
aztecNode: AztecNode;
|
|
86
|
+
/** Client to the Aztec Node admin interface (undefined if connected to remote environment) */
|
|
87
|
+
aztecNodeAdmin?: AztecNodeAdmin;
|
|
87
88
|
/** The prover node service (only set if startProverNode is true) */
|
|
88
89
|
proverNode: ProverNode | undefined;
|
|
89
90
|
/** A client to the sequencer service (undefined if connected to remote environment) */
|
|
@@ -147,9 +148,19 @@ export declare function getBalancesFn(symbol: string, method: ContractMethod, lo
|
|
|
147
148
|
export declare function expectMapping<K, V>(fn: (...k: K[]) => Promise<V[]>, inputs: K[], expectedOutputs: V[]): Promise<void>;
|
|
148
149
|
export declare function expectMappingDelta<K, V extends number | bigint>(initialValues: V[], fn: (...k: K[]) => Promise<V[]>, inputs: K[], expectedDiffs: V[]): Promise<void>;
|
|
149
150
|
/**
|
|
150
|
-
* Deploy the
|
|
151
|
+
* Deploy the canonical Fee Juice contract to a running instance.
|
|
151
152
|
*/
|
|
152
153
|
export declare function setupCanonicalFeeJuice(pxe: PXE): Promise<void>;
|
|
154
|
+
/**
|
|
155
|
+
* Computes the address of the "canonical" SponosoredFPCContract. This is not a protocol contract
|
|
156
|
+
* but by conventions its address is computed with a salt of 0.
|
|
157
|
+
* @returns The address of the sponsored FPC contract
|
|
158
|
+
*/
|
|
159
|
+
export declare function getSponsoredFPCAddress(): Promise<AztecAddress>;
|
|
160
|
+
/**
|
|
161
|
+
* Deploy a sponsored FPC contract to a running instance.
|
|
162
|
+
*/
|
|
163
|
+
export declare function setupSponsoredFPC(pxe: PXE): Promise<SponsoredFPCContract>;
|
|
153
164
|
export declare function waitForProvenChain(node: AztecNode, targetBlock?: number, timeoutSec?: number, intervalSec?: number): Promise<void>;
|
|
154
165
|
export declare function createAndSyncProverNode(proverNodePrivateKey: `0x${string}`, aztecNodeConfig: AztecNodeConfig, aztecNode: AztecNode, dataDirectory: string, prefilledPublicData?: PublicDataTreeLeaf[]): Promise<ProverNode>;
|
|
155
166
|
export declare function createForwarderContract(aztecNodeConfig: AztecNodeConfig, privateKey: `0x${string}`, rollupAddress: Hex): Promise<ForwarderContract>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fixtures/utils.ts"],"names":[],"mappings":";;AACA,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,KAAK,eAAe,EAAsC,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,cAAc,EAEnB,KAAK,MAAM,EACX,KAAK,GAAG,EAER,KAAK,MAAM,EAMZ,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fixtures/utils.ts"],"names":[],"mappings":";;AACA,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,KAAK,eAAe,EAAsC,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,cAAc,EAEnB,KAAK,MAAM,EACX,KAAK,GAAG,EAER,KAAK,MAAM,EAMZ,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AAGpF,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,iBAAiB,EAOlB,MAAM,iBAAiB,C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AAK,MAAM,EAAE,EACnC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,MAAM,EACrB,mBAAmB,GAAE,kBAAkB,EAAO,uBA+C/C;AAWD,wBAAsB,uBAAuB,CAC3C,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,KAAK,MAAM,EAAE,EACzB,aAAa,EAAE,GAAG,8BAWnB"}
|
package/dest/fixtures/utils.js
CHANGED
|
@@ -4,10 +4,12 @@ import { createArchiver } from '@aztec/archiver';
|
|
|
4
4
|
import { AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
|
|
5
5
|
import { BatchCall, FeeJuicePaymentMethod, SignerlessWallet, createAztecNodeClient, createLogger, createPXEClient, makeFetch, waitForPXE } from '@aztec/aztec.js';
|
|
6
6
|
import { deployInstance, registerContractClass } from '@aztec/aztec.js/deployment';
|
|
7
|
+
import { SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee/testing';
|
|
7
8
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
|
|
8
9
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
9
10
|
import { createBlobSinkServer } from '@aztec/blob-sink/server';
|
|
10
|
-
import { FEE_JUICE_INITIAL_MINT, GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH } from '@aztec/constants';
|
|
11
|
+
import { FEE_JUICE_INITIAL_MINT, GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH, SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
12
|
+
import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
|
|
11
13
|
import { ForwarderContract, NULL_KEY, createL1Clients, deployL1Contracts, getL1ContractsConfigEnvVars, isAnvilTestChain, l1Artifacts } from '@aztec/ethereum';
|
|
12
14
|
import { DelayedTxUtils, EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
|
|
13
15
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
@@ -16,11 +18,14 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
16
18
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
17
19
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
18
20
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
21
|
+
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
19
22
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
20
23
|
import { ProtocolContractAddress, protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
21
24
|
import { createProverNode } from '@aztec/prover-node';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
25
|
+
import { createPXEServiceWithSimulationProvider, getPXEServiceConfig } from '@aztec/pxe/server';
|
|
26
|
+
import { WASMSimulator } from '@aztec/simulator/client';
|
|
27
|
+
import { SimulationProviderRecorderWrapper } from '@aztec/simulator/testing';
|
|
28
|
+
import { getContractClassFromArtifact, getContractInstanceFromDeployParams } from '@aztec/stdlib/contract';
|
|
24
29
|
import { Gas } from '@aztec/stdlib/gas';
|
|
25
30
|
import { getConfigEnvVars as getTelemetryConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
26
31
|
import { BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
|
|
@@ -82,22 +87,24 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
82
87
|
* Sets up Private eXecution Environment (PXE).
|
|
83
88
|
* @param aztecNode - An instance of Aztec Node.
|
|
84
89
|
* @param opts - Partial configuration for the PXE service.
|
|
85
|
-
* @param firstPrivKey - The private key of the first account to be created.
|
|
86
90
|
* @param logger - The logger to be used.
|
|
87
91
|
* @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
|
|
88
|
-
* @
|
|
89
|
-
|
|
90
|
-
*/ export async function setupPXEService(aztecNode, opts = {}, logger = getLogger(), useLogSuffix = false, proofCreator) {
|
|
92
|
+
* @returns Private eXecution Environment (PXE), logger and teardown function.
|
|
93
|
+
*/ export async function setupPXEService(aztecNode, opts = {}, logger = getLogger(), useLogSuffix = false) {
|
|
91
94
|
const pxeServiceConfig = {
|
|
92
95
|
...getPXEServiceConfig(),
|
|
93
96
|
...opts
|
|
94
97
|
};
|
|
98
|
+
// For tests we only want proving enabled if specifically requested
|
|
99
|
+
pxeServiceConfig.proverEnabled = !!opts.proverEnabled;
|
|
95
100
|
// If no data directory provided, create a temp directory and clean up afterwards
|
|
96
101
|
const configuredDataDirectory = pxeServiceConfig.dataDirectory;
|
|
97
102
|
if (!configuredDataDirectory) {
|
|
98
103
|
pxeServiceConfig.dataDirectory = path.join(tmpdir(), randomBytes(8).toString('hex'));
|
|
99
104
|
}
|
|
100
|
-
const
|
|
105
|
+
const simulationProvider = new WASMSimulator();
|
|
106
|
+
const simulationProviderWithRecorder = new SimulationProviderRecorderWrapper(simulationProvider);
|
|
107
|
+
const pxe = await createPXEServiceWithSimulationProvider(aztecNode, simulationProviderWithRecorder, pxeServiceConfig, useLogSuffix);
|
|
101
108
|
const teardown = async ()=>{
|
|
102
109
|
if (!configuredDataDirectory) {
|
|
103
110
|
try {
|
|
@@ -158,11 +165,11 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
158
165
|
}
|
|
159
166
|
return {
|
|
160
167
|
aztecNode,
|
|
168
|
+
aztecNodeAdmin: undefined,
|
|
161
169
|
sequencer: undefined,
|
|
162
170
|
proverNode: undefined,
|
|
163
171
|
pxe: pxeClient,
|
|
164
172
|
deployL1ContractsValues,
|
|
165
|
-
accounts: await pxeClient.getRegisteredAccounts(),
|
|
166
173
|
config,
|
|
167
174
|
initialFundedAccounts,
|
|
168
175
|
wallet: wallets[0],
|
|
@@ -189,6 +196,8 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
189
196
|
...opts
|
|
190
197
|
};
|
|
191
198
|
config.peerCheckIntervalMS = TEST_PEER_CHECK_INTERVAL_MS;
|
|
199
|
+
// For tests we only want proving enabled if specifically requested
|
|
200
|
+
config.realProofs = !!opts.realProofs;
|
|
192
201
|
const logger = getLogger();
|
|
193
202
|
// Create a temp directory for any services that need it and cleanup later
|
|
194
203
|
const directoryToCleanup = path.join(tmpdir(), randomBytes(8).toString('hex'));
|
|
@@ -293,7 +302,9 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
293
302
|
l1ChainId: config.l1ChainId,
|
|
294
303
|
l1RpcUrls: config.l1RpcUrls,
|
|
295
304
|
rollupAddress: config.l1Contracts.rollupAddress,
|
|
296
|
-
port: blobSinkPort
|
|
305
|
+
port: blobSinkPort,
|
|
306
|
+
dataDirectory: config.dataDirectory,
|
|
307
|
+
dataStoreMapSizeKB: config.dataStoreMapSizeKB
|
|
297
308
|
}, telemetry);
|
|
298
309
|
await blobSink.start();
|
|
299
310
|
config.blobSinkUrl = `http://localhost:${blobSinkPort}`;
|
|
@@ -378,6 +389,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
378
389
|
};
|
|
379
390
|
return {
|
|
380
391
|
aztecNode,
|
|
392
|
+
aztecNodeAdmin: aztecNode,
|
|
381
393
|
blobSink,
|
|
382
394
|
cheatCodes,
|
|
383
395
|
config,
|
|
@@ -471,7 +483,7 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
|
|
|
471
483
|
expect(diffs).toEqual(expectedDiffs);
|
|
472
484
|
}
|
|
473
485
|
/**
|
|
474
|
-
* Deploy the
|
|
486
|
+
* Deploy the canonical Fee Juice contract to a running instance.
|
|
475
487
|
*/ export async function setupCanonicalFeeJuice(pxe) {
|
|
476
488
|
// "deploy" the Fee Juice as it contains public functions
|
|
477
489
|
const feeJuicePortalAddress = (await pxe.getNodeInfo()).l1ContractAddresses.feeJuicePortalAddress;
|
|
@@ -492,6 +504,33 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
|
|
|
492
504
|
getLogger().warn(`Fee Juice might have already been setup. Got error: ${inspect(error)}.`);
|
|
493
505
|
}
|
|
494
506
|
}
|
|
507
|
+
/**
|
|
508
|
+
* Computes the address of the "canonical" SponosoredFPCContract. This is not a protocol contract
|
|
509
|
+
* but by conventions its address is computed with a salt of 0.
|
|
510
|
+
* @returns The address of the sponsored FPC contract
|
|
511
|
+
*/ export async function getSponsoredFPCAddress() {
|
|
512
|
+
const sponsoredFPCInstance = await getContractInstanceFromDeployParams(SponsoredFPCContract.artifact, {
|
|
513
|
+
salt: new Fr(SPONSORED_FPC_SALT)
|
|
514
|
+
});
|
|
515
|
+
return sponsoredFPCInstance.address;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Deploy a sponsored FPC contract to a running instance.
|
|
519
|
+
*/ export async function setupSponsoredFPC(pxe) {
|
|
520
|
+
const { l1ChainId: chainId, protocolVersion } = await pxe.getNodeInfo();
|
|
521
|
+
const deployer = new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(chainId, protocolVersion));
|
|
522
|
+
// Make the contract pay for the deployment fee itself
|
|
523
|
+
const paymentMethod = new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
|
|
524
|
+
const deployed = await SponsoredFPCContract.deploy(deployer).send({
|
|
525
|
+
contractAddressSalt: new Fr(SPONSORED_FPC_SALT),
|
|
526
|
+
universalDeploy: true,
|
|
527
|
+
fee: {
|
|
528
|
+
paymentMethod
|
|
529
|
+
}
|
|
530
|
+
}).deployed();
|
|
531
|
+
getLogger().info(`SponsoredFPC: ${deployed.address}`);
|
|
532
|
+
return deployed;
|
|
533
|
+
}
|
|
495
534
|
export async function waitForProvenChain(node, targetBlock, timeoutSec = 60, intervalSec = 1) {
|
|
496
535
|
targetBlock ??= await node.getBlockNumber();
|
|
497
536
|
await retryUntil(async ()=>await node.getProvenBlockNumber() >= targetBlock, 'proven chain status', timeoutSec, intervalSec);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module exposes the ability to capture the private exection steps that go into our "Client IVC" prover.
|
|
3
|
+
* These are used for debugging and benchmarking barretenberg (the prover component).
|
|
4
|
+
*/
|
|
5
|
+
import type { ContractFunctionInteraction } from '@aztec/aztec.js/contracts';
|
|
6
|
+
export declare function capturePrivateExecutionStepsIfEnvSet(label: string, interaction: ContractFunctionInteraction): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=capture_private_execution_steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture_private_execution_steps.d.ts","sourceRoot":"","sources":["../../src/shared/capture_private_execution_steps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AA0B7E,wBAAsB,oCAAoC,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,2BAA2B,iBAYjH"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module exposes the ability to capture the private exection steps that go into our "Client IVC" prover.
|
|
3
|
+
* These are used for debugging and benchmarking barretenberg (the prover component).
|
|
4
|
+
*/ import { createLogger } from '@aztec/foundation/log';
|
|
5
|
+
import { serializeWitness } from '@aztec/noir-noirc_abi';
|
|
6
|
+
import { encode } from '@msgpack/msgpack';
|
|
7
|
+
import { promises as fs } from 'fs';
|
|
8
|
+
import path from 'path';
|
|
9
|
+
const logger = createLogger('e2e:capture-private-execution-steps');
|
|
10
|
+
// TODO(#7371): This is duplicated.
|
|
11
|
+
// Longer term we won't use this hacked together msgpack format
|
|
12
|
+
// Leaving duplicated as this eventually bb will provide a serialization
|
|
13
|
+
// helper for passing to a generic msgpack RPC endpoint.
|
|
14
|
+
async function _createClientIvcProofFiles(directory, executionSteps) {
|
|
15
|
+
const acirPath = path.join(directory, 'acir.msgpack');
|
|
16
|
+
const witnessPath = path.join(directory, 'witnesses.msgpack');
|
|
17
|
+
await fs.writeFile(acirPath, encode(executionSteps.map((map)=>map.bytecode)));
|
|
18
|
+
await fs.writeFile(witnessPath, encode(executionSteps.map((map)=>serializeWitness(map.witness))));
|
|
19
|
+
return {
|
|
20
|
+
acirPath,
|
|
21
|
+
witnessPath
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export async function capturePrivateExecutionStepsIfEnvSet(label, interaction) {
|
|
25
|
+
// Not included in env_var.ts as internal to e2e tests.
|
|
26
|
+
const ivcFolder = process.env.CAPTURE_IVC_FOLDER;
|
|
27
|
+
if (ivcFolder) {
|
|
28
|
+
logger.info(`Capturing client ivc execution steps for ${label}`);
|
|
29
|
+
const result = await interaction.profile({
|
|
30
|
+
profileMode: 'execution-steps'
|
|
31
|
+
});
|
|
32
|
+
const resultsDirectory = path.join(ivcFolder, label);
|
|
33
|
+
logger.info(`Writing private execution steps to ${resultsDirectory}`);
|
|
34
|
+
await fs.mkdir(resultsDirectory, {
|
|
35
|
+
recursive: true
|
|
36
|
+
});
|
|
37
|
+
await _createClientIvcProofFiles(resultsDirectory, result.executionSteps);
|
|
38
|
+
logger.info(`Wrote private execution steps to ${resultsDirectory}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AccountWallet, type AztecAddress, type AztecNode, EthAddress, type FieldsOf, Fr, type L2AmountClaim, type L2AmountClaimWithRecipient, type Logger, type PXE, type SiblingPath, type TxReceipt, type Wallet } from '@aztec/aztec.js';
|
|
1
|
+
import { type AccountWallet, AuthWitness, type AztecAddress, type AztecNode, EthAddress, type FieldsOf, Fr, type L2AmountClaim, type L2AmountClaimWithRecipient, type Logger, type PXE, type SiblingPath, type TxReceipt, type Wallet } from '@aztec/aztec.js';
|
|
2
2
|
import { type L1ContractAddresses, type ViemPublicClient, type ViemWalletClient } from '@aztec/ethereum';
|
|
3
3
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
4
4
|
import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
|
|
@@ -102,7 +102,7 @@ export declare class CrossChainTestHarness {
|
|
|
102
102
|
sendL2PublicTransfer(transferAmount: bigint, receiverAddress: AztecAddress): Promise<void>;
|
|
103
103
|
consumeMessageOnAztecAndMintPrivately(claim: Pick<L2AmountClaimWithRecipient, 'claimAmount' | 'claimSecret' | 'messageLeafIndex' | 'recipient'>): Promise<void>;
|
|
104
104
|
consumeMessageOnAztecAndMintPublicly(claim: Pick<L2AmountClaim, 'claimAmount' | 'claimSecret' | 'messageLeafIndex'>): Promise<void>;
|
|
105
|
-
withdrawPrivateFromAztecToL1(withdrawAmount: bigint, nonce
|
|
105
|
+
withdrawPrivateFromAztecToL1(withdrawAmount: bigint, nonce: Fr | undefined, authWitness: AuthWitness): Promise<FieldsOf<TxReceipt>>;
|
|
106
106
|
withdrawPublicFromAztecToL1(withdrawAmount: bigint, nonce?: Fr): Promise<FieldsOf<TxReceipt>>;
|
|
107
107
|
getL2PrivateBalanceOf(owner: AztecAddress): Promise<any>;
|
|
108
108
|
expectPrivateBalanceOnL2(owner: AztecAddress, expectedBalance: bigint): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross_chain_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/cross_chain_test_harness.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,UAAU,EACV,KAAK,QAAQ,EACb,EAAE,EAGF,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAEtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCA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C,OAAO,CAAC,qBAAqB,CAAC;IAgCjC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAuB;IAE5D,SAAgB,YAAY,EAAE,YAAY,CAAC;;IAGzC,2BAA2B;IACpB,SAAS,EAAE,SAAS;IAC3B,2CAA2C;IACpC,UAAU,EAAE,GAAG;IACtB,cAAc;IACP,MAAM,EAAE,MAAM;IAErB,yBAAyB;IAClB,OAAO,EAAE,aAAa;IAC7B,gCAAgC;IACzB,QAAQ,EAAE,mBAAmB;IAEpC,oCAAoC;IAC7B,UAAU,EAAE,UAAU;IAE7B,sBAAsB;IACf,kBAAkB,EAAE,UAAU;IACrC,yCAAyC;IAClC,sBAAsB,EAAE,UAAU;IACzC,mCAAmC;IAC5B,YAAY,EAAE,gBAAgB;IACrC,mCAAmC;IAC5B,YAAY,EAAE,gBAAgB;IAErC,gDAAgD;IAChC,mBAAmB,EAAE,mBAAmB;IAExD,2BAA2B;IACX,WAAW,EAAE,aAAa;
|
|
1
|
+
{"version":3,"file":"cross_chain_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/cross_chain_test_harness.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,UAAU,EACV,KAAK,QAAQ,EACb,EAAE,EAGF,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAEtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E,OAAO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W,EAAE,WAAW,GACvB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IASzB,2BAA2B,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,GAAE,EAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAStG,qBAAqB,CAAC,KAAK,EAAE,YAAY;IAIzC,wBAAwB,CAAC,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM;IAMrE,oBAAoB,CAAC,KAAK,EAAE,YAAY;IAIxC,uBAAuB,CAAC,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM;IAK1E,oBAAoB,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,GAAE,UAA4B,GAAG,EAAE;IAS1F,2BAA2B,CACzB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,EAC5B,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC;IAW5B,qBAAqB,CAAC,YAAY,EAAE,MAAM;IAK1C,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,KAAU;IAK1D;;;;;;OAMG;IACG,qBAAqB,CAAC,OAAO,EAAE,EAAE,GAAG,GAAG;CAQ9C"}
|
|
@@ -100,12 +100,20 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
100
100
|
this.walletClient = walletClient;
|
|
101
101
|
this.l1ContractAddresses = l1ContractAddresses;
|
|
102
102
|
this.ownerWallet = ownerWallet;
|
|
103
|
-
this.l1TokenPortalManager = new L1TokenPortalManager(this.tokenPortalAddress, this.underlyingERC20Address, this.l1ContractAddresses.outboxAddress, this.publicClient, this.walletClient, this.logger);
|
|
103
|
+
this.l1TokenPortalManager = new L1TokenPortalManager(this.tokenPortalAddress, this.underlyingERC20Address, this.l1ContractAddresses.feeAssetHandlerAddress, this.l1ContractAddresses.outboxAddress, this.publicClient, this.walletClient, this.logger);
|
|
104
104
|
this.l1TokenManager = this.l1TokenPortalManager.getTokenManager();
|
|
105
105
|
this.ownerAddress = this.ownerWallet.getAddress();
|
|
106
106
|
}
|
|
107
107
|
async mintTokensOnL1(amount) {
|
|
108
|
-
|
|
108
|
+
const contract = getContract({
|
|
109
|
+
abi: TestERC20Abi,
|
|
110
|
+
address: this.l1TokenManager.tokenAddress.toString(),
|
|
111
|
+
client: this.walletClient
|
|
112
|
+
});
|
|
113
|
+
await contract.write.mint([
|
|
114
|
+
this.ethAccount.toString(),
|
|
115
|
+
amount
|
|
116
|
+
]);
|
|
109
117
|
expect(await this.l1TokenManager.getL1TokenBalance(this.ethAccount.toString())).toEqual(amount);
|
|
110
118
|
}
|
|
111
119
|
getL1BalanceOf(address) {
|
|
@@ -138,8 +146,12 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
138
146
|
const { claimAmount, claimSecret, messageLeafIndex } = claim;
|
|
139
147
|
await this.l2Bridge.methods.claim_public(this.ownerAddress, claimAmount, claimSecret, messageLeafIndex).send().wait();
|
|
140
148
|
}
|
|
141
|
-
async withdrawPrivateFromAztecToL1(withdrawAmount, nonce = Fr.ZERO) {
|
|
142
|
-
const withdrawReceipt = await this.l2Bridge.methods.exit_to_l1_private(this.l2Token.address, this.ethAccount, withdrawAmount, EthAddress.ZERO, nonce).send(
|
|
149
|
+
async withdrawPrivateFromAztecToL1(withdrawAmount, nonce = Fr.ZERO, authWitness) {
|
|
150
|
+
const withdrawReceipt = await this.l2Bridge.methods.exit_to_l1_private(this.l2Token.address, this.ethAccount, withdrawAmount, EthAddress.ZERO, nonce).send({
|
|
151
|
+
authWitnesses: [
|
|
152
|
+
authWitness
|
|
153
|
+
]
|
|
154
|
+
}).wait();
|
|
143
155
|
return withdrawReceipt;
|
|
144
156
|
}
|
|
145
157
|
async withdrawPublicFromAztecToL1(withdrawAmount, nonce = Fr.ZERO) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type AztecAddress, type AztecNode, EthAddress, L1FeeJuicePortalManager, type L1TokenManager, type L2AmountClaim, type Logger, type PXE, type Wallet } from '@aztec/aztec.js';
|
|
2
2
|
import type { ViemPublicClient, ViemWalletClient } from '@aztec/ethereum';
|
|
3
3
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
4
|
+
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
4
5
|
export interface IGasBridgingTestHarness {
|
|
5
6
|
getL1FeeJuiceBalance(address: EthAddress): Promise<bigint>;
|
|
6
7
|
prepareTokensOnL1(bridgeAmount: bigint, owner: AztecAddress): Promise<L2AmountClaim>;
|
|
@@ -10,6 +11,7 @@ export interface IGasBridgingTestHarness {
|
|
|
10
11
|
}
|
|
11
12
|
export interface FeeJuicePortalTestingHarnessFactoryConfig {
|
|
12
13
|
aztecNode: AztecNode;
|
|
14
|
+
aztecNodeAdmin?: AztecNodeAdmin;
|
|
13
15
|
pxeService: PXE;
|
|
14
16
|
publicClient: ViemPublicClient;
|
|
15
17
|
walletClient: ViemWalletClient;
|
|
@@ -30,6 +32,8 @@ export declare class FeeJuicePortalTestingHarnessFactory {
|
|
|
30
32
|
export declare class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
31
33
|
/** Aztec node */
|
|
32
34
|
aztecNode: AztecNode;
|
|
35
|
+
/** Aztec node admin interface */
|
|
36
|
+
aztecNodeAdmin: AztecNodeAdmin | undefined;
|
|
33
37
|
/** Private eXecution Environment (PXE). */
|
|
34
38
|
pxeService: PXE;
|
|
35
39
|
/** Logger. */
|
|
@@ -42,6 +46,8 @@ export declare class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
42
46
|
feeJuicePortalAddress: EthAddress;
|
|
43
47
|
/** Underlying token for portal tests. */
|
|
44
48
|
l1FeeJuiceAddress: EthAddress;
|
|
49
|
+
/** Fee asset handler address. */
|
|
50
|
+
feeAssetHandlerAddress: EthAddress;
|
|
45
51
|
/** Viem Public client instance. */
|
|
46
52
|
publicClient: ViemPublicClient;
|
|
47
53
|
/** Viem Wallet Client instance. */
|
|
@@ -51,6 +57,8 @@ export declare class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
51
57
|
constructor(
|
|
52
58
|
/** Aztec node */
|
|
53
59
|
aztecNode: AztecNode,
|
|
60
|
+
/** Aztec node admin interface */
|
|
61
|
+
aztecNodeAdmin: AztecNodeAdmin | undefined,
|
|
54
62
|
/** Private eXecution Environment (PXE). */
|
|
55
63
|
pxeService: PXE,
|
|
56
64
|
/** Logger. */
|
|
@@ -63,13 +71,15 @@ export declare class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
63
71
|
feeJuicePortalAddress: EthAddress,
|
|
64
72
|
/** Underlying token for portal tests. */
|
|
65
73
|
l1FeeJuiceAddress: EthAddress,
|
|
74
|
+
/** Fee asset handler address. */
|
|
75
|
+
feeAssetHandlerAddress: EthAddress,
|
|
66
76
|
/** Viem Public client instance. */
|
|
67
77
|
publicClient: ViemPublicClient,
|
|
68
78
|
/** Viem Wallet Client instance. */
|
|
69
79
|
walletClient: ViemWalletClient);
|
|
70
80
|
mintTokensOnL1(amount: bigint, to?: EthAddress): Promise<void>;
|
|
71
81
|
getL1FeeJuiceBalance(address: EthAddress): Promise<bigint>;
|
|
72
|
-
sendTokensToPortalPublic(bridgeAmount: bigint, l2Address: AztecAddress
|
|
82
|
+
sendTokensToPortalPublic(bridgeAmount: bigint, l2Address: AztecAddress): Promise<L2AmountClaim>;
|
|
73
83
|
consumeMessageOnAztecAndClaimPrivately(owner: AztecAddress, claim: L2AmountClaim): Promise<void>;
|
|
74
84
|
getL2PublicBalanceOf(owner: AztecAddress): Promise<any>;
|
|
75
85
|
expectPublicBalanceOnL2(owner: AztecAddress, expectedBalance: bigint): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gas_portal_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/gas_portal_test_harness.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAC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