@aztec/archiver 0.0.1-commit.fffb133c → 0.0.1-dev

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.
Files changed (100) hide show
  1. package/dest/archiver.d.ts +9 -5
  2. package/dest/archiver.d.ts.map +1 -1
  3. package/dest/archiver.js +87 -111
  4. package/dest/errors.d.ts +7 -9
  5. package/dest/errors.d.ts.map +1 -1
  6. package/dest/errors.js +9 -14
  7. package/dest/factory.d.ts +4 -3
  8. package/dest/factory.d.ts.map +1 -1
  9. package/dest/factory.js +32 -26
  10. package/dest/index.d.ts +2 -1
  11. package/dest/index.d.ts.map +1 -1
  12. package/dest/index.js +1 -0
  13. package/dest/l1/bin/retrieve-calldata.js +36 -33
  14. package/dest/l1/calldata_retriever.d.ts +73 -50
  15. package/dest/l1/calldata_retriever.d.ts.map +1 -1
  16. package/dest/l1/calldata_retriever.js +190 -259
  17. package/dest/l1/data_retrieval.d.ts +4 -7
  18. package/dest/l1/data_retrieval.d.ts.map +1 -1
  19. package/dest/l1/data_retrieval.js +10 -14
  20. package/dest/l1/spire_proposer.d.ts +5 -5
  21. package/dest/l1/spire_proposer.d.ts.map +1 -1
  22. package/dest/l1/spire_proposer.js +9 -17
  23. package/dest/l1/validate_trace.d.ts +6 -3
  24. package/dest/l1/validate_trace.d.ts.map +1 -1
  25. package/dest/l1/validate_trace.js +13 -9
  26. package/dest/modules/data_source_base.d.ts +13 -8
  27. package/dest/modules/data_source_base.d.ts.map +1 -1
  28. package/dest/modules/data_source_base.js +29 -73
  29. package/dest/modules/data_store_updater.d.ts +22 -7
  30. package/dest/modules/data_store_updater.d.ts.map +1 -1
  31. package/dest/modules/data_store_updater.js +114 -40
  32. package/dest/modules/instrumentation.d.ts +4 -2
  33. package/dest/modules/instrumentation.d.ts.map +1 -1
  34. package/dest/modules/instrumentation.js +26 -12
  35. package/dest/modules/l1_synchronizer.d.ts +5 -8
  36. package/dest/modules/l1_synchronizer.d.ts.map +1 -1
  37. package/dest/modules/l1_synchronizer.js +42 -13
  38. package/dest/store/block_store.d.ts +38 -29
  39. package/dest/store/block_store.d.ts.map +1 -1
  40. package/dest/store/block_store.js +294 -85
  41. package/dest/store/contract_class_store.d.ts +1 -1
  42. package/dest/store/contract_class_store.d.ts.map +1 -1
  43. package/dest/store/contract_class_store.js +27 -7
  44. package/dest/store/contract_instance_store.d.ts +1 -1
  45. package/dest/store/contract_instance_store.d.ts.map +1 -1
  46. package/dest/store/contract_instance_store.js +17 -2
  47. package/dest/store/kv_archiver_store.d.ts +40 -18
  48. package/dest/store/kv_archiver_store.d.ts.map +1 -1
  49. package/dest/store/kv_archiver_store.js +44 -16
  50. package/dest/store/l2_tips_cache.d.ts +18 -0
  51. package/dest/store/l2_tips_cache.d.ts.map +1 -0
  52. package/dest/store/l2_tips_cache.js +20 -0
  53. package/dest/store/log_store.d.ts +1 -1
  54. package/dest/store/log_store.d.ts.map +1 -1
  55. package/dest/store/log_store.js +125 -56
  56. package/dest/store/message_store.js +1 -1
  57. package/dest/test/fake_l1_state.d.ts +20 -1
  58. package/dest/test/fake_l1_state.d.ts.map +1 -1
  59. package/dest/test/fake_l1_state.js +97 -20
  60. package/dest/test/index.js +3 -1
  61. package/dest/test/mock_archiver.d.ts +1 -1
  62. package/dest/test/mock_archiver.d.ts.map +1 -1
  63. package/dest/test/mock_archiver.js +3 -2
  64. package/dest/test/mock_l2_block_source.d.ts +25 -9
  65. package/dest/test/mock_l2_block_source.d.ts.map +1 -1
  66. package/dest/test/mock_l2_block_source.js +133 -87
  67. package/dest/test/mock_structs.d.ts +6 -2
  68. package/dest/test/mock_structs.d.ts.map +1 -1
  69. package/dest/test/mock_structs.js +20 -6
  70. package/dest/test/noop_l1_archiver.d.ts +26 -0
  71. package/dest/test/noop_l1_archiver.d.ts.map +1 -0
  72. package/dest/test/noop_l1_archiver.js +72 -0
  73. package/package.json +14 -13
  74. package/src/archiver.ts +110 -132
  75. package/src/errors.ts +10 -24
  76. package/src/factory.ts +47 -23
  77. package/src/index.ts +1 -0
  78. package/src/l1/README.md +25 -68
  79. package/src/l1/bin/retrieve-calldata.ts +46 -39
  80. package/src/l1/calldata_retriever.ts +249 -379
  81. package/src/l1/data_retrieval.ts +7 -17
  82. package/src/l1/spire_proposer.ts +7 -15
  83. package/src/l1/validate_trace.ts +24 -6
  84. package/src/modules/data_source_base.ts +59 -98
  85. package/src/modules/data_store_updater.ts +124 -43
  86. package/src/modules/instrumentation.ts +24 -12
  87. package/src/modules/l1_synchronizer.ts +49 -17
  88. package/src/store/block_store.ts +359 -115
  89. package/src/store/contract_class_store.ts +27 -7
  90. package/src/store/contract_instance_store.ts +19 -5
  91. package/src/store/kv_archiver_store.ts +71 -25
  92. package/src/store/l2_tips_cache.ts +27 -0
  93. package/src/store/log_store.ts +186 -57
  94. package/src/store/message_store.ts +1 -1
  95. package/src/test/fake_l1_state.ts +125 -21
  96. package/src/test/index.ts +3 -0
  97. package/src/test/mock_archiver.ts +3 -2
  98. package/src/test/mock_l2_block_source.ts +179 -87
  99. package/src/test/mock_structs.ts +42 -12
  100. package/src/test/noop_l1_archiver.ts +115 -0
@@ -6,32 +6,33 @@ import { createLogger } from '@aztec/foundation/log';
6
6
  import { BufferReader } from '@aztec/foundation/serialize';
7
7
  import { bufferToHex } from '@aztec/foundation/string';
8
8
  import { isDefined } from '@aztec/foundation/types';
9
- import { Body, CheckpointedL2Block, CommitteeAttestation, L2Block, L2BlockHash, deserializeValidateCheckpointResult, serializeValidateCheckpointResult } from '@aztec/stdlib/block';
9
+ import { BlockHash, Body, CheckpointedL2Block, CommitteeAttestation, GENESIS_CHECKPOINT_HEADER_HASH, L2Block, deserializeValidateCheckpointResult, serializeValidateCheckpointResult } from '@aztec/stdlib/block';
10
10
  import { L1PublishedData } from '@aztec/stdlib/checkpoint';
11
+ import { getEpochAtSlot } from '@aztec/stdlib/epoch-helpers';
11
12
  import { CheckpointHeader } from '@aztec/stdlib/rollup';
12
13
  import { AppendOnlyTreeSnapshot } from '@aztec/stdlib/trees';
13
14
  import { BlockHeader, TxHash, TxReceipt, TxStatus, deserializeIndexedTxEffect, serializeIndexedTxEffect } from '@aztec/stdlib/tx';
14
- import { BlockArchiveNotConsistentError, BlockIndexNotSequentialError, BlockNotFoundError, BlockNumberNotSequentialError, CannotOverwriteCheckpointedBlockError, CheckpointNotFoundError, CheckpointNumberNotConsistentError, CheckpointNumberNotSequentialError, InitialBlockNumberNotSequentialError, InitialCheckpointNumberNotSequentialError } from '../errors.js';
15
+ import { BlockAlreadyCheckpointedError, BlockArchiveNotConsistentError, BlockIndexNotSequentialError, BlockNotFoundError, BlockNumberNotSequentialError, CannotOverwriteCheckpointedBlockError, CheckpointNotFoundError, CheckpointNumberNotSequentialError, InitialCheckpointNumberNotSequentialError } from '../errors.js';
15
16
  export { TxReceipt } from '@aztec/stdlib/tx';
16
17
  /**
17
18
  * LMDB-based block storage for the archiver.
18
19
  */ export class BlockStore {
19
20
  db;
20
- l1Constants;
21
21
  /** Map block number to block data */ #blocks;
22
22
  /** Map checkpoint number to checkpoint data */ #checkpoints;
23
+ /** Map slot number to checkpoint number, for looking up checkpoints by slot range. */ #slotToCheckpoint;
23
24
  /** Map block hash to list of tx hashes */ #blockTxs;
24
25
  /** Tx hash to serialized IndexedTxEffect */ #txEffects;
25
26
  /** Stores L1 block number in which the last processed L2 block was included */ #lastSynchedL1Block;
26
27
  /** Stores last proven checkpoint */ #lastProvenCheckpoint;
28
+ /** Stores last finalized checkpoint (proven at or before the finalized L1 block) */ #lastFinalizedCheckpoint;
27
29
  /** Stores the pending chain validation status */ #pendingChainValidationStatus;
28
30
  /** Index mapping a contract's address (as a string) to its location in a block */ #contractIndex;
29
31
  /** Index mapping block hash to block number */ #blockHashIndex;
30
32
  /** Index mapping block archive to block number */ #blockArchiveIndex;
31
33
  #log;
32
- constructor(db, l1Constants){
34
+ constructor(db){
33
35
  this.db = db;
34
- this.l1Constants = l1Constants;
35
36
  this.#log = createLogger('archiver:block_store');
36
37
  this.#blocks = db.openMap('archiver_blocks');
37
38
  this.#blockTxs = db.openMap('archiver_block_txs');
@@ -41,89 +42,78 @@ export { TxReceipt } from '@aztec/stdlib/tx';
41
42
  this.#blockArchiveIndex = db.openMap('archiver_block_archive_index');
42
43
  this.#lastSynchedL1Block = db.openSingleton('archiver_last_synched_l1_block');
43
44
  this.#lastProvenCheckpoint = db.openSingleton('archiver_last_proven_l2_checkpoint');
45
+ this.#lastFinalizedCheckpoint = db.openSingleton('archiver_last_finalized_l2_checkpoint');
44
46
  this.#pendingChainValidationStatus = db.openSingleton('archiver_pending_chain_validation_status');
45
47
  this.#checkpoints = db.openMap('archiver_checkpoints');
48
+ this.#slotToCheckpoint = db.openMap('archiver_slot_to_checkpoint');
46
49
  }
47
50
  /**
48
- * Computes the finalized block number based on the proven block number.
49
- * A block is considered finalized when it's 2 epochs behind the proven block.
50
- * TODO(#13569): Compute proper finalized block number based on L1 finalized block.
51
- * TODO(palla/mbps): Even the provisional computation is wrong, since it should subtract checkpoints, not blocks
51
+ * Returns the finalized L2 block number. An L2 block is finalized when it was proven
52
+ * in an L1 block that has itself been finalized on Ethereum.
52
53
  * @returns The finalized block number.
53
54
  */ async getFinalizedL2BlockNumber() {
54
- const provenBlockNumber = await this.getProvenBlockNumber();
55
- return BlockNumber(Math.max(provenBlockNumber - this.l1Constants.epochDuration * 2, 0));
55
+ const finalizedCheckpointNumber = await this.getFinalizedCheckpointNumber();
56
+ if (finalizedCheckpointNumber === INITIAL_CHECKPOINT_NUMBER - 1) {
57
+ return BlockNumber(INITIAL_L2_BLOCK_NUM - 1);
58
+ }
59
+ const checkpointStorage = await this.#checkpoints.getAsync(finalizedCheckpointNumber);
60
+ if (!checkpointStorage) {
61
+ throw new CheckpointNotFoundError(finalizedCheckpointNumber);
62
+ }
63
+ return BlockNumber(checkpointStorage.startBlock + checkpointStorage.blockCount - 1);
56
64
  }
57
65
  /**
58
- * Append new proposed blocks to the store's list. All blocks must be for the 'current' checkpoint.
59
- * These are uncheckpointed blocks that have been proposed by the sequencer but not yet included in a checkpoint on L1.
66
+ * Append a new proposed block to the store.
67
+ * This is an uncheckpointed block that has been proposed by the sequencer but not yet included in a checkpoint on L1.
60
68
  * For checkpointed blocks (already published to L1), use addCheckpoints() instead.
61
- * @param blocks - The proposed L2 blocks to be added to the store.
69
+ * @param block - The proposed L2 block to be added to the store.
62
70
  * @returns True if the operation is successful.
63
- */ async addProposedBlocks(blocks, opts = {}) {
64
- if (blocks.length === 0) {
65
- return true;
66
- }
71
+ */ async addProposedBlock(block, opts = {}) {
67
72
  return await this.db.transactionAsync(async ()=>{
68
- // Check that the block immediately before the first block to be added is present in the store.
69
- const firstBlockNumber = blocks[0].number;
70
- const firstBlockCheckpointNumber = blocks[0].checkpointNumber;
71
- const firstBlockIndex = blocks[0].indexWithinCheckpoint;
72
- const firstBlockLastArchive = blocks[0].header.lastArchive.root;
73
+ const blockNumber = block.number;
74
+ const blockCheckpointNumber = block.checkpointNumber;
75
+ const blockIndex = block.indexWithinCheckpoint;
76
+ const blockLastArchive = block.header.lastArchive.root;
73
77
  // Extract the latest block and checkpoint numbers
74
78
  const previousBlockNumber = await this.getLatestBlockNumber();
75
79
  const previousCheckpointNumber = await this.getLatestCheckpointNumber();
76
80
  // Verify we're not overwriting checkpointed blocks
77
81
  const lastCheckpointedBlockNumber = await this.getCheckpointedL2BlockNumber();
78
- if (!opts.force && firstBlockNumber <= lastCheckpointedBlockNumber) {
79
- throw new CannotOverwriteCheckpointedBlockError(firstBlockNumber, lastCheckpointedBlockNumber);
82
+ if (!opts.force && blockNumber <= lastCheckpointedBlockNumber) {
83
+ // Check if the proposed block matches the already-checkpointed one
84
+ const existingBlock = await this.getBlock(BlockNumber(blockNumber));
85
+ if (existingBlock && existingBlock.archive.root.equals(block.archive.root)) {
86
+ throw new BlockAlreadyCheckpointedError(blockNumber);
87
+ }
88
+ throw new CannotOverwriteCheckpointedBlockError(blockNumber, lastCheckpointedBlockNumber);
80
89
  }
81
- // Check that the first block number is the expected one
82
- if (!opts.force && previousBlockNumber !== firstBlockNumber - 1) {
83
- throw new InitialBlockNumberNotSequentialError(firstBlockNumber, previousBlockNumber);
90
+ // Check that the block number is the expected one
91
+ if (!opts.force && previousBlockNumber !== blockNumber - 1) {
92
+ throw new BlockNumberNotSequentialError(blockNumber, previousBlockNumber);
84
93
  }
85
94
  // The same check as above but for checkpoints
86
- if (!opts.force && previousCheckpointNumber !== firstBlockCheckpointNumber - 1) {
87
- throw new InitialCheckpointNumberNotSequentialError(firstBlockCheckpointNumber, previousCheckpointNumber);
95
+ if (!opts.force && previousCheckpointNumber !== blockCheckpointNumber - 1) {
96
+ throw new CheckpointNumberNotSequentialError(blockCheckpointNumber, previousCheckpointNumber);
88
97
  }
89
98
  // Extract the previous block if there is one and see if it is for the same checkpoint or not
90
99
  const previousBlockResult = await this.getBlock(previousBlockNumber);
91
- let expectedFirstblockIndex = 0;
100
+ let expectedBlockIndex = 0;
92
101
  let previousBlockIndex = undefined;
93
102
  if (previousBlockResult !== undefined) {
94
- if (previousBlockResult.checkpointNumber === firstBlockCheckpointNumber) {
103
+ if (previousBlockResult.checkpointNumber === blockCheckpointNumber) {
95
104
  // The previous block is for the same checkpoint, therefore our index should follow it
96
105
  previousBlockIndex = previousBlockResult.indexWithinCheckpoint;
97
- expectedFirstblockIndex = previousBlockIndex + 1;
106
+ expectedBlockIndex = previousBlockIndex + 1;
98
107
  }
99
- if (!previousBlockResult.archive.root.equals(firstBlockLastArchive)) {
100
- throw new BlockArchiveNotConsistentError(firstBlockNumber, previousBlockResult.number, firstBlockLastArchive, previousBlockResult.archive.root);
108
+ if (!previousBlockResult.archive.root.equals(blockLastArchive)) {
109
+ throw new BlockArchiveNotConsistentError(blockNumber, previousBlockResult.number, blockLastArchive, previousBlockResult.archive.root);
101
110
  }
102
111
  }
103
- // Now check that the first block has the expected index value
104
- if (!opts.force && expectedFirstblockIndex !== firstBlockIndex) {
105
- throw new BlockIndexNotSequentialError(firstBlockIndex, previousBlockIndex);
106
- }
107
- // Iterate over blocks array and insert them, checking that the block numbers and indexes are sequential. Also check they are for the correct checkpoint.
108
- let previousBlock = undefined;
109
- for (const block of blocks){
110
- if (!opts.force && previousBlock) {
111
- if (previousBlock.number + 1 !== block.number) {
112
- throw new BlockNumberNotSequentialError(block.number, previousBlock.number);
113
- }
114
- if (previousBlock.indexWithinCheckpoint + 1 !== block.indexWithinCheckpoint) {
115
- throw new BlockIndexNotSequentialError(block.indexWithinCheckpoint, previousBlock.indexWithinCheckpoint);
116
- }
117
- if (!previousBlock.archive.root.equals(block.header.lastArchive.root)) {
118
- throw new BlockArchiveNotConsistentError(block.number, previousBlock.number, block.header.lastArchive.root, previousBlock.archive.root);
119
- }
120
- }
121
- if (!opts.force && firstBlockCheckpointNumber !== block.checkpointNumber) {
122
- throw new CheckpointNumberNotConsistentError(block.checkpointNumber, firstBlockCheckpointNumber);
123
- }
124
- previousBlock = block;
125
- await this.addBlockToDatabase(block, block.checkpointNumber, block.indexWithinCheckpoint);
112
+ // Now check that the block has the expected index value
113
+ if (!opts.force && expectedBlockIndex !== blockIndex) {
114
+ throw new BlockIndexNotSequentialError(blockIndex, previousBlockIndex);
126
115
  }
116
+ await this.addBlockToDatabase(block, block.checkpointNumber, block.indexWithinCheckpoint);
127
117
  return true;
128
118
  });
129
119
  }
@@ -136,26 +126,39 @@ export { TxReceipt } from '@aztec/stdlib/tx';
136
126
  return true;
137
127
  }
138
128
  return await this.db.transactionAsync(async ()=>{
139
- // Check that the checkpoint immediately before the first block to be added is present in the store.
140
129
  const firstCheckpointNumber = checkpoints[0].checkpoint.number;
141
130
  const previousCheckpointNumber = await this.getLatestCheckpointNumber();
142
- if (previousCheckpointNumber !== firstCheckpointNumber - 1 && !opts.force) {
131
+ // Handle already-stored checkpoints at the start of the batch.
132
+ // This can happen after an L1 reorg re-includes a checkpoint in a different L1 block.
133
+ // We accept them if archives match (same content) and update their L1 metadata.
134
+ if (!opts.force && firstCheckpointNumber <= previousCheckpointNumber) {
135
+ checkpoints = await this.skipOrUpdateAlreadyStoredCheckpoints(checkpoints, previousCheckpointNumber);
136
+ if (checkpoints.length === 0) {
137
+ return true;
138
+ }
139
+ // Re-check sequentiality after skipping
140
+ const newFirstNumber = checkpoints[0].checkpoint.number;
141
+ if (previousCheckpointNumber !== newFirstNumber - 1) {
142
+ throw new InitialCheckpointNumberNotSequentialError(newFirstNumber, previousCheckpointNumber);
143
+ }
144
+ } else if (previousCheckpointNumber !== firstCheckpointNumber - 1 && !opts.force) {
143
145
  throw new InitialCheckpointNumberNotSequentialError(firstCheckpointNumber, previousCheckpointNumber);
144
146
  }
145
147
  // Extract the previous checkpoint if there is one
148
+ const currentFirstCheckpointNumber = checkpoints[0].checkpoint.number;
146
149
  let previousCheckpointData = undefined;
147
- if (previousCheckpointNumber !== INITIAL_CHECKPOINT_NUMBER - 1) {
150
+ if (currentFirstCheckpointNumber - 1 !== INITIAL_CHECKPOINT_NUMBER - 1) {
148
151
  // There should be a previous checkpoint
149
- previousCheckpointData = await this.getCheckpointData(previousCheckpointNumber);
152
+ previousCheckpointData = await this.getCheckpointData(CheckpointNumber(currentFirstCheckpointNumber - 1));
150
153
  if (previousCheckpointData === undefined) {
151
- throw new CheckpointNotFoundError(previousCheckpointNumber);
154
+ throw new CheckpointNotFoundError(CheckpointNumber(currentFirstCheckpointNumber - 1));
152
155
  }
153
156
  }
154
157
  let previousBlockNumber = undefined;
155
158
  let previousBlock = undefined;
156
159
  // If we have a previous checkpoint then we need to get the previous block number
157
160
  if (previousCheckpointData !== undefined) {
158
- previousBlockNumber = BlockNumber(previousCheckpointData.startBlock + previousCheckpointData.numBlocks - 1);
161
+ previousBlockNumber = BlockNumber(previousCheckpointData.startBlock + previousCheckpointData.blockCount - 1);
159
162
  previousBlock = await this.getBlock(previousBlockNumber);
160
163
  if (previousBlock === undefined) {
161
164
  // We should be able to get the required previous block
@@ -200,19 +203,54 @@ export { TxReceipt } from '@aztec/stdlib/tx';
200
203
  await this.#checkpoints.set(checkpoint.checkpoint.number, {
201
204
  header: checkpoint.checkpoint.header.toBuffer(),
202
205
  archive: checkpoint.checkpoint.archive.toBuffer(),
206
+ checkpointOutHash: checkpoint.checkpoint.getCheckpointOutHash().toBuffer(),
203
207
  l1: checkpoint.l1.toBuffer(),
204
208
  attestations: checkpoint.attestations.map((attestation)=>attestation.toBuffer()),
205
209
  checkpointNumber: checkpoint.checkpoint.number,
206
210
  startBlock: checkpoint.checkpoint.blocks[0].number,
207
- numBlocks: checkpoint.checkpoint.blocks.length
211
+ blockCount: checkpoint.checkpoint.blocks.length
208
212
  });
213
+ // Update slot-to-checkpoint index
214
+ await this.#slotToCheckpoint.set(checkpoint.checkpoint.header.slotNumber, checkpoint.checkpoint.number);
209
215
  }
210
216
  await this.#lastSynchedL1Block.set(checkpoints[checkpoints.length - 1].l1.blockNumber);
211
217
  return true;
212
218
  });
213
219
  }
220
+ /**
221
+ * Handles checkpoints at the start of a batch that are already stored (e.g. due to L1 reorg).
222
+ * Verifies the archive root matches, updates L1 metadata, and returns only the new checkpoints.
223
+ */ async skipOrUpdateAlreadyStoredCheckpoints(checkpoints, latestStored) {
224
+ let i = 0;
225
+ for(; i < checkpoints.length && checkpoints[i].checkpoint.number <= latestStored; i++){
226
+ const incoming = checkpoints[i];
227
+ const stored = await this.getCheckpointData(incoming.checkpoint.number);
228
+ if (!stored) {
229
+ break;
230
+ }
231
+ // Verify the checkpoint content matches (archive root)
232
+ if (!stored.archive.root.equals(incoming.checkpoint.archive.root)) {
233
+ throw new Error(`Checkpoint ${incoming.checkpoint.number} already exists in store but with a different archive root. ` + `Stored: ${stored.archive.root}, incoming: ${incoming.checkpoint.archive.root}`);
234
+ }
235
+ // Update L1 metadata and attestations for the already-stored checkpoint
236
+ this.#log.warn(`Checkpoint ${incoming.checkpoint.number} already stored, updating L1 info ` + `(L1 block ${stored.l1.blockNumber} -> ${incoming.l1.blockNumber})`);
237
+ await this.#checkpoints.set(incoming.checkpoint.number, {
238
+ header: incoming.checkpoint.header.toBuffer(),
239
+ archive: incoming.checkpoint.archive.toBuffer(),
240
+ checkpointOutHash: incoming.checkpoint.getCheckpointOutHash().toBuffer(),
241
+ l1: incoming.l1.toBuffer(),
242
+ attestations: incoming.attestations.map((a)=>a.toBuffer()),
243
+ checkpointNumber: incoming.checkpoint.number,
244
+ startBlock: incoming.checkpoint.blocks[0].number,
245
+ blockCount: incoming.checkpoint.blocks.length
246
+ });
247
+ // Update the sync point to reflect the new L1 block
248
+ await this.#lastSynchedL1Block.set(incoming.l1.blockNumber);
249
+ }
250
+ return checkpoints.slice(i);
251
+ }
214
252
  async addBlockToDatabase(block, checkpointNumber, indexWithinCheckpoint) {
215
- const blockHash = L2BlockHash.fromField(await block.hash());
253
+ const blockHash = await block.hash();
216
254
  await this.#blocks.set(block.number, {
217
255
  header: block.header.toBuffer(),
218
256
  blockHash: blockHash.toBuffer(),
@@ -274,12 +312,17 @@ export { TxReceipt } from '@aztec/stdlib/tx';
274
312
  if (!targetCheckpoint) {
275
313
  throw new Error(`Target checkpoint ${checkpointNumber} not found in store`);
276
314
  }
277
- lastBlockToKeep = BlockNumber(targetCheckpoint.startBlock + targetCheckpoint.numBlocks - 1);
315
+ lastBlockToKeep = BlockNumber(targetCheckpoint.startBlock + targetCheckpoint.blockCount - 1);
278
316
  }
279
317
  // Remove all blocks after lastBlockToKeep (both checkpointed and uncheckpointed)
280
318
  const blocksRemoved = await this.removeBlocksAfter(lastBlockToKeep);
281
319
  // Remove all checkpoints after the target
282
320
  for(let c = latestCheckpointNumber; c > checkpointNumber; c = CheckpointNumber(c - 1)){
321
+ const checkpointStorage = await this.#checkpoints.getAsync(c);
322
+ if (checkpointStorage) {
323
+ const slotNumber = CheckpointHeader.fromBuffer(checkpointStorage.header).slotNumber;
324
+ await this.#slotToCheckpoint.delete(slotNumber);
325
+ }
283
326
  await this.#checkpoints.delete(c);
284
327
  this.#log.debug(`Removed checkpoint ${c}`);
285
328
  }
@@ -306,17 +349,30 @@ export { TxReceipt } from '@aztec/stdlib/tx';
306
349
  }
307
350
  return checkpoints;
308
351
  }
352
+ /** Returns checkpoint data for all checkpoints whose slot falls within the given range (inclusive). */ async getCheckpointDataForSlotRange(startSlot, endSlot) {
353
+ const result = [];
354
+ for await (const [, checkpointNumber] of this.#slotToCheckpoint.entriesAsync({
355
+ start: startSlot,
356
+ end: endSlot + 1
357
+ })){
358
+ const checkpointStorage = await this.#checkpoints.getAsync(checkpointNumber);
359
+ if (checkpointStorage) {
360
+ result.push(this.checkpointDataFromCheckpointStorage(checkpointStorage));
361
+ }
362
+ }
363
+ return result;
364
+ }
309
365
  checkpointDataFromCheckpointStorage(checkpointStorage) {
310
- const data = {
366
+ return {
311
367
  header: CheckpointHeader.fromBuffer(checkpointStorage.header),
312
368
  archive: AppendOnlyTreeSnapshot.fromBuffer(checkpointStorage.archive),
369
+ checkpointOutHash: Fr.fromBuffer(checkpointStorage.checkpointOutHash),
313
370
  checkpointNumber: CheckpointNumber(checkpointStorage.checkpointNumber),
314
- startBlock: checkpointStorage.startBlock,
315
- numBlocks: checkpointStorage.numBlocks,
371
+ startBlock: BlockNumber(checkpointStorage.startBlock),
372
+ blockCount: checkpointStorage.blockCount,
316
373
  l1: L1PublishedData.fromBuffer(checkpointStorage.l1),
317
- attestations: checkpointStorage.attestations
374
+ attestations: checkpointStorage.attestations.map((buf)=>CommitteeAttestation.fromBuffer(buf))
318
375
  };
319
- return data;
320
376
  }
321
377
  async getBlocksForCheckpoint(checkpointNumber) {
322
378
  const checkpoint = await this.#checkpoints.getAsync(checkpointNumber);
@@ -325,7 +381,7 @@ export { TxReceipt } from '@aztec/stdlib/tx';
325
381
  }
326
382
  const blocksForCheckpoint = await toArray(this.#blocks.entriesAsync({
327
383
  start: checkpoint.startBlock,
328
- end: checkpoint.startBlock + checkpoint.numBlocks
384
+ end: checkpoint.startBlock + checkpoint.blockCount
329
385
  }));
330
386
  const converted = await Promise.all(blocksForCheckpoint.map((x)=>this.getBlockFromBlockStorage(x[0], x[1])));
331
387
  return converted.filter(isDefined);
@@ -386,7 +442,7 @@ export { TxReceipt } from '@aztec/stdlib/tx';
386
442
  if (!checkpointStorage) {
387
443
  throw new CheckpointNotFoundError(provenCheckpointNumber);
388
444
  } else {
389
- return BlockNumber(checkpointStorage.startBlock + checkpointStorage.numBlocks - 1);
445
+ return BlockNumber(checkpointStorage.startBlock + checkpointStorage.blockCount - 1);
390
446
  }
391
447
  }
392
448
  async getLatestBlockNumber() {
@@ -396,6 +452,118 @@ export { TxReceipt } from '@aztec/stdlib/tx';
396
452
  }));
397
453
  return typeof latestBlocknumber === 'number' ? BlockNumber(latestBlocknumber) : BlockNumber(INITIAL_L2_BLOCK_NUM - 1);
398
454
  }
455
+ /**
456
+ * Resolves all L2 chain tips in a single read transaction so the snapshot is internally consistent.
457
+ * The result is guaranteed to satisfy finalized <= proven <= checkpointed <= proposed by block number.
458
+ */ async getL2TipsData(genesisBlockHash) {
459
+ return await this.db.transactionAsync(async ()=>{
460
+ const genesisBlockNumber = BlockNumber(INITIAL_L2_BLOCK_NUM - 1);
461
+ const genesisCheckpointNumber = CheckpointNumber(INITIAL_CHECKPOINT_NUMBER - 1);
462
+ const genesisBlockId = {
463
+ number: genesisBlockNumber,
464
+ hash: genesisBlockHash.toString()
465
+ };
466
+ const genesisCheckpointId = {
467
+ number: genesisCheckpointNumber,
468
+ hash: GENESIS_CHECKPOINT_HEADER_HASH.toString()
469
+ };
470
+ const genesisTip = {
471
+ block: genesisBlockId,
472
+ checkpoint: genesisCheckpointId
473
+ };
474
+ const [latestBlockEntry] = await toArray(this.#blocks.entriesAsync({
475
+ reverse: true,
476
+ limit: 1
477
+ }));
478
+ const [latestCheckpointEntry] = await toArray(this.#checkpoints.entriesAsync({
479
+ reverse: true,
480
+ limit: 1
481
+ }));
482
+ const latestCheckpointNumber = latestCheckpointEntry ? CheckpointNumber(latestCheckpointEntry[0]) : genesisCheckpointNumber;
483
+ const [provenRaw, finalizedRaw] = await Promise.all([
484
+ this.#lastProvenCheckpoint.getAsync(),
485
+ this.#lastFinalizedCheckpoint.getAsync()
486
+ ]);
487
+ const provenCheckpointNumber = CheckpointNumber(Math.min(provenRaw ?? 0, latestCheckpointNumber));
488
+ const finalizedCheckpointNumber = CheckpointNumber(Math.min(finalizedRaw ?? 0, provenCheckpointNumber));
489
+ const checkpointStorageCache = new Map();
490
+ if (latestCheckpointEntry) {
491
+ checkpointStorageCache.set(CheckpointNumber(latestCheckpointEntry[0]), latestCheckpointEntry[1]);
492
+ }
493
+ const loadCheckpointStorage = async (checkpointNumber)=>{
494
+ if (checkpointNumber === genesisCheckpointNumber) {
495
+ return undefined;
496
+ }
497
+ if (!checkpointStorageCache.has(checkpointNumber)) {
498
+ const checkpointStorage = await this.#checkpoints.getAsync(checkpointNumber);
499
+ if (!checkpointStorage) {
500
+ throw new CheckpointNotFoundError(checkpointNumber);
501
+ }
502
+ checkpointStorageCache.set(checkpointNumber, checkpointStorage);
503
+ }
504
+ return checkpointStorageCache.get(checkpointNumber);
505
+ };
506
+ const [provenCheckpoint, finalizedCheckpoint] = await Promise.all([
507
+ loadCheckpointStorage(provenCheckpointNumber),
508
+ loadCheckpointStorage(finalizedCheckpointNumber)
509
+ ]);
510
+ const blockHashCache = new Map();
511
+ blockHashCache.set(genesisBlockNumber, genesisBlockHash.toString());
512
+ if (latestBlockEntry) {
513
+ blockHashCache.set(BlockNumber(latestBlockEntry[0]), BlockHash.fromBuffer(latestBlockEntry[1].blockHash).toString());
514
+ }
515
+ const loadBlockHash = async (blockNumber)=>{
516
+ if (!blockHashCache.has(blockNumber)) {
517
+ const blockStorage = await this.#blocks.getAsync(blockNumber);
518
+ if (!blockStorage) {
519
+ throw new BlockNotFoundError(blockNumber);
520
+ }
521
+ blockHashCache.set(blockNumber, BlockHash.fromBuffer(blockStorage.blockHash).toString());
522
+ }
523
+ return blockHashCache.get(blockNumber);
524
+ };
525
+ const proposed = latestBlockEntry === undefined ? genesisBlockId : {
526
+ number: BlockNumber(latestBlockEntry[0]),
527
+ hash: BlockHash.fromBuffer(latestBlockEntry[1].blockHash).toString()
528
+ };
529
+ const buildTipFromCheckpoint = async (stored)=>{
530
+ if (!stored) {
531
+ return genesisTip;
532
+ }
533
+ const blockNumber = BlockNumber(stored.startBlock + stored.blockCount - 1);
534
+ return {
535
+ block: {
536
+ number: blockNumber,
537
+ hash: await loadBlockHash(blockNumber)
538
+ },
539
+ checkpoint: {
540
+ number: CheckpointNumber(stored.checkpointNumber),
541
+ hash: CheckpointHeader.fromBuffer(stored.header).hash().toString()
542
+ }
543
+ };
544
+ };
545
+ const [checkpointed, proven, finalized] = await Promise.all([
546
+ buildTipFromCheckpoint(latestCheckpointEntry?.[1]),
547
+ buildTipFromCheckpoint(provenCheckpoint),
548
+ buildTipFromCheckpoint(finalizedCheckpoint)
549
+ ]);
550
+ if (proposed.number < checkpointed.block.number) {
551
+ throw new Error(`Inconsistent block store: latest block ${proposed.number} is behind checkpointed block ${checkpointed.block.number}`);
552
+ }
553
+ if (finalized.checkpoint.number > proven.checkpoint.number || proven.checkpoint.number > checkpointed.checkpoint.number) {
554
+ throw new Error(`Inconsistent checkpoint numbers in chain tips: finalized=${finalized.checkpoint.number} proven=${proven.checkpoint.number} checkpointed=${checkpointed.checkpoint.number}`);
555
+ }
556
+ if (finalized.block.number > proven.block.number || proven.block.number > checkpointed.block.number || checkpointed.block.number > proposed.number) {
557
+ throw new Error(`Inconsistent block numbers in chain tips: finalized=${finalized.block.number} proven=${proven.block.number} checkpointed=${checkpointed.block.number} proposed=${proposed.number}`);
558
+ }
559
+ return {
560
+ proposed,
561
+ checkpointed,
562
+ proven,
563
+ finalized
564
+ };
565
+ });
566
+ }
399
567
  async getLatestCheckpointNumber() {
400
568
  const [latestCheckpointNumber] = await toArray(this.#checkpoints.keysAsync({
401
569
  reverse: true,
@@ -468,6 +636,28 @@ export { TxReceipt } from '@aztec/stdlib/tx';
468
636
  }
469
637
  }
470
638
  /**
639
+ * Gets block metadata (without tx data) by block number.
640
+ * @param blockNumber - The number of the block to return.
641
+ * @returns The requested block data.
642
+ */ async getBlockData(blockNumber) {
643
+ const blockStorage = await this.#blocks.getAsync(blockNumber);
644
+ if (!blockStorage || !blockStorage.header) {
645
+ return undefined;
646
+ }
647
+ return this.getBlockDataFromBlockStorage(blockStorage);
648
+ }
649
+ /**
650
+ * Gets block metadata (without tx data) by archive root.
651
+ * @param archive - The archive root of the block to return.
652
+ * @returns The requested block data.
653
+ */ async getBlockDataByArchive(archive) {
654
+ const blockNumber = await this.#blockArchiveIndex.getAsync(archive.toString());
655
+ if (blockNumber === undefined) {
656
+ return undefined;
657
+ }
658
+ return this.getBlockData(BlockNumber(blockNumber));
659
+ }
660
+ /**
471
661
  * Gets an L2 block.
472
662
  * @param blockNumber - The number of the block to return.
473
663
  * @returns The requested L2 block.
@@ -557,12 +747,19 @@ export { TxReceipt } from '@aztec/stdlib/tx';
557
747
  ];
558
748
  }
559
749
  }
750
+ getBlockDataFromBlockStorage(blockStorage) {
751
+ return {
752
+ header: BlockHeader.fromBuffer(blockStorage.header),
753
+ archive: AppendOnlyTreeSnapshot.fromBuffer(blockStorage.archive),
754
+ blockHash: Fr.fromBuffer(blockStorage.blockHash),
755
+ checkpointNumber: CheckpointNumber(blockStorage.checkpointNumber),
756
+ indexWithinCheckpoint: IndexWithinCheckpoint(blockStorage.indexWithinCheckpoint)
757
+ };
758
+ }
560
759
  async getBlockFromBlockStorage(blockNumber, blockStorage) {
561
- const header = BlockHeader.fromBuffer(blockStorage.header);
562
- const archive = AppendOnlyTreeSnapshot.fromBuffer(blockStorage.archive);
563
- const blockHash = blockStorage.blockHash;
564
- header.setHash(Fr.fromBuffer(blockHash));
565
- const blockHashString = bufferToHex(blockHash);
760
+ const { header, archive, blockHash, checkpointNumber, indexWithinCheckpoint } = this.getBlockDataFromBlockStorage(blockStorage);
761
+ header.setHash(blockHash);
762
+ const blockHashString = bufferToHex(blockStorage.blockHash);
566
763
  const blockTxsBuffer = await this.#blockTxs.getAsync(blockHashString);
567
764
  if (blockTxsBuffer === undefined) {
568
765
  this.#log.warn(`Could not find body for block ${header.globalVariables.blockNumber} ${blockHash}`);
@@ -580,7 +777,7 @@ export { TxReceipt } from '@aztec/stdlib/tx';
580
777
  txEffects.push(deserializeIndexedTxEffect(txEffect).data);
581
778
  }
582
779
  const body = new Body(txEffects);
583
- const block = new L2Block(archive, header, body, CheckpointNumber(blockStorage.checkpointNumber), IndexWithinCheckpoint(blockStorage.indexWithinCheckpoint));
780
+ const block = new L2Block(archive, header, body, checkpointNumber, indexWithinCheckpoint);
584
781
  if (block.number !== blockNumber) {
585
782
  throw new Error(`Block number mismatch when retrieving block from archive (expected ${blockNumber} but got ${block.number} with hash ${blockHashString})`);
586
783
  }
@@ -601,17 +798,18 @@ export { TxReceipt } from '@aztec/stdlib/tx';
601
798
  * Gets a receipt of a settled tx.
602
799
  * @param txHash - The hash of a tx we try to get the receipt for.
603
800
  * @returns The requested tx receipt (or undefined if not found).
604
- */ async getSettledTxReceipt(txHash) {
801
+ */ async getSettledTxReceipt(txHash, l1Constants) {
605
802
  const txEffect = await this.getTxEffect(txHash);
606
803
  if (!txEffect) {
607
804
  return undefined;
608
805
  }
609
806
  const blockNumber = BlockNumber(txEffect.l2BlockNumber);
610
807
  // Use existing archiver methods to determine finalization level
611
- const [provenBlockNumber, checkpointedBlockNumber, finalizedBlockNumber] = await Promise.all([
808
+ const [provenBlockNumber, checkpointedBlockNumber, finalizedBlockNumber, blockData] = await Promise.all([
612
809
  this.getProvenBlockNumber(),
613
810
  this.getCheckpointedL2BlockNumber(),
614
- this.getFinalizedL2BlockNumber()
811
+ this.getFinalizedL2BlockNumber(),
812
+ this.getBlockData(blockNumber)
615
813
  ]);
616
814
  let status;
617
815
  if (blockNumber <= finalizedBlockNumber) {
@@ -623,7 +821,8 @@ export { TxReceipt } from '@aztec/stdlib/tx';
623
821
  } else {
624
822
  status = TxStatus.PROPOSED;
625
823
  }
626
- return new TxReceipt(txHash, status, TxReceipt.executionResultFromRevertCode(txEffect.data.revertCode), undefined, txEffect.data.transactionFee.toBigInt(), txEffect.l2BlockHash, blockNumber);
824
+ const epochNumber = blockData && l1Constants ? getEpochAtSlot(blockData.header.globalVariables.slotNumber, l1Constants) : undefined;
825
+ return new TxReceipt(txHash, status, TxReceipt.executionResultFromRevertCode(txEffect.data.revertCode), undefined, txEffect.data.transactionFee.toBigInt(), txEffect.l2BlockHash, blockNumber, epochNumber);
627
826
  }
628
827
  /**
629
828
  * Looks up which block included the requested tx effect.
@@ -656,7 +855,7 @@ export { TxReceipt } from '@aztec/stdlib/tx';
656
855
  if (!checkpoint) {
657
856
  return BlockNumber(INITIAL_L2_BLOCK_NUM - 1);
658
857
  }
659
- return BlockNumber(checkpoint.startBlock + checkpoint.numBlocks - 1);
858
+ return BlockNumber(checkpoint.startBlock + checkpoint.blockCount - 1);
660
859
  }
661
860
  async getLatestL2BlockNumber() {
662
861
  const [lastBlockNumber] = await toArray(this.#blocks.keysAsync({
@@ -685,6 +884,16 @@ export { TxReceipt } from '@aztec/stdlib/tx';
685
884
  const result = await this.#lastProvenCheckpoint.set(checkpointNumber);
686
885
  return result;
687
886
  }
887
+ async getFinalizedCheckpointNumber() {
888
+ const [latestCheckpointNumber, finalizedCheckpointNumber] = await Promise.all([
889
+ this.getLatestCheckpointNumber(),
890
+ this.#lastFinalizedCheckpoint.getAsync()
891
+ ]);
892
+ return (finalizedCheckpointNumber ?? 0) > latestCheckpointNumber ? latestCheckpointNumber : CheckpointNumber(finalizedCheckpointNumber ?? 0);
893
+ }
894
+ setFinalizedCheckpointNumber(checkpointNumber) {
895
+ return this.#lastFinalizedCheckpoint.set(checkpointNumber);
896
+ }
688
897
  #computeBlockRange(start, limit) {
689
898
  if (limit < 1) {
690
899
  throw new Error(`Invalid limit: ${limit}`);
@@ -15,4 +15,4 @@ export declare class ContractClassStore {
15
15
  getContractClassIds(): Promise<Fr[]>;
16
16
  addFunctions(contractClassId: Fr, newPrivateFunctions: ExecutablePrivateFunctionWithMembershipProof[], newUtilityFunctions: UtilityFunctionWithMembershipProof[]): Promise<boolean>;
17
17
  }
18
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3RfY2xhc3Nfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yZS9jb250cmFjdF9jbGFzc19zdG9yZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFHcEQsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQWlCLE1BQU0saUJBQWlCLENBQUM7QUFFeEUsT0FBTyxLQUFLLEVBQ1YsbUJBQW1CLEVBRW5CLDRDQUE0QyxFQUM1QyxrQ0FBa0MsRUFDbkMsTUFBTSx3QkFBd0IsQ0FBQztBQUdoQzs7R0FFRztBQUNILHFCQUFhLGtCQUFrQjs7SUFJakIsT0FBTyxDQUFDLEVBQUU7SUFBdEIsWUFBb0IsRUFBRSxFQUFFLGlCQUFpQixFQUd4QztJQUVLLGdCQUFnQixDQUNwQixhQUFhLEVBQUUsbUJBQW1CLEVBQ2xDLGtCQUFrQixFQUFFLEVBQUUsRUFDdEIsV0FBVyxFQUFFLE1BQU0sR0FDbEIsT0FBTyxDQUFDLElBQUksQ0FBQyxDQU1mO0lBRUsscUJBQXFCLENBQUMsYUFBYSxFQUFFLG1CQUFtQixFQUFFLFdBQVcsRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQU1sRztJQUVLLGdCQUFnQixDQUFDLEVBQUUsRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUFDLG1CQUFtQixHQUFHLFNBQVMsQ0FBQyxDQUd2RTtJQUVLLHFCQUFxQixDQUFDLEVBQUUsRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUFDLEVBQUUsR0FBRy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