@aztec/sequencer-client 3.0.0-nightly.20251224 → 3.0.0-nightly.20251225

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.
@@ -0,0 +1,94 @@
1
+ import { Body } from '@aztec/aztec.js/block';
2
+ import { CheckpointNumber } from '@aztec/foundation/branded-types';
3
+ import { times } from '@aztec/foundation/collection';
4
+ import { Fr } from '@aztec/foundation/curves/bn254';
5
+ import { Signature } from '@aztec/foundation/eth-signature';
6
+ import { PublicDataWrite } from '@aztec/stdlib/avm';
7
+ import { CommitteeAttestation, L2BlockNew } from '@aztec/stdlib/block';
8
+ import { BlockAttestation, BlockProposal, ConsensusPayload } from '@aztec/stdlib/p2p';
9
+ import { CheckpointHeader } from '@aztec/stdlib/rollup';
10
+ import { makeAppendOnlyTreeSnapshot, mockTxForRollup } from '@aztec/stdlib/testing';
11
+ import { BlockHeader, ContentCommitment, makeProcessedTxFromPrivateOnlyTx } from '@aztec/stdlib/tx';
12
+ // Re-export mock classes from their dedicated file
13
+ export { MockCheckpointBuilder, MockCheckpointsBuilder } from './mock_checkpoint_builder.js';
14
+ /**
15
+ * Creates a mock transaction with a specific seed for deterministic testing
16
+ */ export async function makeTx(seed, chainId) {
17
+ const tx = await mockTxForRollup(seed);
18
+ if (chainId) {
19
+ tx.data.constants.txContext.chainId = chainId;
20
+ }
21
+ return tx;
22
+ }
23
+ /**
24
+ * Creates an L2BlockNew from transactions and global variables
25
+ */ export async function makeBlock(txs, globalVariables) {
26
+ const processedTxs = await Promise.all(txs.map((tx)=>makeProcessedTxFromPrivateOnlyTx(tx, Fr.ZERO, new PublicDataWrite(Fr.random(), Fr.random()), globalVariables)));
27
+ const body = new Body(processedTxs.map((tx)=>tx.txEffect));
28
+ const header = BlockHeader.empty({
29
+ globalVariables
30
+ });
31
+ const archive = makeAppendOnlyTreeSnapshot(globalVariables.blockNumber + 1);
32
+ return new L2BlockNew(archive, header, body, CheckpointNumber(globalVariables.blockNumber), 0);
33
+ }
34
+ /**
35
+ * Mocks the P2P client to return specific pending transactions
36
+ */ export function mockPendingTxs(p2p, txs) {
37
+ p2p.getPendingTxCount.mockResolvedValue(txs.length);
38
+ p2p.iteratePendingTxs.mockImplementation(()=>mockTxIterator(Promise.resolve(txs)));
39
+ }
40
+ /**
41
+ * Creates an async iterator for transactions
42
+ */ export async function* mockTxIterator(txs) {
43
+ for (const tx of (await txs)){
44
+ yield tx;
45
+ }
46
+ }
47
+ /**
48
+ * Creates mock committee attestations from a signer
49
+ */ export function createMockSignatures(signer) {
50
+ const mockedSig = Signature.random();
51
+ return [
52
+ new CommitteeAttestation(signer.address, mockedSig)
53
+ ];
54
+ }
55
+ /**
56
+ * Creates a CheckpointHeader from an L2BlockNew for testing purposes.
57
+ * Uses mock values for contentCommitment and blockHeadersHash since
58
+ * L2BlockNew doesn't have these fields.
59
+ */ function createCheckpointHeaderFromBlock(block) {
60
+ const gv = block.header.globalVariables;
61
+ return new CheckpointHeader(block.header.lastArchive.root, Fr.random(), ContentCommitment.empty(), gv.slotNumber, gv.timestamp, gv.coinbase, gv.feeRecipient, gv.gasFees, block.header.totalManaUsed);
62
+ }
63
+ /**
64
+ * Creates a block proposal from a block and signature
65
+ */ export function createBlockProposal(block, signature) {
66
+ const checkpointHeader = createCheckpointHeaderFromBlock(block);
67
+ const consensusPayload = new ConsensusPayload(checkpointHeader, block.archive.root);
68
+ const txHashes = block.body.txEffects.map((tx)=>tx.txHash);
69
+ return new BlockProposal(consensusPayload, signature, txHashes);
70
+ }
71
+ /**
72
+ * Creates a block attestation from a block and signature.
73
+ * Note: We manually set the sender since we use random signatures in tests.
74
+ * In production, the sender is recovered from the signature.
75
+ */ export function createBlockAttestation(block, signature, sender) {
76
+ const checkpointHeader = createCheckpointHeaderFromBlock(block);
77
+ const consensusPayload = new ConsensusPayload(checkpointHeader, block.archive.root);
78
+ const attestation = new BlockAttestation(consensusPayload, signature, signature);
79
+ // Set sender directly for testing (bypasses signature recovery)
80
+ attestation.sender = sender;
81
+ return attestation;
82
+ }
83
+ /**
84
+ * Creates transactions and a block, and mocks P2P to return them.
85
+ * Helper for tests that need to set up a block with transactions.
86
+ */ export async function setupTxsAndBlock(p2p, globalVariables, txCount, chainId) {
87
+ const txs = await Promise.all(times(txCount, (i)=>makeTx(i + 1, chainId)));
88
+ const block = await makeBlock(txs, globalVariables);
89
+ mockPendingTxs(p2p, txs);
90
+ return {
91
+ txs,
92
+ block
93
+ };
94
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/sequencer-client",
3
- "version": "3.0.0-nightly.20251224",
3
+ "version": "3.0.0-nightly.20251225",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/index.js",
@@ -26,37 +26,37 @@
26
26
  "test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --config jest.integration.config.json"
27
27
  },
28
28
  "dependencies": {
29
- "@aztec/aztec.js": "3.0.0-nightly.20251224",
30
- "@aztec/bb-prover": "3.0.0-nightly.20251224",
31
- "@aztec/blob-client": "3.0.0-nightly.20251224",
32
- "@aztec/blob-lib": "3.0.0-nightly.20251224",
33
- "@aztec/constants": "3.0.0-nightly.20251224",
34
- "@aztec/epoch-cache": "3.0.0-nightly.20251224",
35
- "@aztec/ethereum": "3.0.0-nightly.20251224",
36
- "@aztec/foundation": "3.0.0-nightly.20251224",
37
- "@aztec/l1-artifacts": "3.0.0-nightly.20251224",
38
- "@aztec/merkle-tree": "3.0.0-nightly.20251224",
39
- "@aztec/node-keystore": "3.0.0-nightly.20251224",
40
- "@aztec/noir-acvm_js": "3.0.0-nightly.20251224",
41
- "@aztec/noir-contracts.js": "3.0.0-nightly.20251224",
42
- "@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251224",
43
- "@aztec/noir-types": "3.0.0-nightly.20251224",
44
- "@aztec/p2p": "3.0.0-nightly.20251224",
45
- "@aztec/protocol-contracts": "3.0.0-nightly.20251224",
46
- "@aztec/prover-client": "3.0.0-nightly.20251224",
47
- "@aztec/simulator": "3.0.0-nightly.20251224",
48
- "@aztec/slasher": "3.0.0-nightly.20251224",
49
- "@aztec/stdlib": "3.0.0-nightly.20251224",
50
- "@aztec/telemetry-client": "3.0.0-nightly.20251224",
51
- "@aztec/validator-client": "3.0.0-nightly.20251224",
52
- "@aztec/world-state": "3.0.0-nightly.20251224",
29
+ "@aztec/aztec.js": "3.0.0-nightly.20251225",
30
+ "@aztec/bb-prover": "3.0.0-nightly.20251225",
31
+ "@aztec/blob-client": "3.0.0-nightly.20251225",
32
+ "@aztec/blob-lib": "3.0.0-nightly.20251225",
33
+ "@aztec/constants": "3.0.0-nightly.20251225",
34
+ "@aztec/epoch-cache": "3.0.0-nightly.20251225",
35
+ "@aztec/ethereum": "3.0.0-nightly.20251225",
36
+ "@aztec/foundation": "3.0.0-nightly.20251225",
37
+ "@aztec/l1-artifacts": "3.0.0-nightly.20251225",
38
+ "@aztec/merkle-tree": "3.0.0-nightly.20251225",
39
+ "@aztec/node-keystore": "3.0.0-nightly.20251225",
40
+ "@aztec/noir-acvm_js": "3.0.0-nightly.20251225",
41
+ "@aztec/noir-contracts.js": "3.0.0-nightly.20251225",
42
+ "@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251225",
43
+ "@aztec/noir-types": "3.0.0-nightly.20251225",
44
+ "@aztec/p2p": "3.0.0-nightly.20251225",
45
+ "@aztec/protocol-contracts": "3.0.0-nightly.20251225",
46
+ "@aztec/prover-client": "3.0.0-nightly.20251225",
47
+ "@aztec/simulator": "3.0.0-nightly.20251225",
48
+ "@aztec/slasher": "3.0.0-nightly.20251225",
49
+ "@aztec/stdlib": "3.0.0-nightly.20251225",
50
+ "@aztec/telemetry-client": "3.0.0-nightly.20251225",
51
+ "@aztec/validator-client": "3.0.0-nightly.20251225",
52
+ "@aztec/world-state": "3.0.0-nightly.20251225",
53
53
  "lodash.chunk": "^4.2.0",
54
54
  "tslib": "^2.4.0",
55
55
  "viem": "npm:@aztec/viem@2.38.2"
56
56
  },
57
57
  "devDependencies": {
58
- "@aztec/archiver": "3.0.0-nightly.20251224",
59
- "@aztec/kv-store": "3.0.0-nightly.20251224",
58
+ "@aztec/archiver": "3.0.0-nightly.20251225",
59
+ "@aztec/kv-store": "3.0.0-nightly.20251225",
60
60
  "@jest/globals": "^30.0.0",
61
61
  "@types/jest": "^30.0.0",
62
62
  "@types/lodash.chunk": "^4.2.7",