@aztec/archiver 0.16.4 → 0.16.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/archiver",
3
- "version": "0.16.4",
3
+ "version": "0.16.6",
4
4
  "type": "module",
5
5
  "exports": "./dest/index.js",
6
6
  "typedocOptions": {
@@ -34,11 +34,11 @@
34
34
  "rootDir": "./src"
35
35
  },
36
36
  "dependencies": {
37
- "@aztec/circuits.js": "0.16.4",
38
- "@aztec/ethereum": "0.16.4",
39
- "@aztec/foundation": "0.16.4",
40
- "@aztec/l1-artifacts": "0.16.4",
41
- "@aztec/types": "0.16.4",
37
+ "@aztec/circuits.js": "0.16.6",
38
+ "@aztec/ethereum": "0.16.6",
39
+ "@aztec/foundation": "0.16.6",
40
+ "@aztec/l1-artifacts": "0.16.6",
41
+ "@aztec/types": "0.16.6",
42
42
  "@types/lodash.omit": "^4.5.7",
43
43
  "debug": "^4.3.4",
44
44
  "lmdb": "^2.9.1",
@@ -1,428 +0,0 @@
1
- import { FunctionSelector, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/circuits.js';
2
- import { createEthereumChain } from '@aztec/ethereum';
3
- import { AztecAddress } from '@aztec/foundation/aztec-address';
4
- import { padArrayEnd } from '@aztec/foundation/collection';
5
- import { EthAddress } from '@aztec/foundation/eth-address';
6
- import { Fr } from '@aztec/foundation/fields';
7
- import { DebugLogger, createDebugLogger } from '@aztec/foundation/log';
8
- import { RunningPromise } from '@aztec/foundation/running-promise';
9
- import {
10
- ContractData,
11
- ContractDataSource,
12
- EncodedContractFunction,
13
- ExtendedContractData,
14
- GetUnencryptedLogsResponse,
15
- L1ToL2Message,
16
- L1ToL2MessageSource,
17
- L2Block,
18
- L2BlockL2Logs,
19
- L2BlockSource,
20
- L2LogsSource,
21
- L2Tx,
22
- LogFilter,
23
- LogType,
24
- TxHash,
25
- } from '@aztec/types';
26
-
27
- import omit from 'lodash.omit';
28
- import { Chain, HttpTransport, PublicClient, createPublicClient, http } from 'viem';
29
-
30
- import { ArchiverDataStore } from './archiver_store.js';
31
- import { ArchiverConfig } from './config.js';
32
- import {
33
- retrieveBlocks,
34
- retrieveNewCancelledL1ToL2Messages,
35
- retrieveNewContractData,
36
- retrieveNewPendingL1ToL2Messages,
37
- } from './data_retrieval.js';
38
-
39
- /**
40
- * Pulls L2 blocks in a non-blocking manner and provides interface for their retrieval.
41
- * Responsible for handling robust L1 polling so that other components do not need to
42
- * concern themselves with it.
43
- */
44
- export class Archiver implements L2BlockSource, L2LogsSource, ContractDataSource, L1ToL2MessageSource {
45
- /**
46
- * A promise in which we will be continually fetching new L2 blocks.
47
- */
48
- private runningPromise?: RunningPromise;
49
-
50
- /**
51
- * Next L1 block number to fetch `L2BlockProcessed` logs from (i.e. `fromBlock` in eth_getLogs).
52
- */
53
- private nextL2BlockFromL1Block = 0n;
54
-
55
- /**
56
- * Use this to track logged block in order to avoid repeating the same message.
57
- */
58
- private lastLoggedL1BlockNumber = 0n;
59
-
60
- /**
61
- * Creates a new instance of the Archiver.
62
- * @param publicClient - A client for interacting with the Ethereum node.
63
- * @param rollupAddress - Ethereum address of the rollup contract.
64
- * @param inboxAddress - Ethereum address of the inbox contract.
65
- * @param registryAddress - Ethereum address of the registry contract.
66
- * @param contractDeploymentEmitterAddress - Ethereum address of the contractDeploymentEmitter contract.
67
- * @param searchStartBlock - The L1 block from which to start searching for new blocks.
68
- * @param pollingIntervalMs - The interval for polling for L1 logs (in milliseconds).
69
- * @param store - An archiver data store for storage & retrieval of blocks, encrypted logs & contract data.
70
- * @param log - A logger.
71
- */
72
- constructor(
73
- private readonly publicClient: PublicClient<HttpTransport, Chain>,
74
- private readonly rollupAddress: EthAddress,
75
- private readonly inboxAddress: EthAddress,
76
- private readonly registryAddress: EthAddress,
77
- private readonly contractDeploymentEmitterAddress: EthAddress,
78
- private readonly store: ArchiverDataStore,
79
- private readonly pollingIntervalMs = 10_000,
80
- private readonly log: DebugLogger = createDebugLogger('aztec:archiver'),
81
- ) {}
82
-
83
- /**
84
- * Creates a new instance of the Archiver and blocks until it syncs from chain.
85
- * @param config - The archiver's desired configuration.
86
- * @param archiverStore - The backing store for the archiver.
87
- * @param blockUntilSynced - If true, blocks until the archiver has fully synced.
88
- * @returns - An instance of the archiver.
89
- */
90
- public static async createAndSync(
91
- config: ArchiverConfig,
92
- archiverStore: ArchiverDataStore,
93
- blockUntilSynced = true,
94
- ): Promise<Archiver> {
95
- const chain = createEthereumChain(config.rpcUrl, config.apiKey);
96
- const publicClient = createPublicClient({
97
- chain: chain.chainInfo,
98
- transport: http(chain.rpcUrl),
99
- pollingInterval: config.viemPollingIntervalMS,
100
- });
101
-
102
- const archiver = new Archiver(
103
- publicClient,
104
- config.l1Contracts.rollupAddress,
105
- config.l1Contracts.inboxAddress,
106
- config.l1Contracts.registryAddress,
107
- config.l1Contracts.contractDeploymentEmitterAddress,
108
- archiverStore,
109
- config.archiverPollingIntervalMS,
110
- );
111
- await archiver.start(blockUntilSynced);
112
- return archiver;
113
- }
114
-
115
- /**
116
- * Starts sync process.
117
- * @param blockUntilSynced - If true, blocks until the archiver has fully synced.
118
- */
119
- public async start(blockUntilSynced: boolean): Promise<void> {
120
- if (this.runningPromise) {
121
- throw new Error('Archiver is already running');
122
- }
123
-
124
- if (blockUntilSynced) {
125
- this.log(`Performing initial chain sync...`);
126
- await this.sync(blockUntilSynced);
127
- }
128
-
129
- this.runningPromise = new RunningPromise(() => this.sync(false), this.pollingIntervalMs);
130
- this.runningPromise.start();
131
- }
132
-
133
- /**
134
- * Fetches `L2BlockProcessed` and `ContractDeployment` logs from `nextL2BlockFromBlock` and processes them.
135
- * @param blockUntilSynced - If true, blocks until the archiver has fully synced.
136
- */
137
- private async sync(blockUntilSynced: boolean) {
138
- const currentL1BlockNumber = await this.publicClient.getBlockNumber();
139
- // this makes the archiver more resilient to eventually-consistent eth providers like Infura
140
- // it _will_ process the same L1 blocks over and over again until the L2 chain advances
141
- // one thing to handle now is that we will process the same L1 to L2 messages over and over again
142
- // so the store needs to account for that.
143
- const lastProcessedL1BlockNumber = await this.store.getL1BlockNumber();
144
- if (currentL1BlockNumber <= lastProcessedL1BlockNumber) {
145
- // reducing logs, otherwise this gets triggered on every loop (1s)
146
- if (currentL1BlockNumber !== this.lastLoggedL1BlockNumber) {
147
- this.log(`No new blocks to process, current block number: ${currentL1BlockNumber}`);
148
- this.lastLoggedL1BlockNumber = currentL1BlockNumber;
149
- }
150
- return;
151
- }
152
-
153
- // ********** Ensuring Consistency of data pulled from L1 **********
154
-
155
- /**
156
- * There are a number of calls in this sync operation to L1 for retrieving
157
- * events and transaction data. There are a couple of things we need to bear in mind
158
- * to ensure that data is read exactly once.
159
- *
160
- * The first is the problem of eventually consistent ETH service providers like Infura.
161
- * We currently read from the last L1 block that we saw emit an L2 block. This could mean
162
- * that the archiver ends up looking at the same L1 block multiple times (e.g. if we last saw
163
- * an L2 block emitted at L1 block 10, we'd constantly ask for L1 blocks from 11 onwards until
164
- * we see another L2 block). For this to work message and block processing need to be idempotent.
165
- * We should re-visit this before mainnet launch.
166
- *
167
- * The second is that in between the various calls to L1, the block number can move meaning some
168
- * of the following calls will return data for blocks that were not present during earlier calls.
169
- * It's possible that we actually received messages in block currentBlockNumber + 1 meaning the next time
170
- * we do this sync we get the same message again. Additionally, the call to get cancelled L1 to L2 messages
171
- * could read from a block not present when retrieving pending messages. If a message was added and cancelled
172
- * in the same eth block then we could try and cancel a non-existent pending message.
173
- *
174
- * To combat this for the time being we simply ensure that all data retrieval methods only retrieve
175
- * data up to the currentBlockNumber captured at the top of this function. We might want to improve on this
176
- * in future but for the time being it should give us the guarantees that we need
177
- *
178
- */
179
-
180
- // ********** Events that are processed in between blocks **********
181
-
182
- // Process l1ToL2Messages, these are consumed as time passes, not each block
183
- const retrievedPendingL1ToL2Messages = await retrieveNewPendingL1ToL2Messages(
184
- this.publicClient,
185
- this.inboxAddress,
186
- blockUntilSynced,
187
- lastProcessedL1BlockNumber + 1n, // + 1 to prevent re-including messages from the last processed block
188
- currentL1BlockNumber,
189
- );
190
- const retrievedCancelledL1ToL2Messages = await retrieveNewCancelledL1ToL2Messages(
191
- this.publicClient,
192
- this.inboxAddress,
193
- blockUntilSynced,
194
- lastProcessedL1BlockNumber + 1n,
195
- currentL1BlockNumber,
196
- );
197
-
198
- // TODO (#717): optimize this - there could be messages in confirmed that are also in pending.
199
- // Or messages in pending that are also cancelled in the same block. No need to modify storage for them.
200
- // Store l1 to l2 messages
201
- this.log('Adding pending l1 to l2 messages to store');
202
- await this.store.addPendingL1ToL2Messages(retrievedPendingL1ToL2Messages.retrievedData);
203
- // remove cancelled messages from the pending message store:
204
- this.log('Removing pending l1 to l2 messages from store where messages were cancelled');
205
- await this.store.cancelPendingL1ToL2Messages(retrievedCancelledL1ToL2Messages.retrievedData);
206
-
207
- // ********** Events that are processed per block **********
208
-
209
- // Read all data from chain and then write to our stores at the end
210
- const nextExpectedL2BlockNum = BigInt((await this.store.getBlockNumber()) + 1);
211
- this.log(
212
- `Retrieving chain state from L1 block: ${this.nextL2BlockFromL1Block}, next expected l2 block number: ${nextExpectedL2BlockNum}`,
213
- );
214
- const retrievedBlocks = await retrieveBlocks(
215
- this.publicClient,
216
- this.rollupAddress,
217
- blockUntilSynced,
218
- this.nextL2BlockFromL1Block,
219
- currentL1BlockNumber,
220
- nextExpectedL2BlockNum,
221
- );
222
-
223
- // create the block number -> block hash mapping to ensure we retrieve the appropriate events
224
- const blockHashMapping: { [key: number]: Buffer | undefined } = {};
225
- retrievedBlocks.retrievedData.forEach((block: L2Block) => {
226
- blockHashMapping[block.number] = block.getCalldataHash();
227
- });
228
- const retrievedContracts = await retrieveNewContractData(
229
- this.publicClient,
230
- this.contractDeploymentEmitterAddress,
231
- blockUntilSynced,
232
- this.nextL2BlockFromL1Block,
233
- currentL1BlockNumber,
234
- blockHashMapping,
235
- );
236
- if (retrievedBlocks.retrievedData.length === 0) {
237
- return;
238
- }
239
-
240
- this.log(`Retrieved ${retrievedBlocks.retrievedData.length} block(s) from chain`);
241
-
242
- await Promise.all(
243
- retrievedBlocks.retrievedData.map(block =>
244
- this.store.addLogs(block.newEncryptedLogs, block.newUnencryptedLogs, block.number),
245
- ),
246
- );
247
-
248
- // store contracts for which we have retrieved L2 blocks
249
- const lastKnownL2BlockNum = retrievedBlocks.retrievedData[retrievedBlocks.retrievedData.length - 1].number;
250
- await Promise.all(
251
- retrievedContracts.retrievedData.map(async ([contracts, l2BlockNum]) => {
252
- this.log(`Retrieved extended contract data for l2 block number: ${l2BlockNum}`);
253
- if (l2BlockNum <= lastKnownL2BlockNum) {
254
- await this.store.addExtendedContractData(contracts, l2BlockNum);
255
- }
256
- }),
257
- );
258
-
259
- // from retrieved L2Blocks, confirm L1 to L2 messages that have been published
260
- // from each l2block fetch all messageKeys in a flattened array:
261
- const messageKeysToRemove = retrievedBlocks.retrievedData.map(l2block => l2block.newL1ToL2Messages).flat();
262
- this.log(`Confirming l1 to l2 messages in store`);
263
- await this.store.confirmL1ToL2Messages(messageKeysToRemove);
264
-
265
- // store retrieved L2 blocks after removing new logs information.
266
- // remove logs to serve "lightweight" block information. Logs can be fetched separately if needed.
267
- await this.store.addBlocks(
268
- retrievedBlocks.retrievedData.map(block => {
269
- // Ensure we pad the L1 to L2 message array to the full size before storing.
270
- block.newL1ToL2Messages = padArrayEnd(block.newL1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
271
- return L2Block.fromFields(
272
- omit(block, ['newEncryptedLogs', 'newUnencryptedLogs']),
273
- block.getBlockHash(),
274
- block.getL1BlockNumber(),
275
- );
276
- }),
277
- );
278
-
279
- // set the L1 block for the next search
280
- this.nextL2BlockFromL1Block = retrievedBlocks.nextEthBlockNumber;
281
- }
282
-
283
- /**
284
- * Stops the archiver.
285
- * @returns A promise signalling completion of the stop process.
286
- */
287
- public async stop(): Promise<void> {
288
- this.log('Stopping...');
289
- await this.runningPromise?.stop();
290
-
291
- this.log('Stopped.');
292
- return Promise.resolve();
293
- }
294
-
295
- public getRollupAddress(): Promise<EthAddress> {
296
- return Promise.resolve(this.rollupAddress);
297
- }
298
-
299
- public getRegistryAddress(): Promise<EthAddress> {
300
- return Promise.resolve(this.registryAddress);
301
- }
302
-
303
- /**
304
- * Gets up to `limit` amount of L2 blocks starting from `from`.
305
- * @param from - Number of the first block to return (inclusive).
306
- * @param limit - The number of blocks to return.
307
- * @returns The requested L2 blocks.
308
- */
309
- public getBlocks(from: number, limit: number): Promise<L2Block[]> {
310
- return this.store.getBlocks(from, limit);
311
- }
312
-
313
- /**
314
- * Gets an l2 block.
315
- * @param number - The block number to return (inclusive).
316
- * @returns The requested L2 block.
317
- */
318
- public async getBlock(number: number): Promise<L2Block | undefined> {
319
- // If the number provided is -ve, then return the latest block.
320
- if (number < 0) {
321
- number = await this.store.getBlockNumber();
322
- }
323
- const blocks = await this.store.getBlocks(number, 1);
324
- return blocks.length === 0 ? undefined : blocks[0];
325
- }
326
-
327
- public getL2Tx(txHash: TxHash): Promise<L2Tx | undefined> {
328
- return this.store.getL2Tx(txHash);
329
- }
330
-
331
- /**
332
- * Get the extended contract data for this contract.
333
- * @param contractAddress - The contract data address.
334
- * @returns The extended contract data or undefined if not found.
335
- */
336
- getExtendedContractData(contractAddress: AztecAddress): Promise<ExtendedContractData | undefined> {
337
- return this.store.getExtendedContractData(contractAddress);
338
- }
339
-
340
- /**
341
- * Lookup all contract data in an L2 block.
342
- * @param blockNum - The block number to get all contract data from.
343
- * @returns All new contract data in the block (if found).
344
- */
345
- public getExtendedContractDataInBlock(blockNum: number): Promise<ExtendedContractData[]> {
346
- return this.store.getExtendedContractDataInBlock(blockNum);
347
- }
348
-
349
- /**
350
- * Lookup the contract data for this contract.
351
- * Contains contract address & the ethereum portal address.
352
- * @param contractAddress - The contract data address.
353
- * @returns ContractData with the portal address (if we didn't throw an error).
354
- */
355
- public getContractData(contractAddress: AztecAddress): Promise<ContractData | undefined> {
356
- return this.store.getContractData(contractAddress);
357
- }
358
-
359
- /**
360
- * Lookup the L2 contract data inside a block.
361
- * Contains contract address & the ethereum portal address.
362
- * @param l2BlockNum - The L2 block number to get the contract data from.
363
- * @returns ContractData with the portal address (if we didn't throw an error).
364
- */
365
- public getContractDataInBlock(l2BlockNum: number): Promise<ContractData[] | undefined> {
366
- return this.store.getContractDataInBlock(l2BlockNum);
367
- }
368
-
369
- /**
370
- * Gets the public function data for a contract.
371
- * @param contractAddress - The contract address containing the function to fetch.
372
- * @param selector - The function selector of the function to fetch.
373
- * @returns The public function data (if found).
374
- */
375
- public async getPublicFunction(
376
- contractAddress: AztecAddress,
377
- selector: FunctionSelector,
378
- ): Promise<EncodedContractFunction | undefined> {
379
- const contractData = await this.getExtendedContractData(contractAddress);
380
- return contractData?.getPublicFunction(selector);
381
- }
382
-
383
- /**
384
- * Gets up to `limit` amount of logs starting from `from`.
385
- * @param from - Number of the L2 block to which corresponds the first logs to be returned.
386
- * @param limit - The number of logs to return.
387
- * @param logType - Specifies whether to return encrypted or unencrypted logs.
388
- * @returns The requested logs.
389
- */
390
- public getLogs(from: number, limit: number, logType: LogType): Promise<L2BlockL2Logs[]> {
391
- return this.store.getLogs(from, limit, logType);
392
- }
393
-
394
- /**
395
- * Gets unencrypted logs based on the provided filter.
396
- * @param filter - The filter to apply to the logs.
397
- * @returns The requested logs.
398
- */
399
- getUnencryptedLogs(filter: LogFilter): Promise<GetUnencryptedLogsResponse> {
400
- return this.store.getUnencryptedLogs(filter);
401
- }
402
-
403
- /**
404
- * Gets the number of the latest L2 block processed by the block source implementation.
405
- * @returns The number of the latest L2 block processed by the block source implementation.
406
- */
407
- public getBlockNumber(): Promise<number> {
408
- return this.store.getBlockNumber();
409
- }
410
-
411
- /**
412
- * Gets up to `limit` amount of pending L1 to L2 messages.
413
- * @param limit - The number of messages to return.
414
- * @returns The requested L1 to L2 messages' keys.
415
- */
416
- getPendingL1ToL2Messages(limit: number): Promise<Fr[]> {
417
- return this.store.getPendingL1ToL2MessageKeys(limit);
418
- }
419
-
420
- /**
421
- * Gets the confirmed/consumed L1 to L2 message associated with the given message key
422
- * @param messageKey - The message key.
423
- * @returns The L1 to L2 message (throws if not found).
424
- */
425
- getConfirmedL1ToL2Message(messageKey: Fr): Promise<L1ToL2Message> {
426
- return this.store.getConfirmedL1ToL2Message(messageKey);
427
- }
428
- }
@@ -1,158 +0,0 @@
1
- import { Fr } from '@aztec/circuits.js';
2
- import { AztecAddress } from '@aztec/foundation/aztec-address';
3
- import {
4
- CancelledL1ToL2Message,
5
- ContractData,
6
- ExtendedContractData,
7
- GetUnencryptedLogsResponse,
8
- L1ToL2Message,
9
- L2Block,
10
- L2BlockL2Logs,
11
- L2Tx,
12
- LogFilter,
13
- LogType,
14
- PendingL1ToL2Message,
15
- TxHash,
16
- } from '@aztec/types';
17
-
18
- /**
19
- * Interface describing a data store to be used by the archiver to store all its relevant data
20
- * (blocks, encrypted logs, aztec contract data extended contract data).
21
- */
22
- export interface ArchiverDataStore {
23
- /**
24
- * Append new blocks to the store's list.
25
- * @param blocks - The L2 blocks to be added to the store.
26
- * @returns True if the operation is successful.
27
- */
28
- addBlocks(blocks: L2Block[]): Promise<boolean>;
29
-
30
- /**
31
- * Gets up to `limit` amount of L2 blocks starting from `from`.
32
- * @param from - Number of the first block to return (inclusive).
33
- * @param limit - The number of blocks to return.
34
- * @returns The requested L2 blocks.
35
- */
36
- getBlocks(from: number, limit: number): Promise<L2Block[]>;
37
-
38
- /**
39
- * Gets an l2 tx.
40
- * @param txHash - The txHash of the l2 tx.
41
- * @returns The requested L2 tx.
42
- */
43
- getL2Tx(txHash: TxHash): Promise<L2Tx | undefined>;
44
-
45
- /**
46
- * Append new logs to the store's list.
47
- * @param encryptedLogs - The encrypted logs to be added to the store.
48
- * @param unencryptedLogs - The unencrypted logs to be added to the store.
49
- * @param blockNumber - The block for which to add the logs.
50
- * @returns True if the operation is successful.
51
- */
52
- addLogs(
53
- encryptedLogs: L2BlockL2Logs | undefined,
54
- unencryptedLogs: L2BlockL2Logs | undefined,
55
- blockNumber: number,
56
- ): Promise<boolean>;
57
-
58
- /**
59
- * Append new pending L1 to L2 messages to the store.
60
- * @param messages - The L1 to L2 messages to be added to the store.
61
- * @returns True if the operation is successful.
62
- */
63
- addPendingL1ToL2Messages(messages: PendingL1ToL2Message[]): Promise<boolean>;
64
-
65
- /**
66
- * Remove pending L1 to L2 messages from the store (if they were cancelled).
67
- * @param message - The message keys to be removed from the store.
68
- * @returns True if the operation is successful.
69
- */
70
- cancelPendingL1ToL2Messages(message: CancelledL1ToL2Message[]): Promise<boolean>;
71
-
72
- /**
73
- * Messages that have been published in an L2 block are confirmed.
74
- * Add them to the confirmed store, also remove them from the pending store.
75
- * @param messageKeys - The message keys to be removed from the store.
76
- * @returns True if the operation is successful.
77
- */
78
- confirmL1ToL2Messages(messageKeys: Fr[]): Promise<boolean>;
79
-
80
- /**
81
- * Gets up to `limit` amount of pending L1 to L2 messages, sorted by fee
82
- * @param limit - The number of messages to return (by default NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP).
83
- * @returns The requested L1 to L2 message keys.
84
- */
85
- getPendingL1ToL2MessageKeys(limit: number): Promise<Fr[]>;
86
-
87
- /**
88
- * Gets the confirmed L1 to L2 message corresponding to the given message key.
89
- * @param messageKey - The message key to look up.
90
- * @returns The requested L1 to L2 message or throws if not found.
91
- */
92
- getConfirmedL1ToL2Message(messageKey: Fr): Promise<L1ToL2Message>;
93
-
94
- /**
95
- * Gets up to `limit` amount of logs starting from `from`.
96
- * @param from - Number of the L2 block to which corresponds the first logs to be returned.
97
- * @param limit - The number of logs to return.
98
- * @param logType - Specifies whether to return encrypted or unencrypted logs.
99
- * @returns The requested logs.
100
- */
101
- getLogs(from: number, limit: number, logType: LogType): Promise<L2BlockL2Logs[]>;
102
-
103
- /**
104
- * Gets unencrypted logs based on the provided filter.
105
- * @param filter - The filter to apply to the logs.
106
- * @returns The requested logs.
107
- */
108
- getUnencryptedLogs(filter: LogFilter): Promise<GetUnencryptedLogsResponse>;
109
-
110
- /**
111
- * Add new extended contract data from an L2 block to the store's list.
112
- * @param data - List of contracts' data to be added.
113
- * @param blockNum - Number of the L2 block the contract data was deployed in.
114
- * @returns True if the operation is successful.
115
- */
116
- addExtendedContractData(data: ExtendedContractData[], blockNum: number): Promise<boolean>;
117
-
118
- /**
119
- * Get the extended contract data for this contract.
120
- * @param contractAddress - The contract data address.
121
- * @returns The extended contract data or undefined if not found.
122
- */
123
- getExtendedContractData(contractAddress: AztecAddress): Promise<ExtendedContractData | undefined>;
124
-
125
- /**
126
- * Lookup all extended contract data in an L2 block.
127
- * @param blockNum - The block number to get all contract data from.
128
- * @returns All extended contract data in the block (if found).
129
- */
130
- getExtendedContractDataInBlock(blockNum: number): Promise<ExtendedContractData[]>;
131
-
132
- /**
133
- * Get basic info for an L2 contract.
134
- * Contains contract address & the ethereum portal address.
135
- * @param contractAddress - The contract data address.
136
- * @returns ContractData with the portal address (if we didn't throw an error).
137
- */
138
- getContractData(contractAddress: AztecAddress): Promise<ContractData | undefined>;
139
-
140
- /**
141
- * Get basic info for an all L2 contracts deployed in a block.
142
- * Contains contract address & the ethereum portal address.
143
- * @param l2BlockNum - Number of the L2 block where contracts were deployed.
144
- * @returns ContractData with the portal address (if we didn't throw an error).
145
- */
146
- getContractDataInBlock(l2BlockNum: number): Promise<ContractData[] | undefined>;
147
-
148
- /**
149
- * Gets the number of the latest L2 block processed.
150
- * @returns The number of the latest L2 block processed.
151
- */
152
- getBlockNumber(): Promise<number>;
153
-
154
- /**
155
- * Gets the number of the latest L1 block processed.
156
- */
157
- getL1BlockNumber(): Promise<bigint>;
158
- }