@aztec/archiver 0.28.1 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/archiver/archiver.d.ts +13 -53
- package/dest/archiver/archiver.d.ts.map +1 -1
- package/dest/archiver/archiver.js +60 -199
- package/dest/archiver/archiver_store.d.ts +21 -67
- package/dest/archiver/archiver_store.d.ts.map +1 -1
- package/dest/archiver/archiver_store_test_suite.d.ts.map +1 -1
- package/dest/archiver/archiver_store_test_suite.js +60 -199
- package/dest/archiver/config.d.ts.map +1 -1
- package/dest/archiver/config.js +6 -2
- package/dest/archiver/data_retrieval.d.ts +10 -32
- package/dest/archiver/data_retrieval.d.ts.map +1 -1
- package/dest/archiver/data_retrieval.js +13 -67
- package/dest/archiver/eth_log_handlers.d.ts +7 -38
- package/dest/archiver/eth_log_handlers.d.ts.map +1 -1
- package/dest/archiver/eth_log_handlers.js +9 -77
- package/dest/archiver/kv_archiver_store/block_store.d.ts +5 -4
- package/dest/archiver/kv_archiver_store/block_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/block_store.js +12 -15
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +15 -56
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/kv_archiver_store.js +23 -87
- package/dest/archiver/kv_archiver_store/message_store.d.ts +12 -43
- package/dest/archiver/kv_archiver_store/message_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/message_store.js +32 -141
- package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.d.ts +8 -41
- package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.d.ts.map +1 -1
- package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.js +22 -79
- package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts +20 -81
- package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts.map +1 -1
- package/dest/archiver/memory_archiver_store/memory_archiver_store.js +30 -143
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +3 -15
- package/dest/rpc/archiver_client.d.ts.map +1 -1
- package/dest/rpc/archiver_client.js +2 -6
- package/dest/rpc/archiver_server.d.ts.map +1 -1
- package/dest/rpc/archiver_server.js +2 -6
- package/package.json +9 -9
- package/src/archiver/archiver.ts +80 -267
- package/src/archiver/archiver_store.ts +22 -76
- package/src/archiver/archiver_store_test_suite.ts +78 -243
- package/src/archiver/config.ts +6 -0
- package/src/archiver/data_retrieval.ts +19 -101
- package/src/archiver/eth_log_handlers.ts +14 -108
- package/src/archiver/kv_archiver_store/block_store.ts +13 -14
- package/src/archiver/kv_archiver_store/kv_archiver_store.ts +23 -93
- package/src/archiver/kv_archiver_store/message_store.ts +38 -169
- package/src/archiver/memory_archiver_store/l1_to_l2_message_store.ts +21 -90
- package/src/archiver/memory_archiver_store/memory_archiver_store.ts +33 -161
- package/src/index.ts +1 -15
- package/src/rpc/archiver_client.ts +0 -8
- package/src/rpc/archiver_server.ts +0 -8
- package/dest/archiver/kv_archiver_store/contract_store.d.ts +0 -26
- package/dest/archiver/kv_archiver_store/contract_store.d.ts.map +0 -1
- package/dest/archiver/kv_archiver_store/contract_store.js +0 -49
- package/src/archiver/kv_archiver_store/contract_store.ts +0 -55
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
import { Body,
|
|
2
|
+
import { Body, GetUnencryptedLogsResponse, InboxLeaf, L2Block, L2BlockL2Logs, LogFilter, LogType, TxEffect, TxHash, TxReceipt } from '@aztec/circuit-types';
|
|
3
3
|
import { Fr } from '@aztec/circuits.js';
|
|
4
4
|
import { AztecAddress } from '@aztec/foundation/aztec-address';
|
|
5
5
|
import { ContractClassPublic, ContractInstanceWithAddress } from '@aztec/types/contracts';
|
|
6
|
+
import { DataRetrieval } from './data_retrieval.js';
|
|
6
7
|
/**
|
|
7
8
|
* Represents the latest L1 block processed by the archiver for various objects in L2.
|
|
8
9
|
*/
|
|
9
10
|
export type ArchiverL1SynchPoint = {
|
|
10
11
|
/** The last L1 block that added a new L2 block. */
|
|
11
|
-
|
|
12
|
-
/** The last L1 block that added messages from the
|
|
13
|
-
|
|
14
|
-
/** The last L1 block that added pending messages */
|
|
15
|
-
addedMessages: bigint;
|
|
16
|
-
/** The last L1 block that cancelled messages */
|
|
17
|
-
cancelledMessages: bigint;
|
|
12
|
+
blocks: bigint;
|
|
13
|
+
/** The last L1 block that added L1 -> L2 messages from the Inbox. */
|
|
14
|
+
messages: bigint;
|
|
18
15
|
};
|
|
19
16
|
/**
|
|
20
17
|
* Interface describing a data store to be used by the archiver to store all its relevant data
|
|
@@ -23,10 +20,10 @@ export type ArchiverL1SynchPoint = {
|
|
|
23
20
|
export interface ArchiverDataStore {
|
|
24
21
|
/**
|
|
25
22
|
* Append new blocks to the store's list.
|
|
26
|
-
* @param blocks - The L2 blocks to be added to the store.
|
|
23
|
+
* @param blocks - The L2 blocks to be added to the store and the last processed L1 block.
|
|
27
24
|
* @returns True if the operation is successful.
|
|
28
25
|
*/
|
|
29
|
-
addBlocks(blocks: L2Block
|
|
26
|
+
addBlocks(blocks: DataRetrieval<L2Block>): Promise<boolean>;
|
|
30
27
|
/**
|
|
31
28
|
* Append new block bodies to the store's list.
|
|
32
29
|
* @param blockBodies - The L2 block bodies to be added to the store.
|
|
@@ -68,53 +65,23 @@ export interface ArchiverDataStore {
|
|
|
68
65
|
*/
|
|
69
66
|
addLogs(encryptedLogs: L2BlockL2Logs | undefined, unencryptedLogs: L2BlockL2Logs | undefined, blockNumber: number): Promise<boolean>;
|
|
70
67
|
/**
|
|
71
|
-
* Append
|
|
72
|
-
* @param messages - The L1 to L2 messages to be added to the store.
|
|
73
|
-
* @param lastMessageL1BlockNumber - The L1 block number in which the last message was emitted.
|
|
68
|
+
* Append L1 to L2 messages to the store.
|
|
69
|
+
* @param messages - The L1 to L2 messages to be added to the store and the last processed L1 block.
|
|
74
70
|
* @returns True if the operation is successful.
|
|
75
71
|
*/
|
|
76
|
-
|
|
72
|
+
addL1ToL2Messages(messages: DataRetrieval<InboxLeaf>): Promise<boolean>;
|
|
77
73
|
/**
|
|
78
|
-
*
|
|
79
|
-
* @param messages - The L1 to L2 messages to be added to the store.
|
|
80
|
-
* @param l1BlockNumber - The block number of the L1 block that added the messages.
|
|
81
|
-
* @returns True if the operation is successful.
|
|
82
|
-
* TODO(#4492): Nuke the following when purging the old inbox
|
|
83
|
-
*/
|
|
84
|
-
addPendingL1ToL2Messages(messages: L1ToL2Message[], l1BlockNumber: bigint): Promise<boolean>;
|
|
85
|
-
/**
|
|
86
|
-
* Remove pending L1 to L2 messages from the store (if they were cancelled).
|
|
87
|
-
* @param entryKeys - The entry keys to be removed from the store.
|
|
88
|
-
* @param l1BlockNumber - The block number of the L1 block that cancelled the messages.
|
|
89
|
-
* @returns True if the operation is successful.
|
|
90
|
-
* TODO(#4492): Nuke the following when purging the old inbox
|
|
91
|
-
*/
|
|
92
|
-
cancelPendingL1ToL2EntryKeys(entryKeys: Fr[], l1BlockNumber: bigint): Promise<boolean>;
|
|
93
|
-
/**
|
|
94
|
-
* Messages that have been published in an L2 block are confirmed.
|
|
95
|
-
* Add them to the confirmed store, also remove them from the pending store.
|
|
96
|
-
* @param entryKeys - The entry keys to be removed from the store.
|
|
97
|
-
* @returns True if the operation is successful.
|
|
98
|
-
*/
|
|
99
|
-
confirmL1ToL2EntryKeys(entryKeys: Fr[]): Promise<boolean>;
|
|
100
|
-
/**
|
|
101
|
-
* Gets up to `limit` amount of pending L1 to L2 messages, sorted by fee
|
|
102
|
-
* @param limit - The number of entries to return (by default NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP).
|
|
103
|
-
* @returns The requested L1 to L2 entry keys.
|
|
104
|
-
*/
|
|
105
|
-
getPendingL1ToL2EntryKeys(limit: number): Promise<Fr[]>;
|
|
106
|
-
/**
|
|
107
|
-
* Gets the confirmed L1 to L2 message corresponding to the given entry key.
|
|
108
|
-
* @param entryKey - The entry key to look up.
|
|
109
|
-
* @returns The requested L1 to L2 message or throws if not found.
|
|
110
|
-
*/
|
|
111
|
-
getConfirmedL1ToL2Message(entryKey: Fr): Promise<L1ToL2Message>;
|
|
112
|
-
/**
|
|
113
|
-
* Gets new L1 to L2 message (to be) included in a given block.
|
|
74
|
+
* Gets L1 to L2 message (to be) included in a given block.
|
|
114
75
|
* @param blockNumber - L2 block number to get messages for.
|
|
115
76
|
* @returns The L1 to L2 messages/leaves of the messages subtree (throws if not found).
|
|
116
77
|
*/
|
|
117
|
-
|
|
78
|
+
getL1ToL2Messages(blockNumber: bigint): Promise<Fr[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Gets the L1 to L2 message index in the L1 to L2 message tree.
|
|
81
|
+
* @param l1ToL2Message - The L1 to L2 message.
|
|
82
|
+
* @returns The index of the L1 to L2 message in the L1 to L2 message tree (undefined if not found).
|
|
83
|
+
*/
|
|
84
|
+
getL1ToL2MessageIndex(l1ToL2Message: Fr): Promise<bigint | undefined>;
|
|
118
85
|
/**
|
|
119
86
|
* Gets up to `limit` amount of logs starting from `from`.
|
|
120
87
|
* @param from - Number of the L2 block to which corresponds the first logs to be returned.
|
|
@@ -129,28 +96,15 @@ export interface ArchiverDataStore {
|
|
|
129
96
|
* @returns The requested logs.
|
|
130
97
|
*/
|
|
131
98
|
getUnencryptedLogs(filter: LogFilter): Promise<GetUnencryptedLogsResponse>;
|
|
132
|
-
/**
|
|
133
|
-
* Add new extended contract data from an L2 block to the store's list.
|
|
134
|
-
* @param data - List of contracts' data to be added.
|
|
135
|
-
* @param blockNum - Number of the L2 block the contract data was deployed in.
|
|
136
|
-
* @returns True if the operation is successful.
|
|
137
|
-
*/
|
|
138
|
-
addExtendedContractData(data: ExtendedContractData[], blockNum: number): Promise<boolean>;
|
|
139
|
-
/**
|
|
140
|
-
* Get the extended contract data for this contract.
|
|
141
|
-
* @param contractAddress - The contract data address.
|
|
142
|
-
* @returns The extended contract data or undefined if not found.
|
|
143
|
-
*/
|
|
144
|
-
getExtendedContractData(contractAddress: AztecAddress): Promise<ExtendedContractData | undefined>;
|
|
145
99
|
/**
|
|
146
100
|
* Gets the number of the latest L2 block processed.
|
|
147
101
|
* @returns The number of the latest L2 block processed.
|
|
148
102
|
*/
|
|
149
|
-
|
|
103
|
+
getSynchedL2BlockNumber(): Promise<number>;
|
|
150
104
|
/**
|
|
151
|
-
* Gets the
|
|
105
|
+
* Gets the synch point of the archiver
|
|
152
106
|
*/
|
|
153
|
-
|
|
107
|
+
getSynchedL1BlockNumbers(): Promise<ArchiverL1SynchPoint>;
|
|
154
108
|
/**
|
|
155
109
|
* Add new contract classes from an L2 block to the store's list.
|
|
156
110
|
* @param data - List of contract classes to be added.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archiver_store.d.ts","sourceRoot":"","sources":["../../src/archiver/archiver_store.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,IAAI,EACJ,
|
|
1
|
+
{"version":3,"file":"archiver_store.d.ts","sourceRoot":"","sources":["../../src/archiver/archiver_store.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,IAAI,EACJ,0BAA0B,EAC1B,SAAS,EACT,OAAO,EACP,aAAa,EACb,SAAS,EACT,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,iBA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AAC,CAAC;IAEjF;;;;OAIG;IACH,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAE3E;;;OAGG;IACH,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3C;;OAEG;IACH,wBAAwB,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE1D;;;;;OAKG;IACH,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEvF;;;OAGG;IACH,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAAC;IAEnE;;;;;OAKG;IACH,oBAAoB,CAAC,IAAI,EAAE,2BAA2B,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEjG;;;OAGG;IACH,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAAC;IAE7F,+DAA+D;IAC/D,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;CACtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archiver_store_test_suite.d.ts","sourceRoot":"","sources":["../../src/archiver/archiver_store_test_suite.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"archiver_store_test_suite.d.ts","sourceRoot":"","sources":["../../src/archiver/archiver_store_test_suite.ts"],"names":[],"mappings":"AACA,OAAO,2BAA2B,CAAC;AAMnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAAiB,QAmb5F"}
|