@aztec/end-to-end 1.0.0-nightly.20250608 → 1.0.0-nightly.20250611

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.
@@ -1,12 +1,14 @@
1
1
  import type { InitialAccountData } from '@aztec/accounts/testing';
2
2
  import type { AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
3
3
  import { type AccountWalletWithSecretKey } from '@aztec/aztec.js';
4
- import { type Operator } from '@aztec/ethereum';
4
+ import { type Operator, RollupContract, type ViemClient } from '@aztec/ethereum';
5
5
  import { ChainMonitor } from '@aztec/ethereum/test';
6
6
  import { type Logger } from '@aztec/foundation/log';
7
+ import { SlashFactoryAbi, SlasherAbi, SlashingProposerAbi } from '@aztec/l1-artifacts';
7
8
  import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
8
9
  import type { BootstrapNode } from '@aztec/p2p/bootstrap';
9
10
  import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
11
+ import { type GetContractReturnType } from 'viem';
10
12
  import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
11
13
  export declare const WAIT_FOR_TX_TIMEOUT: number;
12
14
  export declare const SHORTENED_BLOCK_TIME_CONFIG_NO_PRUNES: {
@@ -78,5 +80,11 @@ export declare class P2PNetworkTest {
78
80
  setup(): Promise<void>;
79
81
  stopNodes(nodes: AztecNodeService[]): Promise<void>;
80
82
  teardown(): Promise<void>;
83
+ getContracts(): Promise<{
84
+ rollup: RollupContract;
85
+ slasherContract: GetContractReturnType<typeof SlasherAbi, ViemClient>;
86
+ slashingProposer: GetContractReturnType<typeof SlashingProposerAbi, ViemClient>;
87
+ slashFactory: GetContractReturnType<typeof SlashFactoryAbi, ViemClient>;
88
+ }>;
81
89
  }
82
90
  //# sourceMappingURL=p2p_network.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"p2p_network.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/p2p_network.ts"],"names":[],"mappings":"AACA,O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YAAY,EAAE,qBAAqB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,CAAC;KACzE,CAAC;CA8BH"}
@@ -3,13 +3,13 @@ import { EthAddress } from '@aztec/aztec.js';
3
3
  import { L1TxUtils, RollupContract, deployL1Contract, getL1ContractsConfigEnvVars, l1Artifacts } from '@aztec/ethereum';
4
4
  import { ChainMonitor } from '@aztec/ethereum/test';
5
5
  import { createLogger } from '@aztec/foundation/log';
6
- import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
6
+ import { RollupAbi, SlashFactoryAbi, SlasherAbi, SlashingProposerAbi, TestERC20Abi } from '@aztec/l1-artifacts';
7
7
  import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
8
8
  import { createBootstrapNodeFromPrivateKey, getBootstrapNodeEnr } from '@aztec/p2p/test-helpers';
9
9
  import { tryStop } from '@aztec/stdlib/interfaces/server';
10
10
  import { getGenesisValues } from '@aztec/world-state/testing';
11
11
  import getPort from 'get-port';
12
- import { getContract } from 'viem';
12
+ import { getAddress, getContract } from 'viem';
13
13
  import { privateKeyToAccount } from 'viem/accounts';
14
14
  import { ATTESTER_PRIVATE_KEYS_START_INDEX, createValidatorConfig, generatePrivateKeys } from '../fixtures/setup_p2p_test.js';
15
15
  import { createSnapshotManager, deployAccounts } from '../fixtures/snapshot_manager.js';
@@ -80,7 +80,9 @@ export class P2PNetworkTest {
80
80
  aztecSlotDuration: initialValidatorConfig.aztecSlotDuration ?? l1ContractsConfig.aztecSlotDuration,
81
81
  aztecProofSubmissionWindow: initialValidatorConfig.aztecProofSubmissionWindow ?? l1ContractsConfig.aztecProofSubmissionWindow,
82
82
  initialValidators: [],
83
- mockZkPassportVerifier
83
+ zkPassportArgs: {
84
+ mockZkPassportVerifier
85
+ }
84
86
  });
85
87
  }
86
88
  static async create({ testName, numberOfNodes, basePort, metricsPort, initialConfig, startProverNode, mockZkPassportVerifier }) {
@@ -141,7 +143,7 @@ export class P2PNetworkTest {
141
143
  abi: l1Artifacts.multiAdder.contractAbi,
142
144
  client: deployL1ContractsValues.l1Client
143
145
  });
144
- const stakeNeeded = l1ContractsConfig.minimumStake * BigInt(this.numberOfNodes);
146
+ const stakeNeeded = l1ContractsConfig.depositAmount * BigInt(this.numberOfNodes);
145
147
  await Promise.all([
146
148
  await stakingAsset.write.mint([
147
149
  multiAdder.address,
@@ -238,4 +240,31 @@ export class P2PNetworkTest {
238
240
  await tryStop(this.bootstrapNode, this.logger);
239
241
  await this.snapshotManager.teardown();
240
242
  }
243
+ async getContracts() {
244
+ if (!this.ctx.deployL1ContractsValues) {
245
+ throw new Error('DeployL1ContractsValues not set');
246
+ }
247
+ const rollup = new RollupContract(this.ctx.deployL1ContractsValues.l1Client, this.ctx.deployL1ContractsValues.l1ContractAddresses.rollupAddress);
248
+ const slasherContract = getContract({
249
+ address: getAddress(await rollup.getSlasher()),
250
+ abi: SlasherAbi,
251
+ client: this.ctx.deployL1ContractsValues.l1Client
252
+ });
253
+ const slashingProposer = getContract({
254
+ address: getAddress(await slasherContract.read.PROPOSER()),
255
+ abi: SlashingProposerAbi,
256
+ client: this.ctx.deployL1ContractsValues.l1Client
257
+ });
258
+ const slashFactory = getContract({
259
+ address: getAddress(this.ctx.deployL1ContractsValues.l1ContractAddresses.slashFactoryAddress.toString()),
260
+ abi: SlashFactoryAbi,
261
+ client: this.ctx.deployL1ContractsValues.l1Client
262
+ });
263
+ return {
264
+ rollup,
265
+ slasherContract,
266
+ slashingProposer,
267
+ slashFactory
268
+ };
269
+ }
241
270
  }
@@ -1,8 +1,14 @@
1
1
  import type { InitialAccountData } from '@aztec/accounts/testing';
2
2
  import type { AztecNodeService } from '@aztec/aztec-node';
3
3
  import { type Logger, ProvenTx, type SentTx } from '@aztec/aztec.js';
4
+ import type { RollupCheatCodes } from '@aztec/aztec.js/testing';
5
+ import type { RollupContract, ViemClient } from '@aztec/ethereum';
6
+ import type { SlashFactoryAbi } from '@aztec/l1-artifacts/SlashFactoryAbi';
7
+ import type { SlashingProposerAbi } from '@aztec/l1-artifacts/SlashingProposerAbi';
4
8
  import type { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
5
9
  import { PXEService } from '@aztec/pxe/server';
10
+ import { Offense } from '@aztec/slasher';
11
+ import type { GetContractReturnType } from 'viem';
6
12
  import type { NodeContext } from '../fixtures/setup_p2p_test.js';
7
13
  export declare const submitComplexTxsTo: (logger: Logger, spamContract: SpamContract, numTxs: number, opts?: {
8
14
  callPublic?: boolean;
@@ -13,4 +19,22 @@ export declare function createPXEServiceAndPrepareTransactions(logger: Logger, n
13
19
  txs: ProvenTx[];
14
20
  node: AztecNodeService;
15
21
  }>;
22
+ export declare function awaitProposalExecution(slashingProposer: GetContractReturnType<typeof SlashingProposerAbi, ViemClient>, timeoutSeconds: number): Promise<void>;
23
+ export declare function awaitCommitteeExists({ rollup, logger }: {
24
+ rollup: RollupContract;
25
+ logger: Logger;
26
+ }): Promise<readonly `0x${string}`[]>;
27
+ export declare function awaitCommitteeKicked({ offense, rollup, cheatCodes, committee, slashingAmount, slashFactory, slashingProposer, slashingRoundSize, aztecSlotDuration, logger, sendDummyTx, }: {
28
+ offense: Offense;
29
+ rollup: RollupContract;
30
+ cheatCodes: RollupCheatCodes;
31
+ committee: readonly `0x${string}`[];
32
+ slashingAmount: bigint;
33
+ slashFactory: GetContractReturnType<typeof SlashFactoryAbi, ViemClient>;
34
+ slashingProposer: GetContractReturnType<typeof SlashingProposerAbi, ViemClient>;
35
+ slashingRoundSize: number;
36
+ aztecSlotDuration: number;
37
+ logger: Logger;
38
+ sendDummyTx: () => Promise<void>;
39
+ }): Promise<void>;
16
40
  //# sourceMappingURL=shared.d.ts.map
@@ -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,CA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,CAAC,EACzC,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,EACN,WAAW,GACZ,EAAE;IACD,OAAO,EAAE,OAAO,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,iBA2DA"}
@@ -1,8 +1,9 @@
1
1
  import { getSchnorrAccount } from '@aztec/accounts/schnorr';
2
- import { Fr, TxStatus, getContractInstanceFromDeployParams } from '@aztec/aztec.js';
2
+ import { Fr, TxStatus, getContractInstanceFromDeployParams, retryUntil } from '@aztec/aztec.js';
3
3
  import { timesAsync } 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 { OffenseToBigInt } 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, spamContract, numTxs, opts = {})=>{
@@ -67,3 +68,73 @@ export async function createPXEServiceAndPrepareTransactions(logger, node, numTx
67
68
  node
68
69
  };
69
70
  }
71
+ export async function awaitProposalExecution(slashingProposer, timeoutSeconds) {
72
+ await retryUntil(async ()=>{
73
+ const events = await slashingProposer.getEvents.ProposalExecuted();
74
+ if (events.length === 0) {
75
+ return false;
76
+ }
77
+ const event = events[0];
78
+ const roundNumber = event.args.round;
79
+ const proposal = event.args.proposal;
80
+ return roundNumber && proposal;
81
+ }, 'proposal executed', timeoutSeconds, 1);
82
+ }
83
+ export async function awaitCommitteeExists({ rollup, logger }) {
84
+ logger.info(`Waiting for committee to be set`);
85
+ let committee = [];
86
+ await retryUntil(async ()=>{
87
+ committee = await rollup.getCurrentEpochCommittee();
88
+ return committee.length > 0;
89
+ }, 'non-empty committee', 60);
90
+ return committee;
91
+ }
92
+ export async function awaitCommitteeKicked({ offense, rollup, cheatCodes, committee, slashingAmount, slashFactory, slashingProposer, slashingRoundSize, aztecSlotDuration, logger, sendDummyTx }) {
93
+ logger.info(`Waiting for slash payload to be deployed`);
94
+ const expectedSlashes = Array.from({
95
+ length: committee.length
96
+ }, ()=>slashingAmount);
97
+ const sortedCommittee = [
98
+ ...committee
99
+ ].sort((a, b)=>a.localeCompare(b));
100
+ await retryUntil(async ()=>{
101
+ const [address, _, isDeployed] = await slashFactory.read.getAddressAndIsDeployed([
102
+ sortedCommittee,
103
+ expectedSlashes
104
+ ]);
105
+ return address && isDeployed;
106
+ }, 'slash payload deployed', 60, 1);
107
+ const slashPayloadEvents = await slashFactory.getEvents.SlashPayloadCreated();
108
+ expect(slashPayloadEvents.length).toBe(1);
109
+ expect(slashPayloadEvents[0].args.offenses).toEqual(Array.from({
110
+ length: committee.length
111
+ }, ()=>OffenseToBigInt[offense]));
112
+ const attestersPre = await rollup.getAttesters();
113
+ expect(attestersPre.length).toBe(committee.length);
114
+ for (const attester of attestersPre){
115
+ const attesterInfo = await rollup.getAttesterView(attester);
116
+ // Check that status isValidating
117
+ expect(attesterInfo.status).toEqual(1);
118
+ }
119
+ logger.info(`Waiting for slash proposal to be executed`);
120
+ await awaitProposalExecution(slashingProposer, slashingRoundSize * 2 * aztecSlotDuration);
121
+ // The attesters should still form the committee
122
+ // but they should be reduced to the "living" status
123
+ await cheatCodes.debugRollup();
124
+ const committeePostSlashing = await rollup.getCurrentEpochCommittee();
125
+ expect(committeePostSlashing.length).toBe(attestersPre.length);
126
+ const attestersPostSlashing = await rollup.getAttesters();
127
+ expect(attestersPostSlashing.length).toBe(0);
128
+ for (const attester of attestersPre){
129
+ const attesterInfo = await rollup.getAttesterView(attester);
130
+ // Check that status is Living
131
+ expect(attesterInfo.status).toEqual(2);
132
+ }
133
+ await cheatCodes.advanceToNextEpoch();
134
+ await sendDummyTx();
135
+ await cheatCodes.debugRollup();
136
+ const committeeNextEpoch = await rollup.getCurrentEpochCommittee();
137
+ expect(committeeNextEpoch.length).toBe(0);
138
+ const attestersNextEpoch = await rollup.getAttesters();
139
+ expect(attestersNextEpoch.length).toBe(0);
140
+ }
@@ -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;AAE9C,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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D,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"}
@@ -31,6 +31,11 @@ export async function createNodes(config, dateProvider, bootstrapNodeEnr, numNod
31
31
  nodePromises.push(nodePromise);
32
32
  }
33
33
  const nodes = await Promise.all(nodePromises);
34
+ // Sanity check that we have a sequencer
35
+ const seqClient = nodes[0].getSequencer();
36
+ if (!seqClient) {
37
+ throw new Error('Sequencer not found');
38
+ }
34
39
  removeLogNameHandler(logNameHandler);
35
40
  return nodes;
36
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,SAAS,EAGd,KAAK,MAAM,EACX,KAAK,GAAG,EAGT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAI9B,MAAM,iBAAiB,CAAC;AAsBzB,2DAA2D;AAC3D,MAAM,MAAM,mBAAmB,GAAG;IAChC,0BAA0B;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,+CAA+C;IAC/C,GAAG,EAAE,GAAG,CAAC;IACT,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,QAAQ,EAAE,wBAAwB,CAAC;IACnC,wBAAwB;IACxB,WAAW,EAAE,aAAa,CAAC;IAC3B,0BAA0B;IAC1B,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO;IACP,uBAAuB,EAAE,2BAA2B,CAAC;IACrD,4BAA4B;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAGF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,MAAM,OAAO,CAAC,mBAAmB,CAAC,EACzC,SAAS,MAAM,OAAO,CAAC,IAAI,CAAC,EAC5B,gCAAkC,SA49BnC,CAAC"}
1
+ {"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,SAAS,EAGd,KAAK,MAAM,EACX,KAAK,GAAG,EAGT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAI9B,MAAM,iBAAiB,CAAC;AAuBzB,2DAA2D;AAC3D,MAAM,MAAM,mBAAmB,GAAG;IAChC,0BAA0B;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,+CAA+C;IAC/C,GAAG,EAAE,GAAG,CAAC;IACT,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,QAAQ,EAAE,wBAAwB,CAAC;IACnC,wBAAwB;IACxB,WAAW,EAAE,aAAa,CAAC;IAC3B,0BAA0B;IAC1B,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO;IACP,uBAAuB,EAAE,2BAA2B,CAAC;IACrD,4BAA4B;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAGF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,MAAM,OAAO,CAAC,mBAAmB,CAAC,EACzC,SAAS,MAAM,OAAO,CAAC,IAAI,CAAC,EAC5B,gCAAkC,SA49BnC,CAAC"}
@@ -3,6 +3,7 @@ import { RollupContract, deployL1Contract, extractEvent } from '@aztec/ethereum'
3
3
  import { sha256ToField } from '@aztec/foundation/crypto';
4
4
  import { InboxAbi, UniswapPortalAbi, UniswapPortalBytecode } from '@aztec/l1-artifacts';
5
5
  import { UniswapContract } from '@aztec/noir-contracts.js/Uniswap';
6
+ import { computeL2ToL1MessageHash } from '@aztec/stdlib/hash';
6
7
  import { computeL2ToL1MembershipWitness } from '@aztec/stdlib/messaging';
7
8
  import { jest } from '@jest/globals';
8
9
  import { getContract, parseEther, toFunctionSelector } from 'viem';
@@ -135,26 +136,26 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
135
136
  secretHashForDepositingSwappedDai,
136
137
  ownerEthAddress.toBuffer32()
137
138
  ]);
138
- const swapPrivateLeaf = sha256ToField([
139
- uniswapL2Contract.address,
140
- new Fr(version),
141
- EthAddress.fromString(uniswapPortal.address).toBuffer32(),
142
- new Fr(l1Client.chain.id),
143
- swapPrivateContent
144
- ]);
139
+ const swapPrivateLeaf = computeL2ToL1MessageHash({
140
+ l2Sender: uniswapL2Contract.address,
141
+ l1Recipient: EthAddress.fromString(uniswapPortal.address),
142
+ content: swapPrivateContent,
143
+ rollupVersion: new Fr(version),
144
+ chainId: new Fr(l1Client.chain.id)
145
+ });
145
146
  const withdrawContent = sha256ToField([
146
147
  Buffer.from(toFunctionSelector('withdraw(address,uint256,address)').substring(2), 'hex'),
147
148
  uniswapPortalAddress.toBuffer32(),
148
149
  new Fr(wethAmountToBridge),
149
150
  uniswapPortalAddress.toBuffer32()
150
151
  ]);
151
- const withdrawLeaf = sha256ToField([
152
- wethCrossChainHarness.l2Bridge.address,
153
- new Fr(version),
154
- wethCrossChainHarness.tokenPortalAddress.toBuffer32(),
155
- new Fr(l1Client.chain.id),
156
- withdrawContent
157
- ]);
152
+ const withdrawLeaf = computeL2ToL1MessageHash({
153
+ l2Sender: wethCrossChainHarness.l2Bridge.address,
154
+ l1Recipient: wethCrossChainHarness.tokenPortalAddress,
155
+ content: withdrawContent,
156
+ rollupVersion: new Fr(version),
157
+ chainId: new Fr(l1Client.chain.id)
158
+ });
158
159
  // ensure that user's funds were burnt
159
160
  await wethCrossChainHarness.expectPrivateBalanceOnL2(ownerAddress, wethL2BalanceBeforeSwap - wethAmountToBridge);
160
161
  // ensure that uniswap contract didn't eat the funds.
@@ -536,26 +537,26 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
536
537
  secretHashForDepositingSwappedDai,
537
538
  ownerEthAddress.toBuffer32()
538
539
  ]);
539
- const swapPrivateLeaf = sha256ToField([
540
- uniswapL2Contract.address,
541
- new Fr(version),
542
- EthAddress.fromString(uniswapPortal.address).toBuffer32(),
543
- new Fr(l1Client.chain.id),
544
- swapPrivateContent
545
- ]);
540
+ const swapPrivateLeaf = computeL2ToL1MessageHash({
541
+ l2Sender: uniswapL2Contract.address,
542
+ l1Recipient: EthAddress.fromString(uniswapPortal.address),
543
+ content: swapPrivateContent,
544
+ rollupVersion: new Fr(version),
545
+ chainId: new Fr(l1Client.chain.id)
546
+ });
546
547
  const withdrawContent = sha256ToField([
547
548
  Buffer.from(toFunctionSelector('withdraw(address,uint256,address)').substring(2), 'hex'),
548
549
  uniswapPortalAddress.toBuffer32(),
549
550
  new Fr(wethAmountToBridge),
550
551
  uniswapPortalAddress.toBuffer32()
551
552
  ]);
552
- const withdrawLeaf = sha256ToField([
553
- wethCrossChainHarness.l2Bridge.address,
554
- new Fr(version),
555
- wethCrossChainHarness.tokenPortalAddress.toBuffer32(),
556
- new Fr(l1Client.chain.id),
557
- withdrawContent
558
- ]);
553
+ const withdrawLeaf = computeL2ToL1MessageHash({
554
+ l2Sender: wethCrossChainHarness.l2Bridge.address,
555
+ l1Recipient: wethCrossChainHarness.tokenPortalAddress,
556
+ content: withdrawContent,
557
+ rollupVersion: new Fr(version),
558
+ chainId: new Fr(l1Client.chain.id)
559
+ });
559
560
  const swapResult = await computeL2ToL1MembershipWitness(aztecNode, withdrawReceipt.blockNumber, swapPrivateLeaf);
560
561
  const withdrawResult = await computeL2ToL1MembershipWitness(aztecNode, withdrawReceipt.blockNumber, withdrawLeaf);
561
562
  const swapPrivateL2MessageIndex = swapResult.l2MessageIndex;
@@ -620,26 +621,26 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
620
621
  secretHashForDepositingSwappedDai,
621
622
  ownerEthAddress.toBuffer32()
622
623
  ]);
623
- const swapPublicLeaf = sha256ToField([
624
- uniswapL2Contract.address,
625
- new Fr(version),
626
- EthAddress.fromString(uniswapPortal.address).toBuffer32(),
627
- new Fr(l1Client.chain.id),
628
- swapPublicContent
629
- ]);
624
+ const swapPublicLeaf = computeL2ToL1MessageHash({
625
+ l2Sender: uniswapL2Contract.address,
626
+ l1Recipient: EthAddress.fromString(uniswapPortal.address),
627
+ content: swapPublicContent,
628
+ rollupVersion: new Fr(version),
629
+ chainId: new Fr(l1Client.chain.id)
630
+ });
630
631
  const withdrawContent = sha256ToField([
631
632
  Buffer.from(toFunctionSelector('withdraw(address,uint256,address)').substring(2), 'hex'),
632
633
  uniswapPortalAddress.toBuffer32(),
633
634
  new Fr(wethAmountToBridge),
634
635
  uniswapPortalAddress.toBuffer32()
635
636
  ]);
636
- const withdrawLeaf = sha256ToField([
637
- wethCrossChainHarness.l2Bridge.address,
638
- new Fr(version),
639
- wethCrossChainHarness.tokenPortalAddress.toBuffer32(),
640
- new Fr(l1Client.chain.id),
641
- withdrawContent
642
- ]);
637
+ const withdrawLeaf = computeL2ToL1MessageHash({
638
+ l2Sender: wethCrossChainHarness.l2Bridge.address,
639
+ l1Recipient: wethCrossChainHarness.tokenPortalAddress,
640
+ content: withdrawContent,
641
+ rollupVersion: new Fr(version),
642
+ chainId: new Fr(l1Client.chain.id)
643
+ });
643
644
  const swapResult = await computeL2ToL1MembershipWitness(aztecNode, withdrawReceipt.blockNumber, swapPublicLeaf);
644
645
  const withdrawResult = await computeL2ToL1MembershipWitness(aztecNode, withdrawReceipt.blockNumber, withdrawLeaf);
645
646
  const swapPublicL2MessageIndex = swapResult.l2MessageIndex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/end-to-end",
3
- "version": "1.0.0-nightly.20250608",
3
+ "version": "1.0.0-nightly.20250611",
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.20250608",
29
- "@aztec/archiver": "1.0.0-nightly.20250608",
30
- "@aztec/aztec": "1.0.0-nightly.20250608",
31
- "@aztec/aztec-node": "1.0.0-nightly.20250608",
32
- "@aztec/aztec.js": "1.0.0-nightly.20250608",
33
- "@aztec/bb-prover": "1.0.0-nightly.20250608",
34
- "@aztec/blob-lib": "1.0.0-nightly.20250608",
35
- "@aztec/blob-sink": "1.0.0-nightly.20250608",
36
- "@aztec/bot": "1.0.0-nightly.20250608",
37
- "@aztec/cli": "1.0.0-nightly.20250608",
38
- "@aztec/constants": "1.0.0-nightly.20250608",
39
- "@aztec/entrypoints": "1.0.0-nightly.20250608",
40
- "@aztec/epoch-cache": "1.0.0-nightly.20250608",
41
- "@aztec/ethereum": "1.0.0-nightly.20250608",
42
- "@aztec/foundation": "1.0.0-nightly.20250608",
43
- "@aztec/kv-store": "1.0.0-nightly.20250608",
44
- "@aztec/l1-artifacts": "1.0.0-nightly.20250608",
45
- "@aztec/merkle-tree": "1.0.0-nightly.20250608",
46
- "@aztec/noir-contracts.js": "1.0.0-nightly.20250608",
47
- "@aztec/noir-noirc_abi": "1.0.0-nightly.20250608",
48
- "@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250608",
49
- "@aztec/noir-test-contracts.js": "1.0.0-nightly.20250608",
50
- "@aztec/p2p": "1.0.0-nightly.20250608",
51
- "@aztec/protocol-contracts": "1.0.0-nightly.20250608",
52
- "@aztec/prover-client": "1.0.0-nightly.20250608",
53
- "@aztec/prover-node": "1.0.0-nightly.20250608",
54
- "@aztec/pxe": "1.0.0-nightly.20250608",
55
- "@aztec/sequencer-client": "1.0.0-nightly.20250608",
56
- "@aztec/simulator": "1.0.0-nightly.20250608",
57
- "@aztec/slasher": "1.0.0-nightly.20250608",
58
- "@aztec/stdlib": "1.0.0-nightly.20250608",
59
- "@aztec/telemetry-client": "1.0.0-nightly.20250608",
60
- "@aztec/validator-client": "1.0.0-nightly.20250608",
61
- "@aztec/world-state": "1.0.0-nightly.20250608",
28
+ "@aztec/accounts": "1.0.0-nightly.20250611",
29
+ "@aztec/archiver": "1.0.0-nightly.20250611",
30
+ "@aztec/aztec": "1.0.0-nightly.20250611",
31
+ "@aztec/aztec-node": "1.0.0-nightly.20250611",
32
+ "@aztec/aztec.js": "1.0.0-nightly.20250611",
33
+ "@aztec/bb-prover": "1.0.0-nightly.20250611",
34
+ "@aztec/blob-lib": "1.0.0-nightly.20250611",
35
+ "@aztec/blob-sink": "1.0.0-nightly.20250611",
36
+ "@aztec/bot": "1.0.0-nightly.20250611",
37
+ "@aztec/cli": "1.0.0-nightly.20250611",
38
+ "@aztec/constants": "1.0.0-nightly.20250611",
39
+ "@aztec/entrypoints": "1.0.0-nightly.20250611",
40
+ "@aztec/epoch-cache": "1.0.0-nightly.20250611",
41
+ "@aztec/ethereum": "1.0.0-nightly.20250611",
42
+ "@aztec/foundation": "1.0.0-nightly.20250611",
43
+ "@aztec/kv-store": "1.0.0-nightly.20250611",
44
+ "@aztec/l1-artifacts": "1.0.0-nightly.20250611",
45
+ "@aztec/merkle-tree": "1.0.0-nightly.20250611",
46
+ "@aztec/noir-contracts.js": "1.0.0-nightly.20250611",
47
+ "@aztec/noir-noirc_abi": "1.0.0-nightly.20250611",
48
+ "@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250611",
49
+ "@aztec/noir-test-contracts.js": "1.0.0-nightly.20250611",
50
+ "@aztec/p2p": "1.0.0-nightly.20250611",
51
+ "@aztec/protocol-contracts": "1.0.0-nightly.20250611",
52
+ "@aztec/prover-client": "1.0.0-nightly.20250611",
53
+ "@aztec/prover-node": "1.0.0-nightly.20250611",
54
+ "@aztec/pxe": "1.0.0-nightly.20250611",
55
+ "@aztec/sequencer-client": "1.0.0-nightly.20250611",
56
+ "@aztec/simulator": "1.0.0-nightly.20250611",
57
+ "@aztec/slasher": "1.0.0-nightly.20250611",
58
+ "@aztec/stdlib": "1.0.0-nightly.20250611",
59
+ "@aztec/telemetry-client": "1.0.0-nightly.20250611",
60
+ "@aztec/validator-client": "1.0.0-nightly.20250611",
61
+ "@aztec/world-state": "1.0.0-nightly.20250611",
62
62
  "@iarna/toml": "^2.2.5",
63
63
  "@jest/globals": "^29.5.0",
64
64
  "@noble/curves": "^1.0.0",
@@ -155,6 +155,7 @@
155
155
  "testTimeout": 120000,
156
156
  "setupFiles": [
157
157
  "../../foundation/src/jest/setup.mjs"
158
- ]
158
+ ],
159
+ "testEnvironment": "../../foundation/src/jest/env.mjs"
159
160
  }
160
161
  }
@@ -7,13 +7,14 @@ import {
7
7
  L1TxUtils,
8
8
  type Operator,
9
9
  RollupContract,
10
+ type ViemClient,
10
11
  deployL1Contract,
11
12
  getL1ContractsConfigEnvVars,
12
13
  l1Artifacts,
13
14
  } from '@aztec/ethereum';
14
15
  import { ChainMonitor } from '@aztec/ethereum/test';
15
16
  import { type Logger, createLogger } from '@aztec/foundation/log';
16
- import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
17
+ import { RollupAbi, SlashFactoryAbi, SlasherAbi, SlashingProposerAbi, TestERC20Abi } from '@aztec/l1-artifacts';
17
18
  import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
18
19
  import type { BootstrapNode } from '@aztec/p2p/bootstrap';
19
20
  import { createBootstrapNodeFromPrivateKey, getBootstrapNodeEnr } from '@aztec/p2p/test-helpers';
@@ -22,7 +23,7 @@ import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
22
23
  import { getGenesisValues } from '@aztec/world-state/testing';
23
24
 
24
25
  import getPort from 'get-port';
25
- import { getContract } from 'viem';
26
+ import { type GetContractReturnType, getAddress, getContract } from 'viem';
26
27
  import { privateKeyToAccount } from 'viem/accounts';
27
28
 
28
29
  import {
@@ -114,7 +115,9 @@ export class P2PNetworkTest {
114
115
  aztecProofSubmissionWindow:
115
116
  initialValidatorConfig.aztecProofSubmissionWindow ?? l1ContractsConfig.aztecProofSubmissionWindow,
116
117
  initialValidators: [],
117
- mockZkPassportVerifier,
118
+ zkPassportArgs: {
119
+ mockZkPassportVerifier,
120
+ },
118
121
  },
119
122
  );
120
123
  }
@@ -227,7 +230,7 @@ export class P2PNetworkTest {
227
230
  client: deployL1ContractsValues.l1Client,
228
231
  });
229
232
 
230
- const stakeNeeded = l1ContractsConfig.minimumStake * BigInt(this.numberOfNodes);
233
+ const stakeNeeded = l1ContractsConfig.depositAmount * BigInt(this.numberOfNodes);
231
234
  await Promise.all(
232
235
  [await stakingAsset.write.mint([multiAdder.address, stakeNeeded], {} as any)].map(txHash =>
233
236
  deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash: txHash }),
@@ -352,4 +355,40 @@ export class P2PNetworkTest {
352
355
  await tryStop(this.bootstrapNode, this.logger);
353
356
  await this.snapshotManager.teardown();
354
357
  }
358
+
359
+ async getContracts(): Promise<{
360
+ rollup: RollupContract;
361
+ slasherContract: GetContractReturnType<typeof SlasherAbi, ViemClient>;
362
+ slashingProposer: GetContractReturnType<typeof SlashingProposerAbi, ViemClient>;
363
+ slashFactory: GetContractReturnType<typeof SlashFactoryAbi, ViemClient>;
364
+ }> {
365
+ if (!this.ctx.deployL1ContractsValues) {
366
+ throw new Error('DeployL1ContractsValues not set');
367
+ }
368
+
369
+ const rollup = new RollupContract(
370
+ this.ctx.deployL1ContractsValues!.l1Client,
371
+ this.ctx.deployL1ContractsValues!.l1ContractAddresses.rollupAddress,
372
+ );
373
+
374
+ const slasherContract = getContract({
375
+ address: getAddress(await rollup.getSlasher()),
376
+ abi: SlasherAbi,
377
+ client: this.ctx.deployL1ContractsValues.l1Client,
378
+ });
379
+
380
+ const slashingProposer = getContract({
381
+ address: getAddress(await slasherContract.read.PROPOSER()),
382
+ abi: SlashingProposerAbi,
383
+ client: this.ctx.deployL1ContractsValues.l1Client,
384
+ });
385
+
386
+ const slashFactory = getContract({
387
+ address: getAddress(this.ctx.deployL1ContractsValues.l1ContractAddresses.slashFactoryAddress!.toString()),
388
+ abi: SlashFactoryAbi,
389
+ client: this.ctx.deployL1ContractsValues.l1Client,
390
+ });
391
+
392
+ return { rollup, slasherContract, slashingProposer, slashFactory };
393
+ }
355
394
  }