@aztec/archiver 0.48.0 → 0.49.2
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 +4 -0
- package/dest/archiver/archiver.d.ts.map +1 -1
- package/dest/archiver/archiver.js +26 -10
- package/dest/archiver/archiver_store.d.ts +4 -2
- package/dest/archiver/archiver_store.d.ts.map +1 -1
- package/dest/archiver/archiver_store_test_suite.d.ts.map +1 -1
- package/dest/archiver/archiver_store_test_suite.js +21 -5
- package/dest/archiver/data_retrieval.d.ts +4 -4
- package/dest/archiver/data_retrieval.d.ts.map +1 -1
- package/dest/archiver/data_retrieval.js +8 -5
- package/dest/archiver/kv_archiver_store/block_body_store.d.ts +7 -1
- package/dest/archiver/kv_archiver_store/block_body_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/block_body_store.js +15 -4
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +1 -1
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/kv_archiver_store.js +2 -1
- package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts +2 -1
- package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts.map +1 -1
- package/dest/archiver/memory_archiver_store/memory_archiver_store.js +5 -2
- package/package.json +10 -10
- package/src/archiver/archiver.ts +32 -12
- package/src/archiver/archiver_store.ts +4 -2
- package/src/archiver/archiver_store_test_suite.ts +26 -9
- package/src/archiver/data_retrieval.ts +14 -6
- package/src/archiver/kv_archiver_store/block_body_store.ts +18 -4
- package/src/archiver/kv_archiver_store/kv_archiver_store.ts +2 -1
- package/src/archiver/memory_archiver_store/memory_archiver_store.ts +5 -3
|
@@ -101,7 +101,7 @@ export class KVArchiverDataStore implements ArchiverDataStore {
|
|
|
101
101
|
* @param blockBodies - The L2 block bodies to be added to the store.
|
|
102
102
|
* @returns True if the operation is successful.
|
|
103
103
|
*/
|
|
104
|
-
addBlockBodies(blockBodies: Body
|
|
104
|
+
addBlockBodies(blockBodies: DataRetrieval<Body>): Promise<boolean> {
|
|
105
105
|
return this.#blockBodyStore.addBlockBodies(blockBodies);
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -260,6 +260,7 @@ export class KVArchiverDataStore implements ArchiverDataStore {
|
|
|
260
260
|
getSynchPoint(): Promise<ArchiverL1SynchPoint> {
|
|
261
261
|
return Promise.resolve({
|
|
262
262
|
blocksSynchedTo: this.#blockStore.getSynchedL1BlockNumber(),
|
|
263
|
+
blockBodiesSynchedTo: this.#blockBodyStore.getSynchedL1BlockNumber(),
|
|
263
264
|
messagesSynchedTo: this.#messageStore.getSynchedL1BlockNumber(),
|
|
264
265
|
});
|
|
265
266
|
}
|
|
@@ -83,6 +83,7 @@ export class MemoryArchiverStore implements ArchiverDataStore {
|
|
|
83
83
|
private contractInstances: Map<string, ContractInstanceWithAddress> = new Map();
|
|
84
84
|
|
|
85
85
|
private lastL1BlockNewBlocks: bigint = 0n;
|
|
86
|
+
private lastL1BlockNewBlockBodies: bigint = 0n;
|
|
86
87
|
private lastL1BlockNewMessages: bigint = 0n;
|
|
87
88
|
private lastProvenL2BlockNumber: number = 0;
|
|
88
89
|
|
|
@@ -163,11 +164,11 @@ export class MemoryArchiverStore implements ArchiverDataStore {
|
|
|
163
164
|
* @param blockBodies - The L2 block bodies to be added to the store.
|
|
164
165
|
* @returns True if the operation is successful.
|
|
165
166
|
*/
|
|
166
|
-
addBlockBodies(blockBodies: Body
|
|
167
|
-
for (const body of blockBodies) {
|
|
167
|
+
addBlockBodies(blockBodies: DataRetrieval<Body>): Promise<boolean> {
|
|
168
|
+
for (const body of blockBodies.retrievedData) {
|
|
168
169
|
void this.l2BlockBodies.set(body.getTxsEffectsHash().toString('hex'), body);
|
|
169
170
|
}
|
|
170
|
-
|
|
171
|
+
this.lastL1BlockNewBlockBodies = blockBodies.lastProcessedL1BlockNumber;
|
|
171
172
|
return Promise.resolve(true);
|
|
172
173
|
}
|
|
173
174
|
|
|
@@ -443,6 +444,7 @@ export class MemoryArchiverStore implements ArchiverDataStore {
|
|
|
443
444
|
return Promise.resolve({
|
|
444
445
|
blocksSynchedTo: this.lastL1BlockNewBlocks,
|
|
445
446
|
messagesSynchedTo: this.lastL1BlockNewMessages,
|
|
447
|
+
blockBodiesSynchedTo: this.lastL1BlockNewBlockBodies,
|
|
446
448
|
});
|
|
447
449
|
}
|
|
448
450
|
|