@aztec/archiver 0.0.0-test.1 → 0.0.1-commit.1142ef1
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/README.md +27 -6
- package/dest/archiver/archiver.d.ts +204 -94
- package/dest/archiver/archiver.d.ts.map +1 -1
- package/dest/archiver/archiver.js +1616 -414
- package/dest/archiver/archiver_store.d.ts +178 -83
- 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 +2373 -397
- package/dest/archiver/config.d.ts +7 -22
- package/dest/archiver/config.d.ts.map +1 -1
- package/dest/archiver/config.js +30 -14
- package/dest/archiver/errors.d.ts +33 -1
- package/dest/archiver/errors.d.ts.map +1 -1
- package/dest/archiver/errors.js +49 -0
- package/dest/archiver/index.d.ts +3 -4
- package/dest/archiver/index.d.ts.map +1 -1
- package/dest/archiver/index.js +1 -2
- package/dest/archiver/instrumentation.d.ts +14 -6
- package/dest/archiver/instrumentation.d.ts.map +1 -1
- package/dest/archiver/instrumentation.js +45 -41
- package/dest/archiver/kv_archiver_store/block_store.d.ts +98 -21
- package/dest/archiver/kv_archiver_store/block_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/block_store.js +495 -86
- package/dest/archiver/kv_archiver_store/contract_class_store.d.ts +4 -4
- package/dest/archiver/kv_archiver_store/contract_class_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/contract_class_store.js +13 -19
- package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts +12 -9
- package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/contract_instance_store.js +30 -16
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +81 -75
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/kv_archiver_store.js +145 -83
- package/dest/archiver/kv_archiver_store/log_store.d.ts +12 -16
- package/dest/archiver/kv_archiver_store/log_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/log_store.js +151 -114
- package/dest/archiver/kv_archiver_store/message_store.d.ts +25 -18
- package/dest/archiver/kv_archiver_store/message_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/message_store.js +152 -49
- package/dest/archiver/l1/bin/retrieve-calldata.d.ts +3 -0
- package/dest/archiver/l1/bin/retrieve-calldata.d.ts.map +1 -0
- package/dest/archiver/l1/bin/retrieve-calldata.js +149 -0
- package/dest/archiver/l1/calldata_retriever.d.ts +112 -0
- package/dest/archiver/l1/calldata_retriever.d.ts.map +1 -0
- package/dest/archiver/l1/calldata_retriever.js +471 -0
- package/dest/archiver/l1/data_retrieval.d.ts +90 -0
- package/dest/archiver/l1/data_retrieval.d.ts.map +1 -0
- package/dest/archiver/l1/data_retrieval.js +331 -0
- package/dest/archiver/l1/debug_tx.d.ts +19 -0
- package/dest/archiver/l1/debug_tx.d.ts.map +1 -0
- package/dest/archiver/l1/debug_tx.js +73 -0
- package/dest/archiver/l1/spire_proposer.d.ts +70 -0
- package/dest/archiver/l1/spire_proposer.d.ts.map +1 -0
- package/dest/archiver/l1/spire_proposer.js +157 -0
- package/dest/archiver/l1/trace_tx.d.ts +97 -0
- package/dest/archiver/l1/trace_tx.d.ts.map +1 -0
- package/dest/archiver/l1/trace_tx.js +91 -0
- package/dest/archiver/l1/types.d.ts +12 -0
- package/dest/archiver/l1/types.d.ts.map +1 -0
- package/dest/archiver/l1/types.js +3 -0
- package/dest/archiver/l1/validate_trace.d.ts +29 -0
- package/dest/archiver/l1/validate_trace.d.ts.map +1 -0
- package/dest/archiver/l1/validate_trace.js +150 -0
- package/dest/archiver/structs/data_retrieval.d.ts +1 -1
- package/dest/archiver/structs/inbox_message.d.ts +15 -0
- package/dest/archiver/structs/inbox_message.d.ts.map +1 -0
- package/dest/archiver/structs/inbox_message.js +39 -0
- package/dest/archiver/structs/published.d.ts +2 -11
- package/dest/archiver/structs/published.d.ts.map +1 -1
- package/dest/archiver/structs/published.js +1 -1
- package/dest/archiver/validation.d.ts +17 -0
- package/dest/archiver/validation.d.ts.map +1 -0
- package/dest/archiver/validation.js +98 -0
- package/dest/factory.d.ts +9 -14
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +22 -52
- package/dest/index.d.ts +2 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/rpc/index.d.ts +2 -3
- package/dest/rpc/index.d.ts.map +1 -1
- package/dest/rpc/index.js +1 -4
- package/dest/test/index.d.ts +1 -1
- package/dest/test/mock_archiver.d.ts +16 -8
- package/dest/test/mock_archiver.d.ts.map +1 -1
- package/dest/test/mock_archiver.js +19 -14
- package/dest/test/mock_l1_to_l2_message_source.d.ts +9 -6
- package/dest/test/mock_l1_to_l2_message_source.d.ts.map +1 -1
- package/dest/test/mock_l1_to_l2_message_source.js +30 -7
- package/dest/test/mock_l2_block_source.d.ts +56 -13
- package/dest/test/mock_l2_block_source.d.ts.map +1 -1
- package/dest/test/mock_l2_block_source.js +196 -25
- package/dest/test/mock_structs.d.ts +10 -0
- package/dest/test/mock_structs.d.ts.map +1 -0
- package/dest/test/mock_structs.js +38 -0
- package/package.json +29 -30
- package/src/archiver/archiver.ts +1596 -512
- package/src/archiver/archiver_store.ts +205 -88
- package/src/archiver/archiver_store_test_suite.ts +2386 -354
- package/src/archiver/config.ts +38 -46
- package/src/archiver/errors.ts +85 -0
- package/src/archiver/index.ts +2 -3
- package/src/archiver/instrumentation.ts +65 -45
- package/src/archiver/kv_archiver_store/block_store.ts +668 -101
- package/src/archiver/kv_archiver_store/contract_class_store.ts +14 -24
- package/src/archiver/kv_archiver_store/contract_instance_store.ts +36 -28
- package/src/archiver/kv_archiver_store/kv_archiver_store.ts +197 -113
- package/src/archiver/kv_archiver_store/log_store.ts +204 -132
- package/src/archiver/kv_archiver_store/message_store.ts +213 -54
- package/src/archiver/l1/README.md +98 -0
- package/src/archiver/l1/bin/retrieve-calldata.ts +182 -0
- package/src/archiver/l1/calldata_retriever.ts +641 -0
- package/src/archiver/l1/data_retrieval.ts +512 -0
- package/src/archiver/l1/debug_tx.ts +99 -0
- package/src/archiver/l1/spire_proposer.ts +160 -0
- package/src/archiver/l1/trace_tx.ts +128 -0
- package/src/archiver/l1/types.ts +13 -0
- package/src/archiver/l1/validate_trace.ts +211 -0
- package/src/archiver/structs/inbox_message.ts +41 -0
- package/src/archiver/structs/published.ts +1 -11
- package/src/archiver/validation.ts +124 -0
- package/src/factory.ts +28 -69
- package/src/index.ts +1 -1
- package/src/rpc/index.ts +1 -5
- package/src/test/fixtures/debug_traceTransaction-multicall3.json +88 -0
- package/src/test/fixtures/debug_traceTransaction-multiplePropose.json +153 -0
- package/src/test/fixtures/debug_traceTransaction-proxied.json +122 -0
- package/src/test/fixtures/trace_transaction-multicall3.json +65 -0
- package/src/test/fixtures/trace_transaction-multiplePropose.json +319 -0
- package/src/test/fixtures/trace_transaction-proxied.json +128 -0
- package/src/test/fixtures/trace_transaction-randomRevert.json +216 -0
- package/src/test/mock_archiver.ts +22 -16
- package/src/test/mock_l1_to_l2_message_source.ts +26 -8
- package/src/test/mock_l2_block_source.ts +254 -31
- package/src/test/mock_structs.ts +50 -0
- package/dest/archiver/data_retrieval.d.ts +0 -74
- package/dest/archiver/data_retrieval.d.ts.map +0 -1
- package/dest/archiver/data_retrieval.js +0 -283
- package/dest/archiver/kv_archiver_store/nullifier_store.d.ts +0 -12
- package/dest/archiver/kv_archiver_store/nullifier_store.d.ts.map +0 -1
- package/dest/archiver/kv_archiver_store/nullifier_store.js +0 -73
- package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.d.ts +0 -23
- package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.d.ts.map +0 -1
- package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.js +0 -49
- package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts +0 -175
- package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts.map +0 -1
- package/dest/archiver/memory_archiver_store/memory_archiver_store.js +0 -636
- package/src/archiver/data_retrieval.ts +0 -422
- package/src/archiver/kv_archiver_store/nullifier_store.ts +0 -97
- package/src/archiver/memory_archiver_store/l1_to_l2_message_store.ts +0 -61
- package/src/archiver/memory_archiver_store/memory_archiver_store.ts +0 -801
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { L1BlockId } from '@aztec/ethereum/l1-types';
|
|
2
|
+
import type { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
+
import type { CustomRange } from '@aztec/kv-store';
|
|
2
5
|
import type { FunctionSelector } from '@aztec/stdlib/abi';
|
|
3
6
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
-
import type {
|
|
7
|
+
import type { CheckpointedL2Block, L2BlockNew, ValidateCheckpointResult } from '@aztec/stdlib/block';
|
|
8
|
+
import type { PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
5
9
|
import type {
|
|
6
10
|
ContractClassPublic,
|
|
7
11
|
ContractInstanceUpdateWithAddress,
|
|
8
12
|
ContractInstanceWithAddress,
|
|
9
13
|
ExecutablePrivateFunctionWithMembershipProof,
|
|
10
|
-
|
|
14
|
+
UtilityFunctionWithMembershipProof,
|
|
11
15
|
} from '@aztec/stdlib/contract';
|
|
12
16
|
import type { GetContractClassLogsResponse, GetPublicLogsResponse } from '@aztec/stdlib/interfaces/client';
|
|
13
|
-
import type { LogFilter,
|
|
14
|
-
import type
|
|
15
|
-
import
|
|
17
|
+
import type { LogFilter, SiloedTag, Tag, TxScopedL2Log } from '@aztec/stdlib/logs';
|
|
18
|
+
import { BlockHeader, type IndexedTxEffect, type TxHash, type TxReceipt } from '@aztec/stdlib/tx';
|
|
19
|
+
import type { UInt64 } from '@aztec/stdlib/types';
|
|
16
20
|
|
|
17
|
-
import type {
|
|
18
|
-
import type {
|
|
21
|
+
import type { CheckpointData } from './kv_archiver_store/block_store.js';
|
|
22
|
+
import type { InboxMessage } from './structs/inbox_message.js';
|
|
19
23
|
|
|
20
24
|
/**
|
|
21
25
|
* Represents the latest L1 block processed by the archiver for various objects in L2.
|
|
22
26
|
*/
|
|
23
27
|
export type ArchiverL1SynchPoint = {
|
|
24
|
-
/** Number of the last L1 block that added a new L2
|
|
28
|
+
/** Number of the last L1 block that added a new L2 checkpoint metadata. */
|
|
25
29
|
blocksSynchedTo?: bigint;
|
|
26
|
-
/**
|
|
27
|
-
messagesSynchedTo?:
|
|
28
|
-
/** Number of the last L1 block that added a new proven block. */
|
|
29
|
-
provenLogsSynchedTo?: bigint;
|
|
30
|
+
/** Last L1 block checked for L1 to L2 messages. */
|
|
31
|
+
messagesSynchedTo?: L1BlockId;
|
|
30
32
|
};
|
|
31
33
|
|
|
32
34
|
/**
|
|
@@ -34,29 +36,113 @@ export type ArchiverL1SynchPoint = {
|
|
|
34
36
|
* (blocks, encrypted logs, aztec contract data extended contract data).
|
|
35
37
|
*/
|
|
36
38
|
export interface ArchiverDataStore {
|
|
39
|
+
/** Opens a new transaction to the underlying store and runs all operations within it. */
|
|
40
|
+
transactionAsync<T>(callback: () => Promise<T>): Promise<T>;
|
|
41
|
+
|
|
37
42
|
/**
|
|
38
43
|
* Append new blocks to the store's list.
|
|
39
44
|
* @param blocks - The L2 blocks to be added to the store and the last processed L1 block.
|
|
45
|
+
* @param opts - Options for the operation.
|
|
46
|
+
* @param opts.force - If true, the blocks will be added even if they have gaps.
|
|
40
47
|
* @returns True if the operation is successful.
|
|
41
48
|
*/
|
|
42
|
-
addBlocks(blocks:
|
|
49
|
+
addBlocks(blocks: L2BlockNew[], opts?: { force?: boolean }): Promise<boolean>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Appends new checkpoints, and their blocks to the store's collection
|
|
53
|
+
* @param checkpoints The collectionn of checkpoints to be added
|
|
54
|
+
* @returns True if the operation is successful
|
|
55
|
+
*/
|
|
56
|
+
addCheckpoints(checkpoints: PublishedCheckpoint[]): Promise<boolean>;
|
|
43
57
|
|
|
44
58
|
/**
|
|
45
|
-
*
|
|
59
|
+
* Retrieves all blocks for the requested chackpoint
|
|
60
|
+
* @param checkpointNumber Retreieves all blocks for the given checkpoint
|
|
61
|
+
* @returns The collection of blocks for the requested checkpoint if available (undefined otherwise)
|
|
62
|
+
*/
|
|
63
|
+
getBlocksForCheckpoint(checkpointNumber: CheckpointNumber): Promise<L2BlockNew[] | undefined>;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Returns an array of checkpoint objects
|
|
67
|
+
* @param from The first checkpoint number to be retrieved
|
|
68
|
+
* @param limit The maximum number of chackpoints to retrieve
|
|
69
|
+
* @returns The array of requested checkpoint data objects
|
|
70
|
+
*/
|
|
71
|
+
getRangeOfCheckpoints(from: CheckpointNumber, limit: number): Promise<CheckpointData[]>;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Unwinds checkpoints from the database
|
|
46
75
|
* @param from - The tip of the chain, passed for verification purposes,
|
|
47
76
|
* ensuring that we don't end up deleting something we did not intend
|
|
48
|
-
* @param
|
|
77
|
+
* @param checkpointsToUnwind - The number of checkpoints we are to unwind
|
|
49
78
|
* @returns True if the operation is successful
|
|
50
79
|
*/
|
|
51
|
-
|
|
80
|
+
unwindCheckpoints(from: CheckpointNumber, checkpointsToUnwind: number): Promise<boolean>;
|
|
52
81
|
|
|
53
82
|
/**
|
|
54
|
-
*
|
|
83
|
+
* Returns the block for the given number, or undefined if not exists.
|
|
84
|
+
* @param number - The block number to return.
|
|
85
|
+
*/
|
|
86
|
+
getCheckpointedBlock(number: number): Promise<CheckpointedL2Block | undefined>;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Gets up to `limit` amount of checkpointed L2 blocks starting from `from`.
|
|
90
|
+
* @param from - Number of the first block to return (inclusive).
|
|
91
|
+
* @param limit - The number of blocks to return.
|
|
92
|
+
* @returns The requested checkpointed L2 blocks.
|
|
93
|
+
*/
|
|
94
|
+
getCheckpointedBlocks(from: number, limit: number): Promise<CheckpointedL2Block[]>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Returns the block for the given hash, or undefined if not exists.
|
|
98
|
+
* @param blockHash - The block hash to return.
|
|
99
|
+
*/
|
|
100
|
+
getCheckpointedBlockByHash(blockHash: Fr): Promise<CheckpointedL2Block | undefined>;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Returns the block for the given archive root, or undefined if not exists.
|
|
104
|
+
* @param archive - The archive root to return.
|
|
105
|
+
*/
|
|
106
|
+
getCheckpointedBlockByArchive(archive: Fr): Promise<CheckpointedL2Block | undefined>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Returns checkpoint data for the requested checkpoint number
|
|
110
|
+
* @param checkpointNumber - The checkpoint requested
|
|
111
|
+
* @returns The checkpoint data or undefined if not found
|
|
112
|
+
*/
|
|
113
|
+
getCheckpointData(checkpointNumber: CheckpointNumber): Promise<CheckpointData | undefined>;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Returns the number of the latest block
|
|
117
|
+
* @returns The number of the latest block
|
|
118
|
+
*/
|
|
119
|
+
getLatestBlockNumber(): Promise<BlockNumber>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Returns the block for the given number, or undefined if not exists.
|
|
123
|
+
* @param number - The block number to return.
|
|
124
|
+
*/
|
|
125
|
+
getBlock(number: number): Promise<L2BlockNew | undefined>;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Returns the block for the given hash, or undefined if not exists.
|
|
129
|
+
* @param blockHash - The block hash to return.
|
|
130
|
+
*/
|
|
131
|
+
getBlockByHash(blockHash: Fr): Promise<L2BlockNew | undefined>;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Returns the block for the given archive root, or undefined if not exists.
|
|
135
|
+
* @param archive - The archive root to return.
|
|
136
|
+
*/
|
|
137
|
+
getBlockByArchive(archive: Fr): Promise<L2BlockNew | undefined>;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Gets up to `limit` amount of published L2 blocks starting from `from`.
|
|
55
141
|
* @param from - Number of the first block to return (inclusive).
|
|
56
142
|
* @param limit - The number of blocks to return.
|
|
57
143
|
* @returns The requested L2 blocks.
|
|
58
144
|
*/
|
|
59
|
-
getBlocks(from: number, limit: number): Promise<
|
|
145
|
+
getBlocks(from: number, limit: number): Promise<L2BlockNew[]>;
|
|
60
146
|
|
|
61
147
|
/**
|
|
62
148
|
* Gets up to `limit` amount of L2 block headers starting from `from`.
|
|
@@ -64,14 +150,26 @@ export interface ArchiverDataStore {
|
|
|
64
150
|
* @param limit - The number of blocks to return.
|
|
65
151
|
* @returns The requested L2 block headers.
|
|
66
152
|
*/
|
|
67
|
-
getBlockHeaders(from:
|
|
153
|
+
getBlockHeaders(from: BlockNumber, limit: number): Promise<BlockHeader[]>;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Returns the block header for the given hash, or undefined if not exists.
|
|
157
|
+
* @param blockHash - The block hash to return.
|
|
158
|
+
*/
|
|
159
|
+
getBlockHeaderByHash(blockHash: Fr): Promise<BlockHeader | undefined>;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Returns the block header for the given archive root, or undefined if not exists.
|
|
163
|
+
* @param archive - The archive root to return.
|
|
164
|
+
*/
|
|
165
|
+
getBlockHeaderByArchive(archive: Fr): Promise<BlockHeader | undefined>;
|
|
68
166
|
|
|
69
167
|
/**
|
|
70
168
|
* Gets a tx effect.
|
|
71
|
-
* @param txHash - The
|
|
72
|
-
* @returns The requested tx effect (or undefined if not found).
|
|
169
|
+
* @param txHash - The hash of the tx corresponding to the tx effect.
|
|
170
|
+
* @returns The requested tx effect with block info (or undefined if not found).
|
|
73
171
|
*/
|
|
74
|
-
getTxEffect(txHash: TxHash): Promise<
|
|
172
|
+
getTxEffect(txHash: TxHash): Promise<IndexedTxEffect | undefined>;
|
|
75
173
|
|
|
76
174
|
/**
|
|
77
175
|
* Gets a receipt of a settled tx.
|
|
@@ -85,39 +183,22 @@ export interface ArchiverDataStore {
|
|
|
85
183
|
* @param blocks - The blocks for which to add the logs.
|
|
86
184
|
* @returns True if the operation is successful.
|
|
87
185
|
*/
|
|
88
|
-
addLogs(blocks:
|
|
89
|
-
deleteLogs(blocks:
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Append new nullifiers to the store's list.
|
|
93
|
-
* @param blocks - The blocks for which to add the nullifiers.
|
|
94
|
-
* @returns True if the operation is successful.
|
|
95
|
-
*/
|
|
96
|
-
addNullifiers(blocks: L2Block[]): Promise<boolean>;
|
|
97
|
-
deleteNullifiers(blocks: L2Block[]): Promise<boolean>;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Returns the provided nullifier indexes scoped to the block
|
|
101
|
-
* they were first included in, or undefined if they're not present in the tree
|
|
102
|
-
* @param blockNumber Max block number to search for the nullifiers
|
|
103
|
-
* @param nullifiers Nullifiers to get
|
|
104
|
-
* @returns The block scoped indexes of the provided nullifiers, or undefined if the nullifier doesn't exist in the tree
|
|
105
|
-
*/
|
|
106
|
-
findNullifiersIndexesWithBlock(blockNumber: number, nullifiers: Fr[]): Promise<(InBlock<bigint> | undefined)[]>;
|
|
186
|
+
addLogs(blocks: L2BlockNew[]): Promise<boolean>;
|
|
187
|
+
deleteLogs(blocks: L2BlockNew[]): Promise<boolean>;
|
|
107
188
|
|
|
108
189
|
/**
|
|
109
190
|
* Append L1 to L2 messages to the store.
|
|
110
|
-
* @param messages - The L1 to L2 messages to be added to the store
|
|
191
|
+
* @param messages - The L1 to L2 messages to be added to the store.
|
|
111
192
|
* @returns True if the operation is successful.
|
|
112
193
|
*/
|
|
113
|
-
addL1ToL2Messages(messages:
|
|
194
|
+
addL1ToL2Messages(messages: InboxMessage[]): Promise<void>;
|
|
114
195
|
|
|
115
196
|
/**
|
|
116
|
-
* Gets L1 to L2 message (to be) included in a given
|
|
117
|
-
* @param
|
|
197
|
+
* Gets L1 to L2 message (to be) included in a given checkpoint.
|
|
198
|
+
* @param checkpointNumber - Checkpoint number to get messages for.
|
|
118
199
|
* @returns The L1 to L2 messages/leaves of the messages subtree (throws if not found).
|
|
119
200
|
*/
|
|
120
|
-
getL1ToL2Messages(
|
|
201
|
+
getL1ToL2Messages(checkpointNumber: CheckpointNumber): Promise<Fr[]>;
|
|
121
202
|
|
|
122
203
|
/**
|
|
123
204
|
* Gets the L1 to L2 message index in the L1 to L2 message tree.
|
|
@@ -133,20 +214,17 @@ export interface ArchiverDataStore {
|
|
|
133
214
|
getTotalL1ToL2MessageCount(): Promise<bigint>;
|
|
134
215
|
|
|
135
216
|
/**
|
|
136
|
-
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
* @returns An array of private logs from the specified range of blocks.
|
|
217
|
+
/**
|
|
218
|
+
* Gets all private logs that match any of the `tags`. For each tag, an array of matching logs is returned. An empty
|
|
219
|
+
* array implies no logs match that tag.
|
|
140
220
|
*/
|
|
141
|
-
|
|
221
|
+
getPrivateLogsByTags(tags: SiloedTag[]): Promise<TxScopedL2Log[][]>;
|
|
142
222
|
|
|
143
223
|
/**
|
|
144
|
-
* Gets all logs that match any of the
|
|
145
|
-
*
|
|
146
|
-
* @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
|
|
147
|
-
* that tag.
|
|
224
|
+
* Gets all public logs that match any of the `tags` from the specified contract. For each tag, an array of matching
|
|
225
|
+
* logs is returned. An empty array implies no logs match that tag.
|
|
148
226
|
*/
|
|
149
|
-
|
|
227
|
+
getPublicLogsByTagsFromContract(contractAddress: AztecAddress, tags: Tag[]): Promise<TxScopedL2Log[][]>;
|
|
150
228
|
|
|
151
229
|
/**
|
|
152
230
|
* Gets public logs based on the provided filter.
|
|
@@ -166,31 +244,42 @@ export interface ArchiverDataStore {
|
|
|
166
244
|
* Gets the number of the latest L2 block processed.
|
|
167
245
|
* @returns The number of the latest L2 block processed.
|
|
168
246
|
*/
|
|
169
|
-
|
|
247
|
+
getCheckpointedL2BlockNumber(): Promise<BlockNumber>;
|
|
170
248
|
|
|
171
249
|
/**
|
|
172
|
-
* Gets the number of the latest
|
|
173
|
-
* @returns The number of the latest
|
|
250
|
+
* Gets the number of the latest published checkpoint processed.
|
|
251
|
+
* @returns The number of the latest published checkpoint processed
|
|
174
252
|
*/
|
|
175
|
-
|
|
253
|
+
getSynchedCheckpointNumber(): Promise<CheckpointNumber>;
|
|
176
254
|
|
|
177
255
|
/**
|
|
178
|
-
*
|
|
179
|
-
* @
|
|
256
|
+
* Gets the number of the latest proven checkpoint processed.
|
|
257
|
+
* @returns The number of the latest proven checkpoint processed.
|
|
180
258
|
*/
|
|
181
|
-
|
|
259
|
+
getProvenCheckpointNumber(): Promise<CheckpointNumber>;
|
|
182
260
|
|
|
183
261
|
/**
|
|
184
|
-
*
|
|
185
|
-
* @
|
|
262
|
+
* Returns the number of the most recent proven block
|
|
263
|
+
* @returns The number of the most recent proven block
|
|
186
264
|
*/
|
|
187
|
-
|
|
265
|
+
getProvenBlockNumber(): Promise<BlockNumber>;
|
|
188
266
|
|
|
189
267
|
/**
|
|
190
|
-
* Stores the
|
|
268
|
+
* Stores the number of the latest proven checkpoint processed.
|
|
269
|
+
* @param checkpointNumber - The number of the latest proven checkpoint processed.
|
|
270
|
+
*/
|
|
271
|
+
setProvenCheckpointNumber(checkpointNumber: CheckpointNumber): Promise<void>;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Stores the l1 block number that checkpoints have been synched until
|
|
191
275
|
* @param l1BlockNumber - The l1 block number
|
|
192
276
|
*/
|
|
193
|
-
|
|
277
|
+
setCheckpointSynchedL1BlockNumber(l1BlockNumber: bigint): Promise<void>;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Stores the l1 block that messages have been synched until
|
|
281
|
+
*/
|
|
282
|
+
setMessageSynchedL1Block(l1Block: L1BlockId): Promise<void>;
|
|
194
283
|
|
|
195
284
|
/**
|
|
196
285
|
* Gets the synch point of the archiver
|
|
@@ -203,9 +292,13 @@ export interface ArchiverDataStore {
|
|
|
203
292
|
* @param blockNumber - Number of the L2 block the contracts were registered in.
|
|
204
293
|
* @returns True if the operation is successful.
|
|
205
294
|
*/
|
|
206
|
-
addContractClasses(
|
|
295
|
+
addContractClasses(
|
|
296
|
+
data: ContractClassPublic[],
|
|
297
|
+
bytecodeCommitments: Fr[],
|
|
298
|
+
blockNumber: BlockNumber,
|
|
299
|
+
): Promise<boolean>;
|
|
207
300
|
|
|
208
|
-
deleteContractClasses(data: ContractClassPublic[], blockNumber:
|
|
301
|
+
deleteContractClasses(data: ContractClassPublic[], blockNumber: BlockNumber): Promise<boolean>;
|
|
209
302
|
|
|
210
303
|
getBytecodeCommitment(contractClassId: Fr): Promise<Fr | undefined>;
|
|
211
304
|
|
|
@@ -221,43 +314,67 @@ export interface ArchiverDataStore {
|
|
|
221
314
|
* @param blockNumber - Number of the L2 block the instances were deployed in.
|
|
222
315
|
* @returns True if the operation is successful.
|
|
223
316
|
*/
|
|
224
|
-
addContractInstances(data: ContractInstanceWithAddress[], blockNumber:
|
|
225
|
-
deleteContractInstances(data: ContractInstanceWithAddress[], blockNumber:
|
|
317
|
+
addContractInstances(data: ContractInstanceWithAddress[], blockNumber: BlockNumber): Promise<boolean>;
|
|
318
|
+
deleteContractInstances(data: ContractInstanceWithAddress[], blockNumber: BlockNumber): Promise<boolean>;
|
|
226
319
|
|
|
227
320
|
/**
|
|
228
321
|
* Add new contract instance updates
|
|
229
322
|
* @param data - List of contract updates to be added.
|
|
230
|
-
* @param
|
|
323
|
+
* @param timestamp - Timestamp at which the updates were scheduled.
|
|
231
324
|
* @returns True if the operation is successful.
|
|
232
325
|
*/
|
|
233
|
-
addContractInstanceUpdates(data: ContractInstanceUpdateWithAddress[],
|
|
234
|
-
deleteContractInstanceUpdates(data: ContractInstanceUpdateWithAddress[],
|
|
326
|
+
addContractInstanceUpdates(data: ContractInstanceUpdateWithAddress[], timestamp: UInt64): Promise<boolean>;
|
|
327
|
+
deleteContractInstanceUpdates(data: ContractInstanceUpdateWithAddress[], timestamp: UInt64): Promise<boolean>;
|
|
235
328
|
/**
|
|
236
329
|
* Adds private functions to a contract class.
|
|
237
330
|
*/
|
|
238
331
|
addFunctions(
|
|
239
332
|
contractClassId: Fr,
|
|
240
333
|
privateFunctions: ExecutablePrivateFunctionWithMembershipProof[],
|
|
241
|
-
|
|
334
|
+
utilityFunctions: UtilityFunctionWithMembershipProof[],
|
|
242
335
|
): Promise<boolean>;
|
|
243
336
|
|
|
244
337
|
/**
|
|
245
|
-
* Returns a contract instance given its address and the given
|
|
338
|
+
* Returns a contract instance given its address and the given timestamp, or undefined if not exists.
|
|
246
339
|
* @param address - Address of the contract.
|
|
340
|
+
* @param timestamp - Timestamp to get the contract instance at. Contract updates might change the instance.
|
|
341
|
+
* @returns The contract instance or undefined if not found.
|
|
247
342
|
*/
|
|
248
|
-
getContractInstance(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
|
|
343
|
+
getContractInstance(address: AztecAddress, timestamp: UInt64): Promise<ContractInstanceWithAddress | undefined>;
|
|
249
344
|
|
|
250
345
|
/** Returns the list of all class ids known by the archiver. */
|
|
251
346
|
getContractClassIds(): Promise<Fr[]>;
|
|
252
347
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
// the node api cleanup process.
|
|
256
|
-
registerContractFunctionSignatures(address: AztecAddress, signatures: string[]): Promise<void>;
|
|
257
|
-
getContractFunctionName(address: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
|
|
348
|
+
/** Register a public function signature, so it can be looked up by selector. */
|
|
349
|
+
registerContractFunctionSignatures(signatures: string[]): Promise<void>;
|
|
258
350
|
|
|
259
|
-
/**
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
351
|
+
/** Looks up a public function name given a selector. */
|
|
352
|
+
getDebugFunctionName(address: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
|
|
353
|
+
|
|
354
|
+
/** Estimates the size of the store in bytes. */
|
|
355
|
+
estimateSize(): Promise<{ mappingSize: number; physicalFileSize: number; actualSize: number; numItems: number }>;
|
|
356
|
+
|
|
357
|
+
/** Backups the archiver db to the target folder. Returns the path to the db file. */
|
|
358
|
+
backupTo(path: string): Promise<string>;
|
|
359
|
+
|
|
360
|
+
/** Closes the underlying data store. */
|
|
361
|
+
close(): Promise<void>;
|
|
362
|
+
|
|
363
|
+
/** Deletes all L1 to L2 messages up until (excluding) the target checkpoint number. */
|
|
364
|
+
rollbackL1ToL2MessagesToCheckpoint(targetCheckpointNumber: CheckpointNumber): Promise<void>;
|
|
365
|
+
|
|
366
|
+
/** Returns an async iterator to all L1 to L2 messages on the range. */
|
|
367
|
+
iterateL1ToL2Messages(range?: CustomRange<bigint>): AsyncIterableIterator<InboxMessage>;
|
|
368
|
+
|
|
369
|
+
/** Removes all L1 to L2 messages starting from the given index (inclusive). */
|
|
370
|
+
removeL1ToL2Messages(startIndex: bigint): Promise<void>;
|
|
371
|
+
|
|
372
|
+
/** Returns the last L1 to L2 message stored. */
|
|
373
|
+
getLastL1ToL2Message(): Promise<InboxMessage | undefined>;
|
|
374
|
+
|
|
375
|
+
/** Returns the last synced validation status of the pending chain. */
|
|
376
|
+
getPendingChainValidationStatus(): Promise<ValidateCheckpointResult | undefined>;
|
|
377
|
+
|
|
378
|
+
/** Sets the last synced validation status of the pending chain. */
|
|
379
|
+
setPendingChainValidationStatus(status: ValidateCheckpointResult | undefined): Promise<void>;
|
|
263
380
|
}
|