@aztec/archiver 0.0.1-commit.f2ce05ee → 0.0.1-commit.f5a9928

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 (132) hide show
  1. package/README.md +19 -13
  2. package/dest/archiver.d.ts +76 -18
  3. package/dest/archiver.d.ts.map +1 -1
  4. package/dest/archiver.js +329 -162
  5. package/dest/config.d.ts +7 -3
  6. package/dest/config.d.ts.map +1 -1
  7. package/dest/config.js +43 -14
  8. package/dest/errors.d.ts +55 -9
  9. package/dest/errors.d.ts.map +1 -1
  10. package/dest/errors.js +81 -14
  11. package/dest/factory.d.ts +20 -9
  12. package/dest/factory.d.ts.map +1 -1
  13. package/dest/factory.js +87 -39
  14. package/dest/index.d.ts +12 -3
  15. package/dest/index.d.ts.map +1 -1
  16. package/dest/index.js +11 -2
  17. package/dest/l1/bin/retrieve-calldata.js +32 -28
  18. package/dest/l1/calldata_retriever.d.ts +81 -50
  19. package/dest/l1/calldata_retriever.d.ts.map +1 -1
  20. package/dest/l1/calldata_retriever.js +202 -260
  21. package/dest/l1/data_retrieval.d.ts +32 -18
  22. package/dest/l1/data_retrieval.d.ts.map +1 -1
  23. package/dest/l1/data_retrieval.js +42 -47
  24. package/dest/l1/spire_proposer.d.ts +5 -5
  25. package/dest/l1/spire_proposer.d.ts.map +1 -1
  26. package/dest/l1/spire_proposer.js +9 -17
  27. package/dest/l1/trace_tx.d.ts +12 -66
  28. package/dest/l1/trace_tx.d.ts.map +1 -1
  29. package/dest/l1/validate_historical_logs.d.ts +23 -0
  30. package/dest/l1/validate_historical_logs.d.ts.map +1 -0
  31. package/dest/l1/validate_historical_logs.js +108 -0
  32. package/dest/modules/contract_data_source_adapter.d.ts +25 -0
  33. package/dest/modules/contract_data_source_adapter.d.ts.map +1 -0
  34. package/dest/modules/contract_data_source_adapter.js +32 -0
  35. package/dest/modules/data_source_base.d.ts +74 -46
  36. package/dest/modules/data_source_base.d.ts.map +1 -1
  37. package/dest/modules/data_source_base.js +252 -190
  38. package/dest/modules/data_store_updater.d.ts +49 -17
  39. package/dest/modules/data_store_updater.d.ts.map +1 -1
  40. package/dest/modules/data_store_updater.js +218 -122
  41. package/dest/modules/instrumentation.d.ts +29 -3
  42. package/dest/modules/instrumentation.d.ts.map +1 -1
  43. package/dest/modules/instrumentation.js +67 -11
  44. package/dest/modules/l1_synchronizer.d.ts +16 -14
  45. package/dest/modules/l1_synchronizer.d.ts.map +1 -1
  46. package/dest/modules/l1_synchronizer.js +488 -219
  47. package/dest/modules/outbox_trees_resolver.d.ts +64 -0
  48. package/dest/modules/outbox_trees_resolver.d.ts.map +1 -0
  49. package/dest/modules/outbox_trees_resolver.js +184 -0
  50. package/dest/modules/validation.d.ts +30 -7
  51. package/dest/modules/validation.d.ts.map +1 -1
  52. package/dest/modules/validation.js +35 -17
  53. package/dest/store/block_store.d.ts +186 -74
  54. package/dest/store/block_store.d.ts.map +1 -1
  55. package/dest/store/block_store.js +810 -285
  56. package/dest/store/contract_class_store.d.ts +17 -4
  57. package/dest/store/contract_class_store.d.ts.map +1 -1
  58. package/dest/store/contract_class_store.js +42 -68
  59. package/dest/store/contract_instance_store.d.ts +28 -1
  60. package/dest/store/contract_instance_store.d.ts.map +1 -1
  61. package/dest/store/contract_instance_store.js +58 -6
  62. package/dest/store/data_stores.d.ts +68 -0
  63. package/dest/store/data_stores.d.ts.map +1 -0
  64. package/dest/store/data_stores.js +54 -0
  65. package/dest/store/function_names_cache.d.ts +17 -0
  66. package/dest/store/function_names_cache.d.ts.map +1 -0
  67. package/dest/store/function_names_cache.js +30 -0
  68. package/dest/store/l2_tips_cache.d.ts +25 -0
  69. package/dest/store/l2_tips_cache.d.ts.map +1 -0
  70. package/dest/store/l2_tips_cache.js +26 -0
  71. package/dest/store/log_store.d.ts +42 -37
  72. package/dest/store/log_store.d.ts.map +1 -1
  73. package/dest/store/log_store.js +262 -408
  74. package/dest/store/log_store_codec.d.ts +78 -0
  75. package/dest/store/log_store_codec.d.ts.map +1 -0
  76. package/dest/store/log_store_codec.js +110 -0
  77. package/dest/store/message_store.d.ts +11 -1
  78. package/dest/store/message_store.d.ts.map +1 -1
  79. package/dest/store/message_store.js +51 -9
  80. package/dest/test/fake_l1_state.d.ts +25 -1
  81. package/dest/test/fake_l1_state.d.ts.map +1 -1
  82. package/dest/test/fake_l1_state.js +166 -32
  83. package/dest/test/mock_archiver.d.ts +1 -1
  84. package/dest/test/mock_archiver.d.ts.map +1 -1
  85. package/dest/test/mock_archiver.js +3 -2
  86. package/dest/test/mock_l2_block_source.d.ts +61 -47
  87. package/dest/test/mock_l2_block_source.d.ts.map +1 -1
  88. package/dest/test/mock_l2_block_source.js +306 -211
  89. package/dest/test/mock_structs.d.ts +4 -1
  90. package/dest/test/mock_structs.d.ts.map +1 -1
  91. package/dest/test/mock_structs.js +15 -3
  92. package/dest/test/noop_l1_archiver.d.ts +17 -6
  93. package/dest/test/noop_l1_archiver.d.ts.map +1 -1
  94. package/dest/test/noop_l1_archiver.js +31 -11
  95. package/package.json +15 -14
  96. package/src/archiver.ts +427 -185
  97. package/src/config.ts +51 -13
  98. package/src/errors.ts +122 -21
  99. package/src/factory.ts +104 -29
  100. package/src/index.ts +19 -2
  101. package/src/l1/README.md +25 -68
  102. package/src/l1/bin/retrieve-calldata.ts +40 -27
  103. package/src/l1/calldata_retriever.ts +267 -379
  104. package/src/l1/data_retrieval.ts +66 -70
  105. package/src/l1/spire_proposer.ts +7 -15
  106. package/src/l1/validate_historical_logs.ts +140 -0
  107. package/src/modules/contract_data_source_adapter.ts +46 -0
  108. package/src/modules/data_source_base.ts +337 -238
  109. package/src/modules/data_store_updater.ts +259 -154
  110. package/src/modules/instrumentation.ts +71 -11
  111. package/src/modules/l1_synchronizer.ts +659 -269
  112. package/src/modules/outbox_trees_resolver.ts +220 -0
  113. package/src/modules/validation.ts +80 -23
  114. package/src/store/block_store.ts +989 -358
  115. package/src/store/contract_class_store.ts +49 -103
  116. package/src/store/contract_instance_store.ts +74 -11
  117. package/src/store/data_stores.ts +104 -0
  118. package/src/store/function_names_cache.ts +37 -0
  119. package/src/store/l2_tips_cache.ts +35 -0
  120. package/src/store/log_store.ts +302 -559
  121. package/src/store/log_store_codec.ts +143 -0
  122. package/src/store/message_store.ts +60 -10
  123. package/src/structs/inbox_message.ts +1 -1
  124. package/src/test/fake_l1_state.ts +213 -42
  125. package/src/test/mock_archiver.ts +3 -2
  126. package/src/test/mock_l2_block_source.ts +378 -233
  127. package/src/test/mock_structs.ts +25 -8
  128. package/src/test/noop_l1_archiver.ts +61 -12
  129. package/dest/store/kv_archiver_store.d.ts +0 -340
  130. package/dest/store/kv_archiver_store.d.ts.map +0 -1
  131. package/dest/store/kv_archiver_store.js +0 -446
  132. package/src/store/kv_archiver_store.ts +0 -639
@@ -1,260 +1,322 @@
1
- import { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
2
- import { isDefined } from '@aztec/foundation/types';
3
- import { CommitteeAttestation } from '@aztec/stdlib/block';
1
+ import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
2
+ import { BlockNumber, CheckpointNumber, IndexWithinCheckpoint } from '@aztec/foundation/branded-types';
3
+ import { Body, L2Block } from '@aztec/stdlib/block';
4
4
  import { Checkpoint, PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
5
- import { getSlotRangeForEpoch } from '@aztec/stdlib/epoch-helpers';
5
+ import { getEpochAtSlot, getEpochNumberAtTimestamp, getLastL1SlotTimestampForL2Slot, getProofSubmissionDeadlineEpoch, getSlotRangeForEpoch } from '@aztec/stdlib/epoch-helpers';
6
+ import { AppendOnlyTreeSnapshot } from '@aztec/stdlib/trees';
6
7
  /**
7
- * Abstract base class implementing ArchiverDataSource using a KVArchiverDataStore.
8
- * Provides implementations for all store-delegating methods and declares abstract methods
9
- * for L1-dependent functionality that subclasses must implement.
8
+ * Abstract base class implementing ArchiverDataSource using a bundle of archiver substores.
9
+ * Provides implementations for all read-side methods and declares abstract methods for
10
+ * L1-dependent functionality that subclasses must implement.
10
11
  */ export class ArchiverDataSourceBase {
11
- store;
12
+ stores;
12
13
  l1Constants;
13
- constructor(store, l1Constants){
14
- this.store = store;
14
+ /** The injected genesis block header. */ initialHeader;
15
+ /** Precomputed hash of the initial header, exposed via {@link getGenesisBlockHash}. */ initialBlockHash;
16
+ /** Archive root after block 0 was appended — read from L1 (`Rollup.getGenesisArchiveTreeRoot`). */ genesisArchiveRoot;
17
+ /** Memoized synthetic genesis block — callers rely on referential identity for caching. */ genesisBlock;
18
+ /** Memoized synthetic genesis block data — kept consistent with {@link genesisBlock}. */ genesisBlockData;
19
+ constructor(stores, l1Constants, initialHeader, initialBlockHash, genesisArchiveRoot){
20
+ this.stores = stores;
15
21
  this.l1Constants = l1Constants;
22
+ this.initialHeader = initialHeader;
23
+ this.initialBlockHash = initialBlockHash;
24
+ this.genesisArchiveRoot = genesisArchiveRoot;
25
+ const genesisArchive = new AppendOnlyTreeSnapshot(genesisArchiveRoot, 1);
26
+ this.genesisBlock = new L2Block(genesisArchive, initialHeader, Body.empty(), CheckpointNumber.ZERO, IndexWithinCheckpoint(0));
27
+ this.genesisBlockData = {
28
+ header: initialHeader,
29
+ archive: genesisArchive,
30
+ blockHash: initialBlockHash,
31
+ checkpointNumber: CheckpointNumber.ZERO,
32
+ indexWithinCheckpoint: IndexWithinCheckpoint(0)
33
+ };
16
34
  }
17
- getCheckpointNumber() {
18
- return this.store.getSynchedCheckpointNumber();
19
- }
20
- getSynchedCheckpointNumber() {
21
- return this.store.getSynchedCheckpointNumber();
35
+ /** Returns the precomputed hash of the genesis block header. */ getGenesisBlockHash() {
36
+ return this.initialBlockHash;
22
37
  }
23
- getProvenCheckpointNumber() {
24
- return this.store.getProvenCheckpointNumber();
38
+ /** Returns the synthetic genesis L2Block (memoized — same instance across calls). */ getGenesisBlock() {
39
+ return this.genesisBlock;
25
40
  }
26
- getBlockNumber() {
27
- return this.store.getLatestBlockNumber();
41
+ /** Returns genesis block data (memoized — same instance across calls). */ getGenesisBlockData() {
42
+ return this.genesisBlockData;
28
43
  }
29
- getProvenBlockNumber() {
30
- return this.store.getProvenBlockNumber();
44
+ /**
45
+ * Type guard distinguishing the genesis sentinel from a {@link ResolvedBlockQuery}.
46
+ * `resolveBlockQuery` already rewrites every genesis-matching shape to the sentinel,
47
+ * so callers only need this single sync check.
48
+ */ isGenesisBlockQuery(query) {
49
+ return 'genesis' in query;
31
50
  }
32
- async getBlockHeader(number) {
33
- const blockNumber = number === 'latest' ? await this.store.getLatestBlockNumber() : number;
34
- if (blockNumber === 0) {
35
- return undefined;
51
+ async isPruneDueAtSlot(slot) {
52
+ if (!this.l1Constants) {
53
+ throw new Error('isPruneDueAtSlot requires l1Constants');
36
54
  }
37
- const headers = await this.store.getBlockHeaders(blockNumber, 1);
38
- return headers.length === 0 ? undefined : headers[0];
39
- }
40
- getCheckpointedBlock(number) {
41
- return this.store.getCheckpointedBlock(number);
55
+ const tips = await this.getL2Tips();
56
+ const proven = tips.proven.checkpoint.number;
57
+ const pending = tips.checkpointed.checkpoint.number;
58
+ if (pending === proven) {
59
+ return false;
60
+ }
61
+ const oldestUnproven = await this.getCheckpointData({
62
+ number: CheckpointNumber(Number(proven) + 1)
63
+ });
64
+ if (!oldestUnproven) {
65
+ return false;
66
+ }
67
+ const slotTs = getLastL1SlotTimestampForL2Slot(slot, this.l1Constants);
68
+ const slotEpoch = getEpochNumberAtTimestamp(slotTs, this.l1Constants);
69
+ const oldestUnprovenEpoch = getEpochAtSlot(oldestUnproven.header.slotNumber, this.l1Constants);
70
+ const deadlineEpoch = getProofSubmissionDeadlineEpoch(oldestUnprovenEpoch, this.l1Constants);
71
+ return slotEpoch >= deadlineEpoch;
42
72
  }
43
- getCheckpointedL2BlockNumber() {
44
- return this.store.getCheckpointedL2BlockNumber();
73
+ getCheckpointNumber() {
74
+ return this.stores.blocks.getLatestCheckpointNumber();
45
75
  }
46
- getFinalizedL2BlockNumber() {
47
- return this.store.getFinalizedL2BlockNumber();
76
+ getProvenCheckpointNumber() {
77
+ return this.stores.blocks.getProvenCheckpointNumber();
48
78
  }
49
- async getCheckpointHeader(number) {
50
- if (number === 'latest') {
51
- number = await this.store.getSynchedCheckpointNumber();
79
+ async getBlockNumber(query) {
80
+ if (!query) {
81
+ return this.stores.blocks.getLatestL2BlockNumber();
52
82
  }
53
- if (number === 0) {
83
+ const resolved = await this.resolveBlockQuery(query);
84
+ if (resolved === undefined) {
54
85
  return undefined;
55
86
  }
56
- const checkpoint = await this.store.getCheckpointData(number);
57
- if (!checkpoint) {
58
- return undefined;
87
+ if (this.isGenesisBlockQuery(resolved)) {
88
+ return BlockNumber.ZERO;
89
+ }
90
+ return this.stores.blocks.getBlockNumber(resolved);
91
+ }
92
+ /**
93
+ * Resolves a {@link CheckpointQuery} to a concrete `CheckpointNumber`, or undefined when the
94
+ * query refers to a position that has no checkpoint yet (e.g. `{ slot }` not found).
95
+ */ resolveCheckpointQuery(query) {
96
+ if ('number' in query) {
97
+ return Promise.resolve(query.number);
98
+ }
99
+ if ('slot' in query) {
100
+ return this.stores.blocks.getCheckpointNumberBySlot(query.slot);
101
+ }
102
+ // tag variant
103
+ switch(query.tag){
104
+ case 'checkpointed':
105
+ return this.stores.blocks.getLatestCheckpointNumber();
106
+ case 'proven':
107
+ return this.stores.blocks.getProvenCheckpointNumber();
108
+ case 'finalized':
109
+ return this.stores.blocks.getFinalizedCheckpointNumber();
59
110
  }
60
- return checkpoint.header;
61
111
  }
62
- async getLastBlockNumberInCheckpoint(checkpointNumber) {
63
- const checkpointData = await this.store.getCheckpointData(checkpointNumber);
64
- if (!checkpointData) {
112
+ async getCheckpoint(query) {
113
+ const number = await this.resolveCheckpointQuery(query);
114
+ if (number === undefined || number === 0) {
65
115
  return undefined;
66
116
  }
67
- return BlockNumber(checkpointData.startBlock + checkpointData.numBlocks - 1);
117
+ const data = await this.stores.blocks.getCheckpointData(number);
118
+ if (!data) {
119
+ return undefined;
120
+ }
121
+ return this.getPublishedCheckpointFromCheckpointData(data);
68
122
  }
69
- getCheckpointedBlocks(from, limit) {
70
- return this.store.getCheckpointedBlocks(from, limit);
123
+ async getCheckpoints(query) {
124
+ const checkpoints = await this.getCheckpointsData(query);
125
+ return Promise.all(checkpoints.map((ch)=>this.getPublishedCheckpointFromCheckpointData(ch)));
71
126
  }
72
- getBlockHeaderByHash(blockHash) {
73
- return this.store.getBlockHeaderByHash(blockHash);
127
+ async getCheckpointData(query) {
128
+ const number = await this.resolveCheckpointQuery(query);
129
+ if (number === undefined || number === 0) {
130
+ return undefined;
131
+ }
132
+ return this.stores.blocks.getCheckpointData(number);
74
133
  }
75
- getBlockHeaderByArchive(archive) {
76
- return this.store.getBlockHeaderByArchive(archive);
134
+ async getCheckpointsData(query) {
135
+ if ('fromSlot' in query) {
136
+ return this.stores.blocks.getCheckpointsBySlot(query.fromSlot, query.limit, query.reverse ?? false);
137
+ }
138
+ if ('from' in query) {
139
+ return this.stores.blocks.getRangeOfCheckpoints(query.from, query.limit);
140
+ }
141
+ const numbers = await this.getCheckpointNumbersForEpoch(query.epoch);
142
+ return numbers.length > 0 ? this.stores.blocks.getRangeOfCheckpoints(numbers[0], numbers.length) : [];
77
143
  }
78
- async getL2Block(number) {
79
- // If the number provided is -ve, then return the latest block.
80
- if (number < 0) {
81
- number = await this.store.getLatestBlockNumber();
144
+ getProposedCheckpointData(query) {
145
+ if (!query || 'tag' in query) {
146
+ return this.stores.blocks.getLastProposedCheckpoint();
82
147
  }
83
- if (number === 0) {
84
- return undefined;
148
+ if ('number' in query) {
149
+ return this.stores.blocks.getProposedCheckpointByNumber(query.number);
85
150
  }
86
- const publishedBlock = await this.store.getBlock(number);
87
- return publishedBlock;
151
+ return this.stores.blocks.getProposedCheckpointBySlot(query.slot);
88
152
  }
89
153
  getTxEffect(txHash) {
90
- return this.store.getTxEffect(txHash);
91
- }
92
- getSettledTxReceipt(txHash) {
93
- return this.store.getSettledTxReceipt(txHash);
154
+ return this.stores.blocks.getTxEffect(txHash);
94
155
  }
95
156
  isPendingChainInvalid() {
96
157
  return this.getPendingChainValidationStatus().then((status)=>!status.valid);
97
158
  }
98
159
  async getPendingChainValidationStatus() {
99
- return await this.store.getPendingChainValidationStatus() ?? {
160
+ return await this.stores.blocks.getPendingChainValidationStatus() ?? {
100
161
  valid: true
101
162
  };
102
163
  }
103
- getPrivateLogsByTags(tags, page) {
104
- return this.store.getPrivateLogsByTags(tags, page);
105
- }
106
- getPublicLogsByTagsFromContract(contractAddress, tags, page) {
107
- return this.store.getPublicLogsByTagsFromContract(contractAddress, tags, page);
164
+ getPrivateLogsByTags(query) {
165
+ return this.stores.logs.getPrivateLogsByTags(query);
108
166
  }
109
- getPublicLogs(filter) {
110
- return this.store.getPublicLogs(filter);
111
- }
112
- getContractClassLogs(filter) {
113
- return this.store.getContractClassLogs(filter);
167
+ getPublicLogsByTags(query) {
168
+ return this.stores.logs.getPublicLogsByTags(query);
114
169
  }
115
170
  getContractClass(id) {
116
- return this.store.getContractClass(id);
171
+ return this.stores.contractClasses.getContractClass(id);
117
172
  }
118
173
  getBytecodeCommitment(id) {
119
- return this.store.getBytecodeCommitment(id);
120
- }
121
- async getContract(address, maybeTimestamp) {
122
- let timestamp;
123
- if (maybeTimestamp === undefined) {
124
- const latestBlockHeader = await this.getBlockHeader('latest');
125
- // If we get undefined block header, it means that the archiver has not yet synced any block so we default to 0.
126
- timestamp = latestBlockHeader ? latestBlockHeader.globalVariables.timestamp : 0n;
127
- } else {
128
- timestamp = maybeTimestamp;
129
- }
130
- return this.store.getContractInstance(address, timestamp);
174
+ return this.stores.contractClasses.getBytecodeCommitment(id);
175
+ }
176
+ getContract(address, timestamp) {
177
+ return this.stores.contractInstances.getContractInstance(address, timestamp);
131
178
  }
132
179
  getContractClassIds() {
133
- return this.store.getContractClassIds();
180
+ return this.stores.contractClasses.getContractClassIds();
134
181
  }
135
- getDebugFunctionName(address, selector) {
136
- return this.store.getDebugFunctionName(address, selector);
182
+ /** Looks up a public function name given a selector. */ getDebugFunctionName(_address, selector) {
183
+ return Promise.resolve(this.stores.functionNames.get(selector));
137
184
  }
138
- registerContractFunctionSignatures(signatures) {
139
- return this.store.registerContractFunctionSignatures(signatures);
185
+ /** Register public function signatures so they can be looked up by selector. */ registerContractFunctionSignatures(signatures) {
186
+ return this.stores.functionNames.register(signatures);
140
187
  }
141
188
  getL1ToL2Messages(checkpointNumber) {
142
- return this.store.getL1ToL2Messages(checkpointNumber);
189
+ return this.stores.messages.getL1ToL2Messages(checkpointNumber);
143
190
  }
144
191
  getL1ToL2MessageIndex(l1ToL2Message) {
145
- return this.store.getL1ToL2MessageIndex(l1ToL2Message);
146
- }
147
- async getCheckpoints(checkpointNumber, limit) {
148
- const checkpoints = await this.store.getRangeOfCheckpoints(checkpointNumber, limit);
149
- const blocks = (await Promise.all(checkpoints.map((ch)=>this.store.getBlocksForCheckpoint(ch.checkpointNumber)))).filter(isDefined);
150
- const fullCheckpoints = [];
151
- for(let i = 0; i < checkpoints.length; i++){
152
- const blocksForCheckpoint = blocks[i];
153
- const checkpoint = checkpoints[i];
154
- const fullCheckpoint = new Checkpoint(checkpoint.archive, checkpoint.header, blocksForCheckpoint, checkpoint.checkpointNumber);
155
- const publishedCheckpoint = new PublishedCheckpoint(fullCheckpoint, checkpoint.l1, checkpoint.attestations.map((x)=>CommitteeAttestation.fromBuffer(x)));
156
- fullCheckpoints.push(publishedCheckpoint);
192
+ return this.stores.messages.getL1ToL2MessageIndex(l1ToL2Message);
193
+ }
194
+ async getPublishedCheckpointFromCheckpointData(checkpoint) {
195
+ const blocksForCheckpoint = await this.stores.blocks.getBlocksForCheckpoint(checkpoint.checkpointNumber);
196
+ if (!blocksForCheckpoint) {
197
+ throw new Error(`Blocks for checkpoint ${checkpoint.checkpointNumber} not found`);
157
198
  }
158
- return fullCheckpoints;
199
+ const fullCheckpoint = new Checkpoint(checkpoint.archive, checkpoint.header, blocksForCheckpoint, checkpoint.checkpointNumber, checkpoint.feeAssetPriceModifier);
200
+ return new PublishedCheckpoint(fullCheckpoint, checkpoint.l1, checkpoint.attestations);
159
201
  }
160
202
  getBlocksForSlot(slotNumber) {
161
- return this.store.getBlocksForSlot(slotNumber);
203
+ return this.stores.blocks.getBlocksForSlot(slotNumber);
162
204
  }
163
- async getCheckpointedBlocksForEpoch(epochNumber) {
205
+ /** Returns just the checkpoint numbers for all checkpoints whose slot falls within the given epoch. */ getCheckpointNumbersForEpoch(epochNumber) {
164
206
  if (!this.l1Constants) {
165
207
  throw new Error('L1 constants not set');
166
208
  }
167
209
  const [start, end] = getSlotRangeForEpoch(epochNumber, this.l1Constants);
168
- const blocks = [];
169
- // Walk the list of checkpoints backwards and filter by slots matching the requested epoch.
170
- // We'll typically ask for checkpoints for a very recent epoch, so we shouldn't need an index here.
171
- let checkpoint = await this.store.getCheckpointData(await this.store.getSynchedCheckpointNumber());
172
- const slot = (b)=>b.header.slotNumber;
173
- while(checkpoint && slot(checkpoint) >= start){
174
- if (slot(checkpoint) <= end) {
175
- // push the blocks on backwards
176
- const endBlock = checkpoint.startBlock + checkpoint.numBlocks - 1;
177
- for(let i = endBlock; i >= checkpoint.startBlock; i--){
178
- const checkpointedBlock = await this.getCheckpointedBlock(BlockNumber(i));
179
- if (checkpointedBlock) {
180
- blocks.push(checkpointedBlock);
181
- }
182
- }
183
- }
184
- checkpoint = await this.store.getCheckpointData(CheckpointNumber(checkpoint.checkpointNumber - 1));
185
- }
186
- return blocks.reverse();
210
+ return this.stores.blocks.getCheckpointNumbersForSlotRange(start, end);
187
211
  }
188
- async getCheckpointedBlockHeadersForEpoch(epochNumber) {
189
- if (!this.l1Constants) {
190
- throw new Error('L1 constants not set');
212
+ async getBlock(query) {
213
+ const resolved = await this.resolveBlockQuery(query);
214
+ if (resolved === undefined) {
215
+ return undefined;
191
216
  }
192
- const [start, end] = getSlotRangeForEpoch(epochNumber, this.l1Constants);
193
- const blocks = [];
194
- // Walk the list of checkpoints backwards and filter by slots matching the requested epoch.
195
- // We'll typically ask for checkpoints for a very recent epoch, so we shouldn't need an index here.
196
- let checkpoint = await this.store.getCheckpointData(await this.store.getSynchedCheckpointNumber());
197
- const slot = (b)=>b.header.slotNumber;
198
- while(checkpoint && slot(checkpoint) >= start){
199
- if (slot(checkpoint) <= end) {
200
- // push the blocks on backwards
201
- const endBlock = checkpoint.startBlock + checkpoint.numBlocks - 1;
202
- for(let i = endBlock; i >= checkpoint.startBlock; i--){
203
- const block = await this.getBlockHeader(BlockNumber(i));
204
- if (block) {
205
- blocks.push(block);
206
- }
207
- }
208
- }
209
- checkpoint = await this.store.getCheckpointData(CheckpointNumber(checkpoint.checkpointNumber - 1));
217
+ if (this.isGenesisBlockQuery(resolved)) {
218
+ return this.getGenesisBlock();
219
+ }
220
+ return this.stores.blocks.getBlock(resolved);
221
+ }
222
+ /**
223
+ * Range queries iterate physical blocks only; the genesis block is NOT prepended.
224
+ * `L2BlockStream` consumers (`world-state.handleL2Blocks`, etc.) emit `blocks-added` events for
225
+ * real blocks and would be surprised by a synthetic block 0. Use {@link getBlock} or
226
+ * {@link getBlockData} for genesis-aware single-block lookups.
227
+ */ async getBlocks(query) {
228
+ const resolved = await this.resolveBlocksQuery(query);
229
+ return resolved ? this.stores.blocks.getBlocks(resolved) : [];
230
+ }
231
+ async getBlockData(query) {
232
+ const resolved = await this.resolveBlockQuery(query);
233
+ if (resolved === undefined) {
234
+ return undefined;
235
+ }
236
+ if (this.isGenesisBlockQuery(resolved)) {
237
+ return this.getGenesisBlockData();
238
+ }
239
+ return this.stores.blocks.getBlockData(resolved);
240
+ }
241
+ /** See {@link getBlocks} — range queries do not prepend the genesis block. */ async getBlocksData(query) {
242
+ const resolved = await this.resolveBlocksQuery(query);
243
+ return resolved ? this.stores.blocks.getBlocksData(resolved) : [];
244
+ }
245
+ /**
246
+ * Resolves a {@link BlockQuery} to either the genesis sentinel or a {@link ResolvedBlockQuery}
247
+ * understood by BlockStore. Detects every shape that points at block 0 — `{number:0}`,
248
+ * `{hash}` matching the initial header, `{archive}` matching the post-genesis archive root,
249
+ * and `{tag}` resolving to 0 — and rewrites them to the sentinel so callers branch once.
250
+ */ async resolveBlockQuery(query) {
251
+ if ('number' in query) {
252
+ return query.number === BlockNumber.ZERO ? {
253
+ genesis: true
254
+ } : query;
255
+ }
256
+ if ('hash' in query) {
257
+ return query.hash.equals(this.initialBlockHash) ? {
258
+ genesis: true
259
+ } : query;
210
260
  }
211
- return blocks.reverse();
261
+ if ('archive' in query) {
262
+ return query.archive.equals(this.genesisArchiveRoot) ? {
263
+ genesis: true
264
+ } : query;
265
+ }
266
+ const number = await this.resolveBlockTag(query.tag);
267
+ if (number === BlockNumber.ZERO) {
268
+ return {
269
+ genesis: true
270
+ };
271
+ }
272
+ return {
273
+ number
274
+ };
212
275
  }
213
- async getCheckpointsForEpoch(epochNumber) {
214
- if (!this.l1Constants) {
215
- throw new Error('L1 constants not set');
276
+ /** Maps a {@link BlockTag} to the matching block number for the current chain state. */ resolveBlockTag(tag) {
277
+ switch(tag){
278
+ case 'latest':
279
+ case 'proposed':
280
+ return this.stores.blocks.getLatestL2BlockNumber();
281
+ case 'checkpointed':
282
+ return this.stores.blocks.getCheckpointedL2BlockNumber();
283
+ case 'proven':
284
+ return this.stores.blocks.getProvenBlockNumber();
285
+ case 'finalized':
286
+ return this.stores.blocks.getFinalizedL2BlockNumber();
216
287
  }
217
- const [start, end] = getSlotRangeForEpoch(epochNumber, this.l1Constants);
218
- const checkpoints = [];
219
- // Walk the list of checkpoints backwards and filter by slots matching the requested epoch.
220
- // We'll typically ask for checkpoints for a very recent epoch, so we shouldn't need an index here.
221
- let checkpointData = await this.store.getCheckpointData(await this.store.getSynchedCheckpointNumber());
222
- const slot = (b)=>b.header.slotNumber;
223
- while(checkpointData && slot(checkpointData) >= start){
224
- if (slot(checkpointData) <= end) {
225
- // push the checkpoints on backwards
226
- const [checkpoint] = await this.getCheckpoints(checkpointData.checkpointNumber, 1);
227
- checkpoints.push(checkpoint.checkpoint);
288
+ }
289
+ /**
290
+ * Converts an epoch-based BlocksQuery to a from/limit query using l1Constants.
291
+ * Returns undefined when the epoch has no checkpoints, so callers can return [] without
292
+ * entering BlockStore. Reads only the two endpoint checkpoints rather than the whole epoch.
293
+ */ async resolveBlocksQuery(query) {
294
+ if (!('epoch' in query)) {
295
+ if (query.from < INITIAL_L2_BLOCK_NUM) {
296
+ throw new Error(`getBlocks/getBlocksData: 'from' must be >= ${INITIAL_L2_BLOCK_NUM}, got ${query.from}. ` + `Use getBlock({number:0})/getBlockData({number:0}) for genesis-aware single-block lookups.`);
228
297
  }
229
- checkpointData = await this.store.getCheckpointData(CheckpointNumber(checkpointData.checkpointNumber - 1));
298
+ return query;
230
299
  }
231
- return checkpoints.reverse();
232
- }
233
- async getBlock(number) {
234
- // If the number provided is -ve, then return the latest block.
235
- if (number < 0) {
236
- number = await this.store.getLatestBlockNumber();
300
+ const checkpointNumbers = await this.getCheckpointNumbersForEpoch(query.epoch);
301
+ if (checkpointNumbers.length === 0) {
302
+ return undefined;
237
303
  }
238
- if (number === 0) {
304
+ const firstNumber = checkpointNumbers[0];
305
+ const lastNumber = checkpointNumbers[checkpointNumbers.length - 1];
306
+ const first = await this.stores.blocks.getCheckpointData(firstNumber);
307
+ if (!first) {
239
308
  return undefined;
240
309
  }
241
- return this.store.getBlock(number);
242
- }
243
- getBlocks(from, limit) {
244
- return this.store.getBlocks(from, limit);
245
- }
246
- getCheckpointedBlockByHash(blockHash) {
247
- return this.store.getCheckpointedBlockByHash(blockHash);
248
- }
249
- getCheckpointedBlockByArchive(archive) {
250
- return this.store.getCheckpointedBlockByArchive(archive);
251
- }
252
- async getL2BlockByHash(blockHash) {
253
- const checkpointedBlock = await this.store.getCheckpointedBlockByHash(blockHash);
254
- return checkpointedBlock?.block;
255
- }
256
- async getL2BlockByArchive(archive) {
257
- const checkpointedBlock = await this.store.getCheckpointedBlockByArchive(archive);
258
- return checkpointedBlock?.block;
310
+ const last = firstNumber === lastNumber ? first : await this.stores.blocks.getCheckpointData(lastNumber);
311
+ if (!last) {
312
+ return undefined;
313
+ }
314
+ const from = BlockNumber(first.startBlock);
315
+ const limit = last.startBlock + last.blockCount - first.startBlock;
316
+ return {
317
+ from,
318
+ limit,
319
+ onlyCheckpointed: true
320
+ };
259
321
  }
260
322
  }
@@ -1,7 +1,8 @@
1
1
  import { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
2
- import type { L2Block, ValidateCheckpointResult } from '@aztec/stdlib/block';
3
- import type { PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
4
- import type { KVArchiverDataStore } from '../store/kv_archiver_store.js';
2
+ import type { CommitteeAttestation, L2Block, ValidateCheckpointResult } from '@aztec/stdlib/block';
3
+ import { type L1PublishedData, type ProposedCheckpointInput, type PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
4
+ import type { ArchiverDataStores } from '../store/data_stores.js';
5
+ import type { L2TipsCache } from '../store/l2_tips_cache.js';
5
6
  /** Result of adding checkpoints with information about any pruned blocks. */
6
7
  type ReconcileCheckpointsResult = {
7
8
  /** Blocks that were pruned due to conflict with L1 checkpoints. */
@@ -11,32 +12,42 @@ type ReconcileCheckpointsResult = {
11
12
  };
12
13
  /** Archiver helper module to handle updates to the data store. */
13
14
  export declare class ArchiverDataStoreUpdater {
14
- private store;
15
+ private stores;
16
+ private l2TipsCache?;
17
+ private opts;
15
18
  private readonly log;
16
- constructor(store: KVArchiverDataStore);
19
+ constructor(stores: ArchiverDataStores, l2TipsCache?: L2TipsCache | undefined, opts?: {
20
+ rollupManaLimit?: number;
21
+ });
17
22
  /**
18
- * Adds proposed blocks to the store with contract class/instance extraction from logs.
19
- * These are uncheckpointed blocks that have been proposed by the sequencer but not yet included in a checkpoint on L1.
20
- * Extracts ContractClassPublished, ContractInstancePublished, ContractInstanceUpdated events,
21
- * and individually broadcasted functions from the block logs.
23
+ * Adds a proposed block to the store with contract class/instance extraction from logs.
24
+ * This is an uncheckpointed block that has been proposed by the sequencer but not yet included in a checkpoint on L1.
25
+ * Extracts ContractClassPublished, ContractInstancePublished, ContractInstanceUpdated events from the block logs.
22
26
  *
23
- * @param blocks - The proposed L2 blocks to add.
27
+ * @param block - The proposed L2 block to add.
24
28
  * @param pendingChainValidationStatus - Optional validation status to set.
25
29
  * @returns True if the operation is successful.
26
30
  */
27
- addProposedBlocks(blocks: L2Block[], pendingChainValidationStatus?: ValidateCheckpointResult): Promise<boolean>;
31
+ addProposedBlock(block: L2Block, pendingChainValidationStatus?: ValidateCheckpointResult): Promise<boolean>;
28
32
  /**
29
33
  * Reconciles local blocks with incoming checkpoints from L1.
30
34
  * Adds new checkpoints to the store with contract class/instance extraction from logs.
31
35
  * Prunes any local blocks that conflict with checkpoint data (by comparing archive roots).
32
- * Extracts ContractClassPublished, ContractInstancePublished, ContractInstanceUpdated events,
33
- * and individually broadcasted functions from the checkpoint block logs.
36
+ * Extracts ContractClassPublished, ContractInstancePublished, ContractInstanceUpdated events from the checkpoint block logs.
37
+ * If `promoteProposed` is supplied, the proposed-checkpoint promotion runs inside the same transaction
38
+ * as the added checkpoints so both updates are applied atomically.
34
39
  *
35
- * @param checkpoints - The published checkpoints to add.
40
+ * @param checkpoints - The published checkpoints to add (excluding any being promoted from proposed).
36
41
  * @param pendingChainValidationStatus - Optional validation status to set.
42
+ * @param promoteProposed - Optional promotion of the current proposed checkpoint (fast path when blocks are already local).
37
43
  * @returns Result with information about any pruned blocks.
38
44
  */
39
- addCheckpoints(checkpoints: PublishedCheckpoint[], pendingChainValidationStatus?: ValidateCheckpointResult): Promise<ReconcileCheckpointsResult>;
45
+ addCheckpoints(checkpoints: PublishedCheckpoint[], pendingChainValidationStatus?: ValidateCheckpointResult, promoteProposed?: {
46
+ l1: L1PublishedData;
47
+ attestations: CommitteeAttestation[];
48
+ checkpoint: PublishedCheckpoint;
49
+ }, evictProposedFrom?: CheckpointNumber): Promise<ReconcileCheckpointsResult>;
50
+ addProposedCheckpoint(proposedCheckpoint: ProposedCheckpointInput): Promise<void>;
40
51
  private pruneMismatchingLocalBlocks;
41
52
  /**
42
53
  * Removes all uncheckpointed blocks strictly after the specified block number and cleans up associated contract data.
@@ -48,6 +59,18 @@ export declare class ArchiverDataStoreUpdater {
48
59
  * @throws Error if any block to be removed is checkpointed.
49
60
  */
50
61
  removeUncheckpointedBlocksAfter(blockNumber: BlockNumber): Promise<L2Block[]>;
62
+ /**
63
+ * Removes all blocks without a proposed checkpoint strictly after the specified block number and cleans up associated contract data.
64
+ * This handles removal of provisionally added blocks along with their contract classes/instances.
65
+ * Verifies that each block being removed is not part of a stored checkpoint (proposed or not).
66
+ * This differs from `removeUncheckpointedBlocksAfter` in that it also checks proposed checkpoints.
67
+ *
68
+ * @param blockNumber - Remove all blocks with number greater than this.
69
+ * @returns The removed blocks.
70
+ * @throws Error if any block to be removed is checkpointed.
71
+ */
72
+ removeBlocksWithoutProposedCheckpointAfter(blockNumber: BlockNumber): Promise<L2Block[]>;
73
+ private evictProposedCheckpointsForPrunedBlocks;
51
74
  private removeBlocksAfter;
52
75
  /**
53
76
  * Removes all checkpoints after the given checkpoint number.
@@ -59,6 +82,16 @@ export declare class ArchiverDataStoreUpdater {
59
82
  * @returns True if the operation is successful.
60
83
  */
61
84
  removeCheckpointsAfter(checkpointNumber: CheckpointNumber): Promise<boolean>;
85
+ /**
86
+ * Updates the proven checkpoint number and refreshes the L2 tips cache.
87
+ * @param checkpointNumber - The checkpoint number to set as proven.
88
+ */
89
+ setProvenCheckpointNumber(checkpointNumber: CheckpointNumber): Promise<void>;
90
+ /**
91
+ * Updates the finalized checkpoint number and refreshes the L2 tips cache.
92
+ * @param checkpointNumber - The checkpoint number to set as finalized.
93
+ */
94
+ setFinalizedCheckpointNumber(checkpointNumber: CheckpointNumber): Promise<void>;
62
95
  /** Extracts and stores contract data from a single block. */
63
96
  private addContractDataToDb;
64
97
  /** Removes contract data associated with a block. */
@@ -67,7 +100,6 @@ export declare class ArchiverDataStoreUpdater {
67
100
  private updatePublishedContractClasses;
68
101
  private updateDeployedContractInstances;
69
102
  private updateUpdatedContractIn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