@aztec/end-to-end 2.0.0-nightly.20250903 → 3.0.0-canary.a9708bd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +6 -7
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +2 -2
- package/dest/e2e_fees/bridging_race.notest.js +3 -5
- package/dest/e2e_fees/fees_test.d.ts +1 -1
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +4 -5
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -0
- package/dest/fixtures/e2e_prover_test.d.ts +1 -1
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +10 -10
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +1 -21
- package/dest/shared/gas_portal_test_harness.d.ts +5 -5
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +6 -16
- package/dest/spartan/utils.d.ts +11 -19
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +17 -17
- package/package.json +36 -36
- package/src/bench/client_flows/client_flows_benchmark.ts +9 -17
- package/src/e2e_epochs/epochs_test.ts +7 -2
- package/src/e2e_fees/bridging_race.notest.ts +6 -5
- package/src/e2e_fees/fees_test.ts +7 -9
- package/src/fixtures/e2e_prover_test.ts +7 -6
- package/src/fixtures/snapshot_manager.ts +1 -28
- package/src/shared/gas_portal_test_harness.ts +8 -17
- package/src/spartan/DEVELOP.md +116 -0
- package/src/spartan/utils.ts +21 -18
- package/dest/integration_l1_publisher/write_json.d.ts.map +0 -1
- /package/dest/{integration_l1_publisher → e2e_l1_publisher}/write_json.d.ts +0 -0
- /package/dest/{integration_l1_publisher → e2e_l1_publisher}/write_json.js +0 -0
- /package/src/{integration_l1_publisher → e2e_l1_publisher}/write_json.ts +0 -0
|
@@ -47,7 +47,7 @@ export declare class ClientFlowsBenchmark {
|
|
|
47
47
|
constructor(testName?: string, setupOptions?: Partial<SetupOptions & DeployL1ContractsArgs>);
|
|
48
48
|
setup(): Promise<this>;
|
|
49
49
|
teardown(): Promise<void>;
|
|
50
|
-
mintAndBridgeFeeJuice(address: AztecAddress
|
|
50
|
+
mintAndBridgeFeeJuice(address: AztecAddress): Promise<void>;
|
|
51
51
|
/** Admin mints bananaCoin tokens privately to the target address and redeems them. */
|
|
52
52
|
mintPrivateBananas(amount: bigint, address: AztecAddress): Promise<void>;
|
|
53
53
|
createBenchmarkingAccountManager(pxe: PXE, type: 'ecdsar1' | 'schnorr'): Promise<import("@aztec/aztec.js").AccountManager>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client_flows_benchmark.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/client_flows_benchmark.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,aAAa,EAClB,0BAA0B,EAC1B,YAAY,EACZ,KAAK,SAAS,EACd,qBAAqB,EACrB,8BAA8B,EAC9B,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,uBAAuB,EACvB,yBAAyB,EACzB,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"client_flows_benchmark.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/client_flows_benchmark.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,aAAa,EAClB,0BAA0B,EAC1B,YAAY,EACZ,KAAK,SAAS,EACd,qBAAqB,EACrB,8BAA8B,EAC9B,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,KAA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AW,EAAE,WAAW;IAsBxD,sBAAsB;IA0BtB,wCAAwC,CAAC,MAAM,EAAE,MAAM;IAK7D,mCAAmC,CAAC,MAAM,EAAE,MAAM;IAIlD,qCAAqC,CAAC,OAAO,EAAE,MAAM;IAIrD,iCAAiC,CAAC,MAAM,EAAE,MAAM;CAGxD"}
|
|
@@ -2,7 +2,6 @@ import { EcdsaRAccountContractArtifact, getEcdsaRAccount } from '@aztec/accounts
|
|
|
2
2
|
import { SchnorrAccountContractArtifact, getSchnorrAccount, getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
3
3
|
import { AccountWalletWithSecretKey, FeeJuicePaymentMethod, FeeJuicePaymentMethodWithClaim, PrivateFeePaymentMethod, SponsoredFeePaymentMethod, createLogger } from '@aztec/aztec.js';
|
|
4
4
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
5
|
-
import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
|
|
6
5
|
import { RollupContract, createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
|
|
7
6
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
8
7
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
@@ -115,10 +114,10 @@ export class ClientFlowsBenchmark {
|
|
|
115
114
|
await this.chainMonitor.stop();
|
|
116
115
|
await this.snapshotManager.teardown();
|
|
117
116
|
}
|
|
118
|
-
async mintAndBridgeFeeJuice(address
|
|
119
|
-
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(
|
|
117
|
+
async mintAndBridgeFeeJuice(address) {
|
|
118
|
+
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(address);
|
|
120
119
|
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
121
|
-
await this.feeJuiceContract.methods.claim(address,
|
|
120
|
+
await this.feeJuiceContract.methods.claim(address, claim.claimAmount, secret, index).send({
|
|
122
121
|
from: this.adminAddress
|
|
123
122
|
}).wait();
|
|
124
123
|
}
|
|
@@ -228,7 +227,7 @@ export class ClientFlowsBenchmark {
|
|
|
228
227
|
from: this.adminAddress
|
|
229
228
|
}).deployed();
|
|
230
229
|
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
231
|
-
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(
|
|
230
|
+
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.adminAddress);
|
|
232
231
|
return {
|
|
233
232
|
bananaFPCAddress: bananaFPC.address
|
|
234
233
|
};
|
|
@@ -263,7 +262,7 @@ export class ClientFlowsBenchmark {
|
|
|
263
262
|
const benchysAccountManager = await this.createBenchmarkingAccountManager(this.pxe, accountType);
|
|
264
263
|
const benchysWallet = await benchysAccountManager.getWallet();
|
|
265
264
|
const benchysAddress = benchysAccountManager.getAddress();
|
|
266
|
-
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(
|
|
265
|
+
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
|
|
267
266
|
const paymentMethod = new FeeJuicePaymentMethodWithClaim(benchysWallet, claim);
|
|
268
267
|
await benchysAccountManager.deploy({
|
|
269
268
|
fee: {
|
|
@@ -301,7 +300,7 @@ export class ClientFlowsBenchmark {
|
|
|
301
300
|
});
|
|
302
301
|
}
|
|
303
302
|
async getBridgedFeeJuicePaymentMethodForWallet(wallet) {
|
|
304
|
-
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(
|
|
303
|
+
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(wallet.getAddress());
|
|
305
304
|
return new FeeJuicePaymentMethodWithClaim(wallet, claim);
|
|
306
305
|
}
|
|
307
306
|
getPrivateFPCPaymentMethodForWallet(wallet) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epochs_test.d.ts","sourceRoot":"","sources":["../../src/e2e_epochs/epochs_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,E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0E;IAC7D,mBAAmB,CAAC,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO;IAW9E,oBAAoB,CACzB,UAAU,EAAE,eAAe,EAAE,EAC7B,WAAW,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAc;;;;CAiD/D"}
|
|
@@ -46,7 +46,7 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
46
46
|
const envEthereumSlotDuration = process.env.L1_BLOCK_TIME ? parseInt(process.env.L1_BLOCK_TIME) : DEFAULT_L1_BLOCK_TIME;
|
|
47
47
|
const ethereumSlotDuration = opts.ethereumSlotDuration ?? envEthereumSlotDuration;
|
|
48
48
|
const aztecSlotDuration = opts.aztecSlotDuration ?? ethereumSlotDuration * 2;
|
|
49
|
-
const aztecEpochDuration = opts.aztecEpochDuration ??
|
|
49
|
+
const aztecEpochDuration = opts.aztecEpochDuration ?? 6;
|
|
50
50
|
const aztecProofSubmissionEpochs = opts.aztecProofSubmissionEpochs ?? 1;
|
|
51
51
|
return {
|
|
52
52
|
ethereumSlotDuration,
|
|
@@ -204,7 +204,7 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
204
204
|
/** Waits until the epoch begins (ie until the immediately previous L1 block is mined). */ async waitUntilEpochStarts(epoch) {
|
|
205
205
|
const [start] = getTimestampRangeForEpoch(BigInt(epoch), this.constants);
|
|
206
206
|
this.logger.info(`Waiting until L1 timestamp ${start} is reached as the start of epoch ${epoch}`);
|
|
207
|
-
await waitUntilL1Timestamp(this.l1Client, start - BigInt(this.L1_BLOCK_TIME_IN_S));
|
|
207
|
+
await waitUntilL1Timestamp(this.l1Client, start - BigInt(this.L1_BLOCK_TIME_IN_S), undefined, 30 * this.epochDuration);
|
|
208
208
|
return start;
|
|
209
209
|
}
|
|
210
210
|
/** Waits until the given L2 block number is mined. */ async waitUntilL2BlockNumber(target, timeout = 60) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getSchnorrAccount } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { Fr, sleep } from '@aztec/aztec.js';
|
|
3
|
-
import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
|
|
4
3
|
import { Fq } from '@aztec/foundation/fields';
|
|
5
4
|
import { jest } from '@jest/globals';
|
|
6
5
|
import { FeesTest } from './fees_test.js';
|
|
@@ -50,13 +49,12 @@ describe('e2e_fees bridging_race', ()=>{
|
|
|
50
49
|
// Waiting for the archiver to sync the message _before_ waiting for the mandatory 2 L2 blocks to pass fixed it
|
|
51
50
|
// This was added everywhere we wait for two blocks, which is spread across three different places in the codebase
|
|
52
51
|
// Yes, we need to REFACTOR it at some point
|
|
53
|
-
const
|
|
54
|
-
const claim = await t.feeJuiceBridgeTestHarness.prepareTokensOnL1(amount, bobsAddress);
|
|
52
|
+
const claim = await t.feeJuiceBridgeTestHarness.prepareTokensOnL1(bobsAddress);
|
|
55
53
|
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
56
|
-
await t.feeJuiceContract.methods.claim(bobsAddress,
|
|
54
|
+
await t.feeJuiceContract.methods.claim(bobsAddress, claim.claimAmount, secret, index).send({
|
|
57
55
|
from: bobsAddress
|
|
58
56
|
}).wait();
|
|
59
57
|
const [balance] = await t.getGasBalanceFn(bobsAddress);
|
|
60
|
-
expect(balance).toEqual(
|
|
58
|
+
expect(balance).toEqual(claim.claimAmount);
|
|
61
59
|
});
|
|
62
60
|
});
|
|
@@ -68,7 +68,7 @@ export declare class FeesTest {
|
|
|
68
68
|
sequencerBlockRewards: bigint;
|
|
69
69
|
proverBlockRewards: bigint;
|
|
70
70
|
}>;
|
|
71
|
-
mintAndBridgeFeeJuice(minter: AztecAddress, recipient: AztecAddress
|
|
71
|
+
mintAndBridgeFeeJuice(minter: AztecAddress, recipient: AztecAddress): Promise<void>;
|
|
72
72
|
/** Alice mints bananaCoin tokens privately to the target address and redeems them. */
|
|
73
73
|
mintPrivateBananas(amount: bigint, address: AztecAddress): Promise<void>;
|
|
74
74
|
applyBaseSnapshots(): 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,sBAAsB,CAAC;
|
|
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,sBAAsB,CAAC;AAClD,OAAO,EAAE,KAAK,qBAAqB,EAAE,cAAc,EAA0B,MAAM,iBAAiB,CAAC;AACrG,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKhD,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAA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vC,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;IAgB5D,KAAK;IASL,QAAQ;IAKd,oBAAoB,CAAC,CAAC,EAAE,OAAO;IAIzB,kBAAkB;IAOlB,eAAe;;;;IAcf,qBAAqB,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY;IASzE,sFAAsF;IAChF,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAajD,kBAAkB;IAOzB,4BAA4B;IAyB5B,iCAAiC;IAMjC,0BAA0B;IA4B1B,8BAA8B;IA6BvB,qBAAqB;IAoErB,8BAA8B;IAoB9B,yBAAyB;IAczB,gCAAgC;CAS9C"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { createLogger, sleep } from '@aztec/aztec.js';
|
|
3
3
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
4
|
-
import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
|
|
5
4
|
import { RollupContract, createExtendedL1Client } from '@aztec/ethereum';
|
|
6
5
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
7
6
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
@@ -115,10 +114,10 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
115
114
|
proverBlockRewards
|
|
116
115
|
};
|
|
117
116
|
}
|
|
118
|
-
async mintAndBridgeFeeJuice(minter, recipient
|
|
119
|
-
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(
|
|
117
|
+
async mintAndBridgeFeeJuice(minter, recipient) {
|
|
118
|
+
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(recipient);
|
|
120
119
|
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
121
|
-
await this.feeJuiceContract.methods.claim(recipient,
|
|
120
|
+
await this.feeJuiceContract.methods.claim(recipient, claim.claimAmount, secret, index).send({
|
|
122
121
|
from: minter
|
|
123
122
|
}).wait();
|
|
124
123
|
}
|
|
@@ -200,7 +199,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
200
199
|
from: this.aliceAddress
|
|
201
200
|
}).deployed();
|
|
202
201
|
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
203
|
-
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(
|
|
202
|
+
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.aliceAddress);
|
|
204
203
|
return {
|
|
205
204
|
bananaFPCAddress: bananaFPC.address,
|
|
206
205
|
feeJuiceAddress: feeJuiceContract.address,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write_json.d.ts","sourceRoot":"","sources":["../../src/e2e_l1_publisher/write_json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAOpD;;;GAGG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,EAAE,EAAE,EACnB,KAAK,EAAE,IAAI,EAAE,EACb,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,YAAY,EAC9B,eAAe,EAAE,KAAK,MAAM,EAAE,GAC7B,OAAO,CAAC,IAAI,CAAC,CAqDf"}
|
|
@@ -51,7 +51,7 @@ export declare class FullProverTest {
|
|
|
51
51
|
*/
|
|
52
52
|
applyBaseSnapshots(): Promise<void>;
|
|
53
53
|
setup(): Promise<this>;
|
|
54
|
-
private
|
|
54
|
+
private mintFeeJuice;
|
|
55
55
|
snapshot: <T>(name: string, apply: (context: SubsystemsContext) => Promise<T>, restore?: (snapshotData: T, context: SubsystemsContext) => Promise<void>) => Promise<void>;
|
|
56
56
|
teardown(): Promise<void>;
|
|
57
57
|
applyMintSnapshot(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e_prover_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/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,sBAAsB,CAAC;AAClD,OAAO,EAEL,KAAK,6BAA6B,EAGnC,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAInE,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;AAMtE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGlE,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,uBAAuB,CAAC;AAU/B;;;;;GAKG;AAEH,qBAAa,cAAc;IA6BvB,OAAO,CAAC,sBAAsB;IAE9B,OAAO,CAAC,UAAU;IA9BpB,MAAM,CAAC,UAAU,SAAU;IAC3B,MAAM,CAAC,YAAY,SAAS;IAC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AAa,EAAE,CAAM;IACnC,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,mBAAmB,CAAc;IAClC,WAAW,EAAG,2BAA2B,CAAC;IAC1C,aAAa,EAAG,UAAU,CAAC;gBAGhC,QAAQ,EAAE,MAAM,EACR,sBAAsB,EAAE,MAAM,EACtC,QAAQ,EAAE,UAAU,EACZ,UAAU,UAAO;IAa3B;;;;OAIG;IACG,kBAAkB;IAwDlB,KAAK;YAiKG,YAAY;IAS1B,QAAQ,GAAI,CAAC,EACX,MAAM,MAAM,EACZ,OAAO,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,EACjD,UAAS,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAA2B,KAChG,OAAO,CAAC,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAeR,iBAAiB;CAiDxB"}
|
|
@@ -5,7 +5,7 @@ import { BBCircuitVerifier, QueuedIVCVerifier, TestCircuitVerifier } from '@azte
|
|
|
5
5
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
6
6
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
7
7
|
import { SecretValue } from '@aztec/foundation/config';
|
|
8
|
-
import {
|
|
8
|
+
import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
|
|
9
9
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
10
10
|
import { createProverNode } from '@aztec/prover-node';
|
|
11
11
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
@@ -191,7 +191,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
191
191
|
const proverNodeSenderAddress = privateKeyToAddress(new Buffer32(proverNodePrivateKey).toString());
|
|
192
192
|
this.proverAddress = EthAddress.fromString(proverNodeSenderAddress);
|
|
193
193
|
this.logger.verbose(`Funding prover node at ${proverNodeSenderAddress}`);
|
|
194
|
-
await this.
|
|
194
|
+
await this.mintFeeJuice(proverNodeSenderAddress);
|
|
195
195
|
this.logger.verbose('Starting prover node');
|
|
196
196
|
const proverConfig = {
|
|
197
197
|
...this.context.aztecNodeConfig,
|
|
@@ -225,17 +225,17 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
225
225
|
this.logger.warn(`Proofs are now enabled`);
|
|
226
226
|
return this;
|
|
227
227
|
}
|
|
228
|
-
async
|
|
229
|
-
const
|
|
228
|
+
async mintFeeJuice(recipient) {
|
|
229
|
+
const handlerAddress = this.context.deployL1ContractsValues.l1ContractAddresses.feeAssetHandlerAddress;
|
|
230
|
+
this.logger.verbose(`Minting fee juice to ${recipient} using handler at ${handlerAddress}`);
|
|
230
231
|
const client = this.context.deployL1ContractsValues.l1Client;
|
|
231
|
-
const
|
|
232
|
-
abi:
|
|
233
|
-
address:
|
|
232
|
+
const handler = getContract({
|
|
233
|
+
abi: FeeAssetHandlerAbi,
|
|
234
|
+
address: handlerAddress.toString(),
|
|
234
235
|
client
|
|
235
236
|
});
|
|
236
|
-
const hash = await
|
|
237
|
-
recipient
|
|
238
|
-
amount
|
|
237
|
+
const hash = await handler.write.mint([
|
|
238
|
+
recipient
|
|
239
239
|
]);
|
|
240
240
|
await this.context.deployL1ContractsValues.l1Client.waitForTransactionReceipt({
|
|
241
241
|
hash
|
|
@@ -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,EAIpB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAA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MAAM,EACd,gBAAgB,EAAE,CAAC,eAAe,GAAG,YAAY,CAAC,EAAE,EACpD,eAAe,UAAQ,EACvB,SAAS,CAAC,EAAE,GAAG,GAAG,SAAS,iBAyB5B"}
|
|
@@ -5,7 +5,7 @@ import { BatchCall, DefaultWaitForProvenOpts, EthAddress, getContractClassFromAr
|
|
|
5
5
|
import { publishContractClass, publishInstance } from '@aztec/aztec.js/deployment';
|
|
6
6
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec/testing';
|
|
7
7
|
import { createBlobSinkServer } from '@aztec/blob-sink/server';
|
|
8
|
-
import {
|
|
8
|
+
import { createExtendedL1Client, deployMulticall3, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
9
9
|
import { EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
|
|
10
10
|
import { asyncMap } from '@aztec/foundation/async-map';
|
|
11
11
|
import { SecretValue } from '@aztec/foundation/config';
|
|
@@ -24,7 +24,6 @@ import fs from 'fs/promises';
|
|
|
24
24
|
import getPort from 'get-port';
|
|
25
25
|
import { tmpdir } from 'os';
|
|
26
26
|
import path, { join } from 'path';
|
|
27
|
-
import { getContract } from 'viem';
|
|
28
27
|
import { mnemonicToAccount } from 'viem/accounts';
|
|
29
28
|
import { foundry } from 'viem/chains';
|
|
30
29
|
import { MNEMONIC, TEST_MAX_TX_POOL_SIZE, TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
|
|
@@ -284,25 +283,6 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
284
283
|
aztecNodeConfig.l1Contracts = deployL1ContractsValues.l1ContractAddresses;
|
|
285
284
|
aztecNodeConfig.rollupVersion = deployL1ContractsValues.rollupVersion;
|
|
286
285
|
aztecNodeConfig.l1PublishRetryIntervalMS = 100;
|
|
287
|
-
if (opts.fundRewardDistributor) {
|
|
288
|
-
// Mints block rewards for 10000 blocks to the rewardDistributor contract
|
|
289
|
-
const rollup = new RollupContract(deployL1ContractsValues.l1Client, deployL1ContractsValues.l1ContractAddresses.rollupAddress);
|
|
290
|
-
const blockReward = await rollup.getBlockReward();
|
|
291
|
-
const mintAmount = 10_000n * blockReward;
|
|
292
|
-
const feeJuice = getContract({
|
|
293
|
-
address: deployL1ContractsValues.l1ContractAddresses.feeJuiceAddress.toString(),
|
|
294
|
-
abi: FeeAssetArtifact.contractAbi,
|
|
295
|
-
client: deployL1ContractsValues.l1Client
|
|
296
|
-
});
|
|
297
|
-
const rewardDistributorMintTxHash = await feeJuice.write.mint([
|
|
298
|
-
deployL1ContractsValues.l1ContractAddresses.rewardDistributorAddress.toString(),
|
|
299
|
-
mintAmount
|
|
300
|
-
], {});
|
|
301
|
-
await deployL1ContractsValues.l1Client.waitForTransactionReceipt({
|
|
302
|
-
hash: rewardDistributorMintTxHash
|
|
303
|
-
});
|
|
304
|
-
logger.info(`Funding rewardDistributor in ${rewardDistributorMintTxHash}`);
|
|
305
|
-
}
|
|
306
286
|
const dateProvider = new TestDateProvider();
|
|
307
287
|
const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls), deployL1ContractsValues.l1ContractAddresses.rollupAddress, deployL1ContractsValues.l1Client, dateProvider);
|
|
308
288
|
await watcher.start();
|
|
@@ -4,8 +4,8 @@ import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
|
4
4
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
5
5
|
export interface IGasBridgingTestHarness {
|
|
6
6
|
getL1FeeJuiceBalance(address: EthAddress): Promise<bigint>;
|
|
7
|
-
prepareTokensOnL1(
|
|
8
|
-
bridgeFromL1ToL2(
|
|
7
|
+
prepareTokensOnL1(owner: AztecAddress): Promise<L2AmountClaim>;
|
|
8
|
+
bridgeFromL1ToL2(owner: AztecAddress, claimer: AztecAddress): Promise<void>;
|
|
9
9
|
feeJuice: FeeJuiceContract;
|
|
10
10
|
l1FeeJuiceAddress: EthAddress;
|
|
11
11
|
}
|
|
@@ -72,14 +72,14 @@ export declare class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
72
72
|
feeAssetHandlerAddress: EthAddress,
|
|
73
73
|
/** Viem Extended client instance. */
|
|
74
74
|
l1Client: ExtendedViemWalletClient);
|
|
75
|
-
mintTokensOnL1(
|
|
75
|
+
mintTokensOnL1(to?: EthAddress): Promise<void>;
|
|
76
76
|
getL1FeeJuiceBalance(address: EthAddress): Promise<bigint>;
|
|
77
77
|
sendTokensToPortalPublic(bridgeAmount: bigint, l2Address: AztecAddress): Promise<L2AmountClaim>;
|
|
78
78
|
consumeMessageOnAztecAndClaimPrivately(owner: AztecAddress, claimer: AztecAddress, claim: L2AmountClaim): Promise<void>;
|
|
79
79
|
getL2PublicBalanceOf(owner: AztecAddress): Promise<any>;
|
|
80
80
|
expectPublicBalanceOnL2(owner: AztecAddress, expectedBalance: bigint): Promise<void>;
|
|
81
|
-
prepareTokensOnL1(
|
|
82
|
-
bridgeFromL1ToL2(
|
|
81
|
+
prepareTokensOnL1(owner: AztecAddress): Promise<L2AmountClaim>;
|
|
82
|
+
bridgeFromL1ToL2(owner: AztecAddress, claimer: AztecAddress): Promise<void>;
|
|
83
83
|
private advanceL2Block;
|
|
84
84
|
}
|
|
85
85
|
//# sourceMappingURL=gas_portal_test_harness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gas_portal_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/gas_portal_test_harness.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,UAAU,EAEV,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"gas_portal_test_harness.d.ts","source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AAE,MAAM;IAKpE,iBAAiB,CAAC,KAAK,EAAE,YAAY;IAerC,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY;YAQnD,cAAc;CAe7B"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { EthAddress, Fr, L1FeeJuicePortalManager, retryUntil } from '@aztec/aztec.js';
|
|
2
|
-
import { TestERC20Abi } from '@aztec/l1-artifacts/TestERC20Abi';
|
|
3
2
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
4
3
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
5
|
-
import { getContract } from 'viem';
|
|
6
4
|
export class FeeJuicePortalTestingHarnessFactory {
|
|
7
5
|
config;
|
|
8
6
|
constructor(config){
|
|
@@ -55,18 +53,9 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
55
53
|
this.feeJuicePortalManager = new L1FeeJuicePortalManager(this.feeJuicePortalAddress, this.l1FeeJuiceAddress, this.feeAssetHandlerAddress, this.l1Client, this.logger);
|
|
56
54
|
this.l1TokenManager = this.feeJuicePortalManager.getTokenManager();
|
|
57
55
|
}
|
|
58
|
-
async mintTokensOnL1(
|
|
56
|
+
async mintTokensOnL1(to = this.ethAccount) {
|
|
59
57
|
// const balanceBefore = await this.l1TokenManager.getL1TokenBalance(to.toString());
|
|
60
58
|
await this.l1TokenManager.mint(to.toString());
|
|
61
|
-
const feeAssetL1 = getContract({
|
|
62
|
-
address: this.l1FeeJuiceAddress.toString(),
|
|
63
|
-
abi: TestERC20Abi,
|
|
64
|
-
client: this.l1Client
|
|
65
|
-
});
|
|
66
|
-
await feeAssetL1.write.mint([
|
|
67
|
-
to.toString(),
|
|
68
|
-
amount
|
|
69
|
-
]);
|
|
70
59
|
// expect(await this.l1TokenManager.getL1TokenBalance(to.toString())).toEqual(balanceBefore + amount);
|
|
71
60
|
}
|
|
72
61
|
async getL1FeeJuiceBalance(address) {
|
|
@@ -91,8 +80,9 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
91
80
|
const balance = await this.getL2PublicBalanceOf(owner);
|
|
92
81
|
expect(balance).toBe(expectedBalance);
|
|
93
82
|
}
|
|
94
|
-
async prepareTokensOnL1(
|
|
95
|
-
await this.
|
|
83
|
+
async prepareTokensOnL1(owner) {
|
|
84
|
+
const bridgeAmount = await this.l1TokenManager.getMintAmount();
|
|
85
|
+
await this.mintTokensOnL1();
|
|
96
86
|
const claim = await this.sendTokensToPortalPublic(bridgeAmount, owner);
|
|
97
87
|
const isSynced = async ()=>await this.aztecNode.isL1ToL2MessageSynced(Fr.fromHexString(claim.messageHash));
|
|
98
88
|
await retryUntil(isSynced, `message ${claim.messageHash} sync`, 24, 1);
|
|
@@ -101,9 +91,9 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
101
91
|
await this.advanceL2Block();
|
|
102
92
|
return claim;
|
|
103
93
|
}
|
|
104
|
-
async bridgeFromL1ToL2(
|
|
94
|
+
async bridgeFromL1ToL2(owner, claimer) {
|
|
105
95
|
// Prepare the tokens on the L1 side
|
|
106
|
-
const claim = await this.prepareTokensOnL1(
|
|
96
|
+
const claim = await this.prepareTokensOnL1(owner);
|
|
107
97
|
// Consume L1 -> L2 message and claim tokens privately on L2
|
|
108
98
|
await this.consumeMessageOnAztecAndClaimPrivately(owner, claimer, claim);
|
|
109
99
|
}
|
package/dest/spartan/utils.d.ts
CHANGED
|
@@ -3,28 +3,15 @@ import type { Logger } from '@aztec/foundation/log';
|
|
|
3
3
|
import { type AztecNodeAdminConfig } from '@aztec/stdlib/interfaces/client';
|
|
4
4
|
import { ChildProcess } from 'child_process';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
export declare const RPC_SERVICE_NAME = "services/aztec-infra-rpc-aztec-node";
|
|
7
6
|
declare const testConfigSchema: z.ZodObject<{
|
|
8
|
-
NAMESPACE: z.ZodString
|
|
9
|
-
|
|
10
|
-
K8S_CLUSTER: z.ZodString;
|
|
11
|
-
REGION: z.ZodOptional<z.ZodString>;
|
|
12
|
-
PROJECT_ID: z.ZodOptional<z.ZodString>;
|
|
13
|
-
AZTEC_REAL_PROOFS: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
+
NAMESPACE: z.ZodDefault<z.ZodString>;
|
|
8
|
+
REAL_VERIFIER: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodEffects<z.ZodNumber, 0 | 1, number>, boolean, number>, z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, boolean, string>]>>>;
|
|
14
9
|
}, "strip", z.ZodTypeAny, {
|
|
15
10
|
NAMESPACE: string;
|
|
16
|
-
|
|
17
|
-
K8S_CLUSTER: string;
|
|
18
|
-
AZTEC_REAL_PROOFS: boolean;
|
|
19
|
-
REGION?: string | undefined;
|
|
20
|
-
PROJECT_ID?: string | undefined;
|
|
11
|
+
REAL_VERIFIER: boolean;
|
|
21
12
|
}, {
|
|
22
|
-
NAMESPACE
|
|
23
|
-
|
|
24
|
-
L1_ACCOUNT_MNEMONIC?: string | undefined;
|
|
25
|
-
REGION?: string | undefined;
|
|
26
|
-
PROJECT_ID?: string | undefined;
|
|
27
|
-
AZTEC_REAL_PROOFS?: boolean | undefined;
|
|
13
|
+
NAMESPACE?: string | undefined;
|
|
14
|
+
REAL_VERIFIER?: string | number | boolean | undefined;
|
|
28
15
|
}>;
|
|
29
16
|
export type TestConfig = z.infer<typeof testConfigSchema>;
|
|
30
17
|
export declare function setupEnvironment(env: unknown): TestConfig;
|
|
@@ -51,17 +38,22 @@ export declare function startPortForwardForRPC(namespace: string): Promise<{
|
|
|
51
38
|
process: ChildProcess;
|
|
52
39
|
port: number;
|
|
53
40
|
}>;
|
|
41
|
+
export declare function startPortForwardForEthereum(namespace: string): Promise<{
|
|
42
|
+
process: ChildProcess;
|
|
43
|
+
port: number;
|
|
44
|
+
}>;
|
|
54
45
|
export declare function deleteResourceByName({ resource, namespace, name, force, }: {
|
|
55
46
|
resource: string;
|
|
56
47
|
namespace: string;
|
|
57
48
|
name: string;
|
|
58
49
|
force?: boolean;
|
|
59
50
|
}): Promise<string>;
|
|
60
|
-
export declare function deleteResourceByLabel({ resource, namespace, label, timeout, }: {
|
|
51
|
+
export declare function deleteResourceByLabel({ resource, namespace, label, timeout, force, }: {
|
|
61
52
|
resource: string;
|
|
62
53
|
namespace: string;
|
|
63
54
|
label: string;
|
|
64
55
|
timeout?: string;
|
|
56
|
+
force?: boolean;
|
|
65
57
|
}): Promise<string>;
|
|
66
58
|
export declare function waitForResourceByLabel({ resource, label, namespace, condition, timeout, }: {
|
|
67
59
|
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,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/spartan/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,EAAE,KAAK,oBAAoB,EAA8B,MAAM,iCAAiC,CAAC;AAExG,OAAO,EAAE,YAAY,EAAyB,MAAM,eAAe,CAAC;AAGpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,QAAA,MAAM,gBAAgB;;;;;;;;;EAGpB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,CAIzD;AAyBD,wBAAgB,WAAW,WAE1B;AAED;;;;;;GAMG;A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EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,iBAgBf;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,iBAI7F;AAED,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,qBAIpD;AAsBD,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,iBAMlG;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,iBAcpD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAW1C"}
|
package/dest/spartan/utils.js
CHANGED
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
import { createLogger, sleep } from '@aztec/aztec.js';
|
|
2
2
|
import { makeBackoff, retry } from '@aztec/foundation/retry';
|
|
3
|
+
import { schemas } from '@aztec/foundation/schemas';
|
|
3
4
|
import { createAztecNodeAdminClient } from '@aztec/stdlib/interfaces/client';
|
|
4
5
|
import { exec, execSync, spawn } from 'child_process';
|
|
5
6
|
import path from 'path';
|
|
6
7
|
import { promisify } from 'util';
|
|
7
8
|
import { z } from 'zod';
|
|
8
|
-
export const RPC_SERVICE_NAME = 'services/aztec-infra-rpc-aztec-node';
|
|
9
9
|
const execAsync = promisify(exec);
|
|
10
10
|
const logger = createLogger('e2e:k8s-utils');
|
|
11
11
|
const testConfigSchema = z.object({
|
|
12
|
-
NAMESPACE: z.string().
|
|
13
|
-
|
|
14
|
-
K8S_CLUSTER: z.string().min(1, 'K8S_CLUSTER env variable must be set'),
|
|
15
|
-
REGION: z.string().optional(),
|
|
16
|
-
PROJECT_ID: z.string().optional(),
|
|
17
|
-
AZTEC_REAL_PROOFS: z.coerce.boolean().default(false)
|
|
12
|
+
NAMESPACE: z.string().default('scenario'),
|
|
13
|
+
REAL_VERIFIER: schemas.Boolean.optional().default(true)
|
|
18
14
|
});
|
|
19
15
|
export function setupEnvironment(env) {
|
|
20
16
|
const config = testConfigSchema.parse(env);
|
|
21
|
-
|
|
22
|
-
const command = `gcloud container clusters get-credentials ${config.K8S_CLUSTER} --region=${config.REGION} --project=${config.PROJECT_ID}`;
|
|
23
|
-
execSync(command);
|
|
24
|
-
}
|
|
17
|
+
logger.warn(`Loaded env config`, config);
|
|
25
18
|
return config;
|
|
26
19
|
}
|
|
27
20
|
/**
|
|
@@ -139,19 +132,26 @@ export async function startPortForward({ resource, namespace, containerPort, hos
|
|
|
139
132
|
}
|
|
140
133
|
export function startPortForwardForRPC(namespace) {
|
|
141
134
|
return startPortForward({
|
|
142
|
-
resource:
|
|
135
|
+
resource: `services/${namespace}-rpc-aztec-node`,
|
|
143
136
|
namespace,
|
|
144
137
|
containerPort: 8080
|
|
145
138
|
});
|
|
146
139
|
}
|
|
140
|
+
export function startPortForwardForEthereum(namespace) {
|
|
141
|
+
return startPortForward({
|
|
142
|
+
resource: `services/${namespace}-eth-execution`,
|
|
143
|
+
namespace,
|
|
144
|
+
containerPort: 8545
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
147
|
export async function deleteResourceByName({ resource, namespace, name, force = false }) {
|
|
148
148
|
const command = `kubectl delete ${resource} ${name} -n ${namespace} --ignore-not-found=true --wait=true ${force ? '--force' : ''}`;
|
|
149
149
|
logger.info(`command: ${command}`);
|
|
150
150
|
const { stdout } = await execAsync(command);
|
|
151
151
|
return stdout;
|
|
152
152
|
}
|
|
153
|
-
export async function deleteResourceByLabel({ resource, namespace, label, timeout = '5m' }) {
|
|
154
|
-
const command = `kubectl delete ${resource} -l ${label} -n ${namespace} --ignore-not-found=true --wait=true --timeout=${timeout}`;
|
|
153
|
+
export async function deleteResourceByLabel({ resource, namespace, label, timeout = '5m', force = false }) {
|
|
154
|
+
const command = `kubectl delete ${resource} -l ${label} -n ${namespace} --ignore-not-found=true --wait=true --timeout=${timeout} ${force ? '--force' : ''}`;
|
|
155
155
|
logger.info(`command: ${command}`);
|
|
156
156
|
const { stdout } = await execAsync(command);
|
|
157
157
|
return stdout;
|
|
@@ -204,13 +204,13 @@ async function execHelmCommand(args) {
|
|
|
204
204
|
const deleteArgs = {
|
|
205
205
|
resource: 'podchaos',
|
|
206
206
|
namespace: chaosMeshNamespace,
|
|
207
|
-
|
|
207
|
+
label: `app.kubernetes.io/instance=${instanceName}`
|
|
208
208
|
};
|
|
209
209
|
logger.info(`Deleting podchaos resource`);
|
|
210
|
-
await
|
|
210
|
+
await deleteResourceByLabel(deleteArgs).catch((e)=>{
|
|
211
211
|
logger.error(`Error deleting podchaos resource: ${e}`);
|
|
212
212
|
logger.info(`Force deleting podchaos resource`);
|
|
213
|
-
return
|
|
213
|
+
return deleteResourceByLabel({
|
|
214
214
|
...deleteArgs,
|
|
215
215
|
force: true
|
|
216
216
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-canary.a9708bd",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,41 +25,41 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "
|
|
29
|
-
"@aztec/archiver": "
|
|
30
|
-
"@aztec/aztec": "
|
|
31
|
-
"@aztec/aztec-node": "
|
|
32
|
-
"@aztec/aztec.js": "
|
|
33
|
-
"@aztec/bb-prover": "
|
|
34
|
-
"@aztec/blob-lib": "
|
|
35
|
-
"@aztec/blob-sink": "
|
|
36
|
-
"@aztec/bot": "
|
|
37
|
-
"@aztec/cli": "
|
|
38
|
-
"@aztec/constants": "
|
|
39
|
-
"@aztec/entrypoints": "
|
|
40
|
-
"@aztec/epoch-cache": "
|
|
41
|
-
"@aztec/ethereum": "
|
|
42
|
-
"@aztec/foundation": "
|
|
43
|
-
"@aztec/kv-store": "
|
|
44
|
-
"@aztec/l1-artifacts": "
|
|
45
|
-
"@aztec/merkle-tree": "
|
|
46
|
-
"@aztec/node-keystore": "
|
|
47
|
-
"@aztec/noir-contracts.js": "
|
|
48
|
-
"@aztec/noir-noirc_abi": "
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "
|
|
50
|
-
"@aztec/noir-test-contracts.js": "
|
|
51
|
-
"@aztec/p2p": "
|
|
52
|
-
"@aztec/protocol-contracts": "
|
|
53
|
-
"@aztec/prover-client": "
|
|
54
|
-
"@aztec/prover-node": "
|
|
55
|
-
"@aztec/pxe": "
|
|
56
|
-
"@aztec/sequencer-client": "
|
|
57
|
-
"@aztec/simulator": "
|
|
58
|
-
"@aztec/slasher": "
|
|
59
|
-
"@aztec/stdlib": "
|
|
60
|
-
"@aztec/telemetry-client": "
|
|
61
|
-
"@aztec/validator-client": "
|
|
62
|
-
"@aztec/world-state": "
|
|
28
|
+
"@aztec/accounts": "3.0.0-canary.a9708bd",
|
|
29
|
+
"@aztec/archiver": "3.0.0-canary.a9708bd",
|
|
30
|
+
"@aztec/aztec": "3.0.0-canary.a9708bd",
|
|
31
|
+
"@aztec/aztec-node": "3.0.0-canary.a9708bd",
|
|
32
|
+
"@aztec/aztec.js": "3.0.0-canary.a9708bd",
|
|
33
|
+
"@aztec/bb-prover": "3.0.0-canary.a9708bd",
|
|
34
|
+
"@aztec/blob-lib": "3.0.0-canary.a9708bd",
|
|
35
|
+
"@aztec/blob-sink": "3.0.0-canary.a9708bd",
|
|
36
|
+
"@aztec/bot": "3.0.0-canary.a9708bd",
|
|
37
|
+
"@aztec/cli": "3.0.0-canary.a9708bd",
|
|
38
|
+
"@aztec/constants": "3.0.0-canary.a9708bd",
|
|
39
|
+
"@aztec/entrypoints": "3.0.0-canary.a9708bd",
|
|
40
|
+
"@aztec/epoch-cache": "3.0.0-canary.a9708bd",
|
|
41
|
+
"@aztec/ethereum": "3.0.0-canary.a9708bd",
|
|
42
|
+
"@aztec/foundation": "3.0.0-canary.a9708bd",
|
|
43
|
+
"@aztec/kv-store": "3.0.0-canary.a9708bd",
|
|
44
|
+
"@aztec/l1-artifacts": "3.0.0-canary.a9708bd",
|
|
45
|
+
"@aztec/merkle-tree": "3.0.0-canary.a9708bd",
|
|
46
|
+
"@aztec/node-keystore": "3.0.0-canary.a9708bd",
|
|
47
|
+
"@aztec/noir-contracts.js": "3.0.0-canary.a9708bd",
|
|
48
|
+
"@aztec/noir-noirc_abi": "3.0.0-canary.a9708bd",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-canary.a9708bd",
|
|
50
|
+
"@aztec/noir-test-contracts.js": "3.0.0-canary.a9708bd",
|
|
51
|
+
"@aztec/p2p": "3.0.0-canary.a9708bd",
|
|
52
|
+
"@aztec/protocol-contracts": "3.0.0-canary.a9708bd",
|
|
53
|
+
"@aztec/prover-client": "3.0.0-canary.a9708bd",
|
|
54
|
+
"@aztec/prover-node": "3.0.0-canary.a9708bd",
|
|
55
|
+
"@aztec/pxe": "3.0.0-canary.a9708bd",
|
|
56
|
+
"@aztec/sequencer-client": "3.0.0-canary.a9708bd",
|
|
57
|
+
"@aztec/simulator": "3.0.0-canary.a9708bd",
|
|
58
|
+
"@aztec/slasher": "3.0.0-canary.a9708bd",
|
|
59
|
+
"@aztec/stdlib": "3.0.0-canary.a9708bd",
|
|
60
|
+
"@aztec/telemetry-client": "3.0.0-canary.a9708bd",
|
|
61
|
+
"@aztec/validator-client": "3.0.0-canary.a9708bd",
|
|
62
|
+
"@aztec/world-state": "3.0.0-canary.a9708bd",
|
|
63
63
|
"@iarna/toml": "^2.2.5",
|
|
64
64
|
"@jest/globals": "^30.0.0",
|
|
65
65
|
"@noble/curves": "=1.0.0",
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
createLogger,
|
|
17
17
|
} from '@aztec/aztec.js';
|
|
18
18
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
19
|
-
import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
|
|
20
19
|
import { type DeployL1ContractsArgs, RollupContract, createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
|
|
21
20
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
22
21
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
@@ -155,10 +154,13 @@ export class ClientFlowsBenchmark {
|
|
|
155
154
|
await this.snapshotManager.teardown();
|
|
156
155
|
}
|
|
157
156
|
|
|
158
|
-
async mintAndBridgeFeeJuice(address: AztecAddress
|
|
159
|
-
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(
|
|
157
|
+
async mintAndBridgeFeeJuice(address: AztecAddress) {
|
|
158
|
+
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(address);
|
|
160
159
|
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
161
|
-
await this.feeJuiceContract.methods
|
|
160
|
+
await this.feeJuiceContract.methods
|
|
161
|
+
.claim(address, claim.claimAmount, secret, index)
|
|
162
|
+
.send({ from: this.adminAddress })
|
|
163
|
+
.wait();
|
|
162
164
|
}
|
|
163
165
|
|
|
164
166
|
/** Admin mints bananaCoin tokens privately to the target address and redeems them. */
|
|
@@ -304,11 +306,7 @@ export class ClientFlowsBenchmark {
|
|
|
304
306
|
|
|
305
307
|
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
306
308
|
|
|
307
|
-
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(
|
|
308
|
-
FEE_FUNDING_FOR_TESTER_ACCOUNT,
|
|
309
|
-
bananaFPC.address,
|
|
310
|
-
this.adminAddress,
|
|
311
|
-
);
|
|
309
|
+
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.adminAddress);
|
|
312
310
|
|
|
313
311
|
return { bananaFPCAddress: bananaFPC.address };
|
|
314
312
|
},
|
|
@@ -361,10 +359,7 @@ export class ClientFlowsBenchmark {
|
|
|
361
359
|
const benchysAccountManager = await this.createBenchmarkingAccountManager(this.pxe, accountType);
|
|
362
360
|
const benchysWallet = await benchysAccountManager.getWallet();
|
|
363
361
|
const benchysAddress = benchysAccountManager.getAddress();
|
|
364
|
-
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(
|
|
365
|
-
FEE_FUNDING_FOR_TESTER_ACCOUNT,
|
|
366
|
-
benchysAddress,
|
|
367
|
-
);
|
|
362
|
+
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
|
|
368
363
|
const paymentMethod = new FeeJuicePaymentMethodWithClaim(benchysWallet, claim);
|
|
369
364
|
await benchysAccountManager.deploy({ fee: { paymentMethod } }).wait();
|
|
370
365
|
// Register benchy on the user's PXE, where we're going to be interacting from
|
|
@@ -409,10 +404,7 @@ export class ClientFlowsBenchmark {
|
|
|
409
404
|
}
|
|
410
405
|
|
|
411
406
|
public async getBridgedFeeJuicePaymentMethodForWallet(wallet: Wallet) {
|
|
412
|
-
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(
|
|
413
|
-
FEE_FUNDING_FOR_TESTER_ACCOUNT,
|
|
414
|
-
wallet.getAddress(),
|
|
415
|
-
);
|
|
407
|
+
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(wallet.getAddress());
|
|
416
408
|
return new FeeJuicePaymentMethodWithClaim(wallet, claim);
|
|
417
409
|
}
|
|
418
410
|
|
|
@@ -92,7 +92,7 @@ export class EpochsTestContext {
|
|
|
92
92
|
: DEFAULT_L1_BLOCK_TIME;
|
|
93
93
|
const ethereumSlotDuration = opts.ethereumSlotDuration ?? envEthereumSlotDuration;
|
|
94
94
|
const aztecSlotDuration = opts.aztecSlotDuration ?? ethereumSlotDuration * 2;
|
|
95
|
-
const aztecEpochDuration = opts.aztecEpochDuration ??
|
|
95
|
+
const aztecEpochDuration = opts.aztecEpochDuration ?? 6;
|
|
96
96
|
const aztecProofSubmissionEpochs = opts.aztecProofSubmissionEpochs ?? 1;
|
|
97
97
|
return { ethereumSlotDuration, aztecSlotDuration, aztecEpochDuration, aztecProofSubmissionEpochs };
|
|
98
98
|
}
|
|
@@ -278,7 +278,12 @@ export class EpochsTestContext {
|
|
|
278
278
|
public async waitUntilEpochStarts(epoch: number) {
|
|
279
279
|
const [start] = getTimestampRangeForEpoch(BigInt(epoch), this.constants);
|
|
280
280
|
this.logger.info(`Waiting until L1 timestamp ${start} is reached as the start of epoch ${epoch}`);
|
|
281
|
-
await waitUntilL1Timestamp(
|
|
281
|
+
await waitUntilL1Timestamp(
|
|
282
|
+
this.l1Client,
|
|
283
|
+
start - BigInt(this.L1_BLOCK_TIME_IN_S),
|
|
284
|
+
undefined,
|
|
285
|
+
30 * this.epochDuration,
|
|
286
|
+
);
|
|
282
287
|
return start;
|
|
283
288
|
}
|
|
284
289
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getSchnorrAccount } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { Fr, type Logger, type PXE, sleep } from '@aztec/aztec.js';
|
|
3
|
-
import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
|
|
4
3
|
import { Fq } from '@aztec/foundation/fields';
|
|
5
4
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
5
|
|
|
@@ -64,11 +63,13 @@ describe('e2e_fees bridging_race', () => {
|
|
|
64
63
|
// Waiting for the archiver to sync the message _before_ waiting for the mandatory 2 L2 blocks to pass fixed it
|
|
65
64
|
// This was added everywhere we wait for two blocks, which is spread across three different places in the codebase
|
|
66
65
|
// Yes, we need to REFACTOR it at some point
|
|
67
|
-
const
|
|
68
|
-
const claim = await t.feeJuiceBridgeTestHarness.prepareTokensOnL1(amount, bobsAddress);
|
|
66
|
+
const claim = await t.feeJuiceBridgeTestHarness.prepareTokensOnL1(bobsAddress);
|
|
69
67
|
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
70
|
-
await t.feeJuiceContract.methods
|
|
68
|
+
await t.feeJuiceContract.methods
|
|
69
|
+
.claim(bobsAddress, claim.claimAmount, secret, index)
|
|
70
|
+
.send({ from: bobsAddress })
|
|
71
|
+
.wait();
|
|
71
72
|
const [balance] = await t.getGasBalanceFn(bobsAddress);
|
|
72
|
-
expect(balance).toEqual(
|
|
73
|
+
expect(balance).toEqual(claim.claimAmount);
|
|
73
74
|
});
|
|
74
75
|
});
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
sleep,
|
|
10
10
|
} from '@aztec/aztec.js';
|
|
11
11
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
12
|
-
import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
|
|
13
12
|
import { type DeployL1ContractsArgs, RollupContract, createExtendedL1Client } from '@aztec/ethereum';
|
|
14
13
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
15
14
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
@@ -158,10 +157,13 @@ export class FeesTest {
|
|
|
158
157
|
return { sequencerBlockRewards, proverBlockRewards };
|
|
159
158
|
}
|
|
160
159
|
|
|
161
|
-
async mintAndBridgeFeeJuice(minter: AztecAddress, recipient: AztecAddress
|
|
162
|
-
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(
|
|
160
|
+
async mintAndBridgeFeeJuice(minter: AztecAddress, recipient: AztecAddress) {
|
|
161
|
+
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(recipient);
|
|
163
162
|
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
164
|
-
await this.feeJuiceContract.methods
|
|
163
|
+
await this.feeJuiceContract.methods
|
|
164
|
+
.claim(recipient, claim.claimAmount, secret, index)
|
|
165
|
+
.send({ from: minter })
|
|
166
|
+
.wait();
|
|
165
167
|
}
|
|
166
168
|
|
|
167
169
|
/** Alice mints bananaCoin tokens privately to the target address and redeems them. */
|
|
@@ -287,11 +289,7 @@ export class FeesTest {
|
|
|
287
289
|
|
|
288
290
|
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
289
291
|
|
|
290
|
-
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(
|
|
291
|
-
FEE_FUNDING_FOR_TESTER_ACCOUNT,
|
|
292
|
-
bananaFPC.address,
|
|
293
|
-
this.aliceAddress,
|
|
294
|
-
);
|
|
292
|
+
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.aliceAddress);
|
|
295
293
|
|
|
296
294
|
return {
|
|
297
295
|
bananaFPCAddress: bananaFPC.address,
|
|
@@ -26,7 +26,7 @@ import type { BlobSinkServer } from '@aztec/blob-sink/server';
|
|
|
26
26
|
import type { DeployL1ContractsReturnType } from '@aztec/ethereum';
|
|
27
27
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
28
28
|
import { SecretValue } from '@aztec/foundation/config';
|
|
29
|
-
import {
|
|
29
|
+
import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
|
|
30
30
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
31
31
|
import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
|
|
32
32
|
import type { PXEService } from '@aztec/pxe/server';
|
|
@@ -289,7 +289,7 @@ export class FullProverTest {
|
|
|
289
289
|
this.proverAddress = EthAddress.fromString(proverNodeSenderAddress);
|
|
290
290
|
|
|
291
291
|
this.logger.verbose(`Funding prover node at ${proverNodeSenderAddress}`);
|
|
292
|
-
await this.
|
|
292
|
+
await this.mintFeeJuice(proverNodeSenderAddress);
|
|
293
293
|
|
|
294
294
|
this.logger.verbose('Starting prover node');
|
|
295
295
|
const proverConfig: ProverNodeConfig = {
|
|
@@ -328,11 +328,12 @@ export class FullProverTest {
|
|
|
328
328
|
return this;
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
private async
|
|
332
|
-
const
|
|
331
|
+
private async mintFeeJuice(recipient: Hex) {
|
|
332
|
+
const handlerAddress = this.context.deployL1ContractsValues.l1ContractAddresses.feeAssetHandlerAddress!;
|
|
333
|
+
this.logger.verbose(`Minting fee juice to ${recipient} using handler at ${handlerAddress}`);
|
|
333
334
|
const client = this.context.deployL1ContractsValues.l1Client;
|
|
334
|
-
const
|
|
335
|
-
const hash = await
|
|
335
|
+
const handler = getContract({ abi: FeeAssetHandlerAbi, address: handlerAddress.toString(), client });
|
|
336
|
+
const hash = await handler.write.mint([recipient]);
|
|
336
337
|
await this.context.deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash });
|
|
337
338
|
}
|
|
338
339
|
|
|
@@ -21,8 +21,6 @@ import { type BlobSinkServer, createBlobSinkServer } from '@aztec/blob-sink/serv
|
|
|
21
21
|
import {
|
|
22
22
|
type DeployL1ContractsArgs,
|
|
23
23
|
type DeployL1ContractsReturnType,
|
|
24
|
-
FeeAssetArtifact,
|
|
25
|
-
RollupContract,
|
|
26
24
|
createExtendedL1Client,
|
|
27
25
|
deployMulticall3,
|
|
28
26
|
getL1ContractsConfigEnvVars,
|
|
@@ -49,7 +47,7 @@ import fs from 'fs/promises';
|
|
|
49
47
|
import getPort from 'get-port';
|
|
50
48
|
import { tmpdir } from 'os';
|
|
51
49
|
import path, { join } from 'path';
|
|
52
|
-
import {
|
|
50
|
+
import type { Hex } from 'viem';
|
|
53
51
|
import { mnemonicToAccount } from 'viem/accounts';
|
|
54
52
|
import { foundry } from 'viem/chains';
|
|
55
53
|
|
|
@@ -383,31 +381,6 @@ async function setupFromFresh(
|
|
|
383
381
|
aztecNodeConfig.rollupVersion = deployL1ContractsValues.rollupVersion;
|
|
384
382
|
aztecNodeConfig.l1PublishRetryIntervalMS = 100;
|
|
385
383
|
|
|
386
|
-
if (opts.fundRewardDistributor) {
|
|
387
|
-
// Mints block rewards for 10000 blocks to the rewardDistributor contract
|
|
388
|
-
|
|
389
|
-
const rollup = new RollupContract(
|
|
390
|
-
deployL1ContractsValues.l1Client,
|
|
391
|
-
deployL1ContractsValues.l1ContractAddresses.rollupAddress,
|
|
392
|
-
);
|
|
393
|
-
|
|
394
|
-
const blockReward = await rollup.getBlockReward();
|
|
395
|
-
const mintAmount = 10_000n * (blockReward as bigint);
|
|
396
|
-
|
|
397
|
-
const feeJuice = getContract({
|
|
398
|
-
address: deployL1ContractsValues.l1ContractAddresses.feeJuiceAddress.toString(),
|
|
399
|
-
abi: FeeAssetArtifact.contractAbi,
|
|
400
|
-
client: deployL1ContractsValues.l1Client,
|
|
401
|
-
});
|
|
402
|
-
|
|
403
|
-
const rewardDistributorMintTxHash = await feeJuice.write.mint(
|
|
404
|
-
[deployL1ContractsValues.l1ContractAddresses.rewardDistributorAddress.toString(), mintAmount],
|
|
405
|
-
{} as any,
|
|
406
|
-
);
|
|
407
|
-
await deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash: rewardDistributorMintTxHash });
|
|
408
|
-
logger.info(`Funding rewardDistributor in ${rewardDistributorMintTxHash}`);
|
|
409
|
-
}
|
|
410
|
-
|
|
411
384
|
const dateProvider = new TestDateProvider();
|
|
412
385
|
|
|
413
386
|
const watcher = new AnvilTestWatcher(
|
|
@@ -12,17 +12,14 @@ import {
|
|
|
12
12
|
retryUntil,
|
|
13
13
|
} from '@aztec/aztec.js';
|
|
14
14
|
import type { ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
15
|
-
import { TestERC20Abi } from '@aztec/l1-artifacts/TestERC20Abi';
|
|
16
15
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
17
16
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
18
17
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
19
18
|
|
|
20
|
-
import { getContract } from 'viem';
|
|
21
|
-
|
|
22
19
|
export interface IGasBridgingTestHarness {
|
|
23
20
|
getL1FeeJuiceBalance(address: EthAddress): Promise<bigint>;
|
|
24
|
-
prepareTokensOnL1(
|
|
25
|
-
bridgeFromL1ToL2(
|
|
21
|
+
prepareTokensOnL1(owner: AztecAddress): Promise<L2AmountClaim>;
|
|
22
|
+
bridgeFromL1ToL2(owner: AztecAddress, claimer: AztecAddress): Promise<void>;
|
|
26
23
|
feeJuice: FeeJuiceContract;
|
|
27
24
|
l1FeeJuiceAddress: EthAddress;
|
|
28
25
|
}
|
|
@@ -119,16 +116,9 @@ export class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
119
116
|
this.l1TokenManager = this.feeJuicePortalManager.getTokenManager();
|
|
120
117
|
}
|
|
121
118
|
|
|
122
|
-
async mintTokensOnL1(
|
|
119
|
+
async mintTokensOnL1(to: EthAddress = this.ethAccount) {
|
|
123
120
|
// const balanceBefore = await this.l1TokenManager.getL1TokenBalance(to.toString());
|
|
124
121
|
await this.l1TokenManager.mint(to.toString());
|
|
125
|
-
const feeAssetL1 = getContract({
|
|
126
|
-
address: this.l1FeeJuiceAddress.toString(),
|
|
127
|
-
abi: TestERC20Abi,
|
|
128
|
-
client: this.l1Client,
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
await feeAssetL1.write.mint([to.toString(), amount]);
|
|
132
122
|
|
|
133
123
|
// expect(await this.l1TokenManager.getL1TokenBalance(to.toString())).toEqual(balanceBefore + amount);
|
|
134
124
|
}
|
|
@@ -156,8 +146,9 @@ export class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
156
146
|
expect(balance).toBe(expectedBalance);
|
|
157
147
|
}
|
|
158
148
|
|
|
159
|
-
async prepareTokensOnL1(
|
|
160
|
-
await this.
|
|
149
|
+
async prepareTokensOnL1(owner: AztecAddress) {
|
|
150
|
+
const bridgeAmount = await this.l1TokenManager.getMintAmount();
|
|
151
|
+
await this.mintTokensOnL1();
|
|
161
152
|
const claim = await this.sendTokensToPortalPublic(bridgeAmount, owner);
|
|
162
153
|
|
|
163
154
|
const isSynced = async () => await this.aztecNode.isL1ToL2MessageSynced(Fr.fromHexString(claim.messageHash));
|
|
@@ -170,9 +161,9 @@ export class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
170
161
|
return claim;
|
|
171
162
|
}
|
|
172
163
|
|
|
173
|
-
async bridgeFromL1ToL2(
|
|
164
|
+
async bridgeFromL1ToL2(owner: AztecAddress, claimer: AztecAddress) {
|
|
174
165
|
// Prepare the tokens on the L1 side
|
|
175
|
-
const claim = await this.prepareTokensOnL1(
|
|
166
|
+
const claim = await this.prepareTokensOnL1(owner);
|
|
176
167
|
|
|
177
168
|
// Consume L1 -> L2 message and claim tokens privately on L2
|
|
178
169
|
await this.consumeMessageOnAztecAndClaimPrivately(owner, claimer, claim);
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
The flow is as follows:
|
|
2
|
+
|
|
3
|
+
1. Install/start KIND locally
|
|
4
|
+
2. Bootstrap (to build an aztec image)
|
|
5
|
+
3. Load image into kind
|
|
6
|
+
4. Deploy networks
|
|
7
|
+
5. Run tests in `yarn-project/end-to-end/src/spartan`
|
|
8
|
+
|
|
9
|
+
# Setup KIND
|
|
10
|
+
|
|
11
|
+
KIND is a kubernetes cluster that runs locally out of docker containers.
|
|
12
|
+
|
|
13
|
+
You can just
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
spartan/bootstrap.sh kind
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
You only need to do that once. If you do it again, it will destroy the cluster and recreate it (which you almost never need to do).
|
|
20
|
+
|
|
21
|
+
Now you’ll likely want some visibility into your cluster. You can
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
spartan/scripts/create_k8s_dashboard.sh
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
And after ~30 seconds or so you can
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
spartan/scripts/forward_k8s_dashboard.sh
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
That will run a port forward to your port `8443` . If you’re running in a remote environment (e.g. the mainframe), you’ll need to subsequently forward that back to your local machine. Cursor/VSCode have built in port forwarding (cmd/ctrl shift P, “forward”)
|
|
34
|
+
|
|
35
|
+
Open the forwarded page, and copy/paste the token that was generated when you forwarded the dashboard.
|
|
36
|
+
|
|
37
|
+
# Build an aztecprotocol:aztec image
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
./bootstrap.sh
|
|
41
|
+
export AZTEC_DOCKER_IMAGE="aztecprotocol/aztec:$(docker images "aztecprotocol/aztec" --format json | \
|
|
42
|
+
jq -r 'select(.Tag != "latest") | .Tag' | \
|
|
43
|
+
head -1)"
|
|
44
|
+
kind load docker-image $AZTEC_DOCKER_IMAGE
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If you just changed typescript, you can (after the initial bootstrap)
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
./yarn-project/bootstrap.sh
|
|
51
|
+
./release-image/bootstrap.sh
|
|
52
|
+
export AZTEC_DOCKER_IMAGE="aztecprotocol/aztec:$(docker images "aztecprotocol/aztec" --format json | \
|
|
53
|
+
jq -r 'select(.Tag != "latest") | .Tag' | \
|
|
54
|
+
head -1)"
|
|
55
|
+
kind load docker-image $AZTEC_DOCKER_IMAGE
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The export is important there. The `AZTEC_DOCKER_IMAGE` env var is used as both:
|
|
59
|
+
|
|
60
|
+
- the container that runs the rollup contract deployment
|
|
61
|
+
- the containers for the aztec infrastructure (validators, provers, etc)
|
|
62
|
+
|
|
63
|
+
# Deploy stuff
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
./spartan/bootstrap.sh network_deploy scenario.local.env
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
That will take 1-3 minutes. But at the end you should have everything you need.
|
|
70
|
+
|
|
71
|
+
You can (`k` is just an alias over `kubectl`)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
❯ k get pods -n scenario
|
|
75
|
+
NAME READY STATUS RESTARTS AGE
|
|
76
|
+
deploy-rollup-contracts-2025-08-31-1511-w2dlb 0/1 Completed 0 2m34s
|
|
77
|
+
scenario-eth-beacon-0 1/1 Running 0 39m
|
|
78
|
+
scenario-eth-execution-0 1/1 Running 0 39m
|
|
79
|
+
scenario-eth-validator-0 1/1 Running 0 39m
|
|
80
|
+
scenario-p2p-bootstrap-node-5cbf9658b9-6vd9b 1/1 Running 0 20m
|
|
81
|
+
scenario-prover-agent-59bd96899d-46k5s 1/1 Running 0 116s
|
|
82
|
+
scenario-prover-agent-59bd96899d-vzvkd 1/1 Running 0 116s
|
|
83
|
+
scenario-prover-broker-0 1/1 Running 0 116s
|
|
84
|
+
scenario-prover-node-0 1/1 Running 0 116s
|
|
85
|
+
scenario-rpc-aztec-node-0 1/1 Running 0 116s
|
|
86
|
+
scenario-validator-0 1/1 Running 0 116s
|
|
87
|
+
scenario-validator-1 1/1 Running 0 116s
|
|
88
|
+
scenario-validator-2 1/1 Running 0 116s
|
|
89
|
+
scenario-validator-3 1/1 Running 0 116s
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
For example, you can forward back the ethereum node with
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
k port-forward -n scenario services/eth-devnet-eth-execution 8545:8545
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
And then do whatever you like with it.
|
|
99
|
+
|
|
100
|
+
# Run tests
|
|
101
|
+
|
|
102
|
+
With the cluster running, you can now easily run tests.
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# run one
|
|
106
|
+
./spartan/bootstrap.sh single_test scenario.local.env spartan/smoke.test.ts
|
|
107
|
+
|
|
108
|
+
# run all (serially)
|
|
109
|
+
./spartan/bootstrap.sh network_tests scenario.local.env
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Right now, I recommend running the smoke test first, always, as it waits for the committee to exist.
|
|
113
|
+
|
|
114
|
+
# Teardown
|
|
115
|
+
|
|
116
|
+
You can just `k delete namespace scenario`. That will destroy everything in your kind cluster. To destroy the associated terraform state that was stored locally, just `./spartan/terraform/purge_local_state.sh`.
|
package/src/spartan/utils.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { createLogger, sleep } from '@aztec/aztec.js';
|
|
|
2
2
|
import type { RollupCheatCodes } from '@aztec/aztec/testing';
|
|
3
3
|
import type { Logger } from '@aztec/foundation/log';
|
|
4
4
|
import { makeBackoff, retry } from '@aztec/foundation/retry';
|
|
5
|
+
import { schemas } from '@aztec/foundation/schemas';
|
|
5
6
|
import { type AztecNodeAdminConfig, createAztecNodeAdminClient } from '@aztec/stdlib/interfaces/client';
|
|
6
7
|
|
|
7
8
|
import { ChildProcess, exec, execSync, spawn } from 'child_process';
|
|
@@ -9,30 +10,20 @@ import path from 'path';
|
|
|
9
10
|
import { promisify } from 'util';
|
|
10
11
|
import { z } from 'zod';
|
|
11
12
|
|
|
12
|
-
export const RPC_SERVICE_NAME = 'services/aztec-infra-rpc-aztec-node';
|
|
13
|
-
|
|
14
13
|
const execAsync = promisify(exec);
|
|
15
14
|
|
|
16
15
|
const logger = createLogger('e2e:k8s-utils');
|
|
17
16
|
|
|
18
17
|
const testConfigSchema = z.object({
|
|
19
|
-
NAMESPACE: z.string().
|
|
20
|
-
|
|
21
|
-
K8S_CLUSTER: z.string().min(1, 'K8S_CLUSTER env variable must be set'),
|
|
22
|
-
REGION: z.string().optional(),
|
|
23
|
-
PROJECT_ID: z.string().optional(),
|
|
24
|
-
AZTEC_REAL_PROOFS: z.coerce.boolean().default(false),
|
|
18
|
+
NAMESPACE: z.string().default('scenario'),
|
|
19
|
+
REAL_VERIFIER: schemas.Boolean.optional().default(true),
|
|
25
20
|
});
|
|
26
21
|
|
|
27
22
|
export type TestConfig = z.infer<typeof testConfigSchema>;
|
|
28
23
|
|
|
29
24
|
export function setupEnvironment(env: unknown): TestConfig {
|
|
30
25
|
const config = testConfigSchema.parse(env);
|
|
31
|
-
|
|
32
|
-
if (config.K8S_CLUSTER !== 'kind') {
|
|
33
|
-
const command = `gcloud container clusters get-credentials ${config.K8S_CLUSTER} --region=${config.REGION} --project=${config.PROJECT_ID}`;
|
|
34
|
-
execSync(command);
|
|
35
|
-
}
|
|
26
|
+
logger.warn(`Loaded env config`, config);
|
|
36
27
|
return config;
|
|
37
28
|
}
|
|
38
29
|
|
|
@@ -158,12 +149,20 @@ export async function startPortForward({
|
|
|
158
149
|
|
|
159
150
|
export function startPortForwardForRPC(namespace: string) {
|
|
160
151
|
return startPortForward({
|
|
161
|
-
resource:
|
|
152
|
+
resource: `services/${namespace}-rpc-aztec-node`,
|
|
162
153
|
namespace,
|
|
163
154
|
containerPort: 8080,
|
|
164
155
|
});
|
|
165
156
|
}
|
|
166
157
|
|
|
158
|
+
export function startPortForwardForEthereum(namespace: string) {
|
|
159
|
+
return startPortForward({
|
|
160
|
+
resource: `services/${namespace}-eth-execution`,
|
|
161
|
+
namespace,
|
|
162
|
+
containerPort: 8545,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
167
166
|
export async function deleteResourceByName({
|
|
168
167
|
resource,
|
|
169
168
|
namespace,
|
|
@@ -188,13 +187,17 @@ export async function deleteResourceByLabel({
|
|
|
188
187
|
namespace,
|
|
189
188
|
label,
|
|
190
189
|
timeout = '5m',
|
|
190
|
+
force = false,
|
|
191
191
|
}: {
|
|
192
192
|
resource: string;
|
|
193
193
|
namespace: string;
|
|
194
194
|
label: string;
|
|
195
195
|
timeout?: string;
|
|
196
|
+
force?: boolean;
|
|
196
197
|
}) {
|
|
197
|
-
const command = `kubectl delete ${resource} -l ${label} -n ${namespace} --ignore-not-found=true --wait=true --timeout=${timeout}
|
|
198
|
+
const command = `kubectl delete ${resource} -l ${label} -n ${namespace} --ignore-not-found=true --wait=true --timeout=${timeout} ${
|
|
199
|
+
force ? '--force' : ''
|
|
200
|
+
}`;
|
|
198
201
|
logger.info(`command: ${command}`);
|
|
199
202
|
const { stdout } = await execAsync(command);
|
|
200
203
|
return stdout;
|
|
@@ -306,13 +309,13 @@ export async function installChaosMeshChart({
|
|
|
306
309
|
const deleteArgs = {
|
|
307
310
|
resource: 'podchaos',
|
|
308
311
|
namespace: chaosMeshNamespace,
|
|
309
|
-
|
|
312
|
+
label: `app.kubernetes.io/instance=${instanceName}`,
|
|
310
313
|
};
|
|
311
314
|
logger.info(`Deleting podchaos resource`);
|
|
312
|
-
await
|
|
315
|
+
await deleteResourceByLabel(deleteArgs).catch(e => {
|
|
313
316
|
logger.error(`Error deleting podchaos resource: ${e}`);
|
|
314
317
|
logger.info(`Force deleting podchaos resource`);
|
|
315
|
-
return
|
|
318
|
+
return deleteResourceByLabel({ ...deleteArgs, force: true });
|
|
316
319
|
});
|
|
317
320
|
}
|
|
318
321
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write_json.d.ts","sourceRoot":"","sources":["../../src/integration_l1_publisher/write_json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAOpD;;;GAGG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,EAAE,EAAE,EACnB,KAAK,EAAE,IAAI,EAAE,EACb,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,YAAY,EAC9B,eAAe,EAAE,KAAK,MAAM,EAAE,GAC7B,OAAO,CAAC,IAAI,CAAC,CAqDf"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|