@aztec/archiver 4.0.0-nightly.20260113 → 4.0.0-nightly.20260114

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 (47) hide show
  1. package/README.md +139 -22
  2. package/dest/archiver/archive_source_base.d.ts +75 -0
  3. package/dest/archiver/archive_source_base.d.ts.map +1 -0
  4. package/dest/archiver/archive_source_base.js +202 -0
  5. package/dest/archiver/archiver.d.ts +28 -167
  6. package/dest/archiver/archiver.d.ts.map +1 -1
  7. package/dest/archiver/archiver.js +46 -601
  8. package/dest/archiver/archiver_store_updates.d.ts +38 -0
  9. package/dest/archiver/archiver_store_updates.d.ts.map +1 -0
  10. package/dest/archiver/archiver_store_updates.js +212 -0
  11. package/dest/archiver/index.d.ts +3 -2
  12. package/dest/archiver/index.d.ts.map +1 -1
  13. package/dest/archiver/index.js +2 -0
  14. package/dest/archiver/kv_archiver_store/block_store.d.ts +1 -1
  15. package/dest/archiver/kv_archiver_store/block_store.js +1 -1
  16. package/dest/archiver/kv_archiver_store/contract_class_store.d.ts +1 -1
  17. package/dest/archiver/kv_archiver_store/contract_class_store.js +1 -1
  18. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts +1 -1
  19. package/dest/archiver/kv_archiver_store/contract_instance_store.js +1 -1
  20. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +169 -9
  21. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +1 -1
  22. package/dest/archiver/kv_archiver_store/kv_archiver_store.js +157 -49
  23. package/dest/archiver/l1/data_retrieval.d.ts +9 -11
  24. package/dest/archiver/l1/data_retrieval.d.ts.map +1 -1
  25. package/dest/archiver/l1/data_retrieval.js +32 -51
  26. package/dest/archiver/test/fake_l1_state.d.ts +173 -0
  27. package/dest/archiver/test/fake_l1_state.d.ts.map +1 -0
  28. package/dest/archiver/test/fake_l1_state.js +364 -0
  29. package/package.json +13 -13
  30. package/src/archiver/archive_source_base.ts +339 -0
  31. package/src/archiver/archiver.ts +62 -808
  32. package/src/archiver/archiver_store_updates.ts +321 -0
  33. package/src/archiver/index.ts +2 -1
  34. package/src/archiver/kv_archiver_store/block_store.ts +1 -1
  35. package/src/archiver/kv_archiver_store/contract_class_store.ts +1 -1
  36. package/src/archiver/kv_archiver_store/contract_instance_store.ts +1 -1
  37. package/src/archiver/kv_archiver_store/kv_archiver_store.ts +170 -8
  38. package/src/archiver/l1/data_retrieval.ts +51 -68
  39. package/src/archiver/test/fake_l1_state.ts +561 -0
  40. package/dest/archiver/archiver_store.d.ts +0 -315
  41. package/dest/archiver/archiver_store.d.ts.map +0 -1
  42. package/dest/archiver/archiver_store.js +0 -4
  43. package/dest/archiver/archiver_store_test_suite.d.ts +0 -8
  44. package/dest/archiver/archiver_store_test_suite.d.ts.map +0 -1
  45. package/dest/archiver/archiver_store_test_suite.js +0 -2770
  46. package/src/archiver/archiver_store.ts +0 -380
  47. package/src/archiver/archiver_store_test_suite.ts +0 -2842
@@ -0,0 +1,38 @@
1
+ import type { CheckpointNumber } from '@aztec/foundation/branded-types';
2
+ import type { L2BlockNew, ValidateCheckpointResult } from '@aztec/stdlib/block';
3
+ import type { PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
4
+ import type { KVArchiverDataStore } from './kv_archiver_store/kv_archiver_store.js';
5
+ /**
6
+ * Adds blocks to the store with contract class/instance extraction from logs.
7
+ * Extracts ContractClassPublished, ContractInstancePublished, ContractInstanceUpdated events,
8
+ * and individually broadcasted functions from the block logs.
9
+ *
10
+ * @param store - The archiver data store.
11
+ * @param blocks - The L2 blocks to add.
12
+ * @param pendingChainValidationStatus - Optional validation status to set.
13
+ * @returns True if the operation is successful.
14
+ */
15
+ export declare function addBlocksWithContractData(store: KVArchiverDataStore, blocks: L2BlockNew[], pendingChainValidationStatus?: ValidateCheckpointResult): Promise<boolean>;
16
+ /**
17
+ * Adds checkpoints to the store with contract class/instance extraction from logs.
18
+ * Extracts ContractClassPublished, ContractInstancePublished, ContractInstanceUpdated events,
19
+ * and individually broadcasted functions from the checkpoint block logs.
20
+ *
21
+ * @param store - The archiver data store.
22
+ * @param checkpoints - The published checkpoints to add.
23
+ * @param pendingChainValidationStatus - Optional validation status to set.
24
+ * @returns True if the operation is successful.
25
+ */
26
+ export declare function addCheckpointsWithContractData(store: KVArchiverDataStore, checkpoints: PublishedCheckpoint[], pendingChainValidationStatus?: ValidateCheckpointResult): Promise<boolean>;
27
+ /**
28
+ * Unwinds checkpoints from the store with reverse contract extraction.
29
+ * Deletes ContractClassPublished, ContractInstancePublished, ContractInstanceUpdated data
30
+ * that was stored for the unwound checkpoints.
31
+ *
32
+ * @param store - The archiver data store.
33
+ * @param from - The checkpoint number to unwind from (must be the current tip).
34
+ * @param checkpointsToUnwind - The number of checkpoints to unwind.
35
+ * @returns True if the operation is successful.
36
+ */
37
+ export declare function unwindCheckpointsWithContractData(store: KVArchiverDataStore, from: CheckpointNumber, checkpointsToUnwind: number): Promise<boolean>;
38
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJjaGl2ZXJfc3RvcmVfdXBkYXRlcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2FyY2hpdmVyL2FyY2hpdmVyX3N0b3JlX3VwZGF0ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQWUsZ0JBQWdCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQVlyRixPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNoRixPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBYXBFLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sMENBQTBDLENBQUM7QUFVcEY7Ozs7Ozs7OztHQVNHO0FBQ0gsd0JBQWdCLHlCQUF5QixDQUN2QyxLQUFLLEVBQUUsbUJBQW1CLEVBQzFCLE1BQU0sRUFBRSxVQUFVLEVBQUUsRUFDcEIsNEJBQTRCLENBQUMsRUFBRSx3QkFBd0IsR0FDdEQsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQWVsQjtBQUVEOzs7Ozs7Ozs7R0FTRztBQUNILHdCQUFnQiw4QkFBOEIsQ0FDNUMsS0FBSyxFQUFFLG1CQUFtQixFQUMxQixXQUFXLEVBQUUsbUJBQW1CLEVBQUUsRUFDbEMsNEJBQTRCLENBQUMsRUFBRSx3QkFBd0IsR0FDdEQsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQWdCbEI7QUFFRDs7Ozs7Ozs7O0dBU0c7QUFDSCx3QkFBc0IsaUNBQWlDLENBQ3JELEtBQUssRUFBRSxtQkFBbUIsRUFDMUIsSUFBSSxFQUFFLGdCQUFnQixFQUN0QixtQkFBbUIsRUFBRSxNQUFNLEdBQzFCLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0E0Q2xCIn0=
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archiver_store_updates.d.ts","sourceRoot":"","sources":["../../src/archiver/archiver_store_updates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAYrF,OAAO,KAAK,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAapE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAUpF;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,UAAU,EAAE,EACpB,4BAA4B,CAAC,EAAE,wBAAwB,GACtD,OAAO,CAAC,OAAO,CAAC,CAelB;AAED;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,mBAAmB,EAC1B,WAAW,EAAE,mBAAmB,EAAE,EAClC,4BAA4B,CAAC,EAAE,wBAAwB,GACtD,OAAO,CAAC,OAAO,CAAC,CAgBlB;AAED;;;;;;;;;GASG;AACH,wBAAsB,iCAAiC,CACrD,KAAK,EAAE,mBAAmB,EAC1B,IAAI,EAAE,gBAAgB,EACtB,mBAAmB,EAAE,MAAM,GAC1B,OAAO,CAAC,OAAO,CAAC,CA4ClB"}
@@ -0,0 +1,212 @@
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { createLogger } from '@aztec/foundation/log';
3
+ import { ContractClassPublishedEvent, PrivateFunctionBroadcastedEvent, UtilityFunctionBroadcastedEvent } from '@aztec/protocol-contracts/class-registry';
4
+ import { ContractInstancePublishedEvent, ContractInstanceUpdatedEvent } from '@aztec/protocol-contracts/instance-registry';
5
+ import { computePublicBytecodeCommitment, isValidPrivateFunctionMembershipProof, isValidUtilityFunctionMembershipProof } from '@aztec/stdlib/contract';
6
+ import groupBy from 'lodash.groupby';
7
+ const log = createLogger('archiver:store-updates');
8
+ /** Operation type for contract data updates. */ var Operation = /*#__PURE__*/ function(Operation) {
9
+ Operation[Operation["Store"] = 0] = "Store";
10
+ Operation[Operation["Delete"] = 1] = "Delete";
11
+ return Operation;
12
+ }(Operation || {});
13
+ /**
14
+ * Adds blocks to the store with contract class/instance extraction from logs.
15
+ * Extracts ContractClassPublished, ContractInstancePublished, ContractInstanceUpdated events,
16
+ * and individually broadcasted functions from the block logs.
17
+ *
18
+ * @param store - The archiver data store.
19
+ * @param blocks - The L2 blocks to add.
20
+ * @param pendingChainValidationStatus - Optional validation status to set.
21
+ * @returns True if the operation is successful.
22
+ */ export function addBlocksWithContractData(store, blocks, pendingChainValidationStatus) {
23
+ return store.transactionAsync(async ()=>{
24
+ await store.addBlocks(blocks);
25
+ const opResults = await Promise.all([
26
+ // Update the pending chain validation status if provided
27
+ pendingChainValidationStatus && store.setPendingChainValidationStatus(pendingChainValidationStatus),
28
+ // Add any logs emitted during the retrieved blocks
29
+ store.addLogs(blocks),
30
+ // Unroll all logs emitted during the retrieved blocks and extract any contract classes and instances from them
31
+ ...blocks.map((block)=>addBlockDataToDB(store, block))
32
+ ]);
33
+ return opResults.every(Boolean);
34
+ });
35
+ }
36
+ /**
37
+ * Adds checkpoints to the store with contract class/instance extraction from logs.
38
+ * Extracts ContractClassPublished, ContractInstancePublished, ContractInstanceUpdated events,
39
+ * and individually broadcasted functions from the checkpoint block logs.
40
+ *
41
+ * @param store - The archiver data store.
42
+ * @param checkpoints - The published checkpoints to add.
43
+ * @param pendingChainValidationStatus - Optional validation status to set.
44
+ * @returns True if the operation is successful.
45
+ */ export function addCheckpointsWithContractData(store, checkpoints, pendingChainValidationStatus) {
46
+ return store.transactionAsync(async ()=>{
47
+ await store.addCheckpoints(checkpoints);
48
+ const allBlocks = checkpoints.flatMap((ch)=>ch.checkpoint.blocks);
49
+ const opResults = await Promise.all([
50
+ // Update the pending chain validation status if provided
51
+ pendingChainValidationStatus && store.setPendingChainValidationStatus(pendingChainValidationStatus),
52
+ // Add any logs emitted during the retrieved blocks
53
+ store.addLogs(allBlocks),
54
+ // Unroll all logs emitted during the retrieved blocks and extract any contract classes and instances from them
55
+ ...allBlocks.map((block)=>addBlockDataToDB(store, block))
56
+ ]);
57
+ return opResults.every(Boolean);
58
+ });
59
+ }
60
+ /**
61
+ * Unwinds checkpoints from the store with reverse contract extraction.
62
+ * Deletes ContractClassPublished, ContractInstancePublished, ContractInstanceUpdated data
63
+ * that was stored for the unwound checkpoints.
64
+ *
65
+ * @param store - The archiver data store.
66
+ * @param from - The checkpoint number to unwind from (must be the current tip).
67
+ * @param checkpointsToUnwind - The number of checkpoints to unwind.
68
+ * @returns True if the operation is successful.
69
+ */ export async function unwindCheckpointsWithContractData(store, from, checkpointsToUnwind) {
70
+ if (checkpointsToUnwind <= 0) {
71
+ throw new Error(`Cannot unwind ${checkpointsToUnwind} blocks`);
72
+ }
73
+ const last = await store.getSynchedCheckpointNumber();
74
+ if (from != last) {
75
+ throw new Error(`Cannot unwind checkpoints from checkpoint ${from} when the last checkpoint is ${last}`);
76
+ }
77
+ const blocks = [];
78
+ const lastCheckpointNumber = from + checkpointsToUnwind - 1;
79
+ for(let checkpointNumber = from; checkpointNumber <= lastCheckpointNumber; checkpointNumber++){
80
+ const blocksForCheckpoint = await store.getBlocksForCheckpoint(checkpointNumber);
81
+ if (!blocksForCheckpoint) {
82
+ continue;
83
+ }
84
+ blocks.push(...blocksForCheckpoint);
85
+ }
86
+ const opResults = await Promise.all([
87
+ // Prune rolls back to the last proven block, which is by definition valid
88
+ store.setPendingChainValidationStatus({
89
+ valid: true
90
+ }),
91
+ // Unroll all logs emitted during the retrieved blocks and extract any contract classes and instances from them
92
+ ...blocks.map(async (block)=>{
93
+ const contractClassLogs = block.body.txEffects.flatMap((txEffect)=>txEffect.contractClassLogs);
94
+ // ContractInstancePublished event logs are broadcast in privateLogs.
95
+ const privateLogs = block.body.txEffects.flatMap((txEffect)=>txEffect.privateLogs);
96
+ const publicLogs = block.body.txEffects.flatMap((txEffect)=>txEffect.publicLogs);
97
+ return (await Promise.all([
98
+ updatePublishedContractClasses(store, contractClassLogs, block.number, 1),
99
+ updateDeployedContractInstances(store, privateLogs, block.number, 1),
100
+ updateUpdatedContractInstances(store, publicLogs, block.header.globalVariables.timestamp, 1)
101
+ ])).every(Boolean);
102
+ }),
103
+ store.deleteLogs(blocks),
104
+ store.unwindCheckpoints(from, checkpointsToUnwind)
105
+ ]);
106
+ return opResults.every(Boolean);
107
+ }
108
+ /**
109
+ * Extracts and stores contract data from a single block.
110
+ */ async function addBlockDataToDB(store, block) {
111
+ const contractClassLogs = block.body.txEffects.flatMap((txEffect)=>txEffect.contractClassLogs);
112
+ // ContractInstancePublished event logs are broadcast in privateLogs.
113
+ const privateLogs = block.body.txEffects.flatMap((txEffect)=>txEffect.privateLogs);
114
+ const publicLogs = block.body.txEffects.flatMap((txEffect)=>txEffect.publicLogs);
115
+ return (await Promise.all([
116
+ updatePublishedContractClasses(store, contractClassLogs, block.number, 0),
117
+ updateDeployedContractInstances(store, privateLogs, block.number, 0),
118
+ updateUpdatedContractInstances(store, publicLogs, block.header.globalVariables.timestamp, 0),
119
+ storeBroadcastedIndividualFunctions(store, contractClassLogs, block.number)
120
+ ])).every(Boolean);
121
+ }
122
+ /**
123
+ * Extracts and stores contract classes out of ContractClassPublished events emitted by the class registry contract.
124
+ */ async function updatePublishedContractClasses(store, allLogs, blockNum, operation) {
125
+ const contractClassPublishedEvents = allLogs.filter((log)=>ContractClassPublishedEvent.isContractClassPublishedEvent(log)).map((log)=>ContractClassPublishedEvent.fromLog(log));
126
+ const contractClasses = await Promise.all(contractClassPublishedEvents.map((e)=>e.toContractClassPublic()));
127
+ if (contractClasses.length > 0) {
128
+ contractClasses.forEach((c)=>log.verbose(`${Operation[operation]} contract class ${c.id.toString()}`));
129
+ if (operation == 0) {
130
+ // TODO: Will probably want to create some worker threads to compute these bytecode commitments as they are expensive
131
+ const commitments = await Promise.all(contractClasses.map((c)=>computePublicBytecodeCommitment(c.packedBytecode)));
132
+ return await store.addContractClasses(contractClasses, commitments, blockNum);
133
+ } else if (operation == 1) {
134
+ return await store.deleteContractClasses(contractClasses, blockNum);
135
+ }
136
+ }
137
+ return true;
138
+ }
139
+ /**
140
+ * Extracts and stores contract instances out of ContractInstancePublished events emitted by the canonical deployer contract.
141
+ */ async function updateDeployedContractInstances(store, allLogs, blockNum, operation) {
142
+ const contractInstances = allLogs.filter((log)=>ContractInstancePublishedEvent.isContractInstancePublishedEvent(log)).map((log)=>ContractInstancePublishedEvent.fromLog(log)).map((e)=>e.toContractInstance());
143
+ if (contractInstances.length > 0) {
144
+ contractInstances.forEach((c)=>log.verbose(`${Operation[operation]} contract instance at ${c.address.toString()}`));
145
+ if (operation == 0) {
146
+ return await store.addContractInstances(contractInstances, blockNum);
147
+ } else if (operation == 1) {
148
+ return await store.deleteContractInstances(contractInstances, blockNum);
149
+ }
150
+ }
151
+ return true;
152
+ }
153
+ /**
154
+ * Extracts and stores contract instance updates out of ContractInstanceUpdated events.
155
+ */ async function updateUpdatedContractInstances(store, allLogs, timestamp, operation) {
156
+ const contractUpdates = allLogs.filter((log)=>ContractInstanceUpdatedEvent.isContractInstanceUpdatedEvent(log)).map((log)=>ContractInstanceUpdatedEvent.fromLog(log)).map((e)=>e.toContractInstanceUpdate());
157
+ if (contractUpdates.length > 0) {
158
+ contractUpdates.forEach((c)=>log.verbose(`${Operation[operation]} contract instance update at ${c.address.toString()}`));
159
+ if (operation == 0) {
160
+ return await store.addContractInstanceUpdates(contractUpdates, timestamp);
161
+ } else if (operation == 1) {
162
+ return await store.deleteContractInstanceUpdates(contractUpdates, timestamp);
163
+ }
164
+ }
165
+ return true;
166
+ }
167
+ /**
168
+ * Stores the functions that were broadcasted individually.
169
+ *
170
+ * @dev Beware that there is not a delete variant of this, since they are added to contract classes
171
+ * and will be deleted as part of the class if needed.
172
+ */ async function storeBroadcastedIndividualFunctions(store, allLogs, _blockNum) {
173
+ // Filter out private and utility function broadcast events
174
+ const privateFnEvents = allLogs.filter((log)=>PrivateFunctionBroadcastedEvent.isPrivateFunctionBroadcastedEvent(log)).map((log)=>PrivateFunctionBroadcastedEvent.fromLog(log));
175
+ const utilityFnEvents = allLogs.filter((log)=>UtilityFunctionBroadcastedEvent.isUtilityFunctionBroadcastedEvent(log)).map((log)=>UtilityFunctionBroadcastedEvent.fromLog(log));
176
+ // Group all events by contract class id
177
+ for (const [classIdString, classEvents] of Object.entries(groupBy([
178
+ ...privateFnEvents,
179
+ ...utilityFnEvents
180
+ ], (e)=>e.contractClassId.toString()))){
181
+ const contractClassId = Fr.fromHexString(classIdString);
182
+ const contractClass = await store.getContractClass(contractClassId);
183
+ if (!contractClass) {
184
+ log.warn(`Skipping broadcasted functions as contract class ${contractClassId.toString()} was not found`);
185
+ continue;
186
+ }
187
+ // Split private and utility functions, and filter out invalid ones
188
+ const allFns = classEvents.map((e)=>e.toFunctionWithMembershipProof());
189
+ const privateFns = allFns.filter((fn)=>'utilityFunctionsTreeRoot' in fn);
190
+ const utilityFns = allFns.filter((fn)=>'privateFunctionsArtifactTreeRoot' in fn);
191
+ const privateFunctionsWithValidity = await Promise.all(privateFns.map(async (fn)=>({
192
+ fn,
193
+ valid: await isValidPrivateFunctionMembershipProof(fn, contractClass)
194
+ })));
195
+ const validPrivateFns = privateFunctionsWithValidity.filter(({ valid })=>valid).map(({ fn })=>fn);
196
+ const utilityFunctionsWithValidity = await Promise.all(utilityFns.map(async (fn)=>({
197
+ fn,
198
+ valid: await isValidUtilityFunctionMembershipProof(fn, contractClass)
199
+ })));
200
+ const validUtilityFns = utilityFunctionsWithValidity.filter(({ valid })=>valid).map(({ fn })=>fn);
201
+ const validFnCount = validPrivateFns.length + validUtilityFns.length;
202
+ if (validFnCount !== allFns.length) {
203
+ log.warn(`Skipping ${allFns.length - validFnCount} invalid functions`);
204
+ }
205
+ // Store the functions in the contract class in a single operation
206
+ if (validFnCount > 0) {
207
+ log.verbose(`Storing ${validFnCount} functions for contract class ${contractClassId.toString()}`);
208
+ }
209
+ return await store.addFunctions(contractClassId, validPrivateFns, validUtilityFns);
210
+ }
211
+ return true;
212
+ }
@@ -1,7 +1,8 @@
1
1
  export * from './archiver.js';
2
+ export * from './archive_source_base.js';
3
+ export * from './archiver_store_updates.js';
2
4
  export * from './config.js';
3
5
  export { type L1PublishedData } from './structs/published.js';
4
- export type { ArchiverDataStore } from './archiver_store.js';
5
6
  export { KVArchiverDataStore, ARCHIVER_DB_VERSION } from './kv_archiver_store/kv_archiver_store.js';
6
7
  export { ContractInstanceStore } from './kv_archiver_store/contract_instance_store.js';
7
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9hcmNoaXZlci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGVBQWUsQ0FBQztBQUM5QixjQUFjLGFBQWEsQ0FBQztBQUM1QixPQUFPLEVBQUUsS0FBSyxlQUFlLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUM5RCxZQUFZLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUM3RCxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSwwQ0FBMEMsQ0FBQztBQUNwRyxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSxnREFBZ0QsQ0FBQyJ9
8
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9hcmNoaXZlci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGVBQWUsQ0FBQztBQUM5QixjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMsNkJBQTZCLENBQUM7QUFDNUMsY0FBYyxhQUFhLENBQUM7QUFDNUIsT0FBTyxFQUFFLEtBQUssZUFBZSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDOUQsT0FBTyxFQUFFLG1CQUFtQixFQUFFLG1CQUFtQixFQUFFLE1BQU0sMENBQTBDLENBQUM7QUFDcEcsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sZ0RBQWdELENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/archiver/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AACpG,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/archiver/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AACpG,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC"}
@@ -1,4 +1,6 @@
1
1
  export * from './archiver.js';
2
+ export * from './archive_source_base.js';
3
+ export * from './archiver_store_updates.js';
2
4
  export * from './config.js';
3
5
  export { KVArchiverDataStore, ARCHIVER_DB_VERSION } from './kv_archiver_store/kv_archiver_store.js';
4
6
  export { ContractInstanceStore } from './kv_archiver_store/contract_instance_store.js';
@@ -18,7 +18,7 @@ export type CheckpointData = {
18
18
  attestations: Buffer[];
19
19
  };
20
20
  /**
21
- * LMDB implementation of the ArchiverDataStore interface.
21
+ * LMDB-based block storage for the archiver.
22
22
  */
23
23
  export declare class BlockStore {
24
24
  #private;
@@ -13,7 +13,7 @@ import { BlockHeader, TxHash, TxReceipt, deserializeIndexedTxEffect, serializeIn
13
13
  import { BlockArchiveNotConsistentError, BlockIndexNotSequentialError, BlockNotFoundError, BlockNumberNotSequentialError, CheckpointNotFoundError, CheckpointNumberNotConsistentError, CheckpointNumberNotSequentialError, InitialBlockNumberNotSequentialError, InitialCheckpointNumberNotSequentialError } from '../errors.js';
14
14
  export { TxReceipt } from '@aztec/stdlib/tx';
15
15
  /**
16
- * LMDB implementation of the ArchiverDataStore interface.
16
+ * LMDB-based block storage for the archiver.
17
17
  */ export class BlockStore {
18
18
  db;
19
19
  /** Map block number to block data */ #blocks;
@@ -2,7 +2,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
3
3
  import type { ContractClassPublic, ExecutablePrivateFunctionWithMembershipProof, UtilityFunctionWithMembershipProof } from '@aztec/stdlib/contract';
4
4
  /**
5
- * LMDB implementation of the ArchiverDataStore interface.
5
+ * LMDB-based contract class storage for the archiver.
6
6
  */
7
7
  export declare class ContractClassStore {
8
8
  #private;
@@ -4,7 +4,7 @@ import { BufferReader, numToUInt8, serializeToBuffer } from '@aztec/foundation/s
4
4
  import { FunctionSelector } from '@aztec/stdlib/abi';
5
5
  import { Vector } from '@aztec/stdlib/types';
6
6
  /**
7
- * LMDB implementation of the ArchiverDataStore interface.
7
+ * LMDB-based contract class storage for the archiver.
8
8
  */ export class ContractClassStore {
9
9
  db;
10
10
  #contractClasses;
@@ -5,7 +5,7 @@ import { type ContractInstanceUpdateWithAddress, type ContractInstanceWithAddres
5
5
  import type { UInt64 } from '@aztec/stdlib/types';
6
6
  type ContractInstanceUpdateKey = [string, string] | [string, string, number];
7
7
  /**
8
- * LMDB implementation of the ArchiverDataStore interface.
8
+ * LMDB-based contract instance storage for the archiver.
9
9
  */
10
10
  export declare class ContractInstanceStore {
11
11
  #private;
@@ -1,6 +1,6 @@
1
1
  import { SerializableContractInstance, SerializableContractInstanceUpdate } from '@aztec/stdlib/contract';
2
2
  /**
3
- * LMDB implementation of the ArchiverDataStore interface.
3
+ * LMDB-based contract instance storage for the archiver.
4
4
  */ export class ContractInstanceStore {
5
5
  db;
6
6
  #contractInstances;