@aztec/archiver 3.0.0-nightly.20251222 → 3.0.0-nightly.20251224
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 +10 -14
- package/dest/archiver/archiver.d.ts.map +1 -1
- package/dest/archiver/archiver.js +23 -18
- package/dest/archiver/archiver_store.d.ts +11 -8
- 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 +134 -39
- package/dest/archiver/config.d.ts +3 -3
- package/dest/archiver/config.d.ts.map +1 -1
- package/dest/archiver/config.js +2 -2
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +4 -10
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/kv_archiver_store.js +9 -8
- package/dest/archiver/kv_archiver_store/log_store.d.ts +11 -8
- package/dest/archiver/kv_archiver_store/log_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/log_store.js +114 -48
- package/dest/archiver/l1/bin/retrieve-calldata.js +3 -1
- package/dest/archiver/l1/data_retrieval.d.ts +5 -5
- package/dest/archiver/l1/data_retrieval.d.ts.map +1 -1
- package/dest/archiver/l1/data_retrieval.js +9 -9
- package/dest/factory.d.ts +1 -1
- package/dest/factory.js +1 -1
- package/package.json +13 -13
- package/src/archiver/archiver.ts +29 -20
- package/src/archiver/archiver_store.ts +11 -7
- package/src/archiver/archiver_store_test_suite.ts +157 -43
- package/src/archiver/config.ts +7 -3
- package/src/archiver/kv_archiver_store/kv_archiver_store.ts +11 -10
- package/src/archiver/kv_archiver_store/log_store.ts +158 -53
- package/src/archiver/l1/bin/retrieve-calldata.ts +1 -1
- package/src/archiver/l1/data_retrieval.ts +10 -10
- package/src/factory.ts +1 -1
|
@@ -4,6 +4,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
4
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
5
5
|
import { BufferReader, numToUInt32BE } from '@aztec/foundation/serialize';
|
|
6
6
|
import type { AztecAsyncKVStore, AztecAsyncMap } from '@aztec/kv-store';
|
|
7
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
8
|
import { L2BlockHash, L2BlockNew } from '@aztec/stdlib/block';
|
|
8
9
|
import type { GetContractClassLogsResponse, GetPublicLogsResponse } from '@aztec/stdlib/interfaces/client';
|
|
9
10
|
import {
|
|
@@ -13,6 +14,8 @@ import {
|
|
|
13
14
|
type LogFilter,
|
|
14
15
|
LogId,
|
|
15
16
|
PublicLog,
|
|
17
|
+
type SiloedTag,
|
|
18
|
+
Tag,
|
|
16
19
|
TxScopedL2Log,
|
|
17
20
|
} from '@aztec/stdlib/logs';
|
|
18
21
|
|
|
@@ -22,8 +25,12 @@ import type { BlockStore } from './block_store.js';
|
|
|
22
25
|
* A store for logs
|
|
23
26
|
*/
|
|
24
27
|
export class LogStore {
|
|
25
|
-
|
|
26
|
-
#
|
|
28
|
+
// `tag` --> private logs
|
|
29
|
+
#privateLogsByTag: AztecAsyncMap<string, Buffer[]>;
|
|
30
|
+
// `{contractAddress}_${tag}` --> public logs
|
|
31
|
+
#publicLogsByContractAndTag: AztecAsyncMap<string, Buffer[]>;
|
|
32
|
+
#privateLogKeysByBlock: AztecAsyncMap<number, string[]>;
|
|
33
|
+
#publicLogKeysByBlock: AztecAsyncMap<number, string[]>;
|
|
27
34
|
#publicLogsByBlock: AztecAsyncMap<number, Buffer>;
|
|
28
35
|
#contractClassLogsByBlock: AztecAsyncMap<number, Buffer>;
|
|
29
36
|
#logsMaxPageSize: number;
|
|
@@ -34,86 +41,173 @@ export class LogStore {
|
|
|
34
41
|
private blockStore: BlockStore,
|
|
35
42
|
logsMaxPageSize: number = 1000,
|
|
36
43
|
) {
|
|
37
|
-
this.#
|
|
38
|
-
this.#
|
|
44
|
+
this.#privateLogsByTag = db.openMap('archiver_private_tagged_logs_by_tag');
|
|
45
|
+
this.#publicLogsByContractAndTag = db.openMap('archiver_public_tagged_logs_by_tag');
|
|
46
|
+
this.#privateLogKeysByBlock = db.openMap('archiver_private_log_keys_by_block');
|
|
47
|
+
this.#publicLogKeysByBlock = db.openMap('archiver_public_log_keys_by_block');
|
|
39
48
|
this.#publicLogsByBlock = db.openMap('archiver_public_logs_by_block');
|
|
40
49
|
this.#contractClassLogsByBlock = db.openMap('archiver_contract_class_logs_by_block');
|
|
41
50
|
|
|
42
51
|
this.#logsMaxPageSize = logsMaxPageSize;
|
|
43
52
|
}
|
|
44
53
|
|
|
45
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Extracts tagged logs from a single block, grouping them into private and public maps.
|
|
56
|
+
*
|
|
57
|
+
* @param block - The L2 block to extract logs from.
|
|
58
|
+
* @returns An object containing the private and public tagged logs for the block.
|
|
59
|
+
*/
|
|
60
|
+
async #extractTaggedLogsFromBlock(block: L2BlockNew) {
|
|
46
61
|
const blockHash = L2BlockHash.fromField(await block.hash());
|
|
47
|
-
|
|
62
|
+
// SiloedTag (as string) -> array of log buffers.
|
|
63
|
+
const privateTaggedLogs = new Map<string, Buffer[]>();
|
|
64
|
+
// "{contractAddress}_{tag}" (as string) -> array of log buffers.
|
|
65
|
+
const publicTaggedLogs = new Map<string, Buffer[]>();
|
|
48
66
|
const dataStartIndexForBlock =
|
|
49
67
|
block.header.state.partial.noteHashTree.nextAvailableLeafIndex -
|
|
50
68
|
block.body.txEffects.length * MAX_NOTE_HASHES_PER_TX;
|
|
69
|
+
|
|
51
70
|
block.body.txEffects.forEach((txEffect, txIndex) => {
|
|
52
71
|
const txHash = txEffect.txHash;
|
|
53
72
|
const dataStartIndexForTx = dataStartIndexForBlock + txIndex * MAX_NOTE_HASHES_PER_TX;
|
|
54
73
|
|
|
55
74
|
txEffect.privateLogs.forEach((log, logIndex) => {
|
|
75
|
+
// Private logs use SiloedTag (already siloed by kernel)
|
|
56
76
|
const tag = log.fields[0];
|
|
57
77
|
this.#log.debug(`Found private log with tag ${tag.toString()} in block ${block.number}`);
|
|
58
78
|
|
|
59
|
-
const currentLogs =
|
|
79
|
+
const currentLogs = privateTaggedLogs.get(tag.toString()) ?? [];
|
|
60
80
|
currentLogs.push(
|
|
61
|
-
new TxScopedL2Log(
|
|
81
|
+
new TxScopedL2Log(
|
|
82
|
+
txHash,
|
|
83
|
+
dataStartIndexForTx,
|
|
84
|
+
logIndex,
|
|
85
|
+
block.number,
|
|
86
|
+
blockHash,
|
|
87
|
+
block.timestamp,
|
|
88
|
+
log,
|
|
89
|
+
).toBuffer(),
|
|
62
90
|
);
|
|
63
|
-
|
|
91
|
+
privateTaggedLogs.set(tag.toString(), currentLogs);
|
|
64
92
|
});
|
|
65
93
|
|
|
66
94
|
txEffect.publicLogs.forEach((log, logIndex) => {
|
|
95
|
+
// Public logs use Tag directly (not siloed) and are stored with contract address
|
|
67
96
|
const tag = log.fields[0];
|
|
68
|
-
|
|
97
|
+
const contractAddress = log.contractAddress;
|
|
98
|
+
const key = `${contractAddress.toString()}_${tag.toString()}`;
|
|
99
|
+
this.#log.debug(
|
|
100
|
+
`Found public log with tag ${tag.toString()} from contract ${contractAddress.toString()} in block ${block.number}`,
|
|
101
|
+
);
|
|
69
102
|
|
|
70
|
-
const currentLogs =
|
|
103
|
+
const currentLogs = publicTaggedLogs.get(key) ?? [];
|
|
71
104
|
currentLogs.push(
|
|
72
|
-
new TxScopedL2Log(
|
|
105
|
+
new TxScopedL2Log(
|
|
106
|
+
txHash,
|
|
107
|
+
dataStartIndexForTx,
|
|
108
|
+
logIndex,
|
|
109
|
+
block.number,
|
|
110
|
+
blockHash,
|
|
111
|
+
block.timestamp,
|
|
112
|
+
log,
|
|
113
|
+
).toBuffer(),
|
|
73
114
|
);
|
|
74
|
-
|
|
115
|
+
publicTaggedLogs.set(key, currentLogs);
|
|
75
116
|
});
|
|
76
117
|
});
|
|
77
|
-
|
|
118
|
+
|
|
119
|
+
return { privateTaggedLogs, publicTaggedLogs };
|
|
78
120
|
}
|
|
79
121
|
|
|
80
122
|
/**
|
|
81
|
-
*
|
|
82
|
-
* @param blocks - The blocks
|
|
83
|
-
* @returns
|
|
123
|
+
* Extracts and aggregates tagged logs from a list of blocks.
|
|
124
|
+
* @param blocks - The blocks to extract logs from.
|
|
125
|
+
* @returns A map from tag (as string) to an array of serialized private logs belonging to that tag, and a map from
|
|
126
|
+
* "{contractAddress}_{tag}" (as string) to an array of serialized public logs belonging to that key.
|
|
84
127
|
*/
|
|
85
|
-
async
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
128
|
+
async #extractTaggedLogs(
|
|
129
|
+
blocks: L2BlockNew[],
|
|
130
|
+
): Promise<{ privateTaggedLogs: Map<string, Buffer[]>; publicTaggedLogs: Map<string, Buffer[]> }> {
|
|
131
|
+
const taggedLogsInBlocks = await Promise.all(blocks.map(block => this.#extractTaggedLogsFromBlock(block)));
|
|
132
|
+
|
|
133
|
+
// Now we merge the maps from each block into a single map.
|
|
134
|
+
const privateTaggedLogs = taggedLogsInBlocks.reduce((acc, { privateTaggedLogs }) => {
|
|
135
|
+
for (const [tag, logs] of privateTaggedLogs.entries()) {
|
|
89
136
|
const currentLogs = acc.get(tag) ?? [];
|
|
90
137
|
acc.set(tag, currentLogs.concat(logs));
|
|
91
138
|
}
|
|
92
139
|
return acc;
|
|
93
140
|
}, new Map<string, Buffer[]>());
|
|
94
|
-
|
|
141
|
+
|
|
142
|
+
const publicTaggedLogs = taggedLogsInBlocks.reduce((acc, { publicTaggedLogs }) => {
|
|
143
|
+
for (const [key, logs] of publicTaggedLogs.entries()) {
|
|
144
|
+
const currentLogs = acc.get(key) ?? [];
|
|
145
|
+
acc.set(key, currentLogs.concat(logs));
|
|
146
|
+
}
|
|
147
|
+
return acc;
|
|
148
|
+
}, new Map<string, Buffer[]>());
|
|
149
|
+
|
|
150
|
+
return { privateTaggedLogs, publicTaggedLogs };
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Append new logs to the store's list.
|
|
155
|
+
* @param blocks - The blocks for which to add the logs.
|
|
156
|
+
* @returns True if the operation is successful.
|
|
157
|
+
*/
|
|
158
|
+
async addLogs(blocks: L2BlockNew[]): Promise<boolean> {
|
|
159
|
+
const { privateTaggedLogs, publicTaggedLogs } = await this.#extractTaggedLogs(blocks);
|
|
160
|
+
|
|
161
|
+
const keysOfPrivateLogsToUpdate = Array.from(privateTaggedLogs.keys());
|
|
162
|
+
const keysOfPublicLogsToUpdate = Array.from(publicTaggedLogs.keys());
|
|
95
163
|
|
|
96
164
|
return this.db.transactionAsync(async () => {
|
|
97
|
-
const
|
|
98
|
-
|
|
165
|
+
const currentPrivateTaggedLogs = await Promise.all(
|
|
166
|
+
keysOfPrivateLogsToUpdate.map(async key => ({
|
|
167
|
+
tag: key,
|
|
168
|
+
logBuffers: await this.#privateLogsByTag.getAsync(key),
|
|
169
|
+
})),
|
|
99
170
|
);
|
|
100
|
-
|
|
171
|
+
currentPrivateTaggedLogs.forEach(taggedLogBuffer => {
|
|
101
172
|
if (taggedLogBuffer.logBuffers && taggedLogBuffer.logBuffers.length > 0) {
|
|
102
|
-
|
|
173
|
+
privateTaggedLogs.set(
|
|
103
174
|
taggedLogBuffer.tag,
|
|
104
|
-
taggedLogBuffer.logBuffers!.concat(
|
|
175
|
+
taggedLogBuffer.logBuffers!.concat(privateTaggedLogs.get(taggedLogBuffer.tag)!),
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
const currentPublicTaggedLogs = await Promise.all(
|
|
181
|
+
keysOfPublicLogsToUpdate.map(async key => ({
|
|
182
|
+
key,
|
|
183
|
+
logBuffers: await this.#publicLogsByContractAndTag.getAsync(key),
|
|
184
|
+
})),
|
|
185
|
+
);
|
|
186
|
+
currentPublicTaggedLogs.forEach(taggedLogBuffer => {
|
|
187
|
+
if (taggedLogBuffer.logBuffers && taggedLogBuffer.logBuffers.length > 0) {
|
|
188
|
+
publicTaggedLogs.set(
|
|
189
|
+
taggedLogBuffer.key,
|
|
190
|
+
taggedLogBuffer.logBuffers!.concat(publicTaggedLogs.get(taggedLogBuffer.key)!),
|
|
105
191
|
);
|
|
106
192
|
}
|
|
107
193
|
});
|
|
194
|
+
|
|
108
195
|
for (const block of blocks) {
|
|
109
196
|
const blockHash = await block.hash();
|
|
110
197
|
|
|
111
|
-
const
|
|
112
|
-
for (const [tag, logs] of
|
|
113
|
-
await this.#
|
|
114
|
-
|
|
198
|
+
const privateTagsInBlock: string[] = [];
|
|
199
|
+
for (const [tag, logs] of privateTaggedLogs.entries()) {
|
|
200
|
+
await this.#privateLogsByTag.set(tag, logs);
|
|
201
|
+
privateTagsInBlock.push(tag);
|
|
115
202
|
}
|
|
116
|
-
await this.#
|
|
203
|
+
await this.#privateLogKeysByBlock.set(block.number, privateTagsInBlock);
|
|
204
|
+
|
|
205
|
+
const publicKeysInBlock: string[] = [];
|
|
206
|
+
for (const [key, logs] of publicTaggedLogs.entries()) {
|
|
207
|
+
await this.#publicLogsByContractAndTag.set(key, logs);
|
|
208
|
+
publicKeysInBlock.push(key);
|
|
209
|
+
}
|
|
210
|
+
await this.#publicLogKeysByBlock.set(block.number, publicKeysInBlock);
|
|
117
211
|
|
|
118
212
|
const publicLogsInBlock = block.body.txEffects
|
|
119
213
|
.map((txEffect, txIndex) =>
|
|
@@ -162,44 +256,55 @@ export class LogStore {
|
|
|
162
256
|
|
|
163
257
|
deleteLogs(blocks: L2BlockNew[]): Promise<boolean> {
|
|
164
258
|
return this.db.transactionAsync(async () => {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
259
|
+
await Promise.all(
|
|
260
|
+
blocks.map(async block => {
|
|
261
|
+
// Delete private logs
|
|
262
|
+
const privateKeys = (await this.#privateLogKeysByBlock.getAsync(block.number)) ?? [];
|
|
263
|
+
await Promise.all(privateKeys.map(tag => this.#privateLogsByTag.delete(tag)));
|
|
264
|
+
|
|
265
|
+
// Delete public logs
|
|
266
|
+
const publicKeys = (await this.#publicLogKeysByBlock.getAsync(block.number)) ?? [];
|
|
267
|
+
await Promise.all(publicKeys.map(key => this.#publicLogsByContractAndTag.delete(key)));
|
|
268
|
+
}),
|
|
269
|
+
);
|
|
173
270
|
|
|
174
271
|
await Promise.all(
|
|
175
272
|
blocks.map(block =>
|
|
176
273
|
Promise.all([
|
|
177
274
|
this.#publicLogsByBlock.delete(block.number),
|
|
178
|
-
this.#
|
|
275
|
+
this.#privateLogKeysByBlock.delete(block.number),
|
|
276
|
+
this.#publicLogKeysByBlock.delete(block.number),
|
|
179
277
|
this.#contractClassLogsByBlock.delete(block.number),
|
|
180
278
|
]),
|
|
181
279
|
),
|
|
182
280
|
);
|
|
183
281
|
|
|
184
|
-
await Promise.all(tagsToDelete.map(tag => this.#logsByTag.delete(tag.toString())));
|
|
185
282
|
return true;
|
|
186
283
|
});
|
|
187
284
|
}
|
|
188
285
|
|
|
189
286
|
/**
|
|
190
|
-
* Gets all logs that match any of the
|
|
191
|
-
*
|
|
192
|
-
* @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
|
|
193
|
-
* that tag.
|
|
287
|
+
* Gets all private logs that match any of the `tags`. For each tag, an array of matching logs is returned. An empty
|
|
288
|
+
* array implies no logs match that tag.
|
|
194
289
|
*/
|
|
195
|
-
async
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
290
|
+
async getPrivateLogsByTags(tags: SiloedTag[]): Promise<TxScopedL2Log[][]> {
|
|
291
|
+
const logs = await Promise.all(tags.map(tag => this.#privateLogsByTag.getAsync(tag.toString())));
|
|
292
|
+
|
|
293
|
+
return logs.map(logBuffers => logBuffers?.map(logBuffer => TxScopedL2Log.fromBuffer(logBuffer)) ?? []);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Gets all public logs that match any of the `tags` from the specified contract. For each tag, an array of matching
|
|
298
|
+
* logs is returned. An empty array implies no logs match that tag.
|
|
299
|
+
*/
|
|
300
|
+
async getPublicLogsByTagsFromContract(contractAddress: AztecAddress, tags: Tag[]): Promise<TxScopedL2Log[][]> {
|
|
301
|
+
const logs = await Promise.all(
|
|
302
|
+
tags.map(tag => {
|
|
303
|
+
const key = `${contractAddress.toString()}_${tag.value.toString()}`;
|
|
304
|
+
return this.#publicLogsByContractAndTag.getAsync(key);
|
|
305
|
+
}),
|
|
202
306
|
);
|
|
307
|
+
return logs.map(logBuffers => logBuffers?.map(logBuffer => TxScopedL2Log.fromBuffer(logBuffer)) ?? []);
|
|
203
308
|
}
|
|
204
309
|
|
|
205
310
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BlobClientInterface } from '@aztec/blob-client/client';
|
|
1
2
|
import {
|
|
2
3
|
BlobDeserializationError,
|
|
3
4
|
type CheckpointBlobData,
|
|
@@ -5,7 +6,6 @@ import {
|
|
|
5
6
|
decodeCheckpointBlobDataFromBlobs,
|
|
6
7
|
encodeBlockBlobData,
|
|
7
8
|
} from '@aztec/blob-lib';
|
|
8
|
-
import type { BlobSinkClientInterface } from '@aztec/blob-sink/client';
|
|
9
9
|
import type { EpochProofPublicInputArgs } from '@aztec/ethereum/contracts';
|
|
10
10
|
import type { ViemClient, ViemPublicClient, ViemPublicDebugClient } from '@aztec/ethereum/types';
|
|
11
11
|
import { asyncPool } from '@aztec/foundation/async-pool';
|
|
@@ -140,7 +140,7 @@ export async function retrievedToPublishedCheckpoint({
|
|
|
140
140
|
* @param rollup - The rollup contract instance.
|
|
141
141
|
* @param publicClient - The viem public client to use for transaction retrieval.
|
|
142
142
|
* @param debugClient - The viem debug client to use for trace/debug RPC methods (optional).
|
|
143
|
-
* @param
|
|
143
|
+
* @param blobClient - The blob client client for fetching blob data.
|
|
144
144
|
* @param searchStartBlock - The block number to use for starting the search.
|
|
145
145
|
* @param searchEndBlock - The highest block number that we should search up to.
|
|
146
146
|
* @param contractAddresses - The contract addresses (governanceProposerAddress, slashFactoryAddress, slashingProposerAddress).
|
|
@@ -153,7 +153,7 @@ export async function retrieveCheckpointsFromRollup(
|
|
|
153
153
|
rollup: GetContractReturnType<typeof RollupAbi, ViemPublicClient>,
|
|
154
154
|
publicClient: ViemPublicClient,
|
|
155
155
|
debugClient: ViemPublicDebugClient,
|
|
156
|
-
|
|
156
|
+
blobClient: BlobClientInterface,
|
|
157
157
|
searchStartBlock: bigint,
|
|
158
158
|
searchEndBlock: bigint,
|
|
159
159
|
contractAddresses: {
|
|
@@ -209,7 +209,7 @@ export async function retrieveCheckpointsFromRollup(
|
|
|
209
209
|
rollup,
|
|
210
210
|
publicClient,
|
|
211
211
|
debugClient,
|
|
212
|
-
|
|
212
|
+
blobClient,
|
|
213
213
|
checkpointProposedLogs,
|
|
214
214
|
rollupConstants,
|
|
215
215
|
contractAddresses,
|
|
@@ -230,7 +230,7 @@ export async function retrieveCheckpointsFromRollup(
|
|
|
230
230
|
* @param rollup - The rollup contract instance.
|
|
231
231
|
* @param publicClient - The viem public client to use for transaction retrieval.
|
|
232
232
|
* @param debugClient - The viem debug client to use for trace/debug RPC methods (optional).
|
|
233
|
-
* @param
|
|
233
|
+
* @param blobClient - The blob client client for fetching blob data.
|
|
234
234
|
* @param logs - CheckpointProposed logs.
|
|
235
235
|
* @param rollupConstants - The rollup constants (chainId, version, targetCommitteeSize).
|
|
236
236
|
* @param contractAddresses - The contract addresses (governanceProposerAddress, slashFactoryAddress, slashingProposerAddress).
|
|
@@ -243,7 +243,7 @@ async function processCheckpointProposedLogs(
|
|
|
243
243
|
rollup: GetContractReturnType<typeof RollupAbi, ViemPublicClient>,
|
|
244
244
|
publicClient: ViemPublicClient,
|
|
245
245
|
debugClient: ViemPublicDebugClient,
|
|
246
|
-
|
|
246
|
+
blobClient: BlobClientInterface,
|
|
247
247
|
logs: GetContractEventsReturnType<typeof RollupAbi, 'CheckpointProposed'>,
|
|
248
248
|
{ chainId, version, targetCommitteeSize }: { chainId: Fr; version: Fr; targetCommitteeSize: number },
|
|
249
249
|
contractAddresses: {
|
|
@@ -286,7 +286,7 @@ async function processCheckpointProposedLogs(
|
|
|
286
286
|
expectedHashes,
|
|
287
287
|
);
|
|
288
288
|
const checkpointBlobData = await getCheckpointBlobDataFromBlobs(
|
|
289
|
-
|
|
289
|
+
blobClient,
|
|
290
290
|
checkpoint.blockHash,
|
|
291
291
|
blobHashes,
|
|
292
292
|
checkpointNumber,
|
|
@@ -324,14 +324,14 @@ export async function getL1BlockTime(publicClient: ViemPublicClient, blockNumber
|
|
|
324
324
|
}
|
|
325
325
|
|
|
326
326
|
export async function getCheckpointBlobDataFromBlobs(
|
|
327
|
-
|
|
327
|
+
blobClient: BlobClientInterface,
|
|
328
328
|
blockHash: string,
|
|
329
329
|
blobHashes: Buffer<ArrayBufferLike>[],
|
|
330
330
|
checkpointNumber: CheckpointNumber,
|
|
331
331
|
logger: Logger,
|
|
332
332
|
isHistoricalSync: boolean,
|
|
333
333
|
): Promise<CheckpointBlobData> {
|
|
334
|
-
const blobBodies = await
|
|
334
|
+
const blobBodies = await blobClient.getBlobSidecar(blockHash, blobHashes, { isHistoricalSync });
|
|
335
335
|
if (blobBodies.length === 0) {
|
|
336
336
|
throw new NoBlobBodiesFoundError(checkpointNumber);
|
|
337
337
|
}
|
|
@@ -339,7 +339,7 @@ export async function getCheckpointBlobDataFromBlobs(
|
|
|
339
339
|
let checkpointBlobData: CheckpointBlobData;
|
|
340
340
|
try {
|
|
341
341
|
// Attempt to decode the checkpoint blob data.
|
|
342
|
-
checkpointBlobData = decodeCheckpointBlobDataFromBlobs(blobBodies
|
|
342
|
+
checkpointBlobData = decodeCheckpointBlobDataFromBlobs(blobBodies);
|
|
343
343
|
} catch (err: any) {
|
|
344
344
|
if (err instanceof BlobDeserializationError) {
|
|
345
345
|
logger.fatal(err.message);
|
package/src/factory.ts
CHANGED
|
@@ -28,7 +28,7 @@ export async function createArchiverStore(
|
|
|
28
28
|
/**
|
|
29
29
|
* Creates a local archiver.
|
|
30
30
|
* @param config - The archiver configuration.
|
|
31
|
-
* @param
|
|
31
|
+
* @param blobClient - The blob client client.
|
|
32
32
|
* @param opts - The options.
|
|
33
33
|
* @param telemetry - The telemetry client.
|
|
34
34
|
* @returns The local archiver.
|