@aztec/archiver 3.0.0-nightly.20251214 → 3.0.0-nightly.20251217
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/archiver/archiver.d.ts +60 -36
- package/dest/archiver/archiver.d.ts.map +1 -1
- package/dest/archiver/archiver.js +366 -180
- package/dest/archiver/archiver_store.d.ts +79 -23
- package/dest/archiver/archiver_store.d.ts.map +1 -1
- package/dest/archiver/archiver_store_test_suite.d.ts +1 -1
- package/dest/archiver/archiver_store_test_suite.d.ts.map +1 -1
- package/dest/archiver/archiver_store_test_suite.js +1666 -244
- package/dest/archiver/errors.d.ts +25 -1
- package/dest/archiver/errors.d.ts.map +1 -1
- package/dest/archiver/errors.js +37 -0
- package/dest/archiver/index.d.ts +2 -2
- package/dest/archiver/index.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/block_store.d.ts +49 -17
- package/dest/archiver/kv_archiver_store/block_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/block_store.js +320 -83
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +30 -28
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/kv_archiver_store.js +51 -27
- package/dest/archiver/kv_archiver_store/log_store.d.ts +5 -5
- package/dest/archiver/kv_archiver_store/log_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/log_store.js +39 -15
- package/dest/archiver/l1/bin/retrieve-calldata.js +2 -2
- package/dest/archiver/l1/calldata_retriever.d.ts +17 -3
- package/dest/archiver/l1/calldata_retriever.d.ts.map +1 -1
- package/dest/archiver/l1/calldata_retriever.js +75 -7
- package/dest/archiver/l1/data_retrieval.d.ts +11 -8
- package/dest/archiver/l1/data_retrieval.d.ts.map +1 -1
- package/dest/archiver/l1/data_retrieval.js +30 -17
- package/dest/archiver/structs/published.d.ts +1 -2
- package/dest/archiver/structs/published.d.ts.map +1 -1
- package/dest/test/mock_l2_block_source.d.ts +3 -2
- package/dest/test/mock_l2_block_source.d.ts.map +1 -1
- package/dest/test/mock_l2_block_source.js +8 -15
- package/package.json +13 -13
- package/src/archiver/archiver.ts +464 -222
- package/src/archiver/archiver_store.ts +88 -22
- package/src/archiver/archiver_store_test_suite.ts +1689 -226
- package/src/archiver/errors.ts +64 -0
- package/src/archiver/index.ts +1 -1
- package/src/archiver/kv_archiver_store/block_store.ts +435 -94
- package/src/archiver/kv_archiver_store/kv_archiver_store.ts +63 -39
- package/src/archiver/kv_archiver_store/log_store.ts +62 -25
- package/src/archiver/l1/bin/retrieve-calldata.ts +2 -2
- package/src/archiver/l1/calldata_retriever.ts +116 -6
- package/src/archiver/l1/data_retrieval.ts +34 -13
- package/src/archiver/structs/published.ts +0 -1
- package/src/test/mock_l2_block_source.ts +9 -16
|
@@ -4,7 +4,8 @@ import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
4
4
|
import type { CustomRange } from '@aztec/kv-store';
|
|
5
5
|
import type { FunctionSelector } from '@aztec/stdlib/abi';
|
|
6
6
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
-
import type {
|
|
7
|
+
import type { CheckpointedL2Block, L2BlockNew, ValidateBlockResult } from '@aztec/stdlib/block';
|
|
8
|
+
import type { PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
8
9
|
import type {
|
|
9
10
|
ContractClassPublic,
|
|
10
11
|
ContractInstanceUpdateWithAddress,
|
|
@@ -17,14 +18,14 @@ import type { LogFilter, TxScopedL2Log } from '@aztec/stdlib/logs';
|
|
|
17
18
|
import { BlockHeader, type IndexedTxEffect, type TxHash, type TxReceipt } from '@aztec/stdlib/tx';
|
|
18
19
|
import type { UInt64 } from '@aztec/stdlib/types';
|
|
19
20
|
|
|
21
|
+
import type { CheckpointData } from './kv_archiver_store/block_store.js';
|
|
20
22
|
import type { InboxMessage } from './structs/inbox_message.js';
|
|
21
|
-
import type { PublishedL2Block } from './structs/published.js';
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* Represents the latest L1 block processed by the archiver for various objects in L2.
|
|
25
26
|
*/
|
|
26
27
|
export type ArchiverL1SynchPoint = {
|
|
27
|
-
/** Number of the last L1 block that added a new L2
|
|
28
|
+
/** Number of the last L1 block that added a new L2 checkpoint metadata. */
|
|
28
29
|
blocksSynchedTo?: bigint;
|
|
29
30
|
/** Last L1 block checked for L1 to L2 messages. */
|
|
30
31
|
messagesSynchedTo?: L1BlockId;
|
|
@@ -45,34 +46,87 @@ export interface ArchiverDataStore {
|
|
|
45
46
|
* @param opts.force - If true, the blocks will be added even if they have gaps.
|
|
46
47
|
* @returns True if the operation is successful.
|
|
47
48
|
*/
|
|
48
|
-
addBlocks(blocks:
|
|
49
|
+
addBlocks(blocks: L2BlockNew[], opts?: { force?: boolean }): Promise<boolean>;
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
|
-
*
|
|
52
|
+
* Appends new checkpoints, and their blocks to the store's collection
|
|
53
|
+
* @param checkpoints The collectionn of checkpoints to be added
|
|
54
|
+
* @returns True if the operation is successful
|
|
55
|
+
*/
|
|
56
|
+
addCheckpoints(checkpoints: PublishedCheckpoint[]): Promise<boolean>;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Retrieves all blocks for the requested chackpoint
|
|
60
|
+
* @param checkpointNumber Retreieves all blocks for the given checkpoint
|
|
61
|
+
* @returns The collection of blocks for the requested checkpoint if available (undefined otherwise)
|
|
62
|
+
*/
|
|
63
|
+
getBlocksForCheckpoint(checkpointNumber: CheckpointNumber): Promise<L2BlockNew[] | undefined>;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Returns an array of checkpoint objects
|
|
67
|
+
* @param from The first checkpoint number to be retrieved
|
|
68
|
+
* @param limit The maximum number of chackpoints to retrieve
|
|
69
|
+
* @returns The array of requested checkpoint data objects
|
|
70
|
+
*/
|
|
71
|
+
getRangeOfCheckpoints(from: CheckpointNumber, limit: number): Promise<CheckpointData[]>;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Unwinds checkpoints from the database
|
|
52
75
|
* @param from - The tip of the chain, passed for verification purposes,
|
|
53
76
|
* ensuring that we don't end up deleting something we did not intend
|
|
54
|
-
* @param
|
|
77
|
+
* @param checkpointsToUnwind - The number of checkpoints we are to unwind
|
|
55
78
|
* @returns True if the operation is successful
|
|
56
79
|
*/
|
|
57
|
-
|
|
80
|
+
unwindCheckpoints(from: CheckpointNumber, checkpointsToUnwind: number): Promise<boolean>;
|
|
58
81
|
|
|
59
82
|
/**
|
|
60
83
|
* Returns the block for the given number, or undefined if not exists.
|
|
61
84
|
* @param number - The block number to return.
|
|
62
85
|
*/
|
|
63
|
-
|
|
86
|
+
getCheckpointedBlock(number: number): Promise<CheckpointedL2Block | undefined>;
|
|
64
87
|
|
|
65
88
|
/**
|
|
66
89
|
* Returns the block for the given hash, or undefined if not exists.
|
|
67
90
|
* @param blockHash - The block hash to return.
|
|
68
91
|
*/
|
|
69
|
-
|
|
92
|
+
getCheckpointedBlockByHash(blockHash: Fr): Promise<CheckpointedL2Block | undefined>;
|
|
70
93
|
|
|
71
94
|
/**
|
|
72
95
|
* Returns the block for the given archive root, or undefined if not exists.
|
|
73
96
|
* @param archive - The archive root to return.
|
|
74
97
|
*/
|
|
75
|
-
|
|
98
|
+
getCheckpointedBlockByArchive(archive: Fr): Promise<CheckpointedL2Block | undefined>;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Returns checkpoint data for the requested checkpoint number
|
|
102
|
+
* @param checkpointNumber - The checkpoint requested
|
|
103
|
+
* @returns The checkpoint data or undefined if not found
|
|
104
|
+
*/
|
|
105
|
+
getCheckpointData(checkpointNumber: CheckpointNumber): Promise<CheckpointData | undefined>;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Returns the number of the latest block
|
|
109
|
+
* @returns The number of the latest block
|
|
110
|
+
*/
|
|
111
|
+
getLatestBlockNumber(): Promise<BlockNumber>;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Returns the block for the given number, or undefined if not exists.
|
|
115
|
+
* @param number - The block number to return.
|
|
116
|
+
*/
|
|
117
|
+
getBlock(number: number): Promise<L2BlockNew | undefined>;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Returns the block for the given hash, or undefined if not exists.
|
|
121
|
+
* @param blockHash - The block hash to return.
|
|
122
|
+
*/
|
|
123
|
+
getBlockByHash(blockHash: Fr): Promise<L2BlockNew | undefined>;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Returns the block for the given archive root, or undefined if not exists.
|
|
127
|
+
* @param archive - The archive root to return.
|
|
128
|
+
*/
|
|
129
|
+
getBlockByArchive(archive: Fr): Promise<L2BlockNew | undefined>;
|
|
76
130
|
|
|
77
131
|
/**
|
|
78
132
|
* Gets up to `limit` amount of published L2 blocks starting from `from`.
|
|
@@ -80,7 +134,7 @@ export interface ArchiverDataStore {
|
|
|
80
134
|
* @param limit - The number of blocks to return.
|
|
81
135
|
* @returns The requested L2 blocks.
|
|
82
136
|
*/
|
|
83
|
-
|
|
137
|
+
getBlocks(from: number, limit: number): Promise<L2BlockNew[]>;
|
|
84
138
|
|
|
85
139
|
/**
|
|
86
140
|
* Gets up to `limit` amount of L2 block headers starting from `from`.
|
|
@@ -121,8 +175,8 @@ export interface ArchiverDataStore {
|
|
|
121
175
|
* @param blocks - The blocks for which to add the logs.
|
|
122
176
|
* @returns True if the operation is successful.
|
|
123
177
|
*/
|
|
124
|
-
addLogs(blocks:
|
|
125
|
-
deleteLogs(blocks:
|
|
178
|
+
addLogs(blocks: L2BlockNew[]): Promise<boolean>;
|
|
179
|
+
deleteLogs(blocks: L2BlockNew[]): Promise<boolean>;
|
|
126
180
|
|
|
127
181
|
/**
|
|
128
182
|
* Append L1 to L2 messages to the store.
|
|
@@ -178,25 +232,37 @@ export interface ArchiverDataStore {
|
|
|
178
232
|
* Gets the number of the latest L2 block processed.
|
|
179
233
|
* @returns The number of the latest L2 block processed.
|
|
180
234
|
*/
|
|
181
|
-
|
|
235
|
+
getCheckpointedL2BlockNumber(): Promise<BlockNumber>;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Gets the number of the latest published checkpoint processed.
|
|
239
|
+
* @returns The number of the latest published checkpoint processed
|
|
240
|
+
*/
|
|
241
|
+
getSynchedCheckpointNumber(): Promise<CheckpointNumber>;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Gets the number of the latest proven checkpoint processed.
|
|
245
|
+
* @returns The number of the latest proven checkpoint processed.
|
|
246
|
+
*/
|
|
247
|
+
getProvenCheckpointNumber(): Promise<CheckpointNumber>;
|
|
182
248
|
|
|
183
249
|
/**
|
|
184
|
-
*
|
|
185
|
-
* @returns The number of the
|
|
250
|
+
* Returns the number of the most recent proven block
|
|
251
|
+
* @returns The number of the most recent proven block
|
|
186
252
|
*/
|
|
187
|
-
|
|
253
|
+
getProvenBlockNumber(): Promise<BlockNumber>;
|
|
188
254
|
|
|
189
255
|
/**
|
|
190
|
-
* Stores the number of the latest proven
|
|
191
|
-
* @param
|
|
256
|
+
* Stores the number of the latest proven checkpoint processed.
|
|
257
|
+
* @param checkpointNumber - The number of the latest proven checkpoint processed.
|
|
192
258
|
*/
|
|
193
|
-
|
|
259
|
+
setProvenCheckpointNumber(checkpointNumber: CheckpointNumber): Promise<void>;
|
|
194
260
|
|
|
195
261
|
/**
|
|
196
|
-
* Stores the l1 block number that
|
|
262
|
+
* Stores the l1 block number that checkpoints have been synched until
|
|
197
263
|
* @param l1BlockNumber - The l1 block number
|
|
198
264
|
*/
|
|
199
|
-
|
|
265
|
+
setCheckpointSynchedL1BlockNumber(l1BlockNumber: bigint): Promise<void>;
|
|
200
266
|
|
|
201
267
|
/**
|
|
202
268
|
* Stores the l1 block that messages have been synched until
|