@aztec/end-to-end 1.0.0-nightly.20250616 → 1.0.0-nightly.20250618
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_epochs/epochs_test.d.ts +7 -2
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +21 -3
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +2 -0
- package/dest/e2e_p2p/shared.d.ts +5 -1
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +10 -5
- package/dest/{e2e_prover → fixtures}/e2e_prover_test.d.ts +1 -1
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -0
- package/dest/{e2e_prover → fixtures}/e2e_prover_test.js +6 -5
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +7 -2
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +4 -3
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +13 -4
- package/dest/fixtures/utils.d.ts +2 -3
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +20 -13
- package/package.json +39 -37
- package/src/e2e_epochs/epochs_test.ts +22 -5
- package/src/e2e_p2p/p2p_network.ts +2 -0
- package/src/e2e_p2p/shared.ts +18 -6
- package/src/{e2e_prover → fixtures}/e2e_prover_test.ts +7 -6
- package/src/fixtures/l1_to_l2_messaging.ts +11 -6
- package/src/fixtures/setup_p2p_test.ts +3 -2
- package/src/fixtures/snapshot_manager.ts +12 -2
- package/src/fixtures/utils.ts +24 -19
- package/dest/e2e_prover/e2e_prover_test.d.ts.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
2
2
|
import { Fr, type Logger, type Wallet } from '@aztec/aztec.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
4
4
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
5
5
|
import { ChainMonitor, type Delayer } from '@aztec/ethereum/test';
|
|
6
6
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
@@ -21,7 +21,7 @@ export type EpochsTestOpts = Partial<Pick<SetupOptions, 'startProverNode' | 'azt
|
|
|
21
21
|
*/
|
|
22
22
|
export declare class EpochsTestContext {
|
|
23
23
|
context: EndToEndContext;
|
|
24
|
-
l1Client:
|
|
24
|
+
l1Client: ExtendedViemWalletClient;
|
|
25
25
|
rollup: RollupContract;
|
|
26
26
|
constants: L1RollupConstants;
|
|
27
27
|
logger: Logger;
|
|
@@ -61,6 +61,11 @@ export declare class EpochsTestContext {
|
|
|
61
61
|
waitForNodeToSync(blockNumber: number, type: 'proven' | 'finalised' | 'historic'): Promise<void>;
|
|
62
62
|
/** Registers the SpamContract on the given wallet. */
|
|
63
63
|
registerSpamContract(wallet: Wallet, salt?: Fr): Promise<SpamContract>;
|
|
64
|
+
/** Creates an L1 client using a fresh account with funds from anvil, with a tx delayer already set up. */
|
|
65
|
+
createL1Client(): Promise<{
|
|
66
|
+
client: ExtendedViemWalletClient;
|
|
67
|
+
delayer: Delayer;
|
|
68
|
+
}>;
|
|
64
69
|
/** Verifies whether the given block number is found on the aztec node. */
|
|
65
70
|
verifyHistoricBlock(blockNumber: L2BlockNumber, expectedSuccess: boolean): Promise<void>;
|
|
66
71
|
}
|
|
@@ -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,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,EAAE,EACF,KAAK,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oB7F,sDAAsD;IACzC,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,KAAU;IAYhE,0GAA0G;IAC7F,cAAc;;;;IAa3B,0EAA0E;IAC7D,mBAAmB,CAAC,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO;CAUtF"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AztecNodeService } from '@aztec/aztec-node';
|
|
2
2
|
import { Fr, MerkleTreeId, getContractInstanceFromDeployParams, getTimestampRangeForEpoch, retryUntil, sleep } from '@aztec/aztec.js';
|
|
3
|
+
import { createExtendedL1Client } from '@aztec/ethereum';
|
|
3
4
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
4
|
-
import { ChainMonitor, waitUntilL1Timestamp } from '@aztec/ethereum/test';
|
|
5
|
+
import { ChainMonitor, waitUntilL1Timestamp, withDelayer } from '@aztec/ethereum/test';
|
|
6
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
5
7
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
6
8
|
import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
7
9
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
@@ -9,6 +11,7 @@ import { getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
|
9
11
|
import { getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
10
12
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
11
13
|
import { join } from 'path';
|
|
14
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
12
15
|
import { createAndSyncProverNode, getPrivateKeyFromIndex, setup } from '../fixtures/utils.js';
|
|
13
16
|
export const WORLD_STATE_BLOCK_HISTORY = 2;
|
|
14
17
|
export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
|
|
@@ -66,6 +69,7 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
66
69
|
aztecSlotDuration,
|
|
67
70
|
ethereumSlotDuration,
|
|
68
71
|
aztecProofSubmissionWindow,
|
|
72
|
+
aztecTargetCommitteeSize: opts.initialValidators?.length ?? 0,
|
|
69
73
|
minTxsPerBlock: 0,
|
|
70
74
|
realProofs: false,
|
|
71
75
|
startProverNode: true,
|
|
@@ -141,7 +145,7 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
141
145
|
return this.createNode({
|
|
142
146
|
...opts,
|
|
143
147
|
disableValidator: false,
|
|
144
|
-
validatorPrivateKeys: privateKeys
|
|
148
|
+
validatorPrivateKeys: new SecretValue(privateKeys)
|
|
145
149
|
});
|
|
146
150
|
}
|
|
147
151
|
async createNode(opts = {}) {
|
|
@@ -156,7 +160,7 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
156
160
|
const node = await withLogNameSuffix(suffix, ()=>AztecNodeService.createAndSync({
|
|
157
161
|
...resolvedConfig,
|
|
158
162
|
dataDirectory: join(this.context.config.dataDirectory, randomBytes(8).toString('hex')),
|
|
159
|
-
validatorPrivateKeys: opts.validatorPrivateKeys,
|
|
163
|
+
validatorPrivateKeys: opts.validatorPrivateKeys ?? new SecretValue([]),
|
|
160
164
|
p2pEnabled,
|
|
161
165
|
p2pIp
|
|
162
166
|
}, {
|
|
@@ -234,6 +238,20 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
234
238
|
});
|
|
235
239
|
return SpamContract.at(instance.address, wallet);
|
|
236
240
|
}
|
|
241
|
+
/** Creates an L1 client using a fresh account with funds from anvil, with a tx delayer already set up. */ async createL1Client() {
|
|
242
|
+
const { client, delayer } = withDelayer(createExtendedL1Client([
|
|
243
|
+
...this.l1Client.chain.rpcUrls.default.http
|
|
244
|
+
], privateKeyToAccount(this.getNextPrivateKey()), this.l1Client.chain), {
|
|
245
|
+
ethereumSlotDuration: this.L1_BLOCK_TIME_IN_S
|
|
246
|
+
});
|
|
247
|
+
expect(await client.getBalance({
|
|
248
|
+
address: client.account.address
|
|
249
|
+
})).toBeGreaterThan(0n);
|
|
250
|
+
return {
|
|
251
|
+
client,
|
|
252
|
+
delayer
|
|
253
|
+
};
|
|
254
|
+
}
|
|
237
255
|
/** Verifies whether the given block number is found on the aztec node. */ async verifyHistoricBlock(blockNumber, expectedSuccess) {
|
|
238
256
|
// We use `findLeavesIndexes` here, but could use any function that queries the world-state
|
|
239
257
|
// at a particular block, so we know whether that historic block is available or has been
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p2p_network.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/p2p_network.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,KAAK,0BAA0B,EAAc,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAGL,KAAK,QAAQ,EACb,cAAc,EACd,KAAK,UAAU,EAIhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAa,eAAe,EAAE,UAAU,EAAE,mBAAmB,EAAgB,MAAM,qBAAqB,CAAC;AAChH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAI9D,OAAO,EAAE,KAAK,qBAAqB,EAA2B,MAAM,MAAM,CAAC;AAQ3E,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,iCAAiC,CAAC;AAOzC,eAAO,MAAM,mBAAmB,QAA0C,CAAC;AAE3E,eAAO,MAAM,qCAAqC;;;;CAIjD,CAAC;AAEF,qBAAa,cAAc;IAwBhB,gBAAgB,EA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AAC;CA8BH"}
|
|
@@ -69,6 +69,7 @@ export class P2PNetworkTest {
|
|
|
69
69
|
aztecEpochDuration: initialValidatorConfig.aztecEpochDuration ?? l1ContractsConfig.aztecEpochDuration,
|
|
70
70
|
aztecSlotDuration: initialValidatorConfig.aztecSlotDuration ?? l1ContractsConfig.aztecSlotDuration,
|
|
71
71
|
aztecProofSubmissionWindow: initialValidatorConfig.aztecProofSubmissionWindow ?? l1ContractsConfig.aztecProofSubmissionWindow,
|
|
72
|
+
aztecTargetCommitteeSize: numberOfNodes,
|
|
72
73
|
salt: 420,
|
|
73
74
|
metricsPort: metricsPort,
|
|
74
75
|
numberOfInitialFundedAccounts: 2,
|
|
@@ -79,6 +80,7 @@ export class P2PNetworkTest {
|
|
|
79
80
|
ethereumSlotDuration: initialValidatorConfig.ethereumSlotDuration ?? l1ContractsConfig.ethereumSlotDuration,
|
|
80
81
|
aztecSlotDuration: initialValidatorConfig.aztecSlotDuration ?? l1ContractsConfig.aztecSlotDuration,
|
|
81
82
|
aztecProofSubmissionWindow: initialValidatorConfig.aztecProofSubmissionWindow ?? l1ContractsConfig.aztecProofSubmissionWindow,
|
|
83
|
+
aztecTargetCommitteeSize: numberOfNodes,
|
|
82
84
|
initialValidators: [],
|
|
83
85
|
zkPassportArgs: {
|
|
84
86
|
mockZkPassportVerifier
|
package/dest/e2e_p2p/shared.d.ts
CHANGED
|
@@ -20,10 +20,14 @@ export declare function createPXEServiceAndPrepareTransactions(logger: Logger, n
|
|
|
20
20
|
node: AztecNodeService;
|
|
21
21
|
}>;
|
|
22
22
|
export declare function awaitProposalExecution(slashingProposer: GetContractReturnType<typeof SlashingProposerAbi, ViemClient>, timeoutSeconds: number): Promise<void>;
|
|
23
|
-
export declare function awaitCommitteeExists({ rollup, logger }: {
|
|
23
|
+
export declare function awaitCommitteeExists({ rollup, logger, }: {
|
|
24
24
|
rollup: RollupContract;
|
|
25
25
|
logger: Logger;
|
|
26
26
|
}): Promise<readonly `0x${string}`[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Await the committee to be slashed out of the validator set.
|
|
29
|
+
* Currently assumes that the committee is the same size as the validator set.
|
|
30
|
+
*/
|
|
27
31
|
export declare function awaitCommitteeKicked({ offense, rollup, cheatCodes, committee, slashingAmount, slashFactory, slashingProposer, slashingRoundSize, aztecSlotDuration, logger, sendDummyTx, }: {
|
|
28
32
|
offense: Offense;
|
|
29
33
|
rollup: RollupContract;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAEL,KAAK,MAAM,EACX,QAAQ,EACR,KAAK,MAAM,EAIZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAyD,MAAM,mBAAmB,CAAC;AACtG,OAAO,EAAE,OAAO,EAAmB,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,MAAM,EACd,cAAc,YAAY,EAC1B,QAAQ,MAAM,EACd,OAAM;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;C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,CAAC;IACjB,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,SAAS,EAAE,SAAS,KAAK,MAAM,EAAE,EAAE,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,qBAAqB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,CAAC;IACxE,gBAAgB,EAAE,qBAAqB,CAAC,OAAO,mBAAmB,EAAE,UAAU,CAAC,CAAC;IAChF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC,iBA6DA"}
|
package/dest/e2e_p2p/shared.js
CHANGED
|
@@ -82,14 +82,17 @@ export async function awaitProposalExecution(slashingProposer, timeoutSeconds) {
|
|
|
82
82
|
}
|
|
83
83
|
export async function awaitCommitteeExists({ rollup, logger }) {
|
|
84
84
|
logger.info(`Waiting for committee to be set`);
|
|
85
|
-
let committee
|
|
85
|
+
let committee;
|
|
86
86
|
await retryUntil(async ()=>{
|
|
87
87
|
committee = await rollup.getCurrentEpochCommittee();
|
|
88
|
-
return committee.length > 0;
|
|
88
|
+
return committee && committee.length > 0;
|
|
89
89
|
}, 'non-empty committee', 60);
|
|
90
90
|
return committee;
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Await the committee to be slashed out of the validator set.
|
|
94
|
+
* Currently assumes that the committee is the same size as the validator set.
|
|
95
|
+
*/ export async function awaitCommitteeKicked({ offense, rollup, cheatCodes, committee, slashingAmount, slashFactory, slashingProposer, slashingRoundSize, aztecSlotDuration, logger, sendDummyTx }) {
|
|
93
96
|
logger.info(`Waiting for slash payload to be deployed`);
|
|
94
97
|
const expectedSlashes = Array.from({
|
|
95
98
|
length: committee.length
|
|
@@ -122,7 +125,7 @@ export async function awaitCommitteeKicked({ offense, rollup, cheatCodes, commit
|
|
|
122
125
|
// but they should be reduced to the "living" status
|
|
123
126
|
await cheatCodes.debugRollup();
|
|
124
127
|
const committeePostSlashing = await rollup.getCurrentEpochCommittee();
|
|
125
|
-
expect(committeePostSlashing
|
|
128
|
+
expect(committeePostSlashing?.length).toBe(attestersPre.length);
|
|
126
129
|
const attestersPostSlashing = await rollup.getAttesters();
|
|
127
130
|
expect(attestersPostSlashing.length).toBe(0);
|
|
128
131
|
for (const attester of attestersPre){
|
|
@@ -134,7 +137,9 @@ export async function awaitCommitteeKicked({ offense, rollup, cheatCodes, commit
|
|
|
134
137
|
await sendDummyTx();
|
|
135
138
|
await cheatCodes.debugRollup();
|
|
136
139
|
const committeeNextEpoch = await rollup.getCurrentEpochCommittee();
|
|
137
|
-
|
|
140
|
+
// The committee should be undefined, since the validator set is empty
|
|
141
|
+
// and the tests currently using this helper always set a target committee size.
|
|
142
|
+
expect(committeeNextEpoch).toBeUndefined();
|
|
138
143
|
const attestersNextEpoch = await rollup.getAttesters();
|
|
139
144
|
expect(attestersNextEpoch.length).toBe(0);
|
|
140
145
|
}
|
|
@@ -7,8 +7,8 @@ import type { DeployL1ContractsReturnType } from '@aztec/ethereum';
|
|
|
7
7
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
8
8
|
import type { PXEService } from '@aztec/pxe/server';
|
|
9
9
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
10
|
-
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
11
10
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
11
|
+
import { type SubsystemsContext } from './snapshot_manager.js';
|
|
12
12
|
/**
|
|
13
13
|
* Largely taken from the e2e_token_contract test file. We deploy 2 accounts and a token contract.
|
|
14
14
|
* However, we then setup a second PXE with a full prover instance.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e_prover_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/e2e_prover_test.ts"],"names":[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EAAG,UAAU,CAAC;IACxB,QAAQ,EAAG,cAAc,CAAC;IAC1B,OAAO,CAAC,gBAAgB,CAAqB;IAC7C,OAAO,CAAC,eAAe,CAAC,CAAsB;IAC9C,OAAO,CAAC,iBAAiB,CAAC,CAAsB;IAChD,oBAAoB,CAAC,EAAE,6BAA6B,CAAC;IACrD,YAAY,EAAE,aAAa,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;IAqDlB,KAAK;YA+JG,WAAW;IAQzB,QAAQ,GAAI,CAAC,EACX,MAAM,MAAM,EACZ,OAAO,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,EACjD,UAAS,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAA2B,KAChG,OAAO,CAAC,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAeR,iBAAiB;CA8CxB"}
|
|
@@ -4,17 +4,18 @@ import { EthAddress, createLogger } from '@aztec/aztec.js';
|
|
|
4
4
|
import { BBCircuitVerifier, TestCircuitVerifier } from '@aztec/bb-prover';
|
|
5
5
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
6
6
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
7
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
7
8
|
import { TestERC20Abi } from '@aztec/l1-artifacts';
|
|
8
9
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
9
10
|
import { createProverNode } from '@aztec/prover-node';
|
|
10
11
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
11
12
|
import { getContract } from 'viem';
|
|
12
13
|
import { privateKeyToAddress } from 'viem/accounts';
|
|
13
|
-
import { getACVMConfig } from '../fixtures/get_acvm_config.js';
|
|
14
|
-
import { getBBConfig } from '../fixtures/get_bb_config.js';
|
|
15
|
-
import { createSnapshotManager, deployAccounts, publicDeployAccounts } from '../fixtures/snapshot_manager.js';
|
|
16
|
-
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEService } from '../fixtures/utils.js';
|
|
17
14
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
15
|
+
import { getACVMConfig } from './get_acvm_config.js';
|
|
16
|
+
import { getBBConfig } from './get_bb_config.js';
|
|
17
|
+
import { createSnapshotManager, deployAccounts, publicDeployAccounts } from './snapshot_manager.js';
|
|
18
|
+
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEService } from './utils.js';
|
|
18
19
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
19
20
|
/**
|
|
20
21
|
* Largely taken from the e2e_token_contract test file. We deploy 2 accounts and a token contract.
|
|
@@ -192,7 +193,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
192
193
|
proverId: this.proverAddress.toField(),
|
|
193
194
|
realProofs: this.realProofs,
|
|
194
195
|
proverAgentCount: 2,
|
|
195
|
-
publisherPrivateKey: `0x${proverNodePrivateKey.toString('hex')}
|
|
196
|
+
publisherPrivateKey: new SecretValue(`0x${proverNodePrivateKey.toString('hex')}`),
|
|
196
197
|
proverNodeMaxPendingJobs: 100,
|
|
197
198
|
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
198
199
|
proverNodePollingIntervalMs: 100,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l1_to_l2_messaging.d.ts","sourceRoot":"","sources":["../../src/fixtures/l1_to_l2_messaging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,mBAAmB,EAAkB,MAAM,iBAAiB,CAAC;AAC1G,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAMhE,wBAAsB,iBAAiB,CACrC,OAAO,EAAE;IAAE,SAAS,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;IAAC,UAAU,EAAE,EAAE,CAAA;CAAE,EACjE,GAAG,EAAE;IACH,QAAQ,EAAE,wBAAwB,CAAC;IACnC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,cAAc,GAAG,eAAe,CAAC,CAAC;CAClF;;;;
|
|
1
|
+
{"version":3,"file":"l1_to_l2_messaging.d.ts","sourceRoot":"","sources":["../../src/fixtures/l1_to_l2_messaging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,mBAAmB,EAAkB,MAAM,iBAAiB,CAAC;AAC1G,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAMhE,wBAAsB,iBAAiB,CACrC,OAAO,EAAE;IAAE,SAAS,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;IAAC,UAAU,EAAE,EAAE,CAAA;CAAE,EACjE,GAAG,EAAE;IACH,QAAQ,EAAE,wBAAwB,CAAC;IACnC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,cAAc,GAAG,eAAe,CAAC,CAAC;CAClF;;;;GAqDF"}
|
|
@@ -21,13 +21,18 @@ export async function sendL1ToL2Message(message, ctx) {
|
|
|
21
21
|
},
|
|
22
22
|
content.toString(),
|
|
23
23
|
secretHash.toString()
|
|
24
|
-
]
|
|
24
|
+
], {
|
|
25
|
+
gas: 1_000_000n
|
|
26
|
+
});
|
|
25
27
|
logger.info(`L1 to L2 message sent in tx ${txHash}`);
|
|
26
28
|
// We check that the message was correctly injected by checking the emitted event
|
|
27
29
|
const txReceipt = await ctx.l1Client.waitForTransactionReceipt({
|
|
28
30
|
hash: txHash
|
|
29
31
|
});
|
|
30
|
-
|
|
32
|
+
if (txReceipt.status !== 'success') {
|
|
33
|
+
throw new Error(`L1 to L2 message failed to be sent in tx ${txHash}. Status: ${txReceipt.status}`);
|
|
34
|
+
}
|
|
35
|
+
logger.info(`L1 to L2 message receipt retrieved for tx ${txReceipt.transactionHash}`, txReceipt);
|
|
31
36
|
if (txReceipt.transactionHash !== txHash) {
|
|
32
37
|
throw new Error(`Receipt transaction hash mismatch: ${txReceipt.transactionHash} !== ${txHash}`);
|
|
33
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_p2p_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/setup_p2p_test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"setup_p2p_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/setup_p2p_test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAQrD,eAAO,MAAM,iCAAiC,IAAI,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,gBAAgB,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,GAAG,EAAE,MAAM,EAAE,CAAC;CACf;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,EAAE,CAO7F;AAED,wBAAsB,WAAW,CAC/B,MAAM,EAAE,eAAe,EACvB,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,EAC1C,aAAa,CAAC,EAAE,MAAM,EACtB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAmC7B;AAGD,wBAAsB,UAAU,CAC9B,MAAM,EAAE,eAAe,EACvB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,YAAY,EAAE,MAAM,EACpB,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,EAC1C,aAAa,CAAC,EAAE,MAAM,EACtB,WAAW,CAAC,EAAE,MAAM,EACpB,eAAe,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,6BAQ5C;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,eAAe,EACvB,gBAAgB,CAAC,EAAE,MAAM,EACzB,IAAI,CAAC,EAAE,MAAM,EACb,YAAY,GAAE,MAAU,EACxB,aAAa,CAAC,EAAE,MAAM,4BAuBvB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Test fixtures and utilities to set up and run a test using multiple validators
|
|
3
3
|
*/ import { AztecNodeService } from '@aztec/aztec-node';
|
|
4
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
4
5
|
import { addLogNameHandler, removeLogNameHandler } from '@aztec/foundation/log';
|
|
5
6
|
import getPort from 'get-port';
|
|
6
7
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
@@ -56,10 +57,10 @@ export async function createNode(config, dateProvider, tcpPort, bootstrapNode, a
|
|
|
56
57
|
export async function createValidatorConfig(config, bootstrapNodeEnr, port, addressIndex = 1, dataDirectory) {
|
|
57
58
|
port = port ?? await getPort();
|
|
58
59
|
const attesterPrivateKey = `0x${getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex).toString('hex')}`;
|
|
59
|
-
config.validatorPrivateKeys = [
|
|
60
|
+
config.validatorPrivateKeys = new SecretValue([
|
|
60
61
|
attesterPrivateKey
|
|
61
|
-
];
|
|
62
|
-
config.publisherPrivateKey = attesterPrivateKey;
|
|
62
|
+
]);
|
|
63
|
+
config.publisherPrivateKey = new SecretValue(attesterPrivateKey);
|
|
63
64
|
const nodeConfig = {
|
|
64
65
|
...config,
|
|
65
66
|
p2pIp: `127.0.0.1`,
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"snapshot_manager.d.ts","sourceRoot":"","sources":["../../src/fixtures/snapshot_manager.ts"],"names":[],"mappings":"AACA,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AAO,CAAC,MAAM;IACd,OAAO,CAAC,qBAAqB;IAT/B,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,OAAO,CAAC,CAAoB;IACpC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;gBAGrB,QAAQ,EAAE,MAAM,EACR,QAAQ,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;AA0VD;;;GAGG;AACH,eAAO,MAAM,cAAc,GACxB,kBAAkB,MAAM,EAAE,QAAQ,MAAM,EAAE,yBAAuB,MAC3D,gCAAgC;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"}
|
|
@@ -5,9 +5,10 @@ import { BatchCall, DefaultWaitForProvenOpts, getContractClassFromArtifact, wait
|
|
|
5
5
|
import { deployInstance, registerContractClass } from '@aztec/aztec.js/deployment';
|
|
6
6
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
|
|
7
7
|
import { createBlobSinkServer } from '@aztec/blob-sink/server';
|
|
8
|
-
import { createExtendedL1Client, getL1ContractsConfigEnvVars, l1Artifacts } from '@aztec/ethereum';
|
|
8
|
+
import { createExtendedL1Client, deployMulticall3, getL1ContractsConfigEnvVars, l1Artifacts } from '@aztec/ethereum';
|
|
9
9
|
import { EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
|
|
10
10
|
import { asyncMap } from '@aztec/foundation/async-map';
|
|
11
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
11
12
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
12
13
|
import { tryRmDir } from '@aztec/foundation/fs';
|
|
13
14
|
import { createLogger } from '@aztec/foundation/log';
|
|
@@ -25,6 +26,7 @@ import { tmpdir } from 'os';
|
|
|
25
26
|
import path, { join } from 'path';
|
|
26
27
|
import { getContract } from 'viem';
|
|
27
28
|
import { mnemonicToAccount } from 'viem/accounts';
|
|
29
|
+
import { foundry } from 'viem/chains';
|
|
28
30
|
import { MNEMONIC, TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
|
|
29
31
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
30
32
|
import { getBBConfig } from './get_bb_config.js';
|
|
@@ -214,7 +216,10 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
214
216
|
aztecNodeConfig.realProofs = !!opts.realProofs;
|
|
215
217
|
// Only enforce the time table if requested
|
|
216
218
|
aztecNodeConfig.enforceTimeTable = !!opts.enforceTimeTable;
|
|
219
|
+
// Only set the target committee size if it is explicitly set
|
|
220
|
+
aztecNodeConfig.aztecTargetCommitteeSize = opts.aztecTargetCommitteeSize ?? 0;
|
|
217
221
|
aztecNodeConfig.listenAddress = '127.0.0.1';
|
|
222
|
+
deployL1ContractsArgs.aztecTargetCommitteeSize ??= aztecNodeConfig.aztecTargetCommitteeSize;
|
|
218
223
|
// Create a temp directory for all ephemeral state and cleanup afterwards
|
|
219
224
|
const directoryToCleanup = path.join(tmpdir(), randomBytes(8).toString('hex'));
|
|
220
225
|
await fs.mkdir(directoryToCleanup, {
|
|
@@ -244,10 +249,10 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
244
249
|
const publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
|
|
245
250
|
const validatorPrivKey = getPrivateKeyFromIndex(0);
|
|
246
251
|
const proverNodePrivateKey = getPrivateKeyFromIndex(0);
|
|
247
|
-
aztecNodeConfig.publisherPrivateKey = `0x${publisherPrivKey.toString('hex')}
|
|
248
|
-
aztecNodeConfig.validatorPrivateKeys = [
|
|
252
|
+
aztecNodeConfig.publisherPrivateKey = new SecretValue(`0x${publisherPrivKey.toString('hex')}`);
|
|
253
|
+
aztecNodeConfig.validatorPrivateKeys = new SecretValue([
|
|
249
254
|
`0x${validatorPrivKey.toString('hex')}`
|
|
250
|
-
];
|
|
255
|
+
]);
|
|
251
256
|
const ethCheatCodes = new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls);
|
|
252
257
|
if (opts.l1StartTime) {
|
|
253
258
|
await ethCheatCodes.warp(opts.l1StartTime);
|
|
@@ -255,6 +260,10 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
255
260
|
const initialFundedAccounts = await generateSchnorrAccounts(numberOfInitialFundedAccounts);
|
|
256
261
|
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
257
262
|
const { genesisArchiveRoot, prefilledPublicData, fundingNeeded } = await getGenesisValues(initialFundedAccounts.map((a)=>a.address).concat(sponsoredFPCAddress), opts.initialAccountFeeJuice);
|
|
263
|
+
const l1Client = createExtendedL1Client([
|
|
264
|
+
aztecNodeConfig.l1RpcUrls[0]
|
|
265
|
+
], hdAccount, foundry);
|
|
266
|
+
await deployMulticall3(l1Client, logger);
|
|
258
267
|
const deployL1ContractsValues = await setupL1Contracts(aztecNodeConfig.l1RpcUrls[0], hdAccount, logger, {
|
|
259
268
|
...getL1ContractsConfigEnvVars(),
|
|
260
269
|
genesisArchiveRoot,
|
package/dest/fixtures/utils.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type AztecNodeConfig } from '@aztec/aztec-node';
|
|
|
3
3
|
import { type AccountWalletWithSecretKey, type AztecAddress, type AztecNode, type ContractMethod, type Logger, type PXE, type Wallet } from '@aztec/aztec.js';
|
|
4
4
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
|
|
5
5
|
import { type BlobSinkServer } from '@aztec/blob-sink/server';
|
|
6
|
-
import { type DeployL1ContractsArgs, type DeployL1ContractsReturnType,
|
|
6
|
+
import { type DeployL1ContractsArgs, type DeployL1ContractsReturnType, type Operator } from '@aztec/ethereum';
|
|
7
7
|
import { startAnvil } from '@aztec/ethereum/test';
|
|
8
8
|
import { Fr } from '@aztec/foundation/fields';
|
|
9
9
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
@@ -15,7 +15,7 @@ import type { SequencerClient } from '@aztec/sequencer-client';
|
|
|
15
15
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
16
16
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
17
17
|
import { type TelemetryClient, type TelemetryClientConfig } from '@aztec/telemetry-client';
|
|
18
|
-
import { type Chain, type HDAccount, type
|
|
18
|
+
import { type Chain, type HDAccount, type PrivateKeyAccount } from 'viem';
|
|
19
19
|
export { deployAndInitializeTokenAndBridgeContracts } from '../shared/cross_chain_test_harness.js';
|
|
20
20
|
export { startAnvil };
|
|
21
21
|
export declare const getPrivateKeyFromIndex: (index: number) => Buffer | null;
|
|
@@ -171,5 +171,4 @@ export declare function getSponsoredFPCAddress(): Promise<AztecAddress>;
|
|
|
171
171
|
export declare function setupSponsoredFPC(pxe: PXE): Promise<import("@aztec/aztec.js").ContractInstanceWithAddress>;
|
|
172
172
|
export declare function waitForProvenChain(node: AztecNode, targetBlock?: number, timeoutSec?: number, intervalSec?: number): Promise<void>;
|
|
173
173
|
export declare function createAndSyncProverNode(proverNodePrivateKey: `0x${string}`, aztecNodeConfig: AztecNodeConfig, proverNodeConfig: Partial<ProverNodeConfig> & Pick<DataStoreConfig, 'dataDirectory'>, aztecNode: AztecNode, prefilledPublicData?: PublicDataTreeLeaf[]): Promise<ProverNode>;
|
|
174
|
-
export declare function createForwarderContract(aztecNodeConfig: AztecNodeConfig, privateKey: `0x${string}`, rollupAddress: Hex): Promise<ForwarderContract>;
|
|
175
174
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fixtures/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,KAAK,eAAe,EAAsC,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAMZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AAEpF,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,
|
|
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,EACnB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAMZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBA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,CAAC,EAAE,GACnB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,kBAAkB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,EACnE,aAAa,EAAE,CAAC,EAAE,EAClB,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,EAC/B,MAAM,EAAE,CAAC,EAAE,EACX,aAAa,EAAE,CAAC,EAAE,GACjB,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,0BAK3C;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,GAAG,kEAQ/C;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,UAAU,SAAK,EAAE,WAAW,SAAI,iBAS/G;AAED,wBAAgB,uBAAuB,CACrC,oBAAoB,EAAE,KAAK,MAAM,EAAE,EACnC,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,eAAe,EAAE,eAAe,CAAC,EACpF,SAAS,EAAE,SAAS,EACpB,mBAAmB,GAAE,kBAAkB,EAAO,uBA6C/C"}
|
package/dest/fixtures/utils.js
CHANGED
|
@@ -8,8 +8,9 @@ import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
|
|
|
8
8
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
9
9
|
import { createBlobSinkServer } from '@aztec/blob-sink/server';
|
|
10
10
|
import { GENESIS_ARCHIVE_ROOT, SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
11
|
-
import {
|
|
11
|
+
import { NULL_KEY, createExtendedL1Client, deployL1Contracts, deployMulticall3, getL1ContractsConfigEnvVars, isAnvilTestChain, l1Artifacts } from '@aztec/ethereum';
|
|
12
12
|
import { DelayedTxUtils, EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
|
|
13
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
13
14
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
14
15
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
15
16
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -183,12 +184,13 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
183
184
|
}, pxeOpts = {}, chain = foundry) {
|
|
184
185
|
let anvil;
|
|
185
186
|
try {
|
|
187
|
+
opts.aztecTargetCommitteeSize ??= 0;
|
|
186
188
|
const config = {
|
|
187
189
|
...getConfigEnvVars(),
|
|
188
190
|
...opts
|
|
189
191
|
};
|
|
190
192
|
// use initialValidators for the node config
|
|
191
|
-
config.validatorPrivateKeys = opts.initialValidators?.map((v)=>v.privateKey);
|
|
193
|
+
config.validatorPrivateKeys = new SecretValue(opts.initialValidators?.map((v)=>v.privateKey) ?? []);
|
|
192
194
|
config.peerCheckIntervalMS = TEST_PEER_CHECK_INTERVAL_MS;
|
|
193
195
|
// For tests we only want proving enabled if specifically requested
|
|
194
196
|
config.realProofs = !!opts.realProofs;
|
|
@@ -233,8 +235,8 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
233
235
|
}
|
|
234
236
|
let publisherPrivKey = undefined;
|
|
235
237
|
let publisherHdAccount = undefined;
|
|
236
|
-
if (config.publisherPrivateKey && config.publisherPrivateKey != NULL_KEY) {
|
|
237
|
-
publisherHdAccount = privateKeyToAccount(config.publisherPrivateKey);
|
|
238
|
+
if (config.publisherPrivateKey && config.publisherPrivateKey.getValue() != NULL_KEY) {
|
|
239
|
+
publisherHdAccount = privateKeyToAccount(config.publisherPrivateKey.getValue());
|
|
238
240
|
} else if (!MNEMONIC) {
|
|
239
241
|
throw new Error(`Mnemonic not provided and no publisher private key`);
|
|
240
242
|
} else {
|
|
@@ -243,7 +245,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
243
245
|
});
|
|
244
246
|
const publisherPrivKeyRaw = publisherHdAccount.getHdKey().privateKey;
|
|
245
247
|
publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
|
|
246
|
-
config.publisherPrivateKey = `0x${publisherPrivKey.toString('hex')}
|
|
248
|
+
config.publisherPrivateKey = new SecretValue(`0x${publisherPrivKey.toString('hex')}`);
|
|
247
249
|
}
|
|
248
250
|
if (PXE_URL) {
|
|
249
251
|
// we are setting up against a remote environment, l1 contracts are assumed to already be deployed
|
|
@@ -256,6 +258,8 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
256
258
|
if (enableAutomine) {
|
|
257
259
|
await ethCheatCodes.setAutomine(true);
|
|
258
260
|
}
|
|
261
|
+
const l1Client = createExtendedL1Client(config.l1RpcUrls, publisherHdAccount, chain);
|
|
262
|
+
await deployMulticall3(l1Client, logger);
|
|
259
263
|
const deployL1ContractsValues = opts.deployL1ContractsValues ?? await setupL1Contracts(config.l1RpcUrls, publisherHdAccount, logger, {
|
|
260
264
|
...opts,
|
|
261
265
|
genesisArchiveRoot,
|
|
@@ -344,7 +348,8 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
344
348
|
dateProvider,
|
|
345
349
|
blobSinkClient,
|
|
346
350
|
telemetry,
|
|
347
|
-
p2pClientDeps
|
|
351
|
+
p2pClientDeps,
|
|
352
|
+
logger: createLogger('node:MAIN-aztec-node')
|
|
348
353
|
}, {
|
|
349
354
|
prefilledPublicData
|
|
350
355
|
});
|
|
@@ -367,13 +372,20 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
367
372
|
}
|
|
368
373
|
logger.verbose('Creating a pxe...');
|
|
369
374
|
const { pxe, teardown: pxeTeardown } = await setupPXEService(aztecNode, pxeOpts, logger);
|
|
375
|
+
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxe);
|
|
376
|
+
if (opts.aztecTargetCommitteeSize && opts.aztecTargetCommitteeSize > 0 || opts.initialValidators && opts.initialValidators.length > 0) {
|
|
377
|
+
// We need to advance to epoch 2 such that the committee is set up.
|
|
378
|
+
logger.info(`Advancing to epoch 2`);
|
|
379
|
+
await cheatCodes.rollup.advanceToEpoch(2n, {
|
|
380
|
+
updateDateProvider: dateProvider
|
|
381
|
+
});
|
|
382
|
+
}
|
|
370
383
|
const accountManagers = await deployFundedSchnorrAccounts(pxe, initialFundedAccounts.slice(0, numberOfAccounts));
|
|
371
384
|
const wallets = await Promise.all(accountManagers.map((account)=>account.getWallet()));
|
|
372
385
|
if (initialFundedAccounts.length < numberOfAccounts) {
|
|
373
386
|
// TODO: Create (numberOfAccounts - initialFundedAccounts.length) wallets without funds.
|
|
374
387
|
throw new Error(`Unable to deploy ${numberOfAccounts} accounts. Only ${initialFundedAccounts.length} accounts were funded.`);
|
|
375
388
|
}
|
|
376
|
-
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxe);
|
|
377
389
|
const teardown = async ()=>{
|
|
378
390
|
try {
|
|
379
391
|
await pxeTeardown();
|
|
@@ -546,7 +558,7 @@ export function createAndSyncProverNode(proverNodePrivateKey, aztecNodeConfig, p
|
|
|
546
558
|
proverCoordinationNodeUrls: [],
|
|
547
559
|
realProofs: false,
|
|
548
560
|
proverAgentCount: 2,
|
|
549
|
-
publisherPrivateKey: proverNodePrivateKey,
|
|
561
|
+
publisherPrivateKey: new SecretValue(proverNodePrivateKey),
|
|
550
562
|
proverNodeMaxPendingJobs: 10,
|
|
551
563
|
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
552
564
|
proverNodePollingIntervalMs: 200,
|
|
@@ -578,8 +590,3 @@ function createDelayedL1TxUtils(aztecNodeConfig, privateKey, logName) {
|
|
|
578
590
|
l1TxUtils.enableDelayer(aztecNodeConfig.ethereumSlotDuration);
|
|
579
591
|
return l1TxUtils;
|
|
580
592
|
}
|
|
581
|
-
export async function createForwarderContract(aztecNodeConfig, privateKey, rollupAddress) {
|
|
582
|
-
const l1Client = createExtendedL1Client(aztecNodeConfig.l1RpcUrls, privateKey, foundry);
|
|
583
|
-
const forwarderContract = await ForwarderContract.create(l1Client, createLogger('forwarder'), rollupAddress);
|
|
584
|
-
return forwarderContract;
|
|
585
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "1.0.0-nightly.
|
|
3
|
+
"version": "1.0.0-nightly.20250618",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,40 +25,40 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "1.0.0-nightly.
|
|
29
|
-
"@aztec/archiver": "1.0.0-nightly.
|
|
30
|
-
"@aztec/aztec": "1.0.0-nightly.
|
|
31
|
-
"@aztec/aztec-node": "1.0.0-nightly.
|
|
32
|
-
"@aztec/aztec.js": "1.0.0-nightly.
|
|
33
|
-
"@aztec/bb-prover": "1.0.0-nightly.
|
|
34
|
-
"@aztec/blob-lib": "1.0.0-nightly.
|
|
35
|
-
"@aztec/blob-sink": "1.0.0-nightly.
|
|
36
|
-
"@aztec/bot": "1.0.0-nightly.
|
|
37
|
-
"@aztec/cli": "1.0.0-nightly.
|
|
38
|
-
"@aztec/constants": "1.0.0-nightly.
|
|
39
|
-
"@aztec/entrypoints": "1.0.0-nightly.
|
|
40
|
-
"@aztec/epoch-cache": "1.0.0-nightly.
|
|
41
|
-
"@aztec/ethereum": "1.0.0-nightly.
|
|
42
|
-
"@aztec/foundation": "1.0.0-nightly.
|
|
43
|
-
"@aztec/kv-store": "1.0.0-nightly.
|
|
44
|
-
"@aztec/l1-artifacts": "1.0.0-nightly.
|
|
45
|
-
"@aztec/merkle-tree": "1.0.0-nightly.
|
|
46
|
-
"@aztec/noir-contracts.js": "1.0.0-nightly.
|
|
47
|
-
"@aztec/noir-noirc_abi": "1.0.0-nightly.
|
|
48
|
-
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.
|
|
49
|
-
"@aztec/noir-test-contracts.js": "1.0.0-nightly.
|
|
50
|
-
"@aztec/p2p": "1.0.0-nightly.
|
|
51
|
-
"@aztec/protocol-contracts": "1.0.0-nightly.
|
|
52
|
-
"@aztec/prover-client": "1.0.0-nightly.
|
|
53
|
-
"@aztec/prover-node": "1.0.0-nightly.
|
|
54
|
-
"@aztec/pxe": "1.0.0-nightly.
|
|
55
|
-
"@aztec/sequencer-client": "1.0.0-nightly.
|
|
56
|
-
"@aztec/simulator": "1.0.0-nightly.
|
|
57
|
-
"@aztec/slasher": "1.0.0-nightly.
|
|
58
|
-
"@aztec/stdlib": "1.0.0-nightly.
|
|
59
|
-
"@aztec/telemetry-client": "1.0.0-nightly.
|
|
60
|
-
"@aztec/validator-client": "1.0.0-nightly.
|
|
61
|
-
"@aztec/world-state": "1.0.0-nightly.
|
|
28
|
+
"@aztec/accounts": "1.0.0-nightly.20250618",
|
|
29
|
+
"@aztec/archiver": "1.0.0-nightly.20250618",
|
|
30
|
+
"@aztec/aztec": "1.0.0-nightly.20250618",
|
|
31
|
+
"@aztec/aztec-node": "1.0.0-nightly.20250618",
|
|
32
|
+
"@aztec/aztec.js": "1.0.0-nightly.20250618",
|
|
33
|
+
"@aztec/bb-prover": "1.0.0-nightly.20250618",
|
|
34
|
+
"@aztec/blob-lib": "1.0.0-nightly.20250618",
|
|
35
|
+
"@aztec/blob-sink": "1.0.0-nightly.20250618",
|
|
36
|
+
"@aztec/bot": "1.0.0-nightly.20250618",
|
|
37
|
+
"@aztec/cli": "1.0.0-nightly.20250618",
|
|
38
|
+
"@aztec/constants": "1.0.0-nightly.20250618",
|
|
39
|
+
"@aztec/entrypoints": "1.0.0-nightly.20250618",
|
|
40
|
+
"@aztec/epoch-cache": "1.0.0-nightly.20250618",
|
|
41
|
+
"@aztec/ethereum": "1.0.0-nightly.20250618",
|
|
42
|
+
"@aztec/foundation": "1.0.0-nightly.20250618",
|
|
43
|
+
"@aztec/kv-store": "1.0.0-nightly.20250618",
|
|
44
|
+
"@aztec/l1-artifacts": "1.0.0-nightly.20250618",
|
|
45
|
+
"@aztec/merkle-tree": "1.0.0-nightly.20250618",
|
|
46
|
+
"@aztec/noir-contracts.js": "1.0.0-nightly.20250618",
|
|
47
|
+
"@aztec/noir-noirc_abi": "1.0.0-nightly.20250618",
|
|
48
|
+
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250618",
|
|
49
|
+
"@aztec/noir-test-contracts.js": "1.0.0-nightly.20250618",
|
|
50
|
+
"@aztec/p2p": "1.0.0-nightly.20250618",
|
|
51
|
+
"@aztec/protocol-contracts": "1.0.0-nightly.20250618",
|
|
52
|
+
"@aztec/prover-client": "1.0.0-nightly.20250618",
|
|
53
|
+
"@aztec/prover-node": "1.0.0-nightly.20250618",
|
|
54
|
+
"@aztec/pxe": "1.0.0-nightly.20250618",
|
|
55
|
+
"@aztec/sequencer-client": "1.0.0-nightly.20250618",
|
|
56
|
+
"@aztec/simulator": "1.0.0-nightly.20250618",
|
|
57
|
+
"@aztec/slasher": "1.0.0-nightly.20250618",
|
|
58
|
+
"@aztec/stdlib": "1.0.0-nightly.20250618",
|
|
59
|
+
"@aztec/telemetry-client": "1.0.0-nightly.20250618",
|
|
60
|
+
"@aztec/validator-client": "1.0.0-nightly.20250618",
|
|
61
|
+
"@aztec/world-state": "1.0.0-nightly.20250618",
|
|
62
62
|
"@iarna/toml": "^2.2.5",
|
|
63
63
|
"@jest/globals": "^29.5.0",
|
|
64
64
|
"@noble/curves": "^1.0.0",
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"lodash.omit": "^4.5.0",
|
|
88
88
|
"msgpackr": "^1.11.2",
|
|
89
89
|
"process": "^0.11.10",
|
|
90
|
+
"snappy": "^7.2.2",
|
|
90
91
|
"stream-browserify": "^3.0.0",
|
|
91
92
|
"string-argv": "^0.3.2",
|
|
92
93
|
"ts-loader": "^9.4.4",
|
|
@@ -99,12 +100,12 @@
|
|
|
99
100
|
},
|
|
100
101
|
"devDependencies": {
|
|
101
102
|
"0x": "^5.7.0",
|
|
102
|
-
"@jest/globals": "^
|
|
103
|
+
"@jest/globals": "^30.0.0",
|
|
103
104
|
"@types/jest": "^29.5.0",
|
|
104
105
|
"@types/js-yaml": "^4.0.9",
|
|
105
106
|
"@types/lodash.chunk": "^4.2.9",
|
|
106
107
|
"concurrently": "^7.6.0",
|
|
107
|
-
"jest": "^
|
|
108
|
+
"jest": "^30.0.0",
|
|
108
109
|
"jest-extended": "^4.0.2",
|
|
109
110
|
"js-yaml": "^4.1.0",
|
|
110
111
|
"ts-node": "^10.9.1",
|
|
@@ -122,6 +123,7 @@
|
|
|
122
123
|
"jest": {
|
|
123
124
|
"slowTestThreshold": 300,
|
|
124
125
|
"setupFilesAfterEnv": [
|
|
126
|
+
"../../foundation/src/jest/setupAfterEnv.mjs",
|
|
125
127
|
"jest-extended/all",
|
|
126
128
|
"./shared/jest_setup.ts"
|
|
127
129
|
],
|
|
@@ -9,9 +9,10 @@ import {
|
|
|
9
9
|
retryUntil,
|
|
10
10
|
sleep,
|
|
11
11
|
} from '@aztec/aztec.js';
|
|
12
|
-
import type
|
|
12
|
+
import { type ExtendedViemWalletClient, createExtendedL1Client } from '@aztec/ethereum';
|
|
13
13
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
14
|
-
import { ChainMonitor, DelayedTxUtils, type Delayer, waitUntilL1Timestamp } from '@aztec/ethereum/test';
|
|
14
|
+
import { ChainMonitor, DelayedTxUtils, type Delayer, waitUntilL1Timestamp, withDelayer } from '@aztec/ethereum/test';
|
|
15
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
15
16
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
16
17
|
import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
17
18
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
@@ -26,6 +27,7 @@ import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
|
26
27
|
|
|
27
28
|
import { join } from 'path';
|
|
28
29
|
import type { Hex } from 'viem';
|
|
30
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
29
31
|
|
|
30
32
|
import {
|
|
31
33
|
type EndToEndContext,
|
|
@@ -64,7 +66,7 @@ export type EpochsTestOpts = Partial<
|
|
|
64
66
|
*/
|
|
65
67
|
export class EpochsTestContext {
|
|
66
68
|
public context!: EndToEndContext;
|
|
67
|
-
public l1Client!:
|
|
69
|
+
public l1Client!: ExtendedViemWalletClient;
|
|
68
70
|
public rollup!: RollupContract;
|
|
69
71
|
public constants!: L1RollupConstants;
|
|
70
72
|
public logger!: Logger;
|
|
@@ -115,6 +117,7 @@ export class EpochsTestContext {
|
|
|
115
117
|
aztecSlotDuration,
|
|
116
118
|
ethereumSlotDuration,
|
|
117
119
|
aztecProofSubmissionWindow,
|
|
120
|
+
aztecTargetCommitteeSize: opts.initialValidators?.length ?? 0,
|
|
118
121
|
minTxsPerBlock: 0,
|
|
119
122
|
realProofs: false,
|
|
120
123
|
startProverNode: true,
|
|
@@ -204,7 +207,7 @@ export class EpochsTestContext {
|
|
|
204
207
|
opts: Partial<AztecNodeConfig> & { dontStartSequencer?: boolean } = {},
|
|
205
208
|
) {
|
|
206
209
|
this.logger.warn('Creating and syncing a validator node...');
|
|
207
|
-
return this.createNode({ ...opts, disableValidator: false, validatorPrivateKeys: privateKeys });
|
|
210
|
+
return this.createNode({ ...opts, disableValidator: false, validatorPrivateKeys: new SecretValue(privateKeys) });
|
|
208
211
|
}
|
|
209
212
|
|
|
210
213
|
private async createNode(opts: Partial<AztecNodeConfig> & { dontStartSequencer?: boolean } = {}) {
|
|
@@ -218,7 +221,7 @@ export class EpochsTestContext {
|
|
|
218
221
|
{
|
|
219
222
|
...resolvedConfig,
|
|
220
223
|
dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
|
|
221
|
-
validatorPrivateKeys: opts.validatorPrivateKeys,
|
|
224
|
+
validatorPrivateKeys: opts.validatorPrivateKeys ?? new SecretValue([]),
|
|
222
225
|
p2pEnabled,
|
|
223
226
|
p2pIp,
|
|
224
227
|
},
|
|
@@ -314,6 +317,20 @@ export class EpochsTestContext {
|
|
|
314
317
|
return SpamContract.at(instance.address, wallet);
|
|
315
318
|
}
|
|
316
319
|
|
|
320
|
+
/** Creates an L1 client using a fresh account with funds from anvil, with a tx delayer already set up. */
|
|
321
|
+
public async createL1Client() {
|
|
322
|
+
const { client, delayer } = withDelayer(
|
|
323
|
+
createExtendedL1Client(
|
|
324
|
+
[...this.l1Client.chain.rpcUrls.default.http],
|
|
325
|
+
privateKeyToAccount(this.getNextPrivateKey()),
|
|
326
|
+
this.l1Client.chain,
|
|
327
|
+
),
|
|
328
|
+
{ ethereumSlotDuration: this.L1_BLOCK_TIME_IN_S },
|
|
329
|
+
);
|
|
330
|
+
expect(await client.getBalance({ address: client.account.address })).toBeGreaterThan(0n);
|
|
331
|
+
return { client, delayer };
|
|
332
|
+
}
|
|
333
|
+
|
|
317
334
|
/** Verifies whether the given block number is found on the aztec node. */
|
|
318
335
|
public async verifyHistoricBlock(blockNumber: L2BlockNumber, expectedSuccess: boolean) {
|
|
319
336
|
// We use `findLeavesIndexes` here, but could use any function that queries the world-state
|
|
@@ -102,6 +102,7 @@ export class P2PNetworkTest {
|
|
|
102
102
|
aztecSlotDuration: initialValidatorConfig.aztecSlotDuration ?? l1ContractsConfig.aztecSlotDuration,
|
|
103
103
|
aztecProofSubmissionWindow:
|
|
104
104
|
initialValidatorConfig.aztecProofSubmissionWindow ?? l1ContractsConfig.aztecProofSubmissionWindow,
|
|
105
|
+
aztecTargetCommitteeSize: numberOfNodes,
|
|
105
106
|
salt: 420,
|
|
106
107
|
metricsPort: metricsPort,
|
|
107
108
|
numberOfInitialFundedAccounts: 2,
|
|
@@ -114,6 +115,7 @@ export class P2PNetworkTest {
|
|
|
114
115
|
aztecSlotDuration: initialValidatorConfig.aztecSlotDuration ?? l1ContractsConfig.aztecSlotDuration,
|
|
115
116
|
aztecProofSubmissionWindow:
|
|
116
117
|
initialValidatorConfig.aztecProofSubmissionWindow ?? l1ContractsConfig.aztecProofSubmissionWindow,
|
|
118
|
+
aztecTargetCommitteeSize: numberOfNodes,
|
|
117
119
|
initialValidators: [],
|
|
118
120
|
zkPassportArgs: {
|
|
119
121
|
mockZkPassportVerifier,
|
package/src/e2e_p2p/shared.ts
CHANGED
|
@@ -127,20 +127,30 @@ export async function awaitProposalExecution(
|
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
export async function awaitCommitteeExists({
|
|
130
|
+
export async function awaitCommitteeExists({
|
|
131
|
+
rollup,
|
|
132
|
+
logger,
|
|
133
|
+
}: {
|
|
134
|
+
rollup: RollupContract;
|
|
135
|
+
logger: Logger;
|
|
136
|
+
}): Promise<readonly `0x${string}`[]> {
|
|
131
137
|
logger.info(`Waiting for committee to be set`);
|
|
132
|
-
let committee: readonly `0x${string}`[]
|
|
138
|
+
let committee: readonly `0x${string}`[] | undefined;
|
|
133
139
|
await retryUntil(
|
|
134
140
|
async () => {
|
|
135
141
|
committee = await rollup.getCurrentEpochCommittee();
|
|
136
|
-
return committee.length > 0;
|
|
142
|
+
return committee && committee.length > 0;
|
|
137
143
|
},
|
|
138
144
|
'non-empty committee',
|
|
139
145
|
60,
|
|
140
146
|
);
|
|
141
|
-
return committee
|
|
147
|
+
return committee!;
|
|
142
148
|
}
|
|
143
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Await the committee to be slashed out of the validator set.
|
|
152
|
+
* Currently assumes that the committee is the same size as the validator set.
|
|
153
|
+
*/
|
|
144
154
|
export async function awaitCommitteeKicked({
|
|
145
155
|
offense,
|
|
146
156
|
rollup,
|
|
@@ -204,7 +214,7 @@ export async function awaitCommitteeKicked({
|
|
|
204
214
|
// but they should be reduced to the "living" status
|
|
205
215
|
await cheatCodes.debugRollup();
|
|
206
216
|
const committeePostSlashing = await rollup.getCurrentEpochCommittee();
|
|
207
|
-
expect(committeePostSlashing
|
|
217
|
+
expect(committeePostSlashing?.length).toBe(attestersPre.length);
|
|
208
218
|
|
|
209
219
|
const attestersPostSlashing = await rollup.getAttesters();
|
|
210
220
|
expect(attestersPostSlashing.length).toBe(0);
|
|
@@ -220,7 +230,9 @@ export async function awaitCommitteeKicked({
|
|
|
220
230
|
await cheatCodes.debugRollup();
|
|
221
231
|
|
|
222
232
|
const committeeNextEpoch = await rollup.getCurrentEpochCommittee();
|
|
223
|
-
|
|
233
|
+
// The committee should be undefined, since the validator set is empty
|
|
234
|
+
// and the tests currently using this helper always set a target committee size.
|
|
235
|
+
expect(committeeNextEpoch).toBeUndefined();
|
|
224
236
|
|
|
225
237
|
const attestersNextEpoch = await rollup.getAttesters();
|
|
226
238
|
expect(attestersNextEpoch.length).toBe(0);
|
|
@@ -20,6 +20,7 @@ import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
|
20
20
|
import type { BlobSinkServer } from '@aztec/blob-sink/server';
|
|
21
21
|
import type { DeployL1ContractsReturnType } from '@aztec/ethereum';
|
|
22
22
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
23
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
23
24
|
import { TestERC20Abi } from '@aztec/l1-artifacts';
|
|
24
25
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
25
26
|
import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
|
|
@@ -30,17 +31,17 @@ import { getGenesisValues } from '@aztec/world-state/testing';
|
|
|
30
31
|
import { type Hex, getContract } from 'viem';
|
|
31
32
|
import { privateKeyToAddress } from 'viem/accounts';
|
|
32
33
|
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
34
|
+
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
35
|
+
import { getACVMConfig } from './get_acvm_config.js';
|
|
36
|
+
import { getBBConfig } from './get_bb_config.js';
|
|
35
37
|
import {
|
|
36
38
|
type ISnapshotManager,
|
|
37
39
|
type SubsystemsContext,
|
|
38
40
|
createSnapshotManager,
|
|
39
41
|
deployAccounts,
|
|
40
42
|
publicDeployAccounts,
|
|
41
|
-
} from '
|
|
42
|
-
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEService } from '
|
|
43
|
-
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
43
|
+
} from './snapshot_manager.js';
|
|
44
|
+
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEService } from './utils.js';
|
|
44
45
|
|
|
45
46
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
46
47
|
|
|
@@ -289,7 +290,7 @@ export class FullProverTest {
|
|
|
289
290
|
proverId: this.proverAddress.toField(),
|
|
290
291
|
realProofs: this.realProofs,
|
|
291
292
|
proverAgentCount: 2,
|
|
292
|
-
publisherPrivateKey: `0x${proverNodePrivateKey!.toString('hex')}
|
|
293
|
+
publisherPrivateKey: new SecretValue(`0x${proverNodePrivateKey!.toString('hex')}` as const),
|
|
293
294
|
proverNodeMaxPendingJobs: 100,
|
|
294
295
|
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
295
296
|
proverNodePollingIntervalMs: 100,
|
|
@@ -27,17 +27,22 @@ export async function sendL1ToL2Message(
|
|
|
27
27
|
const version = await new RollupContract(ctx.l1Client, ctx.l1ContractAddresses.rollupAddress.toString()).getVersion();
|
|
28
28
|
|
|
29
29
|
// We inject the message to Inbox
|
|
30
|
-
const txHash = await inbox.write.sendL2Message(
|
|
31
|
-
{ actor: recipient.toString(), version: BigInt(version) },
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
const txHash = await inbox.write.sendL2Message(
|
|
31
|
+
[{ actor: recipient.toString(), version: BigInt(version) }, content.toString(), secretHash.toString()],
|
|
32
|
+
{
|
|
33
|
+
gas: 1_000_000n,
|
|
34
|
+
},
|
|
35
|
+
);
|
|
35
36
|
logger.info(`L1 to L2 message sent in tx ${txHash}`);
|
|
36
37
|
|
|
37
38
|
// We check that the message was correctly injected by checking the emitted event
|
|
38
39
|
const txReceipt = await ctx.l1Client.waitForTransactionReceipt({ hash: txHash });
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
if (txReceipt.status !== 'success') {
|
|
42
|
+
throw new Error(`L1 to L2 message failed to be sent in tx ${txHash}. Status: ${txReceipt.status}`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
logger.info(`L1 to L2 message receipt retrieved for tx ${txReceipt.transactionHash}`, txReceipt);
|
|
41
46
|
|
|
42
47
|
if (txReceipt.transactionHash !== txHash) {
|
|
43
48
|
throw new Error(`Receipt transaction hash mismatch: ${txReceipt.transactionHash} !== ${txHash}`);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
5
5
|
import type { SentTx } from '@aztec/aztec.js';
|
|
6
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
6
7
|
import { addLogNameHandler, removeLogNameHandler } from '@aztec/foundation/log';
|
|
7
8
|
import type { DateProvider } from '@aztec/foundation/timer';
|
|
8
9
|
import type { PXEService } from '@aztec/pxe/server';
|
|
@@ -113,8 +114,8 @@ export async function createValidatorConfig(
|
|
|
113
114
|
ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex,
|
|
114
115
|
)!.toString('hex')}`;
|
|
115
116
|
|
|
116
|
-
config.validatorPrivateKeys = [attesterPrivateKey];
|
|
117
|
-
config.publisherPrivateKey = attesterPrivateKey;
|
|
117
|
+
config.validatorPrivateKeys = new SecretValue([attesterPrivateKey]);
|
|
118
|
+
config.publisherPrivateKey = new SecretValue(attesterPrivateKey);
|
|
118
119
|
|
|
119
120
|
const nodeConfig: AztecNodeConfig = {
|
|
120
121
|
...config,
|
|
@@ -21,11 +21,13 @@ import {
|
|
|
21
21
|
type DeployL1ContractsArgs,
|
|
22
22
|
type DeployL1ContractsReturnType,
|
|
23
23
|
createExtendedL1Client,
|
|
24
|
+
deployMulticall3,
|
|
24
25
|
getL1ContractsConfigEnvVars,
|
|
25
26
|
l1Artifacts,
|
|
26
27
|
} from '@aztec/ethereum';
|
|
27
28
|
import { EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
|
|
28
29
|
import { asyncMap } from '@aztec/foundation/async-map';
|
|
30
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
29
31
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
30
32
|
import { tryRmDir } from '@aztec/foundation/fs';
|
|
31
33
|
import { createLogger } from '@aztec/foundation/log';
|
|
@@ -46,6 +48,7 @@ import { tmpdir } from 'os';
|
|
|
46
48
|
import path, { join } from 'path';
|
|
47
49
|
import { type Hex, getContract } from 'viem';
|
|
48
50
|
import { mnemonicToAccount } from 'viem/accounts';
|
|
51
|
+
import { foundry } from 'viem/chains';
|
|
49
52
|
|
|
50
53
|
import { MNEMONIC, TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
|
|
51
54
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
@@ -307,8 +310,12 @@ async function setupFromFresh(
|
|
|
307
310
|
aztecNodeConfig.realProofs = !!opts.realProofs;
|
|
308
311
|
// Only enforce the time table if requested
|
|
309
312
|
aztecNodeConfig.enforceTimeTable = !!opts.enforceTimeTable;
|
|
313
|
+
// Only set the target committee size if it is explicitly set
|
|
314
|
+
aztecNodeConfig.aztecTargetCommitteeSize = opts.aztecTargetCommitteeSize ?? 0;
|
|
310
315
|
aztecNodeConfig.listenAddress = '127.0.0.1';
|
|
311
316
|
|
|
317
|
+
deployL1ContractsArgs.aztecTargetCommitteeSize ??= aztecNodeConfig.aztecTargetCommitteeSize;
|
|
318
|
+
|
|
312
319
|
// Create a temp directory for all ephemeral state and cleanup afterwards
|
|
313
320
|
const directoryToCleanup = path.join(tmpdir(), randomBytes(8).toString('hex'));
|
|
314
321
|
await fs.mkdir(directoryToCleanup, { recursive: true });
|
|
@@ -334,8 +341,8 @@ async function setupFromFresh(
|
|
|
334
341
|
const validatorPrivKey = getPrivateKeyFromIndex(0);
|
|
335
342
|
const proverNodePrivateKey = getPrivateKeyFromIndex(0);
|
|
336
343
|
|
|
337
|
-
aztecNodeConfig.publisherPrivateKey = `0x${publisherPrivKey!.toString('hex')}
|
|
338
|
-
aztecNodeConfig.validatorPrivateKeys = [`0x${validatorPrivKey!.toString('hex')}`];
|
|
344
|
+
aztecNodeConfig.publisherPrivateKey = new SecretValue<`0x${string}`>(`0x${publisherPrivKey!.toString('hex')}`);
|
|
345
|
+
aztecNodeConfig.validatorPrivateKeys = new SecretValue([`0x${validatorPrivKey!.toString('hex')}`]);
|
|
339
346
|
|
|
340
347
|
const ethCheatCodes = new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls);
|
|
341
348
|
|
|
@@ -350,6 +357,9 @@ async function setupFromFresh(
|
|
|
350
357
|
opts.initialAccountFeeJuice,
|
|
351
358
|
);
|
|
352
359
|
|
|
360
|
+
const l1Client = createExtendedL1Client([aztecNodeConfig.l1RpcUrls[0]], hdAccount, foundry);
|
|
361
|
+
await deployMulticall3(l1Client, logger);
|
|
362
|
+
|
|
353
363
|
const deployL1ContractsValues = await setupL1Contracts(aztecNodeConfig.l1RpcUrls[0], hdAccount, logger, {
|
|
354
364
|
...getL1ContractsConfigEnvVars(),
|
|
355
365
|
genesisArchiveRoot,
|
package/src/fixtures/utils.ts
CHANGED
|
@@ -31,16 +31,17 @@ import { GENESIS_ARCHIVE_ROOT, SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
|
31
31
|
import {
|
|
32
32
|
type DeployL1ContractsArgs,
|
|
33
33
|
type DeployL1ContractsReturnType,
|
|
34
|
-
ForwarderContract,
|
|
35
34
|
NULL_KEY,
|
|
36
35
|
type Operator,
|
|
37
36
|
createExtendedL1Client,
|
|
38
37
|
deployL1Contracts,
|
|
38
|
+
deployMulticall3,
|
|
39
39
|
getL1ContractsConfigEnvVars,
|
|
40
40
|
isAnvilTestChain,
|
|
41
41
|
l1Artifacts,
|
|
42
42
|
} from '@aztec/ethereum';
|
|
43
43
|
import { DelayedTxUtils, EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
|
|
44
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
44
45
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
45
46
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
46
47
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -363,9 +364,11 @@ export async function setup(
|
|
|
363
364
|
): Promise<EndToEndContext> {
|
|
364
365
|
let anvil: Anvil | undefined;
|
|
365
366
|
try {
|
|
367
|
+
opts.aztecTargetCommitteeSize ??= 0;
|
|
368
|
+
|
|
366
369
|
const config = { ...getConfigEnvVars(), ...opts };
|
|
367
370
|
// use initialValidators for the node config
|
|
368
|
-
config.validatorPrivateKeys = opts.initialValidators?.map(v => v.privateKey);
|
|
371
|
+
config.validatorPrivateKeys = new SecretValue(opts.initialValidators?.map(v => v.privateKey) ?? []);
|
|
369
372
|
|
|
370
373
|
config.peerCheckIntervalMS = TEST_PEER_CHECK_INTERVAL_MS;
|
|
371
374
|
// For tests we only want proving enabled if specifically requested
|
|
@@ -417,15 +420,15 @@ export async function setup(
|
|
|
417
420
|
let publisherPrivKey = undefined;
|
|
418
421
|
let publisherHdAccount = undefined;
|
|
419
422
|
|
|
420
|
-
if (config.publisherPrivateKey && config.publisherPrivateKey != NULL_KEY) {
|
|
421
|
-
publisherHdAccount = privateKeyToAccount(config.publisherPrivateKey);
|
|
423
|
+
if (config.publisherPrivateKey && config.publisherPrivateKey.getValue() != NULL_KEY) {
|
|
424
|
+
publisherHdAccount = privateKeyToAccount(config.publisherPrivateKey.getValue());
|
|
422
425
|
} else if (!MNEMONIC) {
|
|
423
426
|
throw new Error(`Mnemonic not provided and no publisher private key`);
|
|
424
427
|
} else {
|
|
425
428
|
publisherHdAccount = mnemonicToAccount(MNEMONIC, { addressIndex: 0 });
|
|
426
429
|
const publisherPrivKeyRaw = publisherHdAccount.getHdKey().privateKey;
|
|
427
430
|
publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
|
|
428
|
-
config.publisherPrivateKey = `0x${publisherPrivKey!.toString('hex')}
|
|
431
|
+
config.publisherPrivateKey = new SecretValue(`0x${publisherPrivKey!.toString('hex')}` as const);
|
|
429
432
|
}
|
|
430
433
|
|
|
431
434
|
if (PXE_URL) {
|
|
@@ -448,6 +451,9 @@ export async function setup(
|
|
|
448
451
|
await ethCheatCodes.setAutomine(true);
|
|
449
452
|
}
|
|
450
453
|
|
|
454
|
+
const l1Client = createExtendedL1Client(config.l1RpcUrls, publisherHdAccount!, chain);
|
|
455
|
+
await deployMulticall3(l1Client, logger);
|
|
456
|
+
|
|
451
457
|
const deployL1ContractsValues =
|
|
452
458
|
opts.deployL1ContractsValues ??
|
|
453
459
|
(await setupL1Contracts(
|
|
@@ -560,7 +566,7 @@ export async function setup(
|
|
|
560
566
|
config.p2pIp = opts.p2pIp ?? config.p2pIp ?? '127.0.0.1';
|
|
561
567
|
const aztecNode = await AztecNodeService.createAndSync(
|
|
562
568
|
config, // REFACTOR: createAndSync mutates this config
|
|
563
|
-
{ dateProvider, blobSinkClient, telemetry, p2pClientDeps },
|
|
569
|
+
{ dateProvider, blobSinkClient, telemetry, p2pClientDeps, logger: createLogger('node:MAIN-aztec-node') },
|
|
564
570
|
{ prefilledPublicData },
|
|
565
571
|
);
|
|
566
572
|
const sequencer = aztecNode.getSequencer();
|
|
@@ -589,6 +595,17 @@ export async function setup(
|
|
|
589
595
|
logger.verbose('Creating a pxe...');
|
|
590
596
|
const { pxe, teardown: pxeTeardown } = await setupPXEService(aztecNode!, pxeOpts, logger);
|
|
591
597
|
|
|
598
|
+
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxe!);
|
|
599
|
+
|
|
600
|
+
if (
|
|
601
|
+
(opts.aztecTargetCommitteeSize && opts.aztecTargetCommitteeSize > 0) ||
|
|
602
|
+
(opts.initialValidators && opts.initialValidators.length > 0)
|
|
603
|
+
) {
|
|
604
|
+
// We need to advance to epoch 2 such that the committee is set up.
|
|
605
|
+
logger.info(`Advancing to epoch 2`);
|
|
606
|
+
await cheatCodes.rollup.advanceToEpoch(2n, { updateDateProvider: dateProvider });
|
|
607
|
+
}
|
|
608
|
+
|
|
592
609
|
const accountManagers = await deployFundedSchnorrAccounts(pxe, initialFundedAccounts.slice(0, numberOfAccounts));
|
|
593
610
|
const wallets = await Promise.all(accountManagers.map(account => account.getWallet()));
|
|
594
611
|
if (initialFundedAccounts.length < numberOfAccounts) {
|
|
@@ -598,8 +615,6 @@ export async function setup(
|
|
|
598
615
|
);
|
|
599
616
|
}
|
|
600
617
|
|
|
601
|
-
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxe!);
|
|
602
|
-
|
|
603
618
|
const teardown = async () => {
|
|
604
619
|
try {
|
|
605
620
|
await pxeTeardown();
|
|
@@ -828,7 +843,7 @@ export function createAndSyncProverNode(
|
|
|
828
843
|
proverCoordinationNodeUrls: [],
|
|
829
844
|
realProofs: false,
|
|
830
845
|
proverAgentCount: 2,
|
|
831
|
-
publisherPrivateKey: proverNodePrivateKey,
|
|
846
|
+
publisherPrivateKey: new SecretValue(proverNodePrivateKey),
|
|
832
847
|
proverNodeMaxPendingJobs: 10,
|
|
833
848
|
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
834
849
|
proverNodePollingIntervalMs: 200,
|
|
@@ -860,13 +875,3 @@ function createDelayedL1TxUtils(aztecNodeConfig: AztecNodeConfig, privateKey: `0
|
|
|
860
875
|
l1TxUtils.enableDelayer(aztecNodeConfig.ethereumSlotDuration);
|
|
861
876
|
return l1TxUtils;
|
|
862
877
|
}
|
|
863
|
-
|
|
864
|
-
export async function createForwarderContract(
|
|
865
|
-
aztecNodeConfig: AztecNodeConfig,
|
|
866
|
-
privateKey: `0x${string}`,
|
|
867
|
-
rollupAddress: Hex,
|
|
868
|
-
) {
|
|
869
|
-
const l1Client = createExtendedL1Client(aztecNodeConfig.l1RpcUrls, privateKey, foundry);
|
|
870
|
-
const forwarderContract = await ForwarderContract.create(l1Client, createLogger('forwarder'), rollupAddress);
|
|
871
|
-
return forwarderContract;
|
|
872
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAGnE,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;IAC5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