@aztec/archiver 0.74.0 → 0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2

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 (81) hide show
  1. package/dest/archiver/archiver.js +729 -711
  2. package/dest/archiver/archiver_store.js +4 -2
  3. package/dest/archiver/archiver_store_test_suite.js +385 -224
  4. package/dest/archiver/config.js +9 -11
  5. package/dest/archiver/data_retrieval.js +78 -68
  6. package/dest/archiver/errors.js +1 -2
  7. package/dest/archiver/index.js +0 -1
  8. package/dest/archiver/instrumentation.js +29 -17
  9. package/dest/archiver/kv_archiver_store/block_store.js +118 -127
  10. package/dest/archiver/kv_archiver_store/contract_class_store.js +43 -37
  11. package/dest/archiver/kv_archiver_store/contract_instance_store.js +7 -12
  12. package/dest/archiver/kv_archiver_store/kv_archiver_store.js +135 -158
  13. package/dest/archiver/kv_archiver_store/log_store.js +271 -256
  14. package/dest/archiver/kv_archiver_store/message_store.js +42 -48
  15. package/dest/archiver/kv_archiver_store/nullifier_store.js +35 -42
  16. package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.js +15 -24
  17. package/dest/archiver/memory_archiver_store/memory_archiver_store.js +227 -231
  18. package/dest/archiver/structs/data_retrieval.js +5 -2
  19. package/dest/archiver/structs/published.js +1 -2
  20. package/dest/factory.js +30 -20
  21. package/dest/index.js +0 -1
  22. package/dest/rpc/index.js +5 -2
  23. package/dest/test/index.js +0 -1
  24. package/dest/test/mock_archiver.js +8 -13
  25. package/dest/test/mock_l1_to_l2_message_source.js +4 -4
  26. package/dest/test/mock_l2_block_source.js +68 -67
  27. package/package.json +14 -13
  28. package/src/archiver/data_retrieval.ts +1 -1
  29. package/src/archiver/index.ts +1 -1
  30. package/dest/archiver/archiver.d.ts +0 -186
  31. package/dest/archiver/archiver.d.ts.map +0 -1
  32. package/dest/archiver/archiver_store.d.ts +0 -217
  33. package/dest/archiver/archiver_store.d.ts.map +0 -1
  34. package/dest/archiver/archiver_store_test_suite.d.ts +0 -8
  35. package/dest/archiver/archiver_store_test_suite.d.ts.map +0 -1
  36. package/dest/archiver/config.d.ts +0 -35
  37. package/dest/archiver/config.d.ts.map +0 -1
  38. package/dest/archiver/data_retrieval.d.ts +0 -71
  39. package/dest/archiver/data_retrieval.d.ts.map +0 -1
  40. package/dest/archiver/errors.d.ts +0 -4
  41. package/dest/archiver/errors.d.ts.map +0 -1
  42. package/dest/archiver/index.d.ts +0 -8
  43. package/dest/archiver/index.d.ts.map +0 -1
  44. package/dest/archiver/instrumentation.d.ts +0 -27
  45. package/dest/archiver/instrumentation.d.ts.map +0 -1
  46. package/dest/archiver/kv_archiver_store/block_store.d.ts +0 -87
  47. package/dest/archiver/kv_archiver_store/block_store.d.ts.map +0 -1
  48. package/dest/archiver/kv_archiver_store/contract_class_store.d.ts +0 -17
  49. package/dest/archiver/kv_archiver_store/contract_class_store.d.ts.map +0 -1
  50. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts +0 -13
  51. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts.map +0 -1
  52. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +0 -147
  53. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +0 -1
  54. package/dest/archiver/kv_archiver_store/log_store.d.ts +0 -47
  55. package/dest/archiver/kv_archiver_store/log_store.d.ts.map +0 -1
  56. package/dest/archiver/kv_archiver_store/message_store.d.ts +0 -33
  57. package/dest/archiver/kv_archiver_store/message_store.d.ts.map +0 -1
  58. package/dest/archiver/kv_archiver_store/nullifier_store.d.ts +0 -12
  59. package/dest/archiver/kv_archiver_store/nullifier_store.d.ts.map +0 -1
  60. package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.d.ts +0 -23
  61. package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.d.ts.map +0 -1
  62. package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts +0 -168
  63. package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts.map +0 -1
  64. package/dest/archiver/structs/data_retrieval.d.ts +0 -27
  65. package/dest/archiver/structs/data_retrieval.d.ts.map +0 -1
  66. package/dest/archiver/structs/published.d.ts +0 -11
  67. package/dest/archiver/structs/published.d.ts.map +0 -1
  68. package/dest/factory.d.ts +0 -10
  69. package/dest/factory.d.ts.map +0 -1
  70. package/dest/index.d.ts +0 -5
  71. package/dest/index.d.ts.map +0 -1
  72. package/dest/rpc/index.d.ts +0 -4
  73. package/dest/rpc/index.d.ts.map +0 -1
  74. package/dest/test/index.d.ts +0 -4
  75. package/dest/test/index.d.ts.map +0 -1
  76. package/dest/test/mock_archiver.d.ts +0 -22
  77. package/dest/test/mock_archiver.d.ts.map +0 -1
  78. package/dest/test/mock_l1_to_l2_message_source.d.ts +0 -16
  79. package/dest/test/mock_l1_to_l2_message_source.d.ts.map +0 -1
  80. package/dest/test/mock_l2_block_source.d.ts +0 -80
  81. package/dest/test/mock_l2_block_source.d.ts.map +0 -1
@@ -1,87 +0,0 @@
1
- import { type InBlock, L2Block, type TxEffect, type TxHash, TxReceipt } from '@aztec/circuit-types';
2
- import { type AztecAddress, BlockHeader } from '@aztec/circuits.js';
3
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
4
- import { type L1Published } from '../structs/published.js';
5
- /**
6
- * LMDB implementation of the ArchiverDataStore interface.
7
- */
8
- export declare class BlockStore {
9
- #private;
10
- private db;
11
- constructor(db: AztecAsyncKVStore);
12
- /**
13
- * Append new blocks to the store's list.
14
- * @param blocks - The L2 blocks to be added to the store.
15
- * @returns True if the operation is successful.
16
- */
17
- addBlocks(blocks: L1Published<L2Block>[]): Promise<boolean>;
18
- /**
19
- * Unwinds blocks from the database
20
- * @param from - The tip of the chain, passed for verification purposes,
21
- * ensuring that we don't end up deleting something we did not intend
22
- * @param blocksToUnwind - The number of blocks we are to unwind
23
- * @returns True if the operation is successful
24
- */
25
- unwindBlocks(from: number, blocksToUnwind: number): Promise<boolean>;
26
- /**
27
- * Gets up to `limit` amount of L2 blocks starting from `from`.
28
- * @param start - Number of the first block to return (inclusive).
29
- * @param limit - The number of blocks to return.
30
- * @returns The requested L2 blocks
31
- */
32
- getBlocks(start: number, limit: number): AsyncIterableIterator<L1Published<L2Block>>;
33
- /**
34
- * Gets an L2 block.
35
- * @param blockNumber - The number of the block to return.
36
- * @returns The requested L2 block.
37
- */
38
- getBlock(blockNumber: number): Promise<L1Published<L2Block> | undefined>;
39
- /**
40
- * Gets the headers for a sequence of L2 blocks.
41
- * @param start - Number of the first block to return (inclusive).
42
- * @param limit - The number of blocks to return.
43
- * @returns The requested L2 block headers
44
- */
45
- getBlockHeaders(start: number, limit: number): AsyncIterableIterator<BlockHeader>;
46
- private getBlockFromBlockStorage;
47
- /**
48
- * Gets a tx effect.
49
- * @param txHash - The txHash of the tx corresponding to the tx effect.
50
- * @returns The requested tx effect (or undefined if not found).
51
- */
52
- getTxEffect(txHash: TxHash): Promise<InBlock<TxEffect> | undefined>;
53
- /**
54
- * Gets a receipt of a settled tx.
55
- * @param txHash - The hash of a tx we try to get the receipt for.
56
- * @returns The requested tx receipt (or undefined if not found).
57
- */
58
- getSettledTxReceipt(txHash: TxHash): Promise<TxReceipt | undefined>;
59
- /**
60
- * Looks up which block included the requested tx effect.
61
- * @param txHash - The txHash of the tx.
62
- * @returns The block number and index of the tx.
63
- */
64
- getTxLocation(txHash: TxHash): Promise<[blockNumber: number, txIndex: number] | undefined>;
65
- /**
66
- * Looks up which block deployed a particular contract.
67
- * @param contractAddress - The address of the contract to look up.
68
- * @returns The block number and index of the contract.
69
- */
70
- getContractLocation(contractAddress: AztecAddress): Promise<[blockNumber: number, index: number] | undefined>;
71
- /**
72
- * Gets the number of the latest L2 block processed.
73
- * @returns The number of the latest L2 block processed.
74
- */
75
- getSynchedL2BlockNumber(): Promise<number>;
76
- /**
77
- * Gets the most recent L1 block processed.
78
- * @returns The L1 block that published the latest L2 block
79
- */
80
- getSynchedL1BlockNumber(): Promise<bigint | undefined>;
81
- setSynchedL1BlockNumber(l1BlockNumber: bigint): Promise<boolean>;
82
- getProvenL2BlockNumber(): Promise<number>;
83
- setProvenL2BlockNumber(blockNumber: number): Promise<boolean>;
84
- getProvenL2EpochNumber(): Promise<number | undefined>;
85
- setProvenL2EpochNumber(epochNumber: number): Promise<boolean>;
86
- }
87
- //# sourceMappingURL=block_store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"block_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/kv_archiver_store/block_store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,OAAO,EAAE,OAAO,EAAe,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACvH,OAAO,EAA0B,KAAK,YAAY,EAAE,WAAW,EAAwB,MAAM,oBAAoB,CAAC;AAGlH,OAAO,KAAK,EAAE,iBAAiB,EAA6C,MAAM,iBAAiB,CAAC;AAEpG,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,yBAAyB,CAAC;AAUjF;;GAEG;AACH,qBAAa,UAAU;;IAwBT,OAAO,CAAC,EAAE;gBAAF,EAAE,EAAE,iBAAiB;IAUzC;;;;OAIG;IACG,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IA0BjE;;;;;;OAMG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IAyBvD;;;;;OAKG;IACI,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,qBAAqB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAO3F;;;;OAIG;IACG,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;IAS9E;;;;;OAKG;IACI,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,qBAAqB,CAAC,WAAW,CAAC;YAM1E,wBAAwB;IAgBtC;;;;OAIG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;IAkBzE;;;;OAIG;IACG,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAmBzE;;;;OAIG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAI1F;;;;OAIG;IACH,mBAAmB,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAI7G;;;OAGG;IACG,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC;IAKhD;;;OAGG;IACH,uBAAuB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAItD,uBAAuB,CAAC,aAAa,EAAE,MAAM;IAIvC,sBAAsB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI/C,sBAAsB,CAAC,WAAW,EAAE,MAAM;IAI1C,sBAAsB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAIrD,sBAAsB,CAAC,WAAW,EAAE,MAAM;CAe3C"}
@@ -1,17 +0,0 @@
1
- import { type ContractClassPublic, type ExecutablePrivateFunctionWithMembershipProof, Fr, type UnconstrainedFunctionWithMembershipProof } from '@aztec/circuits.js';
2
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
3
- /**
4
- * LMDB implementation of the ArchiverDataStore interface.
5
- */
6
- export declare class ContractClassStore {
7
- #private;
8
- private db;
9
- constructor(db: AztecAsyncKVStore);
10
- addContractClass(contractClass: ContractClassPublic, bytecodeCommitment: Fr, blockNumber: number): Promise<void>;
11
- deleteContractClasses(contractClass: ContractClassPublic, blockNumber: number): Promise<void>;
12
- getContractClass(id: Fr): Promise<ContractClassPublic | undefined>;
13
- getBytecodeCommitment(id: Fr): Promise<Fr | undefined>;
14
- getContractClassIds(): Promise<Fr[]>;
15
- addFunctions(contractClassId: Fr, newPrivateFunctions: ExecutablePrivateFunctionWithMembershipProof[], newUnconstrainedFunctions: UnconstrainedFunctionWithMembershipProof[]): Promise<boolean>;
16
- }
17
- //# sourceMappingURL=contract_class_store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract_class_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/kv_archiver_store/contract_class_store.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EAExB,KAAK,4CAA4C,EACjD,EAAE,EAEF,KAAK,wCAAwC,EAE9C,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AAExE;;GAEG;AACH,qBAAa,kBAAkB;;IAIjB,OAAO,CAAC,EAAE;gBAAF,EAAE,EAAE,iBAAiB;IAKnC,gBAAgB,CACpB,aAAa,EAAE,mBAAmB,EAClC,kBAAkB,EAAE,EAAE,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAQV,qBAAqB,CAAC,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ7F,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IAKlE,qBAAqB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC;IAKtD,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;IAIpC,YAAY,CAChB,eAAe,EAAE,EAAE,EACnB,mBAAmB,EAAE,4CAA4C,EAAE,EACnE,yBAAyB,EAAE,wCAAwC,EAAE,GACpE,OAAO,CAAC,OAAO,CAAC;CA4BpB"}
@@ -1,13 +0,0 @@
1
- import { type AztecAddress, type ContractInstanceWithAddress } from '@aztec/circuits.js';
2
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
3
- /**
4
- * LMDB implementation of the ArchiverDataStore interface.
5
- */
6
- export declare class ContractInstanceStore {
7
- #private;
8
- constructor(db: AztecAsyncKVStore);
9
- addContractInstance(contractInstance: ContractInstanceWithAddress): Promise<void>;
10
- deleteContractInstance(contractInstance: ContractInstanceWithAddress): Promise<void>;
11
- getContractInstance(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
12
- }
13
- //# sourceMappingURL=contract_instance_store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract_instance_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/kv_archiver_store/contract_instance_store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,2BAA2B,EAAgC,MAAM,oBAAoB,CAAC;AACvH,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AAExE;;GAEG;AACH,qBAAa,qBAAqB;;gBAGpB,EAAE,EAAE,iBAAiB;IAIjC,mBAAmB,CAAC,gBAAgB,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;IAOjF,sBAAsB,CAAC,gBAAgB,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9E,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC;CAInG"}
@@ -1,147 +0,0 @@
1
- import { type GetContractClassLogsResponse, type GetPublicLogsResponse, type InBlock, type InboxLeaf, type L2Block, type LogFilter, type TxHash, type TxReceipt, type TxScopedL2Log } from '@aztec/circuit-types';
2
- import { type BlockHeader, type ContractClassPublic, type ContractInstanceWithAddress, type ExecutablePrivateFunctionWithMembershipProof, type Fr, type PrivateLog, type UnconstrainedFunctionWithMembershipProof } from '@aztec/circuits.js';
3
- import { FunctionSelector } from '@aztec/foundation/abi';
4
- import { type AztecAddress } from '@aztec/foundation/aztec-address';
5
- import { type AztecAsyncKVStore, type StoreSize } from '@aztec/kv-store';
6
- import { type ArchiverDataStore, type ArchiverL1SynchPoint } from '../archiver_store.js';
7
- import { type DataRetrieval } from '../structs/data_retrieval.js';
8
- import { type L1Published } from '../structs/published.js';
9
- /**
10
- * LMDB implementation of the ArchiverDataStore interface.
11
- */
12
- export declare class KVArchiverDataStore implements ArchiverDataStore {
13
- #private;
14
- private db;
15
- private functionNames;
16
- constructor(db: AztecAsyncKVStore, logsMaxPageSize?: number);
17
- getContractFunctionName(_address: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
18
- registerContractFunctionSignatures(_address: AztecAddress, signatures: string[]): Promise<void>;
19
- getContractClass(id: Fr): Promise<ContractClassPublic | undefined>;
20
- getContractClassIds(): Promise<Fr[]>;
21
- getContractInstance(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
22
- addContractClasses(data: ContractClassPublic[], bytecodeCommitments: Fr[], blockNumber: number): Promise<boolean>;
23
- deleteContractClasses(data: ContractClassPublic[], blockNumber: number): Promise<boolean>;
24
- getBytecodeCommitment(contractClassId: Fr): Promise<Fr | undefined>;
25
- addFunctions(contractClassId: Fr, privateFunctions: ExecutablePrivateFunctionWithMembershipProof[], unconstrainedFunctions: UnconstrainedFunctionWithMembershipProof[]): Promise<boolean>;
26
- addContractInstances(data: ContractInstanceWithAddress[], _blockNumber: number): Promise<boolean>;
27
- deleteContractInstances(data: ContractInstanceWithAddress[], _blockNumber: number): Promise<boolean>;
28
- /**
29
- * Append new blocks to the store's list.
30
- * @param blocks - The L2 blocks to be added to the store and the last processed L1 block.
31
- * @returns True if the operation is successful.
32
- */
33
- addBlocks(blocks: L1Published<L2Block>[]): Promise<boolean>;
34
- /**
35
- * Unwinds blocks from the database
36
- * @param from - The tip of the chain, passed for verification purposes,
37
- * ensuring that we don't end up deleting something we did not intend
38
- * @param blocksToUnwind - The number of blocks we are to unwind
39
- * @returns True if the operation is successful
40
- */
41
- unwindBlocks(from: number, blocksToUnwind: number): Promise<boolean>;
42
- /**
43
- * Gets up to `limit` amount of L2 blocks starting from `from`.
44
- *
45
- * @param start - Number of the first block to return (inclusive).
46
- * @param limit - The number of blocks to return.
47
- * @returns The requested L2 blocks
48
- */
49
- getBlocks(start: number, limit: number): Promise<L1Published<L2Block>[]>;
50
- /**
51
- * Gets up to `limit` amount of L2 blocks headers starting from `from`.
52
- *
53
- * @param start - Number of the first block to return (inclusive).
54
- * @param limit - The number of blocks to return.
55
- * @returns The requested L2 blocks
56
- */
57
- getBlockHeaders(start: number, limit: number): Promise<BlockHeader[]>;
58
- /**
59
- * Gets a tx effect.
60
- * @param txHash - The txHash of the tx corresponding to the tx effect.
61
- * @returns The requested tx effect (or undefined if not found).
62
- */
63
- getTxEffect(txHash: TxHash): Promise<InBlock<import("@aztec/circuit-types").TxEffect> | undefined>;
64
- /**
65
- * Gets a receipt of a settled tx.
66
- * @param txHash - The hash of a tx we try to get the receipt for.
67
- * @returns The requested tx receipt (or undefined if not found).
68
- */
69
- getSettledTxReceipt(txHash: TxHash): Promise<TxReceipt | undefined>;
70
- /**
71
- * Append new logs to the store's list.
72
- * @param blocks - The blocks for which to add the logs.
73
- * @returns True if the operation is successful.
74
- */
75
- addLogs(blocks: L2Block[]): Promise<boolean>;
76
- deleteLogs(blocks: L2Block[]): Promise<boolean>;
77
- /**
78
- * Append new nullifiers to the store's list.
79
- * @param blocks - The blocks for which to add the nullifiers.
80
- * @returns True if the operation is successful.
81
- */
82
- addNullifiers(blocks: L2Block[]): Promise<boolean>;
83
- deleteNullifiers(blocks: L2Block[]): Promise<boolean>;
84
- findNullifiersIndexesWithBlock(blockNumber: number, nullifiers: Fr[]): Promise<(InBlock<bigint> | undefined)[]>;
85
- getTotalL1ToL2MessageCount(): Promise<bigint>;
86
- /**
87
- * Append L1 to L2 messages to the store.
88
- * @param messages - The L1 to L2 messages to be added to the store and the last processed L1 block.
89
- * @returns True if the operation is successful.
90
- */
91
- addL1ToL2Messages(messages: DataRetrieval<InboxLeaf>): Promise<boolean>;
92
- /**
93
- * Gets the L1 to L2 message index in the L1 to L2 message tree.
94
- * @param l1ToL2Message - The L1 to L2 message.
95
- * @returns The index of the L1 to L2 message in the L1 to L2 message tree (undefined if not found).
96
- */
97
- getL1ToL2MessageIndex(l1ToL2Message: Fr): Promise<bigint | undefined>;
98
- /**
99
- * Gets L1 to L2 message (to be) included in a given block.
100
- * @param blockNumber - L2 block number to get messages for.
101
- * @returns The L1 to L2 messages/leaves of the messages subtree (throws if not found).
102
- */
103
- getL1ToL2Messages(blockNumber: bigint): Promise<Fr[]>;
104
- /**
105
- * Retrieves all private logs from up to `limit` blocks, starting from the block number `from`.
106
- * @param from - The block number from which to begin retrieving logs.
107
- * @param limit - The maximum number of blocks to retrieve logs from.
108
- * @returns An array of private logs from the specified range of blocks.
109
- */
110
- getPrivateLogs(from: number, limit: number): Promise<PrivateLog[]>;
111
- /**
112
- * Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
113
- * @param tags - The tags to filter the logs by.
114
- * @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
115
- * that tag.
116
- */
117
- getLogsByTags(tags: Fr[]): Promise<TxScopedL2Log[][]>;
118
- /**
119
- * Gets public logs based on the provided filter.
120
- * @param filter - The filter to apply to the logs.
121
- * @returns The requested logs.
122
- */
123
- getPublicLogs(filter: LogFilter): Promise<GetPublicLogsResponse>;
124
- /**
125
- * Gets contract class logs based on the provided filter.
126
- * @param filter - The filter to apply to the logs.
127
- * @returns The requested logs.
128
- */
129
- getContractClassLogs(filter: LogFilter): Promise<GetContractClassLogsResponse>;
130
- /**
131
- * Gets the number of the latest L2 block processed.
132
- * @returns The number of the latest L2 block processed.
133
- */
134
- getSynchedL2BlockNumber(): Promise<number>;
135
- getProvenL2BlockNumber(): Promise<number>;
136
- getProvenL2EpochNumber(): Promise<number | undefined>;
137
- setProvenL2BlockNumber(blockNumber: number): Promise<void>;
138
- setProvenL2EpochNumber(epochNumber: number): Promise<void>;
139
- setBlockSynchedL1BlockNumber(l1BlockNumber: bigint): Promise<void>;
140
- setMessageSynchedL1BlockNumber(l1BlockNumber: bigint): Promise<void>;
141
- /**
142
- * Gets the last L1 block number processed by the archiver
143
- */
144
- getSynchPoint(): Promise<ArchiverL1SynchPoint>;
145
- estimateSize(): Promise<StoreSize>;
146
- }
147
- //# sourceMappingURL=kv_archiver_store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"kv_archiver_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/kv_archiver_store/kv_archiver_store.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC1B,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,4CAA4C,EACjD,KAAK,EAAE,EACP,KAAK,UAAU,EACf,KAAK,wCAAwC,EAC9C,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAQ3D;;GAEG;AACH,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vE;;;;OAIG;IACH,qBAAqB,CAAC,aAAa,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAIrE;;;;OAIG;IACH,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,EAAE,EAAE,CAAC;IAIrD;;;;;OAKG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAIlE;;;;;OAKG;IACH,aAAa,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;IAQrD;;;;OAIG;IACH,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAQhE;;;;OAIG;IACH,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAQ9E;;;OAGG;IACH,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI1C,sBAAsB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIzC,sBAAsB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAI/C,sBAAsB,CAAC,WAAW,EAAE,MAAM;IAI1C,sBAAsB,CAAC,WAAW,EAAE,MAAM;IAI1C,4BAA4B,CAAC,aAAa,EAAE,MAAM;IAIlD,8BAA8B,CAAC,aAAa,EAAE,MAAM;IAI1D;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAW7C,YAAY,IAAI,OAAO,CAAC,SAAS,CAAC;CAG1C"}
@@ -1,47 +0,0 @@
1
- import { type GetContractClassLogsResponse, type GetPublicLogsResponse, type L2Block, type LogFilter, TxScopedL2Log } from '@aztec/circuit-types';
2
- import { type Fr, PrivateLog } from '@aztec/circuits.js';
3
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
4
- import { type BlockStore } from './block_store.js';
5
- /**
6
- * A store for logs
7
- */
8
- export declare class LogStore {
9
- #private;
10
- private db;
11
- private blockStore;
12
- constructor(db: AztecAsyncKVStore, blockStore: BlockStore, logsMaxPageSize?: number);
13
- /**
14
- * Append new logs to the store's list.
15
- * @param blocks - The blocks for which to add the logs.
16
- * @returns True if the operation is successful.
17
- */
18
- addLogs(blocks: L2Block[]): Promise<boolean>;
19
- deleteLogs(blocks: L2Block[]): Promise<boolean>;
20
- /**
21
- * Retrieves all private logs from up to `limit` blocks, starting from the block number `start`.
22
- * @param start - The block number from which to begin retrieving logs.
23
- * @param limit - The maximum number of blocks to retrieve logs from.
24
- * @returns An array of private logs from the specified range of blocks.
25
- */
26
- getPrivateLogs(start: number, limit: number): Promise<PrivateLog[]>;
27
- /**
28
- * Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
29
- * @param tags - The tags to filter the logs by.
30
- * @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
31
- * that tag.
32
- */
33
- getLogsByTags(tags: Fr[]): Promise<TxScopedL2Log[][]>;
34
- /**
35
- * Gets public logs based on the provided filter.
36
- * @param filter - The filter to apply to the logs.
37
- * @returns The requested logs.
38
- */
39
- getPublicLogs(filter: LogFilter): Promise<GetPublicLogsResponse>;
40
- /**
41
- * Gets contract class logs based on the provided filter.
42
- * @param filter - The filter to apply to the logs.
43
- * @returns The requested logs.
44
- */
45
- getContractClassLogs(filter: LogFilter): Promise<GetContractClassLogsResponse>;
46
- }
47
- //# sourceMappingURL=log_store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/kv_archiver_store/log_store.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC1B,KAAK,OAAO,EACZ,KAAK,SAAS,EAEd,aAAa,EAEd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAa,MAAM,oBAAoB,CAAC;AAQpE,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AAExE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;GAEG;AACH,qBAAa,QAAQ;;IASP,OAAO,CAAC,EAAE;IAAqB,OAAO,CAAC,UAAU;gBAAzC,EAAE,EAAE,iBAAiB,EAAU,UAAU,EAAE,UAAU,EAAE,eAAe,GAAE,MAAa;IAsFzG;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAwD5C,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IA0B/C;;;;;OAKG;IACG,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAWzE;;;;;OAKG;IACG,aAAa,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;IAO3D;;;;OAIG;IACH,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA+EhE;;;;OAIG;IACH,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,4BAA4B,CAAC;CA2F/E"}
@@ -1,33 +0,0 @@
1
- import { InboxLeaf } from '@aztec/circuit-types';
2
- import { Fr } from '@aztec/circuits.js';
3
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
4
- import { type DataRetrieval } from '../structs/data_retrieval.js';
5
- /**
6
- * LMDB implementation of the ArchiverDataStore interface.
7
- */
8
- export declare class MessageStore {
9
- #private;
10
- private db;
11
- constructor(db: AztecAsyncKVStore);
12
- getTotalL1ToL2MessageCount(): Promise<bigint>;
13
- /**
14
- * Gets the last L1 block number that emitted new messages.
15
- * @returns The last L1 block number processed
16
- */
17
- getSynchedL1BlockNumber(): Promise<bigint | undefined>;
18
- setSynchedL1BlockNumber(l1BlockNumber: bigint): Promise<void>;
19
- /**
20
- * Append L1 to L2 messages to the store.
21
- * @param messages - The L1 to L2 messages to be added to the store and the last processed L1 block.
22
- * @returns True if the operation is successful.
23
- */
24
- addL1ToL2Messages(messages: DataRetrieval<InboxLeaf>): Promise<boolean>;
25
- /**
26
- * Gets the L1 to L2 message index in the L1 to L2 message tree.
27
- * @param l1ToL2Message - The L1 to L2 message.
28
- * @returns The index of the L1 to L2 message in the L1 to L2 message tree (undefined if not found).
29
- */
30
- getL1ToL2MessageIndex(l1ToL2Message: Fr): Promise<bigint | undefined>;
31
- getL1ToL2Messages(blockNumber: bigint): Promise<Fr[]>;
32
- }
33
- //# sourceMappingURL=message_store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"message_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/kv_archiver_store/message_store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,EAAE,EAA+B,MAAM,oBAAoB,CAAC;AAErE,OAAO,KAAK,EAAE,iBAAiB,EAAsC,MAAM,iBAAiB,CAAC;AAE7F,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE;;GAEG;AACH,qBAAa,YAAY;;IAUX,OAAO,CAAC,EAAE;gBAAF,EAAE,EAAE,iBAAiB;IAOnC,0BAA0B,IAAI,OAAO,CAAC,MAAM,CAAC;IAInD;;;OAGG;IACH,uBAAuB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAIhD,uBAAuB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInE;;;;OAIG;IACH,iBAAiB,CAAC,QAAQ,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAsBvE;;;;OAIG;IACH,qBAAqB,CAAC,aAAa,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAI/D,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,EAAE,EAAE,CAAC;CAqB5D"}
@@ -1,12 +0,0 @@
1
- import { type InBlock, type L2Block } from '@aztec/circuit-types';
2
- import { type Fr } from '@aztec/circuits.js';
3
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
4
- export declare class NullifierStore {
5
- #private;
6
- private db;
7
- constructor(db: AztecAsyncKVStore);
8
- addNullifiers(blocks: L2Block[]): Promise<boolean>;
9
- deleteNullifiers(blocks: L2Block[]): Promise<boolean>;
10
- findNullifiersIndexesWithBlock(blockNumber: number, nullifiers: Fr[]): Promise<(InBlock<bigint> | undefined)[]>;
11
- }
12
- //# sourceMappingURL=nullifier_store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nullifier_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/kv_archiver_store/nullifier_store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,EAAyB,MAAM,oBAAoB,CAAC;AAEpE,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AAExE,qBAAa,cAAc;;IAMb,OAAO,CAAC,EAAE;gBAAF,EAAE,EAAE,iBAAiB;IAMnC,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IA0BlD,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAerD,8BAA8B,CAClC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,EAAE,EAAE,GACf,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;CAkC5C"}
@@ -1,23 +0,0 @@
1
- import { InboxLeaf } from '@aztec/circuit-types';
2
- import { type Fr } from '@aztec/foundation/fields';
3
- /**
4
- * A simple in-memory implementation of an L1 to L2 message store.
5
- */
6
- export declare class L1ToL2MessageStore {
7
- #private;
8
- /**
9
- * A map pointing from a key in a "messageIndex" format to the corresponding L1 to L2 message hash.
10
- */
11
- protected store: Map<string, Fr>;
12
- constructor();
13
- getTotalL1ToL2MessageCount(): bigint;
14
- addMessage(message: InboxLeaf): void;
15
- getMessages(blockNumber: bigint): Fr[];
16
- /**
17
- * Gets the L1 to L2 message index in the L1 to L2 message tree.
18
- * @param l1ToL2Message - The L1 to L2 message.
19
- * @returns The index of the L1 to L2 message in the L1 to L2 message tree (undefined if not found).
20
- */
21
- getMessageIndex(l1ToL2Message: Fr): bigint | undefined;
22
- }
23
- //# sourceMappingURL=l1_to_l2_message_store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"l1_to_l2_message_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/memory_archiver_store/l1_to_l2_message_store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD;;GAEG;AACH,qBAAa,kBAAkB;;IAC7B;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAa;;IAM7C,0BAA0B,IAAI,MAAM;IAIpC,UAAU,CAAC,OAAO,EAAE,SAAS;IAI7B,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,EAAE,EAAE;IAsBtC;;;;OAIG;IACH,eAAe,CAAC,aAAa,EAAE,EAAE,GAAG,MAAM,GAAG,SAAS;CAQvD"}
@@ -1,168 +0,0 @@
1
- import { type GetContractClassLogsResponse, type GetPublicLogsResponse, type InBlock, type InboxLeaf, type L2Block, type LogFilter, type TxEffect, type TxHash, TxReceipt, TxScopedL2Log } from '@aztec/circuit-types';
2
- import { type BlockHeader, type ContractClassPublic, type ContractInstanceWithAddress, type ExecutablePrivateFunctionWithMembershipProof, Fr, type PrivateLog, type UnconstrainedFunctionWithMembershipProof } from '@aztec/circuits.js';
3
- import { FunctionSelector } from '@aztec/foundation/abi';
4
- import { type AztecAddress } from '@aztec/foundation/aztec-address';
5
- import { type ArchiverDataStore, type ArchiverL1SynchPoint } from '../archiver_store.js';
6
- import { type DataRetrieval } from '../structs/data_retrieval.js';
7
- import { type L1Published } from '../structs/published.js';
8
- /**
9
- * Simple, in-memory implementation of an archiver data store.
10
- */
11
- export declare class MemoryArchiverStore implements ArchiverDataStore {
12
- #private;
13
- /** The max number of logs that can be obtained in 1 "getPublicLogs" call. */
14
- readonly maxLogs: number;
15
- /**
16
- * An array containing all the L2 blocks that have been fetched so far.
17
- */
18
- private l2Blocks;
19
- /**
20
- * An array containing all the tx effects in the L2 blocks that have been fetched so far.
21
- */
22
- private txEffects;
23
- private taggedLogs;
24
- private logTagsPerBlock;
25
- private privateLogsPerBlock;
26
- private publicLogsPerBlock;
27
- private contractClassLogsPerBlock;
28
- private blockScopedNullifiers;
29
- /**
30
- * Contains all L1 to L2 messages.
31
- */
32
- private l1ToL2Messages;
33
- private contractClasses;
34
- private bytecodeCommitments;
35
- private privateFunctions;
36
- private unconstrainedFunctions;
37
- private contractInstances;
38
- private lastL1BlockNewBlocks;
39
- private lastL1BlockNewMessages;
40
- private lastProvenL2BlockNumber;
41
- private lastProvenL2EpochNumber;
42
- private functionNames;
43
- constructor(
44
- /** The max number of logs that can be obtained in 1 "getPublicLogs" call. */
45
- maxLogs: number);
46
- getContractClass(id: Fr): Promise<ContractClassPublic | undefined>;
47
- getContractClassIds(): Promise<Fr[]>;
48
- getContractInstance(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
49
- getBytecodeCommitment(contractClassId: Fr): Promise<Fr | undefined>;
50
- addFunctions(contractClassId: Fr, newPrivateFunctions: ExecutablePrivateFunctionWithMembershipProof[], newUnconstrainedFunctions: UnconstrainedFunctionWithMembershipProof[]): Promise<boolean>;
51
- addContractClasses(data: ContractClassPublic[], bytecodeCommitments: Fr[], blockNumber: number): Promise<boolean>;
52
- deleteContractClasses(data: ContractClassPublic[], blockNumber: number): Promise<boolean>;
53
- addContractInstances(data: ContractInstanceWithAddress[], _blockNumber: number): Promise<boolean>;
54
- deleteContractInstances(data: ContractInstanceWithAddress[], _blockNumber: number): Promise<boolean>;
55
- /**
56
- * Append new blocks to the store's list.
57
- * @param blocks - The L2 blocks to be added to the store and the last processed L1 block.
58
- * @returns True if the operation is successful.
59
- */
60
- addBlocks(blocks: L1Published<L2Block>[]): Promise<boolean>;
61
- /**
62
- * Unwinds blocks from the database
63
- * @param from - The tip of the chain, passed for verification purposes,
64
- * ensuring that we don't end up deleting something we did not intend
65
- * @param blocksToUnwind - The number of blocks we are to unwind
66
- * @returns True if the operation is successful
67
- */
68
- unwindBlocks(from: number, blocksToUnwind: number): Promise<boolean>;
69
- /**
70
- * Append new logs to the store's list.
71
- * @param block - The block for which to add the logs.
72
- * @returns True if the operation is successful.
73
- */
74
- addLogs(blocks: L2Block[]): Promise<boolean>;
75
- deleteLogs(blocks: L2Block[]): Promise<boolean>;
76
- addNullifiers(blocks: L2Block[]): Promise<boolean>;
77
- deleteNullifiers(blocks: L2Block[]): Promise<boolean>;
78
- findNullifiersIndexesWithBlock(blockNumber: number, nullifiers: Fr[]): Promise<(InBlock<bigint> | undefined)[]>;
79
- getTotalL1ToL2MessageCount(): Promise<bigint>;
80
- /**
81
- * Append L1 to L2 messages to the store.
82
- * @param messages - The L1 to L2 messages to be added to the store and the last processed L1 block.
83
- * @returns True if the operation is successful.
84
- */
85
- addL1ToL2Messages(messages: DataRetrieval<InboxLeaf>): Promise<boolean>;
86
- /**
87
- * Gets the L1 to L2 message index in the L1 to L2 message tree.
88
- * @param l1ToL2Message - The L1 to L2 message.
89
- * @returns The index of the L1 to L2 message in the L1 to L2 message tree (undefined if not found).
90
- */
91
- getL1ToL2MessageIndex(l1ToL2Message: Fr): Promise<bigint | undefined>;
92
- /**
93
- * Gets up to `limit` amount of L2 blocks starting from `from`.
94
- * @param from - Number of the first block to return (inclusive).
95
- * @param limit - The number of blocks to return.
96
- * @returns The requested L2 blocks.
97
- * @remarks When "from" is smaller than genesis block number, blocks from the beginning are returned.
98
- */
99
- getBlocks(from: number, limit: number): Promise<L1Published<L2Block>[]>;
100
- getBlockHeaders(from: number, limit: number): Promise<BlockHeader[]>;
101
- /**
102
- * Gets a tx effect.
103
- * @param txHash - The txHash of the tx effect.
104
- * @returns The requested tx effect.
105
- */
106
- getTxEffect(txHash: TxHash): Promise<InBlock<TxEffect> | undefined>;
107
- /**
108
- * Gets a receipt of a settled tx.
109
- * @param txHash - The hash of a tx we try to get the receipt for.
110
- * @returns The requested tx receipt (or undefined if not found).
111
- */
112
- getSettledTxReceipt(txHash: TxHash): Promise<TxReceipt | undefined>;
113
- /**
114
- * Gets L1 to L2 message (to be) included in a given block.
115
- * @param blockNumber - L2 block number to get messages for.
116
- * @returns The L1 to L2 messages/leaves of the messages subtree (throws if not found).
117
- */
118
- getL1ToL2Messages(blockNumber: bigint): Promise<Fr[]>;
119
- /**
120
- * Retrieves all private logs from up to `limit` blocks, starting from the block number `from`.
121
- * @param from - The block number from which to begin retrieving logs.
122
- * @param limit - The maximum number of blocks to retrieve logs from.
123
- * @returns An array of private logs from the specified range of blocks.
124
- */
125
- getPrivateLogs(from: number, limit: number): Promise<PrivateLog[]>;
126
- /**
127
- * Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
128
- * @param tags - The tags to filter the logs by.
129
- * @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
130
- * that tag.
131
- */
132
- getLogsByTags(tags: Fr[]): Promise<TxScopedL2Log[][]>;
133
- /**
134
- * Gets public logs based on the provided filter.
135
- * @param filter - The filter to apply to the logs.
136
- * @returns The requested logs.
137
- * @remarks Works by doing an intersection of all params in the filter.
138
- */
139
- getPublicLogs(filter: LogFilter): Promise<GetPublicLogsResponse>;
140
- /**
141
- * Gets contract class logs based on the provided filter.
142
- * NB: clone of the above fn, but for contract class logs
143
- * @param filter - The filter to apply to the logs.
144
- * @returns The requested logs.
145
- * @remarks Works by doing an intersection of all params in the filter.
146
- */
147
- getContractClassLogs(filter: LogFilter): Promise<GetContractClassLogsResponse>;
148
- /**
149
- * Gets the number of the latest L2 block processed.
150
- * @returns The number of the latest L2 block processed.
151
- */
152
- getSynchedL2BlockNumber(): Promise<number>;
153
- getProvenL2BlockNumber(): Promise<number>;
154
- getProvenL2EpochNumber(): Promise<number | undefined>;
155
- setProvenL2BlockNumber(l2BlockNumber: number): Promise<void>;
156
- setProvenL2EpochNumber(l2EpochNumber: number): Promise<void>;
157
- setBlockSynchedL1BlockNumber(l1BlockNumber: bigint): Promise<void>;
158
- setMessageSynchedL1BlockNumber(l1BlockNumber: bigint): Promise<void>;
159
- getSynchPoint(): Promise<ArchiverL1SynchPoint>;
160
- getContractFunctionName(_address: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
161
- registerContractFunctionSignatures(_address: AztecAddress, signatures: string[]): Promise<void>;
162
- estimateSize(): Promise<{
163
- mappingSize: number;
164
- actualSize: number;
165
- numItems: number;
166
- }>;
167
- }
168
- //# sourceMappingURL=memory_archiver_store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory_archiver_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/memory_archiver_store/memory_archiver_store.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC1B,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,OAAO,EAEZ,KAAK,SAAS,EAEd,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,SAAS,EACT,aAAa,EAEd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,mBAAmB,EAExB,KAAK,2BAA2B,EAChC,KAAK,4CAA4C,EACjD,EAAE,EAKF,KAAK,UAAU,EAEf,KAAK,wCAAwC,EAC9C,MAAM,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OAKG;IACH,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA6EhE;;;;;;OAMG;IACH,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,4BAA4B,CAAC;IA6E9E;;;OAGG;IACI,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC;IAO1C,sBAAsB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIzC,sBAAsB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAIrD,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5D,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKnE,4BAA4B,CAAC,aAAa,EAAE,MAAM;IAKlD,8BAA8B,CAAC,aAAa,EAAE,MAAM;IAK7C,aAAa,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAO9C,uBAAuB,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAIlG,kCAAkC,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAWrG,YAAY,IAAI,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAG9F"}
@@ -1,27 +0,0 @@
1
- /**
2
- * Data retrieved from logs
3
- */
4
- export type DataRetrieval<T> = {
5
- /**
6
- * Blocknumber of the last L1 block from which we obtained data.
7
- */
8
- lastProcessedL1BlockNumber: bigint;
9
- /**
10
- * The data returned.
11
- */
12
- retrievedData: T[];
13
- };
14
- /**
15
- * Data retrieved from logs
16
- */
17
- export type SingletonDataRetrieval<T> = {
18
- /**
19
- * Blocknumber of the last L1 block from which we obtained data.
20
- */
21
- lastProcessedL1BlockNumber: bigint;
22
- /**
23
- * The data returned.
24
- */
25
- retrievedData: T;
26
- };
27
- //# sourceMappingURL=data_retrieval.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data_retrieval.d.ts","sourceRoot":"","sources":["../../../src/archiver/structs/data_retrieval.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC7B;;OAEG;IACH,0BAA0B,EAAE,MAAM,CAAC;IACnC;;OAEG;IACH,aAAa,EAAE,CAAC,EAAE,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI;IACtC;;OAEG;IACH,0BAA0B,EAAE,MAAM,CAAC;IACnC;;OAEG;IACH,aAAa,EAAE,CAAC,CAAC;CAClB,CAAC"}