@aztec/end-to-end 2.0.0-nightly.20250826 → 2.0.0-nightly.20250828
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 +1 -1
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +8 -3
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +2 -5
- package/dest/e2e_multi_validator/utils.d.ts +12 -0
- package/dest/e2e_multi_validator/utils.d.ts.map +1 -0
- package/dest/e2e_multi_validator/utils.js +220 -0
- package/dest/e2e_p2p/p2p_network.d.ts +3 -3
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +5 -8
- package/dest/e2e_p2p/shared.d.ts +13 -7
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +76 -38
- package/dest/fixtures/e2e_prover_test.js +4 -2
- package/dest/fixtures/setup_p2p_test.js +3 -1
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +9 -6
- package/dest/fixtures/utils.d.ts +6 -1
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +27 -9
- package/package.json +36 -35
- package/src/e2e_epochs/epochs_test.ts +11 -4
- package/src/e2e_fees/fees_test.ts +2 -2
- package/src/e2e_multi_validator/utils.ts +264 -0
- package/src/e2e_p2p/p2p_network.ts +9 -9
- package/src/e2e_p2p/shared.ts +101 -58
- package/src/fixtures/e2e_prover_test.ts +2 -2
- package/src/fixtures/setup_p2p_test.ts +1 -1
- package/src/fixtures/snapshot_manager.ts +6 -3
- package/src/fixtures/utils.ts +39 -9
package/dest/e2e_p2p/shared.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Fr, TxStatus, getContractInstanceFromInstantiationParams, retryUntil }
|
|
|
3
3
|
import { timesAsync, unique } from '@aztec/foundation/collection';
|
|
4
4
|
import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.js/Test';
|
|
5
5
|
import { createPXEService, getPXEServiceConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
6
|
+
import { getRoundForOffense } from '@aztec/slasher';
|
|
6
7
|
import { submitTxsTo } from '../shared/submit-transactions.js';
|
|
7
8
|
// submits a set of transactions to the provided Private eXecution Environment (PXE)
|
|
8
9
|
export const submitComplexTxsTo = async (logger, from, spamContract, numTxs, opts = {})=>{
|
|
@@ -71,17 +72,31 @@ export async function createPXEServiceAndPrepareTransactions(logger, node, numTx
|
|
|
71
72
|
node
|
|
72
73
|
};
|
|
73
74
|
}
|
|
74
|
-
export
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
export function awaitProposalExecution(slashingProposer, timeoutSeconds, logger) {
|
|
76
|
+
return new Promise((resolve, reject)=>{
|
|
77
|
+
const timeout = setTimeout(()=>{
|
|
78
|
+
logger.warn(`Timed out waiting for proposal execution`);
|
|
79
|
+
reject(new Error(`Timeout waiting for proposal execution after ${timeoutSeconds}s`));
|
|
80
|
+
}, timeoutSeconds * 1000);
|
|
81
|
+
if (slashingProposer.type === 'empire') {
|
|
82
|
+
const unwatch = slashingProposer.listenToPayloadSubmitted((args)=>{
|
|
83
|
+
logger.warn(`Proposal ${args.payload} from round ${args.round} executed`);
|
|
84
|
+
clearTimeout(timeout);
|
|
85
|
+
unwatch();
|
|
86
|
+
resolve(args.round);
|
|
87
|
+
});
|
|
88
|
+
} else if (slashingProposer.type === 'tally') {
|
|
89
|
+
const unwatch = slashingProposer.listenToRoundExecuted((args)=>{
|
|
90
|
+
logger.warn(`Slash from round ${args.round} executed`);
|
|
91
|
+
clearTimeout(timeout);
|
|
92
|
+
unwatch();
|
|
93
|
+
resolve(args.round);
|
|
94
|
+
});
|
|
95
|
+
} else {
|
|
96
|
+
clearTimeout(timeout);
|
|
97
|
+
reject(new Error(`Unknown slashing proposer type: ${slashingProposer.type}`));
|
|
79
98
|
}
|
|
80
|
-
|
|
81
|
-
const roundNumber = event.args.round;
|
|
82
|
-
const payload = event.args.payload;
|
|
83
|
-
return roundNumber && payload;
|
|
84
|
-
}, 'payload submitted', timeoutSeconds, 1);
|
|
99
|
+
});
|
|
85
100
|
}
|
|
86
101
|
export async function awaitCommitteeExists({ rollup, logger }) {
|
|
87
102
|
logger.info(`Waiting for committee to be set`);
|
|
@@ -92,49 +107,72 @@ export async function awaitCommitteeExists({ rollup, logger }) {
|
|
|
92
107
|
}, 'non-empty committee', 60);
|
|
93
108
|
return committee;
|
|
94
109
|
}
|
|
110
|
+
export async function awaitOffenseDetected({ logger, nodeAdmin, slashingRoundSize, epochDuration }) {
|
|
111
|
+
logger.info(`Waiting for an offense to be detected`);
|
|
112
|
+
const offenses = await retryUntil(async ()=>{
|
|
113
|
+
const offenses = await nodeAdmin.getSlashOffenses('all');
|
|
114
|
+
if (offenses.length > 0) {
|
|
115
|
+
return offenses;
|
|
116
|
+
}
|
|
117
|
+
}, 'non-empty offenses', 60);
|
|
118
|
+
logger.info(`Hit ${offenses.length} offenses on rounds ${unique(offenses.map((o)=>getRoundForOffense(o, {
|
|
119
|
+
slashingRoundSize,
|
|
120
|
+
epochDuration
|
|
121
|
+
})))}`, offenses);
|
|
122
|
+
return offenses;
|
|
123
|
+
}
|
|
95
124
|
/**
|
|
96
125
|
* Await the committee to be slashed out of the validator set.
|
|
97
126
|
* Currently assumes that the committee is the same size as the validator set.
|
|
98
|
-
*/ export async function awaitCommitteeKicked({ rollup, cheatCodes, committee, slashFactory, slashingProposer, slashingRoundSize, aztecSlotDuration, logger,
|
|
99
|
-
|
|
127
|
+
*/ export async function awaitCommitteeKicked({ rollup, cheatCodes, committee, slashFactory, slashingProposer, slashingRoundSize, aztecSlotDuration, logger, dateProvider }) {
|
|
128
|
+
if (!slashingProposer) {
|
|
129
|
+
throw new Error('No slashing proposer configured. Cannot test slashing.');
|
|
130
|
+
}
|
|
131
|
+
logger.info(`Advancing epochs so we start slashing`);
|
|
100
132
|
await cheatCodes.debugRollup();
|
|
101
|
-
await cheatCodes.advanceToNextEpoch(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
133
|
+
await cheatCodes.advanceToNextEpoch({
|
|
134
|
+
updateDateProvider: dateProvider
|
|
135
|
+
});
|
|
136
|
+
await cheatCodes.advanceToNextEpoch({
|
|
137
|
+
updateDateProvider: dateProvider
|
|
138
|
+
});
|
|
139
|
+
// Await for the slash payload to be created if empire (no payload is created on tally until execution time)
|
|
140
|
+
if (slashingProposer.type === 'empire') {
|
|
141
|
+
const slashPayloadEvents = await retryUntil(async ()=>{
|
|
142
|
+
const events = await slashFactory.getSlashPayloadCreatedEvents();
|
|
143
|
+
return events.length > 0 ? events : undefined;
|
|
144
|
+
}, 'slash payload created', 120, 1);
|
|
145
|
+
expect(slashPayloadEvents.length).toBe(1);
|
|
146
|
+
// The uniqueness check is needed since a validator may be slashed more than once on the same round (eg because they let two epochs be pruned)
|
|
147
|
+
expect(unique(slashPayloadEvents[0].slashes.map((slash)=>slash.validator.toString()))).toHaveLength(committee.length);
|
|
148
|
+
}
|
|
111
149
|
const attestersPre = await rollup.getAttesters();
|
|
112
150
|
expect(attestersPre.length).toBe(committee.length);
|
|
113
151
|
for (const attester of attestersPre){
|
|
114
152
|
const attesterInfo = await rollup.getAttesterView(attester);
|
|
115
|
-
//
|
|
116
|
-
expect(attesterInfo.status).toEqual(1);
|
|
153
|
+
expect(attesterInfo.status).toEqual(1); // Validating
|
|
117
154
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
// but they should be reduced to the "living" status
|
|
155
|
+
const timeout = slashingRoundSize * 2 * aztecSlotDuration;
|
|
156
|
+
logger.info(`Waiting for slash to be executed (timeout ${timeout}s)`);
|
|
157
|
+
await awaitProposalExecution(slashingProposer, timeout, logger);
|
|
158
|
+
// The attesters should still form the committee but they should be reduced to the "living" status
|
|
122
159
|
await cheatCodes.debugRollup();
|
|
123
160
|
const committeePostSlashing = await rollup.getCurrentEpochCommittee();
|
|
124
161
|
expect(committeePostSlashing?.length).toBe(attestersPre.length);
|
|
125
162
|
const attestersPostSlashing = await rollup.getAttesters();
|
|
126
163
|
expect(attestersPostSlashing.length).toBe(0);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
// }
|
|
164
|
+
for (const attester of attestersPre){
|
|
165
|
+
const attesterInfo = await rollup.getAttesterView(attester);
|
|
166
|
+
expect(attesterInfo.status).toEqual(2); // Living
|
|
167
|
+
}
|
|
168
|
+
logger.info(`Advancing two epochs to check current committee`);
|
|
133
169
|
await cheatCodes.debugRollup();
|
|
134
|
-
await cheatCodes.advanceToNextEpoch(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
await
|
|
170
|
+
await cheatCodes.advanceToNextEpoch({
|
|
171
|
+
updateDateProvider: dateProvider
|
|
172
|
+
});
|
|
173
|
+
await cheatCodes.advanceToNextEpoch({
|
|
174
|
+
updateDateProvider: dateProvider
|
|
175
|
+
});
|
|
138
176
|
await cheatCodes.debugRollup();
|
|
139
177
|
const committeeNextEpoch = await rollup.getCurrentEpochCommittee();
|
|
140
178
|
// The committee should be undefined, since the validator set is empty
|
|
@@ -197,10 +197,12 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
197
197
|
...this.context.aztecNodeConfig,
|
|
198
198
|
txCollectionNodeRpcUrls: [],
|
|
199
199
|
dataDirectory: undefined,
|
|
200
|
-
proverId: this.proverAddress
|
|
200
|
+
proverId: this.proverAddress,
|
|
201
201
|
realProofs: this.realProofs,
|
|
202
202
|
proverAgentCount: 2,
|
|
203
|
-
|
|
203
|
+
publisherPrivateKeys: [
|
|
204
|
+
new SecretValue(`0x${proverNodePrivateKey.toString('hex')}`)
|
|
205
|
+
],
|
|
204
206
|
proverNodeMaxPendingJobs: 100,
|
|
205
207
|
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
206
208
|
proverNodePollingIntervalMs: 100,
|
|
@@ -88,7 +88,9 @@ export async function createValidatorConfig(config, bootstrapNodeEnr, port, addr
|
|
|
88
88
|
config.validatorPrivateKeys = new SecretValue([
|
|
89
89
|
attesterPrivateKey
|
|
90
90
|
]);
|
|
91
|
-
config.
|
|
91
|
+
config.publisherPrivateKeys = [
|
|
92
|
+
new SecretValue(attesterPrivateKey)
|
|
93
|
+
];
|
|
92
94
|
const nodeConfig = {
|
|
93
95
|
...config,
|
|
94
96
|
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,
|
|
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,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM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O,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;AAiWD;;;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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SchnorrAccountContractArtifact } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { deployFundedSchnorrAccounts, generateSchnorrAccounts } from '@aztec/accounts/testing';
|
|
3
3
|
import { AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
|
|
4
|
-
import { BatchCall, DefaultWaitForProvenOpts, getContractClassFromArtifact, waitForProven } from '@aztec/aztec.js';
|
|
4
|
+
import { BatchCall, DefaultWaitForProvenOpts, EthAddress, getContractClassFromArtifact, waitForProven } from '@aztec/aztec.js';
|
|
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';
|
|
@@ -248,12 +248,18 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
248
248
|
});
|
|
249
249
|
const publisherPrivKeyRaw = hdAccount.getHdKey().privateKey;
|
|
250
250
|
const publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
|
|
251
|
+
const l1Client = createExtendedL1Client([
|
|
252
|
+
aztecNodeConfig.l1RpcUrls[0]
|
|
253
|
+
], hdAccount, foundry);
|
|
251
254
|
const validatorPrivKey = getPrivateKeyFromIndex(0);
|
|
252
255
|
const proverNodePrivateKey = getPrivateKeyFromIndex(0);
|
|
253
|
-
aztecNodeConfig.
|
|
256
|
+
aztecNodeConfig.publisherPrivateKeys = [
|
|
257
|
+
new SecretValue(`0x${publisherPrivKey.toString('hex')}`)
|
|
258
|
+
];
|
|
254
259
|
aztecNodeConfig.validatorPrivateKeys = new SecretValue([
|
|
255
260
|
`0x${validatorPrivKey.toString('hex')}`
|
|
256
261
|
]);
|
|
262
|
+
aztecNodeConfig.coinbase = opts.coinbase ?? EthAddress.fromString(`${hdAccount.address}`);
|
|
257
263
|
const ethCheatCodes = new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls);
|
|
258
264
|
if (opts.l1StartTime) {
|
|
259
265
|
await ethCheatCodes.warp(opts.l1StartTime, {
|
|
@@ -263,9 +269,6 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
263
269
|
const initialFundedAccounts = await generateSchnorrAccounts(numberOfInitialFundedAccounts);
|
|
264
270
|
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
265
271
|
const { genesisArchiveRoot, prefilledPublicData, fundingNeeded } = await getGenesisValues(initialFundedAccounts.map((a)=>a.address).concat(sponsoredFPCAddress), opts.initialAccountFeeJuice);
|
|
266
|
-
const l1Client = createExtendedL1Client([
|
|
267
|
-
aztecNodeConfig.l1RpcUrls[0]
|
|
268
|
-
], hdAccount, foundry);
|
|
269
272
|
await deployMulticall3(l1Client, logger);
|
|
270
273
|
const deployL1ContractsValues = await setupL1Contracts(aztecNodeConfig.l1RpcUrls[0], hdAccount, logger, {
|
|
271
274
|
...getL1ContractsConfigEnvVars(),
|
|
@@ -321,7 +324,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
321
324
|
dataStoreMapSizeKB: aztecNodeConfig.dataStoreMapSizeKB
|
|
322
325
|
}, telemetry);
|
|
323
326
|
await blobSink.start();
|
|
324
|
-
logger.
|
|
327
|
+
logger.info('Creating and synching an aztec node...');
|
|
325
328
|
const aztecNode = await AztecNodeService.createAndSync(aztecNodeConfig, {
|
|
326
329
|
telemetry,
|
|
327
330
|
dateProvider
|
package/dest/fixtures/utils.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import { type AccountWalletWithSecretKey, type AztecAddress, type AztecNode, typ
|
|
|
4
4
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec/testing';
|
|
5
5
|
import { type BlobSinkServer } from '@aztec/blob-sink/server';
|
|
6
6
|
import { type DeployL1ContractsArgs, type DeployL1ContractsReturnType, type Operator } from '@aztec/ethereum';
|
|
7
|
-
import { startAnvil } from '@aztec/ethereum/test';
|
|
7
|
+
import { EthCheatCodes, startAnvil } from '@aztec/ethereum/test';
|
|
8
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
8
9
|
import { Fr } from '@aztec/foundation/fields';
|
|
9
10
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
10
11
|
import type { DataStoreConfig } from '@aztec/kv-store/config';
|
|
@@ -91,6 +92,8 @@ export type SetupOptions = {
|
|
|
91
92
|
anvilAccounts?: number;
|
|
92
93
|
/** Port to start anvil (defaults to 8545) */
|
|
93
94
|
anvilPort?: number;
|
|
95
|
+
/** Key to use for publishing L1 contracts */
|
|
96
|
+
l1PublisherKey?: SecretValue<`0x${string}`>;
|
|
94
97
|
} & Partial<AztecNodeConfig>;
|
|
95
98
|
/** Context for an end-to-end test as returned by the `setup` function */
|
|
96
99
|
export type EndToEndContext = {
|
|
@@ -119,6 +122,8 @@ export type EndToEndContext = {
|
|
|
119
122
|
logger: Logger;
|
|
120
123
|
/** The cheat codes. */
|
|
121
124
|
cheatCodes: CheatCodes;
|
|
125
|
+
/** The cheat codes for L1 */
|
|
126
|
+
ethCheatCodes: EthCheatCodes;
|
|
122
127
|
/** The anvil test watcher (undefined if connected to remote environment) */
|
|
123
128
|
watcher: AnvilTestWatcher | undefined;
|
|
124
129
|
/** Allows tweaking current system time, used by the epoch cache only (undefined if connected to remote environment) */
|
|
@@ -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,EAEL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAOZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AAEpF,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAGhC,KAAK,QAAQ,EAOd,MAAM,iBAAiB,CAAC;AACzB,OAAO,
|
|
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,EAEL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK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M,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,GAAG,SAAS,EAChC,mBAAmB,GAAE,kBAAkB,EAAO,EAC9C,cAAc,GAAE,cAAmB,uBAoDpC"}
|
package/dest/fixtures/utils.js
CHANGED
|
@@ -9,7 +9,7 @@ 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
11
|
import { FeeAssetArtifact, NULL_KEY, RollupContract, createExtendedL1Client, deployL1Contracts, deployMulticall3, getL1ContractsConfigEnvVars, isAnvilTestChain } from '@aztec/ethereum';
|
|
12
|
-
import { DelayedTxUtils, EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
|
|
12
|
+
import { DelayedTxUtils, EthCheatCodes, EthCheatCodesWithState, createDelayedL1TxUtilsFromViemWallet, startAnvil } from '@aztec/ethereum/test';
|
|
13
13
|
import { SecretValue } from '@aztec/foundation/config';
|
|
14
14
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
15
15
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
@@ -36,7 +36,7 @@ import getPort from 'get-port';
|
|
|
36
36
|
import { tmpdir } from 'os';
|
|
37
37
|
import * as path from 'path';
|
|
38
38
|
import { getContract } from 'viem';
|
|
39
|
-
import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
|
|
39
|
+
import { generatePrivateKey, mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
|
|
40
40
|
import { foundry } from 'viem/chains';
|
|
41
41
|
import { MNEMONIC, TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
|
|
42
42
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
@@ -143,6 +143,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
143
143
|
l1Client,
|
|
144
144
|
rollupVersion
|
|
145
145
|
};
|
|
146
|
+
const ethCheatCodes = new EthCheatCodes(config.l1RpcUrls);
|
|
146
147
|
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxeClient);
|
|
147
148
|
const teardown = ()=>Promise.resolve();
|
|
148
149
|
logger.verbose('Constructing available wallets from already registered accounts...');
|
|
@@ -166,6 +167,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
166
167
|
accounts: wallets.slice(0, numberOfAccounts).map((w)=>w.getAddress()),
|
|
167
168
|
logger,
|
|
168
169
|
cheatCodes,
|
|
170
|
+
ethCheatCodes,
|
|
169
171
|
prefilledPublicData: undefined,
|
|
170
172
|
mockGossipSubNetwork: undefined,
|
|
171
173
|
watcher: undefined,
|
|
@@ -240,8 +242,10 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
240
242
|
}
|
|
241
243
|
let publisherPrivKey = undefined;
|
|
242
244
|
let publisherHdAccount = undefined;
|
|
243
|
-
if (
|
|
244
|
-
publisherHdAccount = privateKeyToAccount(
|
|
245
|
+
if (opts.l1PublisherKey && opts.l1PublisherKey.getValue() && opts.l1PublisherKey.getValue() != NULL_KEY) {
|
|
246
|
+
publisherHdAccount = privateKeyToAccount(opts.l1PublisherKey.getValue());
|
|
247
|
+
} else if (config.publisherPrivateKeys && config.publisherPrivateKeys.length > 0 && config.publisherPrivateKeys[0].getValue() != NULL_KEY) {
|
|
248
|
+
publisherHdAccount = privateKeyToAccount(config.publisherPrivateKeys[0].getValue());
|
|
245
249
|
} else if (!MNEMONIC) {
|
|
246
250
|
throw new Error(`Mnemonic not provided and no publisher private key`);
|
|
247
251
|
} else {
|
|
@@ -250,8 +254,11 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
250
254
|
});
|
|
251
255
|
const publisherPrivKeyRaw = publisherHdAccount.getHdKey().privateKey;
|
|
252
256
|
publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
|
|
253
|
-
config.
|
|
257
|
+
config.publisherPrivateKeys = [
|
|
258
|
+
new SecretValue(`0x${publisherPrivKey.toString('hex')}`)
|
|
259
|
+
];
|
|
254
260
|
}
|
|
261
|
+
config.coinbase = EthAddress.fromString(publisherHdAccount.address);
|
|
255
262
|
if (PXE_URL) {
|
|
256
263
|
// we are setting up against a remote environment, l1 contracts are assumed to already be deployed
|
|
257
264
|
return await setupWithRemoteEnvironment(publisherHdAccount, config, logger, numberOfAccounts);
|
|
@@ -365,6 +372,13 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
365
372
|
config.minTxsPerBlock = numberOfAccounts === 0 ? 0 : 1;
|
|
366
373
|
config.p2pEnabled = opts.mockGossipSubNetwork || config.p2pEnabled;
|
|
367
374
|
config.p2pIp = opts.p2pIp ?? config.p2pIp ?? '127.0.0.1';
|
|
375
|
+
if (!config.disableValidator) {
|
|
376
|
+
if ((config.validatorPrivateKeys?.getValue().length ?? 0) === 0) {
|
|
377
|
+
config.validatorPrivateKeys = new SecretValue([
|
|
378
|
+
generatePrivateKey()
|
|
379
|
+
]);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
368
382
|
const aztecNode = await AztecNodeService.createAndSync(config, {
|
|
369
383
|
dateProvider,
|
|
370
384
|
blobSinkClient,
|
|
@@ -377,7 +391,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
377
391
|
const sequencerClient = aztecNode.getSequencer();
|
|
378
392
|
if (sequencerClient) {
|
|
379
393
|
const publisher = sequencerClient.sequencer.publisher;
|
|
380
|
-
publisher.l1TxUtils = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, config.ethereumSlotDuration);
|
|
394
|
+
publisher.l1TxUtils = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, config.ethereumSlotDuration, l1Client);
|
|
381
395
|
}
|
|
382
396
|
let proverNode = undefined;
|
|
383
397
|
if (opts.startProverNode) {
|
|
@@ -434,8 +448,8 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
434
448
|
if (bbConfig?.cleanup) {
|
|
435
449
|
await bbConfig.cleanup();
|
|
436
450
|
}
|
|
437
|
-
await tryStop(anvil, logger);
|
|
438
451
|
await tryStop(watcher, logger);
|
|
452
|
+
await tryStop(anvil, logger);
|
|
439
453
|
await tryStop(blobSink, logger);
|
|
440
454
|
await tryRmDir(directoryToCleanup, logger);
|
|
441
455
|
} catch (err) {
|
|
@@ -447,6 +461,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
447
461
|
aztecNodeAdmin: aztecNode,
|
|
448
462
|
blobSink,
|
|
449
463
|
cheatCodes,
|
|
464
|
+
ethCheatCodes,
|
|
450
465
|
config,
|
|
451
466
|
dateProvider,
|
|
452
467
|
deployL1ContractsValues,
|
|
@@ -620,7 +635,9 @@ export function createAndSyncProverNode(proverNodePrivateKey, aztecNodeConfig, p
|
|
|
620
635
|
txCollectionNodeRpcUrls: [],
|
|
621
636
|
realProofs: false,
|
|
622
637
|
proverAgentCount: 2,
|
|
623
|
-
|
|
638
|
+
publisherPrivateKeys: [
|
|
639
|
+
new SecretValue(proverNodePrivateKey)
|
|
640
|
+
],
|
|
624
641
|
proverNodeMaxPendingJobs: 10,
|
|
625
642
|
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
626
643
|
proverNodePollingIntervalMs: 200,
|
|
@@ -629,6 +646,7 @@ export function createAndSyncProverNode(proverNodePrivateKey, aztecNodeConfig, p
|
|
|
629
646
|
txGatheringMaxParallelRequestsPerNode: 10,
|
|
630
647
|
txGatheringTimeoutMs: 24_000,
|
|
631
648
|
proverNodeFailedEpochStore: undefined,
|
|
649
|
+
proverId: EthAddress.fromNumber(1),
|
|
632
650
|
...proverNodeConfig
|
|
633
651
|
};
|
|
634
652
|
const l1TxUtils = createDelayedL1TxUtils(aztecNodeConfig, proverNodePrivateKey, 'prover-node', proverNodeDeps.dateProvider);
|
|
@@ -650,7 +668,7 @@ export function createAndSyncProverNode(proverNodePrivateKey, aztecNodeConfig, p
|
|
|
650
668
|
function createDelayedL1TxUtils(aztecNodeConfig, privateKey, logName, dateProvider) {
|
|
651
669
|
const l1Client = createExtendedL1Client(aztecNodeConfig.l1RpcUrls, privateKey, foundry);
|
|
652
670
|
const log = createLogger(logName);
|
|
653
|
-
const l1TxUtils =
|
|
671
|
+
const l1TxUtils = createDelayedL1TxUtilsFromViemWallet(l1Client, log, dateProvider, aztecNodeConfig);
|
|
654
672
|
l1TxUtils.enableDelayer(aztecNodeConfig.ethereumSlotDuration);
|
|
655
673
|
return l1TxUtils;
|
|
656
674
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "2.0.0-nightly.
|
|
3
|
+
"version": "2.0.0-nightly.20250828",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,40 +25,41 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "2.0.0-nightly.
|
|
29
|
-
"@aztec/archiver": "2.0.0-nightly.
|
|
30
|
-
"@aztec/aztec": "2.0.0-nightly.
|
|
31
|
-
"@aztec/aztec-node": "2.0.0-nightly.
|
|
32
|
-
"@aztec/aztec.js": "2.0.0-nightly.
|
|
33
|
-
"@aztec/bb-prover": "2.0.0-nightly.
|
|
34
|
-
"@aztec/blob-lib": "2.0.0-nightly.
|
|
35
|
-
"@aztec/blob-sink": "2.0.0-nightly.
|
|
36
|
-
"@aztec/bot": "2.0.0-nightly.
|
|
37
|
-
"@aztec/cli": "2.0.0-nightly.
|
|
38
|
-
"@aztec/constants": "2.0.0-nightly.
|
|
39
|
-
"@aztec/entrypoints": "2.0.0-nightly.
|
|
40
|
-
"@aztec/epoch-cache": "2.0.0-nightly.
|
|
41
|
-
"@aztec/ethereum": "2.0.0-nightly.
|
|
42
|
-
"@aztec/foundation": "2.0.0-nightly.
|
|
43
|
-
"@aztec/kv-store": "2.0.0-nightly.
|
|
44
|
-
"@aztec/l1-artifacts": "2.0.0-nightly.
|
|
45
|
-
"@aztec/merkle-tree": "2.0.0-nightly.
|
|
46
|
-
"@aztec/
|
|
47
|
-
"@aztec/noir-
|
|
48
|
-
"@aztec/noir-
|
|
49
|
-
"@aztec/noir-
|
|
50
|
-
"@aztec/
|
|
51
|
-
"@aztec/
|
|
52
|
-
"@aztec/
|
|
53
|
-
"@aztec/prover-
|
|
54
|
-
"@aztec/
|
|
55
|
-
"@aztec/
|
|
56
|
-
"@aztec/
|
|
57
|
-
"@aztec/
|
|
58
|
-
"@aztec/
|
|
59
|
-
"@aztec/
|
|
60
|
-
"@aztec/
|
|
61
|
-
"@aztec/
|
|
28
|
+
"@aztec/accounts": "2.0.0-nightly.20250828",
|
|
29
|
+
"@aztec/archiver": "2.0.0-nightly.20250828",
|
|
30
|
+
"@aztec/aztec": "2.0.0-nightly.20250828",
|
|
31
|
+
"@aztec/aztec-node": "2.0.0-nightly.20250828",
|
|
32
|
+
"@aztec/aztec.js": "2.0.0-nightly.20250828",
|
|
33
|
+
"@aztec/bb-prover": "2.0.0-nightly.20250828",
|
|
34
|
+
"@aztec/blob-lib": "2.0.0-nightly.20250828",
|
|
35
|
+
"@aztec/blob-sink": "2.0.0-nightly.20250828",
|
|
36
|
+
"@aztec/bot": "2.0.0-nightly.20250828",
|
|
37
|
+
"@aztec/cli": "2.0.0-nightly.20250828",
|
|
38
|
+
"@aztec/constants": "2.0.0-nightly.20250828",
|
|
39
|
+
"@aztec/entrypoints": "2.0.0-nightly.20250828",
|
|
40
|
+
"@aztec/epoch-cache": "2.0.0-nightly.20250828",
|
|
41
|
+
"@aztec/ethereum": "2.0.0-nightly.20250828",
|
|
42
|
+
"@aztec/foundation": "2.0.0-nightly.20250828",
|
|
43
|
+
"@aztec/kv-store": "2.0.0-nightly.20250828",
|
|
44
|
+
"@aztec/l1-artifacts": "2.0.0-nightly.20250828",
|
|
45
|
+
"@aztec/merkle-tree": "2.0.0-nightly.20250828",
|
|
46
|
+
"@aztec/node-keystore": "2.0.0-nightly.20250828",
|
|
47
|
+
"@aztec/noir-contracts.js": "2.0.0-nightly.20250828",
|
|
48
|
+
"@aztec/noir-noirc_abi": "2.0.0-nightly.20250828",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "2.0.0-nightly.20250828",
|
|
50
|
+
"@aztec/noir-test-contracts.js": "2.0.0-nightly.20250828",
|
|
51
|
+
"@aztec/p2p": "2.0.0-nightly.20250828",
|
|
52
|
+
"@aztec/protocol-contracts": "2.0.0-nightly.20250828",
|
|
53
|
+
"@aztec/prover-client": "2.0.0-nightly.20250828",
|
|
54
|
+
"@aztec/prover-node": "2.0.0-nightly.20250828",
|
|
55
|
+
"@aztec/pxe": "2.0.0-nightly.20250828",
|
|
56
|
+
"@aztec/sequencer-client": "2.0.0-nightly.20250828",
|
|
57
|
+
"@aztec/simulator": "2.0.0-nightly.20250828",
|
|
58
|
+
"@aztec/slasher": "2.0.0-nightly.20250828",
|
|
59
|
+
"@aztec/stdlib": "2.0.0-nightly.20250828",
|
|
60
|
+
"@aztec/telemetry-client": "2.0.0-nightly.20250828",
|
|
61
|
+
"@aztec/validator-client": "2.0.0-nightly.20250828",
|
|
62
|
+
"@aztec/world-state": "2.0.0-nightly.20250828",
|
|
62
63
|
"@iarna/toml": "^2.2.5",
|
|
63
64
|
"@jest/globals": "^30.0.0",
|
|
64
65
|
"@noble/curves": "=1.0.0",
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
SequencerState,
|
|
27
27
|
} from '@aztec/sequencer-client';
|
|
28
28
|
import type { TestSequencerClient } from '@aztec/sequencer-client/test';
|
|
29
|
-
import
|
|
29
|
+
import { EthAddress, type L2BlockNumber } from '@aztec/stdlib/block';
|
|
30
30
|
import { type L1RollupConstants, getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
31
31
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
32
32
|
|
|
@@ -124,7 +124,8 @@ export class EpochsTestContext {
|
|
|
124
124
|
proverTestDelayMs: opts.proverTestDelayMs ?? 0,
|
|
125
125
|
// We use numeric incremental prover ids for simplicity, but we can switch to
|
|
126
126
|
// using the prover's eth address if the proverId is used for something in the rollup contract
|
|
127
|
-
|
|
127
|
+
// Use numeric EthAddress for deterministic prover id
|
|
128
|
+
proverId: EthAddress.fromNumber(1),
|
|
128
129
|
// This must be enough so that the tx from the prover is delayed properly,
|
|
129
130
|
// but not so much to hang the sequencer and timeout the teardown
|
|
130
131
|
txPropagationMaxQueryAttempts: opts.txPropagationMaxQueryAttempts ?? 12,
|
|
@@ -189,7 +190,7 @@ export class EpochsTestContext {
|
|
|
189
190
|
const proverNode = await withLogNameSuffix(suffix, () =>
|
|
190
191
|
createAndSyncProverNode(
|
|
191
192
|
proverNodePrivateKey,
|
|
192
|
-
{ ...this.context.config, proverId:
|
|
193
|
+
{ ...this.context.config, proverId: EthAddress.fromNumber(parseInt(suffix, 10)) },
|
|
193
194
|
{ dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')) },
|
|
194
195
|
this.context.aztecNode,
|
|
195
196
|
undefined,
|
|
@@ -250,9 +251,15 @@ export class EpochsTestContext {
|
|
|
250
251
|
this.logger.info(
|
|
251
252
|
`Setting tx delayer max inclusion time into slot to ${opts.txDelayerMaxInclusionTimeIntoSlot} seconds`,
|
|
252
253
|
);
|
|
254
|
+
// Here we reach into the sequencer and hook in a tx delayer. The problem is that the sequencer's l1 utils only uses a public client, not a wallet.
|
|
255
|
+
// The delayer needs a wallet (a client that can sign), so we have to create one here.
|
|
256
|
+
const l1Client = createExtendedL1Client(
|
|
257
|
+
resolvedConfig.l1RpcUrls!,
|
|
258
|
+
resolvedConfig.publisherPrivateKeys![0]!.getValue(),
|
|
259
|
+
);
|
|
253
260
|
const sequencer = node.getSequencer() as TestSequencerClient;
|
|
254
261
|
const publisher = sequencer.sequencer.publisher;
|
|
255
|
-
const delayed = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, this.L1_BLOCK_TIME_IN_S);
|
|
262
|
+
const delayed = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, this.L1_BLOCK_TIME_IN_S, l1Client);
|
|
256
263
|
delayed.delayer!.setMaxInclusionTimeIntoSlot(opts.txDelayerMaxInclusionTimeIntoSlot);
|
|
257
264
|
publisher.l1TxUtils = delayed;
|
|
258
265
|
}
|
|
@@ -108,6 +108,8 @@ export class FeesTest {
|
|
|
108
108
|
if (!numberOfAccounts) {
|
|
109
109
|
throw new Error('There must be at least 1 initial account.');
|
|
110
110
|
}
|
|
111
|
+
setupOptions.coinbase ??= EthAddress.random();
|
|
112
|
+
this.coinbase = setupOptions.coinbase!;
|
|
111
113
|
this.logger = createLogger(`e2e:e2e_fees:${testName}`);
|
|
112
114
|
this.snapshotManager = createSnapshotManager(
|
|
113
115
|
`e2e_fees/${testName}-${numberOfAccounts}`,
|
|
@@ -119,7 +121,6 @@ export class FeesTest {
|
|
|
119
121
|
|
|
120
122
|
async setup() {
|
|
121
123
|
const context = await this.snapshotManager.setup();
|
|
122
|
-
await context.aztecNode.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
|
|
123
124
|
|
|
124
125
|
this.rollupContract = RollupContract.getFromConfig(context.aztecNodeConfig);
|
|
125
126
|
this.chainMonitor = new ChainMonitor(this.rollupContract, context.dateProvider, this.logger, 200).start();
|
|
@@ -205,7 +206,6 @@ export class FeesTest {
|
|
|
205
206
|
|
|
206
207
|
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
207
208
|
this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.aliceWallet);
|
|
208
|
-
this.coinbase = EthAddress.random();
|
|
209
209
|
},
|
|
210
210
|
);
|
|
211
211
|
}
|