@aztec/end-to-end 1.0.0-nightly.20250625 → 1.0.0-nightly.20250627
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/fixtures/utils.d.ts +13 -1
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +54 -9
- package/dest/spartan/setup_test_wallets.d.ts +5 -0
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +70 -6
- package/dest/spartan/utils.d.ts +20 -1
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +6 -4
- package/package.json +35 -35
- package/src/fixtures/utils.ts +61 -9
- package/src/spartan/setup_test_wallets.ts +81 -4
- package/src/spartan/utils.ts +6 -2
package/dest/fixtures/utils.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { MockGossipSubNetwork } from '@aztec/p2p/test-helpers';
|
|
|
12
12
|
import { type ProverNode, type ProverNodeConfig } from '@aztec/prover-node';
|
|
13
13
|
import { type PXEService, type PXEServiceConfig } from '@aztec/pxe/server';
|
|
14
14
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
15
|
+
import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
15
16
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
16
17
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
17
18
|
import { type TelemetryClient, type TelemetryClientConfig } from '@aztec/telemetry-client';
|
|
@@ -159,6 +160,12 @@ export declare function getBalancesFn(symbol: string, method: ContractMethod, lo
|
|
|
159
160
|
})[]) => Promise<bigint[]>;
|
|
160
161
|
export declare function expectMapping<K, V>(fn: (...k: K[]) => Promise<V[]>, inputs: K[], expectedOutputs: V[]): Promise<void>;
|
|
161
162
|
export declare function expectMappingDelta<K, V extends number | bigint>(initialValues: V[], fn: (...k: K[]) => Promise<V[]>, inputs: K[], expectedDiffs: V[]): Promise<void>;
|
|
163
|
+
/**
|
|
164
|
+
* Computes the address of the "canonical" SponosoredFPCContract. This is not a protocol contract
|
|
165
|
+
* but by conventions its address is computed with a salt of 0.
|
|
166
|
+
* @returns The address of the sponsored FPC contract
|
|
167
|
+
*/
|
|
168
|
+
export declare function getSponsoredFPCInstance(): Promise<ContractInstanceWithAddress>;
|
|
162
169
|
/**
|
|
163
170
|
* Computes the address of the "canonical" SponosoredFPCContract. This is not a protocol contract
|
|
164
171
|
* but by conventions its address is computed with a salt of 0.
|
|
@@ -168,7 +175,12 @@ export declare function getSponsoredFPCAddress(): Promise<AztecAddress>;
|
|
|
168
175
|
/**
|
|
169
176
|
* Deploy a sponsored FPC contract to a running instance.
|
|
170
177
|
*/
|
|
171
|
-
export declare function setupSponsoredFPC(pxe: PXE): Promise<
|
|
178
|
+
export declare function setupSponsoredFPC(pxe: PXE): Promise<ContractInstanceWithAddress>;
|
|
179
|
+
/**
|
|
180
|
+
* Registers the SponsoredFPC in this PXE instance
|
|
181
|
+
* @param pxe - The pxe client
|
|
182
|
+
*/
|
|
183
|
+
export declare function registerSponsoredFPC(pxe: PXE): Promise<void>;
|
|
172
184
|
export declare function waitForProvenChain(node: AztecNode, targetBlock?: number, timeoutSec?: number, intervalSec?: number): Promise<void>;
|
|
173
185
|
export declare function createAndSyncProverNode(proverNodePrivateKey: `0x${string}`, aztecNodeConfig: AztecNodeConfig, proverNodeConfig: Partial<ProverNodeConfig> & Pick<DataStoreConfig, 'dataDirectory'>, aztecNode: AztecNode, prefilledPublicData?: PublicDataTreeLeaf[]): Promise<ProverNode>;
|
|
174
186
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -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,mBAA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,CACrC,oBAAoB,EAAE,KAAK,MAAM,EAAE,EACnC,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,eAAe,EAAE,eAAe,CAAC,EACpF,SAAS,EAAE,SAAS,EACpB,mBAAmB,GAAE,kBAAkB,EAAO,uBA6C/C"}
|
package/dest/fixtures/utils.js
CHANGED
|
@@ -2,7 +2,7 @@ import { SchnorrAccountContractArtifact } from '@aztec/accounts/schnorr';
|
|
|
2
2
|
import { deployFundedSchnorrAccounts, generateSchnorrAccounts, getDeployedTestAccounts, getDeployedTestAccountsWallets } from '@aztec/accounts/testing';
|
|
3
3
|
import { createArchiver } from '@aztec/archiver';
|
|
4
4
|
import { AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
|
|
5
|
-
import { BatchCall, createAztecNodeClient, createLogger, createPXEClient, makeFetch, waitForPXE } from '@aztec/aztec.js';
|
|
5
|
+
import { BatchCall, createAztecNodeClient, createLogger, createPXEClient, makeFetch, sleep, waitForPXE } from '@aztec/aztec.js';
|
|
6
6
|
import { deployInstance, registerContractClass } from '@aztec/aztec.js/deployment';
|
|
7
7
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
|
|
8
8
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
@@ -353,9 +353,9 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
353
353
|
}, {
|
|
354
354
|
prefilledPublicData
|
|
355
355
|
});
|
|
356
|
-
const
|
|
357
|
-
if (
|
|
358
|
-
const publisher =
|
|
356
|
+
const sequencerClient = aztecNode.getSequencer();
|
|
357
|
+
if (sequencerClient) {
|
|
358
|
+
const publisher = sequencerClient.sequencer.publisher;
|
|
359
359
|
publisher.l1TxUtils = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, config.ethereumSlotDuration);
|
|
360
360
|
}
|
|
361
361
|
let proverNode = undefined;
|
|
@@ -382,7 +382,36 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
382
382
|
await cheatCodes.rollup.setupEpoch();
|
|
383
383
|
await cheatCodes.rollup.debugRollup();
|
|
384
384
|
}
|
|
385
|
-
const
|
|
385
|
+
const sequencer = sequencerClient.getSequencer();
|
|
386
|
+
const minTxsPerBlock = config.minTxsPerBlock;
|
|
387
|
+
if (minTxsPerBlock === undefined) {
|
|
388
|
+
throw new Error('minTxsPerBlock is undefined in e2e test setup');
|
|
389
|
+
}
|
|
390
|
+
// Transactions built against the genesis state must be included in block 1, otherwise they are dropped.
|
|
391
|
+
// To avoid test failures from dropped transactions, we ensure progression beyond genesis before proceeding.
|
|
392
|
+
// For account deployments, we set minTxsPerBlock=1 and deploy accounts sequentially for guaranteed success.
|
|
393
|
+
// If no accounts need deployment, we await an empty block to confirm network progression. After either path
|
|
394
|
+
// completes, we restore the original minTxsPerBlock setting.
|
|
395
|
+
// For more details on why the tx would be dropped see `validate_include_by_timestamp` function in
|
|
396
|
+
// `noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/components/validation_requests.nr`.
|
|
397
|
+
let accountManagers = [];
|
|
398
|
+
if (numberOfAccounts === 0) {
|
|
399
|
+
// We wait until block 1 is mined to ensure that the network has progressed past genesis.
|
|
400
|
+
sequencer.updateConfig({
|
|
401
|
+
minTxsPerBlock: 0
|
|
402
|
+
});
|
|
403
|
+
while(await pxe.getBlockNumber() === 0){
|
|
404
|
+
await sleep(2000);
|
|
405
|
+
}
|
|
406
|
+
} else {
|
|
407
|
+
sequencer.updateConfig({
|
|
408
|
+
minTxsPerBlock: 1
|
|
409
|
+
});
|
|
410
|
+
accountManagers = await deployFundedSchnorrAccounts(pxe, initialFundedAccounts.slice(0, numberOfAccounts));
|
|
411
|
+
}
|
|
412
|
+
sequencer.updateConfig({
|
|
413
|
+
minTxsPerBlock
|
|
414
|
+
});
|
|
386
415
|
const wallets = await Promise.all(accountManagers.map((account)=>account.getWallet()));
|
|
387
416
|
if (initialFundedAccounts.length < numberOfAccounts) {
|
|
388
417
|
// TODO: Create (numberOfAccounts - initialFundedAccounts.length) wallets without funds.
|
|
@@ -421,7 +450,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
421
450
|
prefilledPublicData,
|
|
422
451
|
proverNode,
|
|
423
452
|
pxe,
|
|
424
|
-
sequencer,
|
|
453
|
+
sequencer: sequencerClient,
|
|
425
454
|
teardown,
|
|
426
455
|
telemetryClient: telemetry,
|
|
427
456
|
wallet: wallets[0],
|
|
@@ -513,10 +542,17 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
|
|
|
513
542
|
* Computes the address of the "canonical" SponosoredFPCContract. This is not a protocol contract
|
|
514
543
|
* but by conventions its address is computed with a salt of 0.
|
|
515
544
|
* @returns The address of the sponsored FPC contract
|
|
516
|
-
*/ export
|
|
517
|
-
|
|
545
|
+
*/ export function getSponsoredFPCInstance() {
|
|
546
|
+
return Promise.resolve(getContractInstanceFromDeployParams(SponsoredFPCContract.artifact, {
|
|
518
547
|
salt: new Fr(SPONSORED_FPC_SALT)
|
|
519
|
-
});
|
|
548
|
+
}));
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Computes the address of the "canonical" SponosoredFPCContract. This is not a protocol contract
|
|
552
|
+
* but by conventions its address is computed with a salt of 0.
|
|
553
|
+
* @returns The address of the sponsored FPC contract
|
|
554
|
+
*/ export async function getSponsoredFPCAddress() {
|
|
555
|
+
const sponsoredFPCInstance = await getSponsoredFPCInstance();
|
|
520
556
|
return sponsoredFPCInstance.address;
|
|
521
557
|
}
|
|
522
558
|
/**
|
|
@@ -532,6 +568,15 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
|
|
|
532
568
|
getLogger().info(`SponsoredFPC: ${instance.address}`);
|
|
533
569
|
return instance;
|
|
534
570
|
}
|
|
571
|
+
/**
|
|
572
|
+
* Registers the SponsoredFPC in this PXE instance
|
|
573
|
+
* @param pxe - The pxe client
|
|
574
|
+
*/ export async function registerSponsoredFPC(pxe) {
|
|
575
|
+
await pxe.registerContract({
|
|
576
|
+
instance: await getSponsoredFPCInstance(),
|
|
577
|
+
artifact: SponsoredFPCContract.artifact
|
|
578
|
+
});
|
|
579
|
+
}
|
|
535
580
|
export async function waitForProvenChain(node, targetBlock, timeoutSec = 60, intervalSec = 1) {
|
|
536
581
|
targetBlock ??= await node.getBlockNumber();
|
|
537
582
|
await retryUntil(async ()=>await node.getProvenBlockNumber() >= targetBlock, 'proven chain status', timeoutSec, intervalSec);
|
|
@@ -10,6 +10,7 @@ export interface TestWallets {
|
|
|
10
10
|
tokenAddress: AztecAddress;
|
|
11
11
|
}
|
|
12
12
|
export declare function setupTestWalletsWithTokens(pxeUrl: string, mintAmount: bigint, logger: Logger): Promise<TestWallets>;
|
|
13
|
+
export declare function deploySponsoredTestWallets(pxe: PXE, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number): Promise<TestWallets>;
|
|
13
14
|
export declare function deployTestWalletWithTokens(pxeUrl: string, nodeUrl: string, l1RpcUrls: string[], mnemonicOrPrivateKey: string, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number): Promise<TestWallets>;
|
|
14
15
|
export declare function performTransfers({ testWallets, rounds, transferAmount, logger, }: {
|
|
15
16
|
testWallets: TestWallets;
|
|
@@ -17,4 +18,8 @@ export declare function performTransfers({ testWallets, rounds, transferAmount,
|
|
|
17
18
|
transferAmount: bigint;
|
|
18
19
|
logger: Logger;
|
|
19
20
|
}): Promise<void>;
|
|
21
|
+
export declare function startCompatiblePXE(nodeUrl: string, proverEnabled: boolean, logger: Logger): Promise<{
|
|
22
|
+
pxe: PXE;
|
|
23
|
+
cleanup: () => Promise<void>;
|
|
24
|
+
}>;
|
|
20
25
|
//# sourceMappingURL=setup_test_wallets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_test_wallets.d.ts","sourceRoot":"","sources":["../../src/spartan/setup_test_wallets.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"setup_test_wallets.d.ts","sourceRoot":"","sources":["../../src/spartan/setup_test_wallets.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EAMjB,KAAK,GAAG,EAKT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAQ/D,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,GAAG,CAAC;IACT,OAAO,EAAE,0BAA0B,EAAE,CAAC;IACtC,gBAAgB,EAAE,aAAa,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,0BAA0B,CAAC;IAC5C,YAAY,EAAE,YAAY,CAAC;CAC5B;AAMD,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,CAAC,CAYtB;AAED,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,qBAAqB,SAAI,GACxB,OAAO,CAAC,WAAW,CAAC,CAiCtB;AAED,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EAAE,EACnB,oBAAoB,EAAE,MAAM,EAC5B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,qBAAqB,SAAI,GACxB,OAAO,CAAC,WAAW,CAAC,CAqCtB;AAkED,wBAAsB,gBAAgB,CAAC,EACrC,WAAW,EACX,MAAM,EACN,cAAc,EACd,MAAM,GACP,EAAE;IACD,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB,iBAqBA;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,OAAO,EACtB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAmBrD"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { getSchnorrAccount, getSchnorrWalletWithSecretKey } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { generateSchnorrAccounts, getDeployedTestAccountsWallets } from '@aztec/accounts/testing';
|
|
3
|
-
import { FeeJuicePaymentMethodWithClaim, Fr, L1FeeJuicePortalManager, createAztecNodeClient, createCompatibleClient, retryUntil } from '@aztec/aztec.js';
|
|
3
|
+
import { FeeJuicePaymentMethodWithClaim, Fr, L1FeeJuicePortalManager, SponsoredFeePaymentMethod, createAztecNodeClient, createCompatibleClient, retryUntil } from '@aztec/aztec.js';
|
|
4
4
|
import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
|
|
5
5
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
6
|
+
import { createPXEService } from '@aztec/pxe/server';
|
|
7
|
+
import { getACVMConfig } from '../fixtures/get_acvm_config.js';
|
|
8
|
+
import { getBBConfig } from '../fixtures/get_bb_config.js';
|
|
9
|
+
import { getSponsoredFPCAddress, registerSponsoredFPC } from '../fixtures/utils.js';
|
|
6
10
|
const TOKEN_NAME = 'USDC';
|
|
7
11
|
const TOKEN_SYMBOL = 'USD';
|
|
8
12
|
const TOKEN_DECIMALS = 18n;
|
|
@@ -11,7 +15,37 @@ export async function setupTestWalletsWithTokens(pxeUrl, mintAmount, logger) {
|
|
|
11
15
|
const pxe = await createCompatibleClient(pxeUrl, logger);
|
|
12
16
|
const [recipientWallet, ...wallets] = (await getDeployedTestAccountsWallets(pxe)).slice(0, WALLET_COUNT + 1);
|
|
13
17
|
const tokenAdmin = wallets[0];
|
|
14
|
-
const tokenAddress = await deployTokenAndMint(wallets, tokenAdmin.getAddress(), mintAmount, logger);
|
|
18
|
+
const tokenAddress = await deployTokenAndMint(wallets, tokenAdmin.getAddress(), mintAmount, undefined, logger);
|
|
19
|
+
const tokenAdminWallet = await TokenContract.at(tokenAddress, tokenAdmin);
|
|
20
|
+
return {
|
|
21
|
+
pxe,
|
|
22
|
+
wallets,
|
|
23
|
+
tokenAdminWallet,
|
|
24
|
+
tokenName: TOKEN_NAME,
|
|
25
|
+
tokenAddress,
|
|
26
|
+
recipientWallet
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export async function deploySponsoredTestWallets(pxe, mintAmount, logger, numberOfFundedWallets = 1) {
|
|
30
|
+
const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
|
|
31
|
+
const recipientWallet = await getSchnorrWalletWithSecretKey(pxe, recipient.secret, recipient.signingKey, recipient.salt);
|
|
32
|
+
const fundedAccounts = await Promise.all(funded.map((a)=>getSchnorrAccount(pxe, a.secret, a.signingKey, a.salt)));
|
|
33
|
+
await registerSponsoredFPC(pxe);
|
|
34
|
+
const wallets = await Promise.all(fundedAccounts.map(async (a)=>{
|
|
35
|
+
const wallet = await a.getWallet();
|
|
36
|
+
const paymentMethod = new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
|
|
37
|
+
await a.deploy({
|
|
38
|
+
fee: {
|
|
39
|
+
paymentMethod
|
|
40
|
+
}
|
|
41
|
+
}).wait({
|
|
42
|
+
timeout: 2400
|
|
43
|
+
}); // increase timeout on purpose in order to account for two empty epochs
|
|
44
|
+
logger.info(`Account deployed at ${a.getAddress()}`);
|
|
45
|
+
return wallet;
|
|
46
|
+
}));
|
|
47
|
+
const tokenAdmin = wallets[0];
|
|
48
|
+
const tokenAddress = await deployTokenAndMint(wallets, tokenAdmin.getAddress(), mintAmount, new SponsoredFeePaymentMethod(await getSponsoredFPCAddress()), logger);
|
|
15
49
|
const tokenAdminWallet = await TokenContract.at(tokenAddress, tokenAdmin);
|
|
16
50
|
return {
|
|
17
51
|
pxe,
|
|
@@ -45,7 +79,7 @@ export async function deployTestWalletWithTokens(pxeUrl, nodeUrl, l1RpcUrls, mne
|
|
|
45
79
|
return wallet;
|
|
46
80
|
}));
|
|
47
81
|
const tokenAdmin = wallets[0];
|
|
48
|
-
const tokenAddress = await deployTokenAndMint(wallets, tokenAdmin.getAddress(), mintAmount, logger);
|
|
82
|
+
const tokenAddress = await deployTokenAndMint(wallets, tokenAdmin.getAddress(), mintAmount, undefined, logger);
|
|
49
83
|
const tokenAdminWallet = await TokenContract.at(tokenAddress, tokenAdmin);
|
|
50
84
|
return {
|
|
51
85
|
pxe,
|
|
@@ -74,14 +108,22 @@ async function advanceL2Block(node, nodeAdmin) {
|
|
|
74
108
|
await nodeAdmin?.flushTxs();
|
|
75
109
|
await retryUntil(async ()=>await node.getBlockNumber() >= initialBlockNumber + 1);
|
|
76
110
|
}
|
|
77
|
-
async function deployTokenAndMint(wallets, admin, mintAmount, logger) {
|
|
111
|
+
async function deployTokenAndMint(wallets, admin, mintAmount, paymentMethod, logger) {
|
|
78
112
|
logger.verbose(`Deploying TokenContract...`);
|
|
79
|
-
const tokenContract = await TokenContract.deploy(wallets[0], admin, TOKEN_NAME, TOKEN_SYMBOL, TOKEN_DECIMALS).send(
|
|
113
|
+
const tokenContract = await TokenContract.deploy(wallets[0], admin, TOKEN_NAME, TOKEN_SYMBOL, TOKEN_DECIMALS).send({
|
|
114
|
+
fee: {
|
|
115
|
+
paymentMethod
|
|
116
|
+
}
|
|
117
|
+
}).deployed({
|
|
80
118
|
timeout: 600
|
|
81
119
|
});
|
|
82
120
|
const tokenAddress = tokenContract.address;
|
|
83
121
|
logger.verbose(`Minting ${mintAmount} public assets to the ${wallets.length} wallets...`);
|
|
84
|
-
await Promise.all(wallets.map(async (w)=>(await TokenContract.at(tokenAddress, w)).methods.mint_to_public(w.getAddress(), mintAmount).send(
|
|
122
|
+
await Promise.all(wallets.map(async (w)=>(await TokenContract.at(tokenAddress, w)).methods.mint_to_public(w.getAddress(), mintAmount).send({
|
|
123
|
+
fee: {
|
|
124
|
+
paymentMethod
|
|
125
|
+
}
|
|
126
|
+
}).wait({
|
|
85
127
|
timeout: 600
|
|
86
128
|
})));
|
|
87
129
|
logger.verbose(`Minting complete.`);
|
|
@@ -98,3 +140,25 @@ export async function performTransfers({ testWallets, rounds, transferAmount, lo
|
|
|
98
140
|
logger.info(`Completed round ${i + 1} / ${rounds}`);
|
|
99
141
|
}
|
|
100
142
|
}
|
|
143
|
+
export async function startCompatiblePXE(nodeUrl, proverEnabled, logger) {
|
|
144
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
145
|
+
const [bbConfig, acvmConfig] = await Promise.all([
|
|
146
|
+
getBBConfig(logger),
|
|
147
|
+
getACVMConfig(logger)
|
|
148
|
+
]);
|
|
149
|
+
const pxe = await createPXEService(node, {
|
|
150
|
+
dataDirectory: undefined,
|
|
151
|
+
dataStoreMapSizeKB: 1024 * 1024,
|
|
152
|
+
...bbConfig,
|
|
153
|
+
...acvmConfig,
|
|
154
|
+
proverEnabled
|
|
155
|
+
});
|
|
156
|
+
return {
|
|
157
|
+
pxe,
|
|
158
|
+
async cleanup () {
|
|
159
|
+
await pxe.stop();
|
|
160
|
+
await bbConfig?.cleanup();
|
|
161
|
+
await acvmConfig?.cleanup();
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
}
|
package/dest/spartan/utils.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ declare const k8sLocalConfigSchema: z.ZodObject<{
|
|
|
9
9
|
AZTEC_SLOT_DURATION: z.ZodNumber;
|
|
10
10
|
AZTEC_EPOCH_DURATION: z.ZodNumber;
|
|
11
11
|
AZTEC_PROOF_SUBMISSION_WINDOW: z.ZodNumber;
|
|
12
|
+
AZTEC_REAL_PROOFS: z.ZodDefault<z.ZodString>;
|
|
12
13
|
INSTANCE_NAME: z.ZodString;
|
|
13
14
|
NAMESPACE: z.ZodString;
|
|
14
15
|
CONTAINER_NODE_PORT: z.ZodDefault<z.ZodNumber>;
|
|
@@ -30,6 +31,7 @@ declare const k8sLocalConfigSchema: z.ZodObject<{
|
|
|
30
31
|
AZTEC_SLOT_DURATION: number;
|
|
31
32
|
AZTEC_EPOCH_DURATION: number;
|
|
32
33
|
AZTEC_PROOF_SUBMISSION_WINDOW: number;
|
|
34
|
+
AZTEC_REAL_PROOFS: string;
|
|
33
35
|
INSTANCE_NAME: string;
|
|
34
36
|
NAMESPACE: string;
|
|
35
37
|
CONTAINER_NODE_PORT: number;
|
|
@@ -56,6 +58,7 @@ declare const k8sLocalConfigSchema: z.ZodObject<{
|
|
|
56
58
|
SPARTAN_DIR: string;
|
|
57
59
|
K8S: "local";
|
|
58
60
|
ETHEREUM_HOSTS?: string | undefined;
|
|
61
|
+
AZTEC_REAL_PROOFS?: string | undefined;
|
|
59
62
|
CONTAINER_NODE_PORT?: number | undefined;
|
|
60
63
|
CONTAINER_NODE_ADMIN_PORT?: number | undefined;
|
|
61
64
|
CONTAINER_SEQUENCER_PORT?: number | undefined;
|
|
@@ -73,6 +76,7 @@ declare const k8sGCloudConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
73
76
|
AZTEC_SLOT_DURATION: z.ZodNumber;
|
|
74
77
|
AZTEC_EPOCH_DURATION: z.ZodNumber;
|
|
75
78
|
AZTEC_PROOF_SUBMISSION_WINDOW: z.ZodNumber;
|
|
79
|
+
AZTEC_REAL_PROOFS: z.ZodDefault<z.ZodString>;
|
|
76
80
|
INSTANCE_NAME: z.ZodString;
|
|
77
81
|
NAMESPACE: z.ZodString;
|
|
78
82
|
CONTAINER_NODE_PORT: z.ZodDefault<z.ZodNumber>;
|
|
@@ -93,11 +97,13 @@ declare const k8sGCloudConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
93
97
|
K8S: z.ZodLiteral<"gcloud">;
|
|
94
98
|
CLUSTER_NAME: z.ZodString;
|
|
95
99
|
REGION: z.ZodString;
|
|
100
|
+
PROJECT_ID: z.ZodString;
|
|
96
101
|
}>, "strip", z.ZodTypeAny, {
|
|
97
102
|
ETHEREUM_SLOT_DURATION: number;
|
|
98
103
|
AZTEC_SLOT_DURATION: number;
|
|
99
104
|
AZTEC_EPOCH_DURATION: number;
|
|
100
105
|
AZTEC_PROOF_SUBMISSION_WINDOW: number;
|
|
106
|
+
AZTEC_REAL_PROOFS: string;
|
|
101
107
|
INSTANCE_NAME: string;
|
|
102
108
|
NAMESPACE: string;
|
|
103
109
|
CONTAINER_NODE_PORT: number;
|
|
@@ -114,6 +120,7 @@ declare const k8sGCloudConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
114
120
|
K8S: "gcloud";
|
|
115
121
|
CLUSTER_NAME: string;
|
|
116
122
|
REGION: string;
|
|
123
|
+
PROJECT_ID: string;
|
|
117
124
|
ETHEREUM_HOSTS?: string | undefined;
|
|
118
125
|
GRAFANA_PASSWORD?: string | undefined;
|
|
119
126
|
}, {
|
|
@@ -127,7 +134,9 @@ declare const k8sGCloudConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
127
134
|
K8S: "gcloud";
|
|
128
135
|
CLUSTER_NAME: string;
|
|
129
136
|
REGION: string;
|
|
137
|
+
PROJECT_ID: string;
|
|
130
138
|
ETHEREUM_HOSTS?: string | undefined;
|
|
139
|
+
AZTEC_REAL_PROOFS?: string | undefined;
|
|
131
140
|
CONTAINER_NODE_PORT?: number | undefined;
|
|
132
141
|
CONTAINER_NODE_ADMIN_PORT?: number | undefined;
|
|
133
142
|
CONTAINER_SEQUENCER_PORT?: number | undefined;
|
|
@@ -164,6 +173,7 @@ declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
|
|
|
164
173
|
AZTEC_SLOT_DURATION: z.ZodNumber;
|
|
165
174
|
AZTEC_EPOCH_DURATION: z.ZodNumber;
|
|
166
175
|
AZTEC_PROOF_SUBMISSION_WINDOW: z.ZodNumber;
|
|
176
|
+
AZTEC_REAL_PROOFS: z.ZodDefault<z.ZodString>;
|
|
167
177
|
INSTANCE_NAME: z.ZodString;
|
|
168
178
|
NAMESPACE: z.ZodString;
|
|
169
179
|
CONTAINER_NODE_PORT: z.ZodDefault<z.ZodNumber>;
|
|
@@ -185,6 +195,7 @@ declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
|
|
|
185
195
|
AZTEC_SLOT_DURATION: number;
|
|
186
196
|
AZTEC_EPOCH_DURATION: number;
|
|
187
197
|
AZTEC_PROOF_SUBMISSION_WINDOW: number;
|
|
198
|
+
AZTEC_REAL_PROOFS: string;
|
|
188
199
|
INSTANCE_NAME: string;
|
|
189
200
|
NAMESPACE: string;
|
|
190
201
|
CONTAINER_NODE_PORT: number;
|
|
@@ -211,6 +222,7 @@ declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
|
|
|
211
222
|
SPARTAN_DIR: string;
|
|
212
223
|
K8S: "local";
|
|
213
224
|
ETHEREUM_HOSTS?: string | undefined;
|
|
225
|
+
AZTEC_REAL_PROOFS?: string | undefined;
|
|
214
226
|
CONTAINER_NODE_PORT?: number | undefined;
|
|
215
227
|
CONTAINER_NODE_ADMIN_PORT?: number | undefined;
|
|
216
228
|
CONTAINER_SEQUENCER_PORT?: number | undefined;
|
|
@@ -227,6 +239,7 @@ declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
|
|
|
227
239
|
AZTEC_SLOT_DURATION: z.ZodNumber;
|
|
228
240
|
AZTEC_EPOCH_DURATION: z.ZodNumber;
|
|
229
241
|
AZTEC_PROOF_SUBMISSION_WINDOW: z.ZodNumber;
|
|
242
|
+
AZTEC_REAL_PROOFS: z.ZodDefault<z.ZodString>;
|
|
230
243
|
INSTANCE_NAME: z.ZodString;
|
|
231
244
|
NAMESPACE: z.ZodString;
|
|
232
245
|
CONTAINER_NODE_PORT: z.ZodDefault<z.ZodNumber>;
|
|
@@ -247,11 +260,13 @@ declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
|
|
|
247
260
|
K8S: z.ZodLiteral<"gcloud">;
|
|
248
261
|
CLUSTER_NAME: z.ZodString;
|
|
249
262
|
REGION: z.ZodString;
|
|
263
|
+
PROJECT_ID: z.ZodString;
|
|
250
264
|
}>, "strip", z.ZodTypeAny, {
|
|
251
265
|
ETHEREUM_SLOT_DURATION: number;
|
|
252
266
|
AZTEC_SLOT_DURATION: number;
|
|
253
267
|
AZTEC_EPOCH_DURATION: number;
|
|
254
268
|
AZTEC_PROOF_SUBMISSION_WINDOW: number;
|
|
269
|
+
AZTEC_REAL_PROOFS: string;
|
|
255
270
|
INSTANCE_NAME: string;
|
|
256
271
|
NAMESPACE: string;
|
|
257
272
|
CONTAINER_NODE_PORT: number;
|
|
@@ -268,6 +283,7 @@ declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
|
|
|
268
283
|
K8S: "gcloud";
|
|
269
284
|
CLUSTER_NAME: string;
|
|
270
285
|
REGION: string;
|
|
286
|
+
PROJECT_ID: string;
|
|
271
287
|
ETHEREUM_HOSTS?: string | undefined;
|
|
272
288
|
GRAFANA_PASSWORD?: string | undefined;
|
|
273
289
|
}, {
|
|
@@ -281,7 +297,9 @@ declare const envSchema: z.ZodDiscriminatedUnion<"K8S", [z.ZodObject<{
|
|
|
281
297
|
K8S: "gcloud";
|
|
282
298
|
CLUSTER_NAME: string;
|
|
283
299
|
REGION: string;
|
|
300
|
+
PROJECT_ID: string;
|
|
284
301
|
ETHEREUM_HOSTS?: string | undefined;
|
|
302
|
+
AZTEC_REAL_PROOFS?: string | undefined;
|
|
285
303
|
CONTAINER_NODE_PORT?: number | undefined;
|
|
286
304
|
CONTAINER_NODE_ADMIN_PORT?: number | undefined;
|
|
287
305
|
CONTAINER_SEQUENCER_PORT?: number | undefined;
|
|
@@ -344,10 +362,11 @@ export declare function deleteResourceByName({ resource, namespace, name, force,
|
|
|
344
362
|
name: string;
|
|
345
363
|
force?: boolean;
|
|
346
364
|
}): Promise<string>;
|
|
347
|
-
export declare function deleteResourceByLabel({ resource, namespace, label, }: {
|
|
365
|
+
export declare function deleteResourceByLabel({ resource, namespace, label, timeout, }: {
|
|
348
366
|
resource: string;
|
|
349
367
|
namespace: string;
|
|
350
368
|
label: string;
|
|
369
|
+
timeout?: string;
|
|
351
370
|
}): Promise<string>;
|
|
352
371
|
export declare function waitForResourceByLabel({ resource, label, namespace, condition, timeout, }: {
|
|
353
372
|
resource: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/spartan/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG/D,OAAO,EAAE,YAAY,EAAyB,MAAM,eAAe,CAAC;AAGpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAmBxF,QAAA,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/spartan/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG/D,OAAO,EAAE,YAAY,EAAyB,MAAM,eAAe,CAAC;AAGpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OA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,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,iBAU5F;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,iBAcpD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAW1C"}
|
package/dest/spartan/utils.js
CHANGED
|
@@ -21,6 +21,7 @@ const k8sLocalConfigSchema = z.object({
|
|
|
21
21
|
AZTEC_SLOT_DURATION: z.coerce.number().min(1, 'AZTEC_SLOT_DURATION env variable must be set'),
|
|
22
22
|
AZTEC_EPOCH_DURATION: z.coerce.number().min(1, 'AZTEC_EPOCH_DURATION env variable must be set'),
|
|
23
23
|
AZTEC_PROOF_SUBMISSION_WINDOW: z.coerce.number().min(1, 'AZTEC_PROOF_SUBMISSION_WINDOW env variable must be set'),
|
|
24
|
+
AZTEC_REAL_PROOFS: z.string().default('false'),
|
|
24
25
|
INSTANCE_NAME: z.string().min(1, 'INSTANCE_NAME env variable must be set'),
|
|
25
26
|
NAMESPACE: z.string().min(1, 'NAMESPACE env variable must be set'),
|
|
26
27
|
CONTAINER_NODE_PORT: z.coerce.number().default(8080),
|
|
@@ -41,7 +42,8 @@ const k8sLocalConfigSchema = z.object({
|
|
|
41
42
|
const k8sGCloudConfigSchema = k8sLocalConfigSchema.extend({
|
|
42
43
|
K8S: z.literal('gcloud'),
|
|
43
44
|
CLUSTER_NAME: z.string().min(1, 'CLUSTER_NAME env variable must be set'),
|
|
44
|
-
REGION: z.string().min(1, 'REGION env variable must be set')
|
|
45
|
+
REGION: z.string().min(1, 'REGION env variable must be set'),
|
|
46
|
+
PROJECT_ID: z.string().min(1, 'PROJECT_ID env variable must be set')
|
|
45
47
|
});
|
|
46
48
|
const directConfigSchema = z.object({
|
|
47
49
|
PXE_URL: z.string().url('PXE_URL must be a valid URL'),
|
|
@@ -64,7 +66,7 @@ export function isGCloudConfig(config) {
|
|
|
64
66
|
export function setupEnvironment(env) {
|
|
65
67
|
const config = envSchema.parse(env);
|
|
66
68
|
if (isGCloudConfig(config)) {
|
|
67
|
-
const command = `gcloud container clusters get-credentials ${config.CLUSTER_NAME} --region=${config.REGION}`;
|
|
69
|
+
const command = `gcloud container clusters get-credentials ${config.CLUSTER_NAME} --region=${config.REGION} --project=${config.PROJECT_ID}`;
|
|
68
70
|
execSync(command);
|
|
69
71
|
}
|
|
70
72
|
return config;
|
|
@@ -188,8 +190,8 @@ export async function deleteResourceByName({ resource, namespace, name, force =
|
|
|
188
190
|
const { stdout } = await execAsync(command);
|
|
189
191
|
return stdout;
|
|
190
192
|
}
|
|
191
|
-
export async function deleteResourceByLabel({ resource, namespace, label }) {
|
|
192
|
-
const command = `kubectl delete ${resource} -l ${label} -n ${namespace} --ignore-not-found=true --wait=true`;
|
|
193
|
+
export async function deleteResourceByLabel({ resource, namespace, label, timeout = '5m' }) {
|
|
194
|
+
const command = `kubectl delete ${resource} -l ${label} -n ${namespace} --ignore-not-found=true --wait=true --timeout=${timeout}`;
|
|
193
195
|
logger.info(`command: ${command}`);
|
|
194
196
|
const { stdout } = await execAsync(command);
|
|
195
197
|
return stdout;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "1.0.0-nightly.
|
|
3
|
+
"version": "1.0.0-nightly.20250627",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,40 +25,40 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "1.0.0-nightly.
|
|
29
|
-
"@aztec/archiver": "1.0.0-nightly.
|
|
30
|
-
"@aztec/aztec": "1.0.0-nightly.
|
|
31
|
-
"@aztec/aztec-node": "1.0.0-nightly.
|
|
32
|
-
"@aztec/aztec.js": "1.0.0-nightly.
|
|
33
|
-
"@aztec/bb-prover": "1.0.0-nightly.
|
|
34
|
-
"@aztec/blob-lib": "1.0.0-nightly.
|
|
35
|
-
"@aztec/blob-sink": "1.0.0-nightly.
|
|
36
|
-
"@aztec/bot": "1.0.0-nightly.
|
|
37
|
-
"@aztec/cli": "1.0.0-nightly.
|
|
38
|
-
"@aztec/constants": "1.0.0-nightly.
|
|
39
|
-
"@aztec/entrypoints": "1.0.0-nightly.
|
|
40
|
-
"@aztec/epoch-cache": "1.0.0-nightly.
|
|
41
|
-
"@aztec/ethereum": "1.0.0-nightly.
|
|
42
|
-
"@aztec/foundation": "1.0.0-nightly.
|
|
43
|
-
"@aztec/kv-store": "1.0.0-nightly.
|
|
44
|
-
"@aztec/l1-artifacts": "1.0.0-nightly.
|
|
45
|
-
"@aztec/merkle-tree": "1.0.0-nightly.
|
|
46
|
-
"@aztec/noir-contracts.js": "1.0.0-nightly.
|
|
47
|
-
"@aztec/noir-noirc_abi": "1.0.0-nightly.
|
|
48
|
-
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.
|
|
49
|
-
"@aztec/noir-test-contracts.js": "1.0.0-nightly.
|
|
50
|
-
"@aztec/p2p": "1.0.0-nightly.
|
|
51
|
-
"@aztec/protocol-contracts": "1.0.0-nightly.
|
|
52
|
-
"@aztec/prover-client": "1.0.0-nightly.
|
|
53
|
-
"@aztec/prover-node": "1.0.0-nightly.
|
|
54
|
-
"@aztec/pxe": "1.0.0-nightly.
|
|
55
|
-
"@aztec/sequencer-client": "1.0.0-nightly.
|
|
56
|
-
"@aztec/simulator": "1.0.0-nightly.
|
|
57
|
-
"@aztec/slasher": "1.0.0-nightly.
|
|
58
|
-
"@aztec/stdlib": "1.0.0-nightly.
|
|
59
|
-
"@aztec/telemetry-client": "1.0.0-nightly.
|
|
60
|
-
"@aztec/validator-client": "1.0.0-nightly.
|
|
61
|
-
"@aztec/world-state": "1.0.0-nightly.
|
|
28
|
+
"@aztec/accounts": "1.0.0-nightly.20250627",
|
|
29
|
+
"@aztec/archiver": "1.0.0-nightly.20250627",
|
|
30
|
+
"@aztec/aztec": "1.0.0-nightly.20250627",
|
|
31
|
+
"@aztec/aztec-node": "1.0.0-nightly.20250627",
|
|
32
|
+
"@aztec/aztec.js": "1.0.0-nightly.20250627",
|
|
33
|
+
"@aztec/bb-prover": "1.0.0-nightly.20250627",
|
|
34
|
+
"@aztec/blob-lib": "1.0.0-nightly.20250627",
|
|
35
|
+
"@aztec/blob-sink": "1.0.0-nightly.20250627",
|
|
36
|
+
"@aztec/bot": "1.0.0-nightly.20250627",
|
|
37
|
+
"@aztec/cli": "1.0.0-nightly.20250627",
|
|
38
|
+
"@aztec/constants": "1.0.0-nightly.20250627",
|
|
39
|
+
"@aztec/entrypoints": "1.0.0-nightly.20250627",
|
|
40
|
+
"@aztec/epoch-cache": "1.0.0-nightly.20250627",
|
|
41
|
+
"@aztec/ethereum": "1.0.0-nightly.20250627",
|
|
42
|
+
"@aztec/foundation": "1.0.0-nightly.20250627",
|
|
43
|
+
"@aztec/kv-store": "1.0.0-nightly.20250627",
|
|
44
|
+
"@aztec/l1-artifacts": "1.0.0-nightly.20250627",
|
|
45
|
+
"@aztec/merkle-tree": "1.0.0-nightly.20250627",
|
|
46
|
+
"@aztec/noir-contracts.js": "1.0.0-nightly.20250627",
|
|
47
|
+
"@aztec/noir-noirc_abi": "1.0.0-nightly.20250627",
|
|
48
|
+
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250627",
|
|
49
|
+
"@aztec/noir-test-contracts.js": "1.0.0-nightly.20250627",
|
|
50
|
+
"@aztec/p2p": "1.0.0-nightly.20250627",
|
|
51
|
+
"@aztec/protocol-contracts": "1.0.0-nightly.20250627",
|
|
52
|
+
"@aztec/prover-client": "1.0.0-nightly.20250627",
|
|
53
|
+
"@aztec/prover-node": "1.0.0-nightly.20250627",
|
|
54
|
+
"@aztec/pxe": "1.0.0-nightly.20250627",
|
|
55
|
+
"@aztec/sequencer-client": "1.0.0-nightly.20250627",
|
|
56
|
+
"@aztec/simulator": "1.0.0-nightly.20250627",
|
|
57
|
+
"@aztec/slasher": "1.0.0-nightly.20250627",
|
|
58
|
+
"@aztec/stdlib": "1.0.0-nightly.20250627",
|
|
59
|
+
"@aztec/telemetry-client": "1.0.0-nightly.20250627",
|
|
60
|
+
"@aztec/validator-client": "1.0.0-nightly.20250627",
|
|
61
|
+
"@aztec/world-state": "1.0.0-nightly.20250627",
|
|
62
62
|
"@iarna/toml": "^2.2.5",
|
|
63
63
|
"@jest/globals": "^30.0.0",
|
|
64
64
|
"@noble/curves": "^1.0.0",
|
package/src/fixtures/utils.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import { type Archiver, createArchiver } from '@aztec/archiver';
|
|
10
10
|
import { type AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
|
|
11
11
|
import {
|
|
12
|
+
AccountManager,
|
|
12
13
|
type AccountWalletWithSecretKey,
|
|
13
14
|
type AztecAddress,
|
|
14
15
|
type AztecNode,
|
|
@@ -21,6 +22,7 @@ import {
|
|
|
21
22
|
createLogger,
|
|
22
23
|
createPXEClient,
|
|
23
24
|
makeFetch,
|
|
25
|
+
sleep,
|
|
24
26
|
waitForPXE,
|
|
25
27
|
} from '@aztec/aztec.js';
|
|
26
28
|
import { deployInstance, registerContractClass } from '@aztec/aztec.js/deployment';
|
|
@@ -66,7 +68,11 @@ import type { SequencerClient } from '@aztec/sequencer-client';
|
|
|
66
68
|
import type { TestSequencerClient } from '@aztec/sequencer-client/test';
|
|
67
69
|
import { MemoryCircuitRecorder, SimulatorRecorderWrapper, WASMSimulator } from '@aztec/simulator/client';
|
|
68
70
|
import { FileCircuitRecorder } from '@aztec/simulator/testing';
|
|
69
|
-
import {
|
|
71
|
+
import {
|
|
72
|
+
type ContractInstanceWithAddress,
|
|
73
|
+
getContractClassFromArtifact,
|
|
74
|
+
getContractInstanceFromDeployParams,
|
|
75
|
+
} from '@aztec/stdlib/contract';
|
|
70
76
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
71
77
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
72
78
|
import type { P2PClientType } from '@aztec/stdlib/p2p';
|
|
@@ -569,10 +575,10 @@ export async function setup(
|
|
|
569
575
|
{ dateProvider, blobSinkClient, telemetry, p2pClientDeps, logger: createLogger('node:MAIN-aztec-node') },
|
|
570
576
|
{ prefilledPublicData },
|
|
571
577
|
);
|
|
572
|
-
const
|
|
578
|
+
const sequencerClient = aztecNode.getSequencer();
|
|
573
579
|
|
|
574
|
-
if (
|
|
575
|
-
const publisher = (
|
|
580
|
+
if (sequencerClient) {
|
|
581
|
+
const publisher = (sequencerClient as TestSequencerClient).sequencer.publisher;
|
|
576
582
|
publisher.l1TxUtils = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, config.ethereumSlotDuration);
|
|
577
583
|
}
|
|
578
584
|
|
|
@@ -608,7 +614,34 @@ export async function setup(
|
|
|
608
614
|
await cheatCodes.rollup.debugRollup();
|
|
609
615
|
}
|
|
610
616
|
|
|
611
|
-
const
|
|
617
|
+
const sequencer = sequencerClient!.getSequencer();
|
|
618
|
+
const minTxsPerBlock = config.minTxsPerBlock;
|
|
619
|
+
|
|
620
|
+
if (minTxsPerBlock === undefined) {
|
|
621
|
+
throw new Error('minTxsPerBlock is undefined in e2e test setup');
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// Transactions built against the genesis state must be included in block 1, otherwise they are dropped.
|
|
625
|
+
// To avoid test failures from dropped transactions, we ensure progression beyond genesis before proceeding.
|
|
626
|
+
// For account deployments, we set minTxsPerBlock=1 and deploy accounts sequentially for guaranteed success.
|
|
627
|
+
// If no accounts need deployment, we await an empty block to confirm network progression. After either path
|
|
628
|
+
// completes, we restore the original minTxsPerBlock setting.
|
|
629
|
+
// For more details on why the tx would be dropped see `validate_include_by_timestamp` function in
|
|
630
|
+
// `noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/components/validation_requests.nr`.
|
|
631
|
+
let accountManagers: AccountManager[] = [];
|
|
632
|
+
if (numberOfAccounts === 0) {
|
|
633
|
+
// We wait until block 1 is mined to ensure that the network has progressed past genesis.
|
|
634
|
+
sequencer.updateConfig({ minTxsPerBlock: 0 });
|
|
635
|
+
while ((await pxe.getBlockNumber()) === 0) {
|
|
636
|
+
await sleep(2000);
|
|
637
|
+
}
|
|
638
|
+
} else {
|
|
639
|
+
sequencer.updateConfig({ minTxsPerBlock: 1 });
|
|
640
|
+
accountManagers = await deployFundedSchnorrAccounts(pxe, initialFundedAccounts.slice(0, numberOfAccounts));
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
sequencer.updateConfig({ minTxsPerBlock });
|
|
644
|
+
|
|
612
645
|
const wallets = await Promise.all(accountManagers.map(account => account.getWallet()));
|
|
613
646
|
if (initialFundedAccounts.length < numberOfAccounts) {
|
|
614
647
|
// TODO: Create (numberOfAccounts - initialFundedAccounts.length) wallets without funds.
|
|
@@ -655,7 +688,7 @@ export async function setup(
|
|
|
655
688
|
prefilledPublicData,
|
|
656
689
|
proverNode,
|
|
657
690
|
pxe,
|
|
658
|
-
sequencer,
|
|
691
|
+
sequencer: sequencerClient,
|
|
659
692
|
teardown,
|
|
660
693
|
telemetryClient: telemetry,
|
|
661
694
|
wallet: wallets[0],
|
|
@@ -781,15 +814,26 @@ export async function expectMappingDelta<K, V extends number | bigint>(
|
|
|
781
814
|
expect(diffs).toEqual(expectedDiffs);
|
|
782
815
|
}
|
|
783
816
|
|
|
817
|
+
/**
|
|
818
|
+
* Computes the address of the "canonical" SponosoredFPCContract. This is not a protocol contract
|
|
819
|
+
* but by conventions its address is computed with a salt of 0.
|
|
820
|
+
* @returns The address of the sponsored FPC contract
|
|
821
|
+
*/
|
|
822
|
+
export function getSponsoredFPCInstance(): Promise<ContractInstanceWithAddress> {
|
|
823
|
+
return Promise.resolve(
|
|
824
|
+
getContractInstanceFromDeployParams(SponsoredFPCContract.artifact, {
|
|
825
|
+
salt: new Fr(SPONSORED_FPC_SALT),
|
|
826
|
+
}),
|
|
827
|
+
);
|
|
828
|
+
}
|
|
829
|
+
|
|
784
830
|
/**
|
|
785
831
|
* Computes the address of the "canonical" SponosoredFPCContract. This is not a protocol contract
|
|
786
832
|
* but by conventions its address is computed with a salt of 0.
|
|
787
833
|
* @returns The address of the sponsored FPC contract
|
|
788
834
|
*/
|
|
789
835
|
export async function getSponsoredFPCAddress() {
|
|
790
|
-
const sponsoredFPCInstance = await
|
|
791
|
-
salt: new Fr(SPONSORED_FPC_SALT),
|
|
792
|
-
});
|
|
836
|
+
const sponsoredFPCInstance = await getSponsoredFPCInstance();
|
|
793
837
|
return sponsoredFPCInstance.address;
|
|
794
838
|
}
|
|
795
839
|
|
|
@@ -806,6 +850,14 @@ export async function setupSponsoredFPC(pxe: PXE) {
|
|
|
806
850
|
return instance;
|
|
807
851
|
}
|
|
808
852
|
|
|
853
|
+
/**
|
|
854
|
+
* Registers the SponsoredFPC in this PXE instance
|
|
855
|
+
* @param pxe - The pxe client
|
|
856
|
+
*/
|
|
857
|
+
export async function registerSponsoredFPC(pxe: PXE): Promise<void> {
|
|
858
|
+
await pxe.registerContract({ instance: await getSponsoredFPCInstance(), artifact: SponsoredFPCContract.artifact });
|
|
859
|
+
}
|
|
860
|
+
|
|
809
861
|
export async function waitForProvenChain(node: AztecNode, targetBlock?: number, timeoutSec = 60, intervalSec = 1) {
|
|
810
862
|
targetBlock ??= await node.getBlockNumber();
|
|
811
863
|
|
|
@@ -5,9 +5,11 @@ import {
|
|
|
5
5
|
type AztecAddress,
|
|
6
6
|
type AztecNode,
|
|
7
7
|
FeeJuicePaymentMethodWithClaim,
|
|
8
|
+
type FeePaymentMethod,
|
|
8
9
|
Fr,
|
|
9
10
|
L1FeeJuicePortalManager,
|
|
10
11
|
type PXE,
|
|
12
|
+
SponsoredFeePaymentMethod,
|
|
11
13
|
createAztecNodeClient,
|
|
12
14
|
createCompatibleClient,
|
|
13
15
|
retryUntil,
|
|
@@ -15,8 +17,13 @@ import {
|
|
|
15
17
|
import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
|
|
16
18
|
import type { Logger } from '@aztec/foundation/log';
|
|
17
19
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
20
|
+
import { createPXEService } from '@aztec/pxe/server';
|
|
18
21
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
19
22
|
|
|
23
|
+
import { getACVMConfig } from '../fixtures/get_acvm_config.js';
|
|
24
|
+
import { getBBConfig } from '../fixtures/get_bb_config.js';
|
|
25
|
+
import { getSponsoredFPCAddress, registerSponsoredFPC } from '../fixtures/utils.js';
|
|
26
|
+
|
|
20
27
|
export interface TestWallets {
|
|
21
28
|
pxe: PXE;
|
|
22
29
|
wallets: AccountWalletWithSecretKey[];
|
|
@@ -42,7 +49,47 @@ export async function setupTestWalletsWithTokens(
|
|
|
42
49
|
const [recipientWallet, ...wallets] = (await getDeployedTestAccountsWallets(pxe)).slice(0, WALLET_COUNT + 1);
|
|
43
50
|
|
|
44
51
|
const tokenAdmin = wallets[0];
|
|
45
|
-
const tokenAddress = await deployTokenAndMint(wallets, tokenAdmin.getAddress(), mintAmount, logger);
|
|
52
|
+
const tokenAddress = await deployTokenAndMint(wallets, tokenAdmin.getAddress(), mintAmount, undefined, logger);
|
|
53
|
+
const tokenAdminWallet = await TokenContract.at(tokenAddress, tokenAdmin);
|
|
54
|
+
|
|
55
|
+
return { pxe, wallets, tokenAdminWallet, tokenName: TOKEN_NAME, tokenAddress, recipientWallet };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export async function deploySponsoredTestWallets(
|
|
59
|
+
pxe: PXE,
|
|
60
|
+
mintAmount: bigint,
|
|
61
|
+
logger: Logger,
|
|
62
|
+
numberOfFundedWallets = 1,
|
|
63
|
+
): Promise<TestWallets> {
|
|
64
|
+
const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
|
|
65
|
+
const recipientWallet = await getSchnorrWalletWithSecretKey(
|
|
66
|
+
pxe,
|
|
67
|
+
recipient.secret,
|
|
68
|
+
recipient.signingKey,
|
|
69
|
+
recipient.salt,
|
|
70
|
+
);
|
|
71
|
+
const fundedAccounts = await Promise.all(funded.map(a => getSchnorrAccount(pxe, a.secret, a.signingKey, a.salt)));
|
|
72
|
+
|
|
73
|
+
await registerSponsoredFPC(pxe);
|
|
74
|
+
|
|
75
|
+
const wallets = await Promise.all(
|
|
76
|
+
fundedAccounts.map(async a => {
|
|
77
|
+
const wallet = await a.getWallet();
|
|
78
|
+
const paymentMethod = new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
|
|
79
|
+
await a.deploy({ fee: { paymentMethod } }).wait({ timeout: 2400 }); // increase timeout on purpose in order to account for two empty epochs
|
|
80
|
+
logger.info(`Account deployed at ${a.getAddress()}`);
|
|
81
|
+
return wallet;
|
|
82
|
+
}),
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
const tokenAdmin = wallets[0];
|
|
86
|
+
const tokenAddress = await deployTokenAndMint(
|
|
87
|
+
wallets,
|
|
88
|
+
tokenAdmin.getAddress(),
|
|
89
|
+
mintAmount,
|
|
90
|
+
new SponsoredFeePaymentMethod(await getSponsoredFPCAddress()),
|
|
91
|
+
logger,
|
|
92
|
+
);
|
|
46
93
|
const tokenAdminWallet = await TokenContract.at(tokenAddress, tokenAdmin);
|
|
47
94
|
|
|
48
95
|
return { pxe, wallets, tokenAdminWallet, tokenName: TOKEN_NAME, tokenAddress, recipientWallet };
|
|
@@ -89,7 +136,7 @@ export async function deployTestWalletWithTokens(
|
|
|
89
136
|
);
|
|
90
137
|
|
|
91
138
|
const tokenAdmin = wallets[0];
|
|
92
|
-
const tokenAddress = await deployTokenAndMint(wallets, tokenAdmin.getAddress(), mintAmount, logger);
|
|
139
|
+
const tokenAddress = await deployTokenAndMint(wallets, tokenAdmin.getAddress(), mintAmount, undefined, logger);
|
|
93
140
|
const tokenAdminWallet = await TokenContract.at(tokenAddress, tokenAdmin);
|
|
94
141
|
|
|
95
142
|
return { pxe, wallets, tokenAdminWallet, tokenName: TOKEN_NAME, tokenAddress, recipientWallet };
|
|
@@ -129,11 +176,16 @@ async function deployTokenAndMint(
|
|
|
129
176
|
wallets: AccountWalletWithSecretKey[],
|
|
130
177
|
admin: AztecAddress,
|
|
131
178
|
mintAmount: bigint,
|
|
179
|
+
paymentMethod: FeePaymentMethod | undefined,
|
|
132
180
|
logger: Logger,
|
|
133
181
|
) {
|
|
134
182
|
logger.verbose(`Deploying TokenContract...`);
|
|
135
183
|
const tokenContract = await TokenContract.deploy(wallets[0], admin, TOKEN_NAME, TOKEN_SYMBOL, TOKEN_DECIMALS)
|
|
136
|
-
.send(
|
|
184
|
+
.send({
|
|
185
|
+
fee: {
|
|
186
|
+
paymentMethod,
|
|
187
|
+
},
|
|
188
|
+
})
|
|
137
189
|
.deployed({ timeout: 600 });
|
|
138
190
|
|
|
139
191
|
const tokenAddress = tokenContract.address;
|
|
@@ -144,7 +196,7 @@ async function deployTokenAndMint(
|
|
|
144
196
|
wallets.map(async w =>
|
|
145
197
|
(await TokenContract.at(tokenAddress, w)).methods
|
|
146
198
|
.mint_to_public(w.getAddress(), mintAmount)
|
|
147
|
-
.send()
|
|
199
|
+
.send({ fee: { paymentMethod } })
|
|
148
200
|
.wait({ timeout: 600 }),
|
|
149
201
|
),
|
|
150
202
|
);
|
|
@@ -186,3 +238,28 @@ export async function performTransfers({
|
|
|
186
238
|
logger.info(`Completed round ${i + 1} / ${rounds}`);
|
|
187
239
|
}
|
|
188
240
|
}
|
|
241
|
+
|
|
242
|
+
export async function startCompatiblePXE(
|
|
243
|
+
nodeUrl: string,
|
|
244
|
+
proverEnabled: boolean,
|
|
245
|
+
logger: Logger,
|
|
246
|
+
): Promise<{ pxe: PXE; cleanup: () => Promise<void> }> {
|
|
247
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
248
|
+
const [bbConfig, acvmConfig] = await Promise.all([getBBConfig(logger), getACVMConfig(logger)]);
|
|
249
|
+
const pxe = await createPXEService(node, {
|
|
250
|
+
dataDirectory: undefined,
|
|
251
|
+
dataStoreMapSizeKB: 1024 * 1024,
|
|
252
|
+
...bbConfig,
|
|
253
|
+
...acvmConfig,
|
|
254
|
+
proverEnabled,
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
return {
|
|
258
|
+
pxe,
|
|
259
|
+
async cleanup() {
|
|
260
|
+
await pxe.stop();
|
|
261
|
+
await bbConfig?.cleanup();
|
|
262
|
+
await acvmConfig?.cleanup();
|
|
263
|
+
},
|
|
264
|
+
};
|
|
265
|
+
}
|
package/src/spartan/utils.ts
CHANGED
|
@@ -34,6 +34,7 @@ const k8sLocalConfigSchema = z.object({
|
|
|
34
34
|
AZTEC_SLOT_DURATION: z.coerce.number().min(1, 'AZTEC_SLOT_DURATION env variable must be set'),
|
|
35
35
|
AZTEC_EPOCH_DURATION: z.coerce.number().min(1, 'AZTEC_EPOCH_DURATION env variable must be set'),
|
|
36
36
|
AZTEC_PROOF_SUBMISSION_WINDOW: z.coerce.number().min(1, 'AZTEC_PROOF_SUBMISSION_WINDOW env variable must be set'),
|
|
37
|
+
AZTEC_REAL_PROOFS: z.string().default('false'),
|
|
37
38
|
INSTANCE_NAME: z.string().min(1, 'INSTANCE_NAME env variable must be set'),
|
|
38
39
|
NAMESPACE: z.string().min(1, 'NAMESPACE env variable must be set'),
|
|
39
40
|
CONTAINER_NODE_PORT: z.coerce.number().default(8080),
|
|
@@ -56,6 +57,7 @@ const k8sGCloudConfigSchema = k8sLocalConfigSchema.extend({
|
|
|
56
57
|
K8S: z.literal('gcloud'),
|
|
57
58
|
CLUSTER_NAME: z.string().min(1, 'CLUSTER_NAME env variable must be set'),
|
|
58
59
|
REGION: z.string().min(1, 'REGION env variable must be set'),
|
|
60
|
+
PROJECT_ID: z.string().min(1, 'PROJECT_ID env variable must be set'),
|
|
59
61
|
});
|
|
60
62
|
|
|
61
63
|
const directConfigSchema = z.object({
|
|
@@ -84,7 +86,7 @@ export function isGCloudConfig(config: EnvConfig): config is K8sGCloudConfig {
|
|
|
84
86
|
export function setupEnvironment(env: unknown): EnvConfig {
|
|
85
87
|
const config = envSchema.parse(env);
|
|
86
88
|
if (isGCloudConfig(config)) {
|
|
87
|
-
const command = `gcloud container clusters get-credentials ${config.CLUSTER_NAME} --region=${config.REGION}`;
|
|
89
|
+
const command = `gcloud container clusters get-credentials ${config.CLUSTER_NAME} --region=${config.REGION} --project=${config.PROJECT_ID}`;
|
|
88
90
|
execSync(command);
|
|
89
91
|
}
|
|
90
92
|
return config;
|
|
@@ -233,12 +235,14 @@ export async function deleteResourceByLabel({
|
|
|
233
235
|
resource,
|
|
234
236
|
namespace,
|
|
235
237
|
label,
|
|
238
|
+
timeout = '5m',
|
|
236
239
|
}: {
|
|
237
240
|
resource: string;
|
|
238
241
|
namespace: string;
|
|
239
242
|
label: string;
|
|
243
|
+
timeout?: string;
|
|
240
244
|
}) {
|
|
241
|
-
const command = `kubectl delete ${resource} -l ${label} -n ${namespace} --ignore-not-found=true --wait=true`;
|
|
245
|
+
const command = `kubectl delete ${resource} -l ${label} -n ${namespace} --ignore-not-found=true --wait=true --timeout=${timeout}`;
|
|
242
246
|
logger.info(`command: ${command}`);
|
|
243
247
|
const { stdout } = await execAsync(command);
|
|
244
248
|
return stdout;
|