@aztec/end-to-end 0.82.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_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 +21 -4
- package/dest/e2e_prover/e2e_prover_test.d.ts.map +1 -1
- package/dest/e2e_prover/e2e_prover_test.js +3 -2
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +7 -2
- package/dest/fixtures/utils.d.ts +12 -1
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +37 -3
- package/package.json +32 -32
- package/src/e2e_fees/fees_test.ts +32 -8
- package/src/e2e_prover/e2e_prover_test.ts +5 -2
- package/src/fixtures/snapshot_manager.ts +13 -2
- package/src/fixtures/utils.ts +44 -3
- package/src/guides/up_quick_start.sh +1 -1
|
@@ -7,6 +7,7 @@ import { AppSubscriptionContract } from '@aztec/noir-contracts.js/AppSubscriptio
|
|
|
7
7
|
import { CounterContract } from '@aztec/noir-contracts.js/Counter';
|
|
8
8
|
import { FPCContract } from '@aztec/noir-contracts.js/FPC';
|
|
9
9
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
10
|
+
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
10
11
|
import { TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token';
|
|
11
12
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
12
13
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
@@ -18,6 +19,7 @@ import { type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.j
|
|
|
18
19
|
* PublicDeployAccounts: Deploys the accounts publicly.
|
|
19
20
|
* DeployFeeJuice: Deploys the Fee Juice contract.
|
|
20
21
|
* FPCSetup: Deploys BananaCoin and FPC contracts, and bridges gas from L1.
|
|
22
|
+
* SponsoredFPCSetup: Deploys Sponsored FPC contract, and bridges gas from L1.
|
|
21
23
|
* FundAlice: Mints private and public bananas to Alice.
|
|
22
24
|
* SetupSubscription: Deploys a counter contract and a subscription contract, and mints Fee Juice to the subscription contract.
|
|
23
25
|
*/
|
|
@@ -40,6 +42,7 @@ export declare class FeesTest {
|
|
|
40
42
|
feeJuiceContract: FeeJuiceContract;
|
|
41
43
|
bananaCoin: BananaCoin;
|
|
42
44
|
bananaFPC: FPCContract;
|
|
45
|
+
sponsoredFPC: SponsoredFPCContract;
|
|
43
46
|
counterContract: CounterContract;
|
|
44
47
|
subscriptionContract: AppSubscriptionContract;
|
|
45
48
|
feeJuiceBridgeTestHarness: GasBridgingTestHarness;
|
|
@@ -68,6 +71,7 @@ export declare class FeesTest {
|
|
|
68
71
|
applySetupFeeJuiceSnapshot(): Promise<void>;
|
|
69
72
|
applyDeployBananaTokenSnapshot(): Promise<void>;
|
|
70
73
|
applyFPCSetupSnapshot(): Promise<void>;
|
|
74
|
+
applySponsoredFPCSetupSnapshot(): Promise<void>;
|
|
71
75
|
applyFundAliceWithBananas(): Promise<void>;
|
|
72
76
|
applyFundAliceWithPrivateBananas(): Promise<void>;
|
|
73
77
|
applySetupSubscription(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fees_test.d.ts","sourceRoot":"","sources":["../../src/e2e_fees/fees_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,GAAG,EAGT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,KAAK,qBAAqB,EAAoD,MAAM,iBAAiB,CAAC;AAC/G,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,M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C;IACvC,YAAY,EAAG,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAE/D,SAAgB,qBAAqB,SAAgB;IACrD,SAAgB,mBAAmB,SAAgB;IACnD,SAAgB,0BAA0B,SAAgB;gBAGxD,QAAQ,EAAE,MAAM,EACR,gBAAgB,SAAI,EAC5B,YAAY,GAAE,OAAO,CAAC,YAAY,GAAG,qBAAqB,CAAM;IAc5D,KAAK;IAUL,QAAQ;IAKd,oBAAoB,CAAC,CAAC,EAAE,OAAO;IAIzB,kBAAkB;IAOlB,qBAAqB,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM;IAMjE,sFAAsF;IAChF,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IASjD,kBAAkB;IAOzB,4BAA4B;IAmC5B,iCAAiC;IAMjC,0BAA0B;IA0B1B,8BAA8B;IAuBvB,qBAAqB;IA+DrB,8BAA8B;IAqB9B,yBAAyB;IAWzB,gCAAgC;IAUhC,sBAAsB;CAgCpC"}
|
|
@@ -10,6 +10,7 @@ import { AppSubscriptionContract } from '@aztec/noir-contracts.js/AppSubscriptio
|
|
|
10
10
|
import { CounterContract } from '@aztec/noir-contracts.js/Counter';
|
|
11
11
|
import { FPCContract } from '@aztec/noir-contracts.js/FPC';
|
|
12
12
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
13
|
+
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
13
14
|
import { TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token';
|
|
14
15
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
15
16
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
@@ -18,7 +19,7 @@ import { getContract } from 'viem';
|
|
|
18
19
|
import { MNEMONIC } from '../fixtures/fixtures.js';
|
|
19
20
|
import { createSnapshotManager, deployAccounts } from '../fixtures/snapshot_manager.js';
|
|
20
21
|
import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
21
|
-
import { ensureAccountsPubliclyDeployed, getBalancesFn, setupCanonicalFeeJuice } from '../fixtures/utils.js';
|
|
22
|
+
import { ensureAccountsPubliclyDeployed, getBalancesFn, setupCanonicalFeeJuice, setupSponsoredFPC } from '../fixtures/utils.js';
|
|
22
23
|
import { FeeJuicePortalTestingHarnessFactory } from '../shared/gas_portal_test_harness.js';
|
|
23
24
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
24
25
|
/**
|
|
@@ -27,6 +28,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
27
28
|
* PublicDeployAccounts: Deploys the accounts publicly.
|
|
28
29
|
* DeployFeeJuice: Deploys the Fee Juice contract.
|
|
29
30
|
* FPCSetup: Deploys BananaCoin and FPC contracts, and bridges gas from L1.
|
|
31
|
+
* SponsoredFPCSetup: Deploys Sponsored FPC contract, and bridges gas from L1.
|
|
30
32
|
* FundAlice: Mints private and public bananas to Alice.
|
|
31
33
|
* SetupSubscription: Deploys a counter contract and a subscription contract, and mints Fee Juice to the subscription contract.
|
|
32
34
|
*/ export class FeesTest {
|
|
@@ -48,6 +50,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
48
50
|
feeJuiceContract;
|
|
49
51
|
bananaCoin;
|
|
50
52
|
bananaFPC;
|
|
53
|
+
sponsoredFPC;
|
|
51
54
|
counterContract;
|
|
52
55
|
subscriptionContract;
|
|
53
56
|
feeJuiceBridgeTestHarness;
|
|
@@ -177,6 +180,9 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
177
180
|
};
|
|
178
181
|
}, async ({ bananaCoinAddress })=>{
|
|
179
182
|
this.bananaCoin = await BananaCoin.at(bananaCoinAddress, this.aliceWallet);
|
|
183
|
+
const logger = this.logger;
|
|
184
|
+
this.getBananaPublicBalanceFn = getBalancesFn('🍌.public', this.bananaCoin.methods.balance_of_public, logger);
|
|
185
|
+
this.getBananaPrivateBalanceFn = getBalancesFn('🍌.private', this.bananaCoin.methods.balance_of_private, logger);
|
|
180
186
|
});
|
|
181
187
|
}
|
|
182
188
|
async applyFPCSetupSnapshot() {
|
|
@@ -196,9 +202,6 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
196
202
|
}, async (data, context)=>{
|
|
197
203
|
const bananaFPC = await FPCContract.at(data.bananaFPCAddress, this.aliceWallet);
|
|
198
204
|
this.bananaFPC = bananaFPC;
|
|
199
|
-
const logger = this.logger;
|
|
200
|
-
this.getBananaPublicBalanceFn = getBalancesFn('🍌.public', this.bananaCoin.methods.balance_of_public, logger);
|
|
201
|
-
this.getBananaPrivateBalanceFn = getBalancesFn('🍌.private', this.bananaCoin.methods.balance_of_private, logger);
|
|
202
205
|
this.getCoinbaseBalance = async ()=>{
|
|
203
206
|
const { walletClient } = createL1Clients(context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
204
207
|
const gasL1 = getContract({
|
|
@@ -231,6 +234,20 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
231
234
|
};
|
|
232
235
|
});
|
|
233
236
|
}
|
|
237
|
+
async applySponsoredFPCSetupSnapshot() {
|
|
238
|
+
await this.snapshotManager.snapshot('sponsored_fpc_setup', async (context)=>{
|
|
239
|
+
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
240
|
+
expect((await context.pxe.getContractMetadata(feeJuiceContract.address)).isContractPubliclyDeployed).toBe(true);
|
|
241
|
+
this.sponsoredFPC = await setupSponsoredFPC(context.pxe);
|
|
242
|
+
this.logger.info(`SponsoredFPC deployed at ${this.sponsoredFPC.address}`);
|
|
243
|
+
return {
|
|
244
|
+
sponsoredFPCAddress: this.sponsoredFPC.address
|
|
245
|
+
};
|
|
246
|
+
}, async (data)=>{
|
|
247
|
+
const sponsoredFPC = await SponsoredFPCContract.at(data.sponsoredFPCAddress, this.aliceWallet);
|
|
248
|
+
this.sponsoredFPC = sponsoredFPC;
|
|
249
|
+
});
|
|
250
|
+
}
|
|
234
251
|
async applyFundAliceWithBananas() {
|
|
235
252
|
await this.snapshotManager.snapshot('fund_alice', async ()=>{
|
|
236
253
|
await this.mintPrivateBananas(this.ALICE_INITIAL_BANANAS, this.aliceAddress);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e_prover_test.d.ts","sourceRoot":"","sources":["../../src/e2e_prover/e2e_prover_test.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,UAAU,EACV,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAqB,KAAK,6BAA6B,EAAuB,MAAM,kBAAkB,CAAC;AAE9G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,KAAK,2BAA2B,EAAoB,MAAM,iBAAiB,CAAC;AAGrF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAQtE,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AASlE;;;;;GAKG;AAEH,qBAAa,cAAc;IA6BvB,OAAO,CAAC,sBAAsB;IAE9B,OAAO,CAAC,UAAU;IA9BpB,MAAM,CAAC,UAAU,SAAU;IAC3B,MAAM,CAAC,YAAY,SAAS;IAC5B,MAAM,CAAC,cAAc,SAAO;IAC5B,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAA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AAO,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;IAW3B;;;;OAIG;IACG,kBAAkB;IAqDlB,KAAK;YA8JG,WAAW;IAQzB,QAAQ,YACA,MAAM,SACL,CAAC,OAAO,EAAE,iBAAiB,KAAK,QAAQ,CAAC,CAAC,YACxC,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,QAAQ,IAAI,CAAC,KACtE,QAAQ,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAeR,iBAAiB;IA+CjB,cAAc;CA4BrB"}
|
|
@@ -14,7 +14,7 @@ import { privateKeyToAddress } from 'viem/accounts';
|
|
|
14
14
|
import { getACVMConfig } from '../fixtures/get_acvm_config.js';
|
|
15
15
|
import { getBBConfig } from '../fixtures/get_bb_config.js';
|
|
16
16
|
import { createSnapshotManager, deployAccounts, publicDeployAccounts } from '../fixtures/snapshot_manager.js';
|
|
17
|
-
import { getPrivateKeyFromIndex, setupPXEService } from '../fixtures/utils.js';
|
|
17
|
+
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEService } from '../fixtures/utils.js';
|
|
18
18
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
19
19
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
20
20
|
/**
|
|
@@ -199,7 +199,8 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
199
199
|
txGatheringIntervalMs: 1000,
|
|
200
200
|
txGatheringMaxParallelRequests: 100
|
|
201
201
|
};
|
|
202
|
-
const
|
|
202
|
+
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
203
|
+
const { prefilledPublicData } = await getGenesisValues(this.context.initialFundedAccounts.map((a)=>a.address).concat(sponsoredFPCAddress));
|
|
203
204
|
this.proverNode = await createProverNode(proverConfig, {
|
|
204
205
|
aztecNodeTxProvider: this.aztecNode,
|
|
205
206
|
archiver: archiver,
|
|
@@ -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,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,
|
|
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,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,EAAE,MAAM,EAChB,MAAM,GAAE,OAAO,CAAC,YAAY,CAAM,EAClC,qBAAqB,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAMvD,QAAQ,CAAC,CAAC,EACrB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,EACjD,OAAO,GAAE,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAA2B;IA4CnG;;;;OAIG;IACU,KAAK;IA0BlB;;OAEG;IACU,QAAQ;CAKtB;AAgVD;;;GAGG;AACH,eAAO,MAAM,cAAc,qBACN,MAAM,UAAU,MAAM,iEACF;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,qBAAqB,EAAE,kBAAkB,EAAE,CAAA;CAAE;;EAe/F,CAAC;AAEJ;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,CAAC,eAAe,GAAG,YAAY,CAAC,EAAE,EACpD,eAAe,UAAQ,EACvB,SAAS,CAAC,EAAE,GAAG,GAAG,SAAS,iBAyB5B"}
|
|
@@ -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,
|
|
@@ -326,6 +329,8 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
326
329
|
logger.verbose('Creating pxe...');
|
|
327
330
|
const pxeConfig = getPXEServiceConfig();
|
|
328
331
|
pxeConfig.dataDirectory = statePath ?? path.join(directoryToCleanup, randomBytes(8).toString('hex'));
|
|
332
|
+
// Only enable proving if specifically requested.
|
|
333
|
+
pxeConfig.proverEnabled = !!opts.realProofs;
|
|
329
334
|
const pxe = await createPXEService(aztecNode, pxeConfig);
|
|
330
335
|
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
|
|
331
336
|
if (statePath) {
|
package/dest/fixtures/utils.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { startAnvil } from '@aztec/ethereum/test';
|
|
|
10
10
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
11
11
|
import { Fr } from '@aztec/foundation/fields';
|
|
12
12
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
13
|
+
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
13
14
|
import { type ProverNode } from '@aztec/prover-node';
|
|
14
15
|
import { type PXEService, type PXEServiceConfig } from '@aztec/pxe/server';
|
|
15
16
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
@@ -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,CAAC;AACzB,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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,13 +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
25
|
import { createPXEServiceWithSimulationProvider, getPXEServiceConfig } from '@aztec/pxe/server';
|
|
23
26
|
import { WASMSimulator } from '@aztec/simulator/client';
|
|
24
27
|
import { SimulationProviderRecorderWrapper } from '@aztec/simulator/testing';
|
|
25
|
-
import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
28
|
+
import { getContractClassFromArtifact, getContractInstanceFromDeployParams } from '@aztec/stdlib/contract';
|
|
26
29
|
import { Gas } from '@aztec/stdlib/gas';
|
|
27
30
|
import { getConfigEnvVars as getTelemetryConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
28
31
|
import { BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
|
|
@@ -92,6 +95,8 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
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) {
|
|
@@ -191,6 +196,8 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
191
196
|
...opts
|
|
192
197
|
};
|
|
193
198
|
config.peerCheckIntervalMS = TEST_PEER_CHECK_INTERVAL_MS;
|
|
199
|
+
// For tests we only want proving enabled if specifically requested
|
|
200
|
+
config.realProofs = !!opts.realProofs;
|
|
194
201
|
const logger = getLogger();
|
|
195
202
|
// Create a temp directory for any services that need it and cleanup later
|
|
196
203
|
const directoryToCleanup = path.join(tmpdir(), randomBytes(8).toString('hex'));
|
|
@@ -476,7 +483,7 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
|
|
|
476
483
|
expect(diffs).toEqual(expectedDiffs);
|
|
477
484
|
}
|
|
478
485
|
/**
|
|
479
|
-
* Deploy the
|
|
486
|
+
* Deploy the canonical Fee Juice contract to a running instance.
|
|
480
487
|
*/ export async function setupCanonicalFeeJuice(pxe) {
|
|
481
488
|
// "deploy" the Fee Juice as it contains public functions
|
|
482
489
|
const feeJuicePortalAddress = (await pxe.getNodeInfo()).l1ContractAddresses.feeJuicePortalAddress;
|
|
@@ -497,6 +504,33 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
|
|
|
497
504
|
getLogger().warn(`Fee Juice might have already been setup. Got error: ${inspect(error)}.`);
|
|
498
505
|
}
|
|
499
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
|
+
}
|
|
500
534
|
export async function waitForProvenChain(node, targetBlock, timeoutSec = 60, intervalSec = 1) {
|
|
501
535
|
targetBlock ??= await node.getBlockNumber();
|
|
502
536
|
await retryUntil(async ()=>await node.getProvenBlockNumber() >= targetBlock, 'proven chain status', timeoutSec, intervalSec);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "0.82.
|
|
3
|
+
"version": "0.82.1-alpha-testnet.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -26,37 +26,37 @@
|
|
|
26
26
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@aztec/accounts": "0.82.
|
|
30
|
-
"@aztec/archiver": "0.82.
|
|
31
|
-
"@aztec/aztec": "0.82.
|
|
32
|
-
"@aztec/aztec-node": "0.82.
|
|
33
|
-
"@aztec/aztec.js": "0.82.
|
|
34
|
-
"@aztec/bb-prover": "0.82.
|
|
35
|
-
"@aztec/blob-lib": "0.82.
|
|
36
|
-
"@aztec/blob-sink": "0.82.
|
|
37
|
-
"@aztec/bot": "0.82.
|
|
38
|
-
"@aztec/constants": "0.82.
|
|
39
|
-
"@aztec/entrypoints": "0.82.
|
|
40
|
-
"@aztec/epoch-cache": "0.82.
|
|
41
|
-
"@aztec/ethereum": "0.82.
|
|
42
|
-
"@aztec/foundation": "0.82.
|
|
43
|
-
"@aztec/kv-store": "0.82.
|
|
44
|
-
"@aztec/l1-artifacts": "0.82.
|
|
45
|
-
"@aztec/merkle-tree": "0.82.
|
|
46
|
-
"@aztec/noir-contracts.js": "0.82.
|
|
47
|
-
"@aztec/noir-noirc_abi": "0.82.
|
|
48
|
-
"@aztec/noir-protocol-circuits-types": "0.82.
|
|
49
|
-
"@aztec/p2p": "0.82.
|
|
50
|
-
"@aztec/protocol-contracts": "0.82.
|
|
51
|
-
"@aztec/prover-client": "0.82.
|
|
52
|
-
"@aztec/prover-node": "0.82.
|
|
53
|
-
"@aztec/pxe": "0.82.
|
|
54
|
-
"@aztec/sequencer-client": "0.82.
|
|
55
|
-
"@aztec/simulator": "0.82.
|
|
56
|
-
"@aztec/stdlib": "0.82.
|
|
57
|
-
"@aztec/telemetry-client": "0.82.
|
|
58
|
-
"@aztec/validator-client": "0.82.
|
|
59
|
-
"@aztec/world-state": "0.82.
|
|
29
|
+
"@aztec/accounts": "0.82.1-alpha-testnet.1",
|
|
30
|
+
"@aztec/archiver": "0.82.1-alpha-testnet.1",
|
|
31
|
+
"@aztec/aztec": "0.82.1-alpha-testnet.1",
|
|
32
|
+
"@aztec/aztec-node": "0.82.1-alpha-testnet.1",
|
|
33
|
+
"@aztec/aztec.js": "0.82.1-alpha-testnet.1",
|
|
34
|
+
"@aztec/bb-prover": "0.82.1-alpha-testnet.1",
|
|
35
|
+
"@aztec/blob-lib": "0.82.1-alpha-testnet.1",
|
|
36
|
+
"@aztec/blob-sink": "0.82.1-alpha-testnet.1",
|
|
37
|
+
"@aztec/bot": "0.82.1-alpha-testnet.1",
|
|
38
|
+
"@aztec/constants": "0.82.1-alpha-testnet.1",
|
|
39
|
+
"@aztec/entrypoints": "0.82.1-alpha-testnet.1",
|
|
40
|
+
"@aztec/epoch-cache": "0.82.1-alpha-testnet.1",
|
|
41
|
+
"@aztec/ethereum": "0.82.1-alpha-testnet.1",
|
|
42
|
+
"@aztec/foundation": "0.82.1-alpha-testnet.1",
|
|
43
|
+
"@aztec/kv-store": "0.82.1-alpha-testnet.1",
|
|
44
|
+
"@aztec/l1-artifacts": "0.82.1-alpha-testnet.1",
|
|
45
|
+
"@aztec/merkle-tree": "0.82.1-alpha-testnet.1",
|
|
46
|
+
"@aztec/noir-contracts.js": "0.82.1-alpha-testnet.1",
|
|
47
|
+
"@aztec/noir-noirc_abi": "0.82.1-alpha-testnet.1",
|
|
48
|
+
"@aztec/noir-protocol-circuits-types": "0.82.1-alpha-testnet.1",
|
|
49
|
+
"@aztec/p2p": "0.82.1-alpha-testnet.1",
|
|
50
|
+
"@aztec/protocol-contracts": "0.82.1-alpha-testnet.1",
|
|
51
|
+
"@aztec/prover-client": "0.82.1-alpha-testnet.1",
|
|
52
|
+
"@aztec/prover-node": "0.82.1-alpha-testnet.1",
|
|
53
|
+
"@aztec/pxe": "0.82.1-alpha-testnet.1",
|
|
54
|
+
"@aztec/sequencer-client": "0.82.1-alpha-testnet.1",
|
|
55
|
+
"@aztec/simulator": "0.82.1-alpha-testnet.1",
|
|
56
|
+
"@aztec/stdlib": "0.82.1-alpha-testnet.1",
|
|
57
|
+
"@aztec/telemetry-client": "0.82.1-alpha-testnet.1",
|
|
58
|
+
"@aztec/validator-client": "0.82.1-alpha-testnet.1",
|
|
59
|
+
"@aztec/world-state": "0.82.1-alpha-testnet.1",
|
|
60
60
|
"@iarna/toml": "^2.2.5",
|
|
61
61
|
"@jest/globals": "^29.5.0",
|
|
62
62
|
"@msgpack/msgpack": "^3.0.0-beta2",
|
|
@@ -18,6 +18,7 @@ import { AppSubscriptionContract } from '@aztec/noir-contracts.js/AppSubscriptio
|
|
|
18
18
|
import { CounterContract } from '@aztec/noir-contracts.js/Counter';
|
|
19
19
|
import { FPCContract } from '@aztec/noir-contracts.js/FPC';
|
|
20
20
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
21
|
+
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
21
22
|
import { TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token';
|
|
22
23
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
23
24
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
@@ -39,6 +40,7 @@ import {
|
|
|
39
40
|
ensureAccountsPubliclyDeployed,
|
|
40
41
|
getBalancesFn,
|
|
41
42
|
setupCanonicalFeeJuice,
|
|
43
|
+
setupSponsoredFPC,
|
|
42
44
|
} from '../fixtures/utils.js';
|
|
43
45
|
import { FeeJuicePortalTestingHarnessFactory, type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.js';
|
|
44
46
|
|
|
@@ -50,6 +52,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
50
52
|
* PublicDeployAccounts: Deploys the accounts publicly.
|
|
51
53
|
* DeployFeeJuice: Deploys the Fee Juice contract.
|
|
52
54
|
* FPCSetup: Deploys BananaCoin and FPC contracts, and bridges gas from L1.
|
|
55
|
+
* SponsoredFPCSetup: Deploys Sponsored FPC contract, and bridges gas from L1.
|
|
53
56
|
* FundAlice: Mints private and public bananas to Alice.
|
|
54
57
|
* SetupSubscription: Deploys a counter contract and a subscription contract, and mints Fee Juice to the subscription contract.
|
|
55
58
|
*/
|
|
@@ -76,6 +79,7 @@ export class FeesTest {
|
|
|
76
79
|
public feeJuiceContract!: FeeJuiceContract;
|
|
77
80
|
public bananaCoin!: BananaCoin;
|
|
78
81
|
public bananaFPC!: FPCContract;
|
|
82
|
+
public sponsoredFPC!: SponsoredFPCContract;
|
|
79
83
|
public counterContract!: CounterContract;
|
|
80
84
|
public subscriptionContract!: AppSubscriptionContract;
|
|
81
85
|
public feeJuiceBridgeTestHarness!: GasBridgingTestHarness;
|
|
@@ -239,6 +243,13 @@ export class FeesTest {
|
|
|
239
243
|
},
|
|
240
244
|
async ({ bananaCoinAddress }) => {
|
|
241
245
|
this.bananaCoin = await BananaCoin.at(bananaCoinAddress, this.aliceWallet);
|
|
246
|
+
const logger = this.logger;
|
|
247
|
+
this.getBananaPublicBalanceFn = getBalancesFn('🍌.public', this.bananaCoin.methods.balance_of_public, logger);
|
|
248
|
+
this.getBananaPrivateBalanceFn = getBalancesFn(
|
|
249
|
+
'🍌.private',
|
|
250
|
+
this.bananaCoin.methods.balance_of_private,
|
|
251
|
+
logger,
|
|
252
|
+
);
|
|
242
253
|
},
|
|
243
254
|
);
|
|
244
255
|
}
|
|
@@ -270,14 +281,6 @@ export class FeesTest {
|
|
|
270
281
|
const bananaFPC = await FPCContract.at(data.bananaFPCAddress, this.aliceWallet);
|
|
271
282
|
this.bananaFPC = bananaFPC;
|
|
272
283
|
|
|
273
|
-
const logger = this.logger;
|
|
274
|
-
this.getBananaPublicBalanceFn = getBalancesFn('🍌.public', this.bananaCoin.methods.balance_of_public, logger);
|
|
275
|
-
this.getBananaPrivateBalanceFn = getBalancesFn(
|
|
276
|
-
'🍌.private',
|
|
277
|
-
this.bananaCoin.methods.balance_of_private,
|
|
278
|
-
logger,
|
|
279
|
-
);
|
|
280
|
-
|
|
281
284
|
this.getCoinbaseBalance = async () => {
|
|
282
285
|
const { walletClient } = createL1Clients(context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
283
286
|
const gasL1 = getContract({
|
|
@@ -314,6 +317,27 @@ export class FeesTest {
|
|
|
314
317
|
);
|
|
315
318
|
}
|
|
316
319
|
|
|
320
|
+
public async applySponsoredFPCSetupSnapshot() {
|
|
321
|
+
await this.snapshotManager.snapshot(
|
|
322
|
+
'sponsored_fpc_setup',
|
|
323
|
+
async context => {
|
|
324
|
+
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
325
|
+
expect((await context.pxe.getContractMetadata(feeJuiceContract.address)).isContractPubliclyDeployed).toBe(true);
|
|
326
|
+
|
|
327
|
+
this.sponsoredFPC = await setupSponsoredFPC(context.pxe);
|
|
328
|
+
this.logger.info(`SponsoredFPC deployed at ${this.sponsoredFPC.address}`);
|
|
329
|
+
|
|
330
|
+
return {
|
|
331
|
+
sponsoredFPCAddress: this.sponsoredFPC.address,
|
|
332
|
+
};
|
|
333
|
+
},
|
|
334
|
+
async data => {
|
|
335
|
+
const sponsoredFPC = await SponsoredFPCContract.at(data.sponsoredFPCAddress, this.aliceWallet);
|
|
336
|
+
this.sponsoredFPC = sponsoredFPC;
|
|
337
|
+
},
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
|
|
317
341
|
public async applyFundAliceWithBananas() {
|
|
318
342
|
await this.snapshotManager.snapshot(
|
|
319
343
|
'fund_alice',
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
deployAccounts,
|
|
40
40
|
publicDeployAccounts,
|
|
41
41
|
} from '../fixtures/snapshot_manager.js';
|
|
42
|
-
import { getPrivateKeyFromIndex, setupPXEService } from '../fixtures/utils.js';
|
|
42
|
+
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEService } from '../fixtures/utils.js';
|
|
43
43
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
44
44
|
|
|
45
45
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
@@ -295,7 +295,10 @@ export class FullProverTest {
|
|
|
295
295
|
txGatheringIntervalMs: 1000,
|
|
296
296
|
txGatheringMaxParallelRequests: 100,
|
|
297
297
|
};
|
|
298
|
-
const
|
|
298
|
+
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
299
|
+
const { prefilledPublicData } = await getGenesisValues(
|
|
300
|
+
this.context.initialFundedAccounts.map(a => a.address).concat(sponsoredFPCAddress),
|
|
301
|
+
);
|
|
299
302
|
this.proverNode = await createProverNode(
|
|
300
303
|
proverConfig,
|
|
301
304
|
{
|
|
@@ -49,7 +49,13 @@ import { MNEMONIC, TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
|
|
|
49
49
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
50
50
|
import { getBBConfig } from './get_bb_config.js';
|
|
51
51
|
import { setupL1Contracts } from './setup_l1_contracts.js';
|
|
52
|
-
import {
|
|
52
|
+
import {
|
|
53
|
+
type SetupOptions,
|
|
54
|
+
createAndSyncProverNode,
|
|
55
|
+
getLogger,
|
|
56
|
+
getPrivateKeyFromIndex,
|
|
57
|
+
getSponsoredFPCAddress,
|
|
58
|
+
} from './utils.js';
|
|
53
59
|
import { getEndToEndTestTelemetryClient } from './with_telemetry_utils.js';
|
|
54
60
|
|
|
55
61
|
export type SubsystemsContext = {
|
|
@@ -300,6 +306,8 @@ async function setupFromFresh(
|
|
|
300
306
|
// TODO: For some reason this is currently the union of a bunch of subsystems. That needs fixing.
|
|
301
307
|
const aztecNodeConfig: AztecNodeConfig & SetupOptions = { ...getConfigEnvVars(), ...opts };
|
|
302
308
|
aztecNodeConfig.peerCheckIntervalMS = TEST_PEER_CHECK_INTERVAL_MS;
|
|
309
|
+
// Only enable proving if specifically requested.
|
|
310
|
+
aztecNodeConfig.realProofs = !!opts.realProofs;
|
|
303
311
|
|
|
304
312
|
// Create a temp directory for all ephemeral state and cleanup afterwards
|
|
305
313
|
const directoryToCleanup = path.join(tmpdir(), randomBytes(8).toString('hex'));
|
|
@@ -336,8 +344,9 @@ async function setupFromFresh(
|
|
|
336
344
|
}
|
|
337
345
|
|
|
338
346
|
const initialFundedAccounts = await generateSchnorrAccounts(numberOfInitialFundedAccounts);
|
|
347
|
+
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
339
348
|
const { genesisArchiveRoot, genesisBlockHash, prefilledPublicData } = await getGenesisValues(
|
|
340
|
-
initialFundedAccounts.map(a => a.address),
|
|
349
|
+
initialFundedAccounts.map(a => a.address).concat(sponsoredFPCAddress),
|
|
341
350
|
opts.initialAccountFeeJuice,
|
|
342
351
|
);
|
|
343
352
|
|
|
@@ -433,6 +442,8 @@ async function setupFromFresh(
|
|
|
433
442
|
logger.verbose('Creating pxe...');
|
|
434
443
|
const pxeConfig = getPXEServiceConfig();
|
|
435
444
|
pxeConfig.dataDirectory = statePath ?? path.join(directoryToCleanup, randomBytes(8).toString('hex'));
|
|
445
|
+
// Only enable proving if specifically requested.
|
|
446
|
+
pxeConfig.proverEnabled = !!opts.realProofs;
|
|
436
447
|
const pxe = await createPXEService(aztecNode, pxeConfig);
|
|
437
448
|
|
|
438
449
|
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
|
package/src/fixtures/utils.ts
CHANGED
|
@@ -26,10 +26,12 @@ import {
|
|
|
26
26
|
waitForPXE,
|
|
27
27
|
} from '@aztec/aztec.js';
|
|
28
28
|
import { deployInstance, registerContractClass } from '@aztec/aztec.js/deployment';
|
|
29
|
+
import { SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee/testing';
|
|
29
30
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
|
|
30
31
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
31
32
|
import { type BlobSinkServer, createBlobSinkServer } from '@aztec/blob-sink/server';
|
|
32
|
-
import { FEE_JUICE_INITIAL_MINT, GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH } from '@aztec/constants';
|
|
33
|
+
import { FEE_JUICE_INITIAL_MINT, GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH, SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
34
|
+
import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
|
|
33
35
|
import {
|
|
34
36
|
type DeployL1ContractsArgs,
|
|
35
37
|
type DeployL1ContractsReturnType,
|
|
@@ -48,6 +50,7 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
48
50
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
49
51
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
50
52
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
53
|
+
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
51
54
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
52
55
|
import { ProtocolContractAddress, protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
53
56
|
import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
|
|
@@ -61,7 +64,7 @@ import type { SequencerClient } from '@aztec/sequencer-client';
|
|
|
61
64
|
import type { TestSequencerClient } from '@aztec/sequencer-client/test';
|
|
62
65
|
import { WASMSimulator } from '@aztec/simulator/client';
|
|
63
66
|
import { SimulationProviderRecorderWrapper } from '@aztec/simulator/testing';
|
|
64
|
-
import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
67
|
+
import { getContractClassFromArtifact, getContractInstanceFromDeployParams } from '@aztec/stdlib/contract';
|
|
65
68
|
import { Gas } from '@aztec/stdlib/gas';
|
|
66
69
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
67
70
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
@@ -165,6 +168,8 @@ export async function setupPXEService(
|
|
|
165
168
|
teardown: () => Promise<void>;
|
|
166
169
|
}> {
|
|
167
170
|
const pxeServiceConfig = { ...getPXEServiceConfig(), ...opts };
|
|
171
|
+
// For tests we only want proving enabled if specifically requested
|
|
172
|
+
pxeServiceConfig.proverEnabled = !!opts.proverEnabled;
|
|
168
173
|
|
|
169
174
|
// If no data directory provided, create a temp directory and clean up afterwards
|
|
170
175
|
const configuredDataDirectory = pxeServiceConfig.dataDirectory;
|
|
@@ -354,6 +359,8 @@ export async function setup(
|
|
|
354
359
|
): Promise<EndToEndContext> {
|
|
355
360
|
const config = { ...getConfigEnvVars(), ...opts };
|
|
356
361
|
config.peerCheckIntervalMS = TEST_PEER_CHECK_INTERVAL_MS;
|
|
362
|
+
// For tests we only want proving enabled if specifically requested
|
|
363
|
+
config.realProofs = !!opts.realProofs;
|
|
357
364
|
|
|
358
365
|
const logger = getLogger();
|
|
359
366
|
|
|
@@ -730,7 +737,7 @@ export async function expectMappingDelta<K, V extends number | bigint>(
|
|
|
730
737
|
}
|
|
731
738
|
|
|
732
739
|
/**
|
|
733
|
-
* Deploy the
|
|
740
|
+
* Deploy the canonical Fee Juice contract to a running instance.
|
|
734
741
|
*/
|
|
735
742
|
export async function setupCanonicalFeeJuice(pxe: PXE) {
|
|
736
743
|
// "deploy" the Fee Juice as it contains public functions
|
|
@@ -750,6 +757,40 @@ export async function setupCanonicalFeeJuice(pxe: PXE) {
|
|
|
750
757
|
}
|
|
751
758
|
}
|
|
752
759
|
|
|
760
|
+
/**
|
|
761
|
+
* Computes the address of the "canonical" SponosoredFPCContract. This is not a protocol contract
|
|
762
|
+
* but by conventions its address is computed with a salt of 0.
|
|
763
|
+
* @returns The address of the sponsored FPC contract
|
|
764
|
+
*/
|
|
765
|
+
export async function getSponsoredFPCAddress() {
|
|
766
|
+
const sponsoredFPCInstance = await getContractInstanceFromDeployParams(SponsoredFPCContract.artifact, {
|
|
767
|
+
salt: new Fr(SPONSORED_FPC_SALT),
|
|
768
|
+
});
|
|
769
|
+
return sponsoredFPCInstance.address;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Deploy a sponsored FPC contract to a running instance.
|
|
774
|
+
*/
|
|
775
|
+
export async function setupSponsoredFPC(pxe: PXE) {
|
|
776
|
+
const { l1ChainId: chainId, protocolVersion } = await pxe.getNodeInfo();
|
|
777
|
+
const deployer = new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(chainId, protocolVersion));
|
|
778
|
+
|
|
779
|
+
// Make the contract pay for the deployment fee itself
|
|
780
|
+
const paymentMethod = new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
|
|
781
|
+
|
|
782
|
+
const deployed = await SponsoredFPCContract.deploy(deployer)
|
|
783
|
+
.send({
|
|
784
|
+
contractAddressSalt: new Fr(SPONSORED_FPC_SALT),
|
|
785
|
+
universalDeploy: true,
|
|
786
|
+
fee: { paymentMethod },
|
|
787
|
+
})
|
|
788
|
+
.deployed();
|
|
789
|
+
|
|
790
|
+
getLogger().info(`SponsoredFPC: ${deployed.address}`);
|
|
791
|
+
return deployed;
|
|
792
|
+
}
|
|
793
|
+
|
|
753
794
|
export async function waitForProvenChain(node: AztecNode, targetBlock?: number, timeoutSec = 60, intervalSec = 1) {
|
|
754
795
|
targetBlock ??= await node.getBlockNumber();
|
|
755
796
|
|