@aztec/world-state 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.
- package/dest/index.js +0 -1
- package/dest/instrumentation/instrumentation.js +29 -20
- package/dest/native/index.js +0 -1
- package/dest/native/merkle_trees_facade.js +69 -72
- package/dest/native/message.js +31 -17
- package/dest/native/native_world_state.js +78 -53
- package/dest/native/native_world_state_instance.js +37 -38
- package/dest/native/world_state_ops_queue.js +18 -29
- package/dest/native/world_state_version.js +7 -8
- package/dest/synchronizer/config.js +12 -14
- package/dest/synchronizer/factory.js +5 -5
- package/dest/synchronizer/index.js +0 -1
- package/dest/synchronizer/server_world_state_synchronizer.js +66 -61
- package/dest/test/index.js +0 -1
- package/dest/test/utils.js +14 -12
- package/dest/world-state-db/index.js +0 -1
- package/dest/world-state-db/merkle_tree_db.js +1 -3
- package/package.json +10 -10
- package/src/world-state-db/index.ts +1 -1
- package/dest/index.d.ts +0 -5
- package/dest/index.d.ts.map +0 -1
- package/dest/instrumentation/instrumentation.d.ts +0 -20
- package/dest/instrumentation/instrumentation.d.ts.map +0 -1
- package/dest/native/index.d.ts +0 -2
- package/dest/native/index.d.ts.map +0 -1
- package/dest/native/merkle_trees_facade.d.ts +0 -37
- package/dest/native/merkle_trees_facade.d.ts.map +0 -1
- package/dest/native/message.d.ts +0 -320
- package/dest/native/message.d.ts.map +0 -1
- package/dest/native/native_world_state.d.ts +0 -54
- package/dest/native/native_world_state.d.ts.map +0 -1
- package/dest/native/native_world_state_instance.d.ts +0 -32
- package/dest/native/native_world_state_instance.d.ts.map +0 -1
- package/dest/native/world_state_ops_queue.d.ts +0 -19
- package/dest/native/world_state_ops_queue.d.ts.map +0 -1
- package/dest/native/world_state_version.d.ts +0 -24
- package/dest/native/world_state_version.d.ts.map +0 -1
- package/dest/synchronizer/config.d.ts +0 -23
- package/dest/synchronizer/config.d.ts.map +0 -1
- package/dest/synchronizer/factory.d.ts +0 -10
- package/dest/synchronizer/factory.d.ts.map +0 -1
- package/dest/synchronizer/index.d.ts +0 -3
- package/dest/synchronizer/index.d.ts.map +0 -1
- package/dest/synchronizer/server_world_state_synchronizer.d.ts +0 -76
- package/dest/synchronizer/server_world_state_synchronizer.d.ts.map +0 -1
- package/dest/test/index.d.ts +0 -2
- package/dest/test/index.d.ts.map +0 -1
- package/dest/test/utils.d.ts +0 -14
- package/dest/test/utils.d.ts.map +0 -1
- package/dest/world-state-db/index.d.ts +0 -3
- package/dest/world-state-db/index.d.ts.map +0 -1
- package/dest/world-state-db/merkle_tree_db.d.ts +0 -67
- package/dest/world-state-db/merkle_tree_db.d.ts.map +0 -1
package/dest/native/message.d.ts
DELETED
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import { MerkleTreeId } from '@aztec/circuit-types';
|
|
4
|
-
import { AppendOnlyTreeSnapshot, Fr, type StateReference, type UInt32 } from '@aztec/circuits.js';
|
|
5
|
-
import { type Tuple } from '@aztec/foundation/serialize';
|
|
6
|
-
export declare enum WorldStateMessageType {
|
|
7
|
-
GET_TREE_INFO = 100,
|
|
8
|
-
GET_STATE_REFERENCE = 101,
|
|
9
|
-
GET_INITIAL_STATE_REFERENCE = 102,
|
|
10
|
-
GET_LEAF_VALUE = 103,
|
|
11
|
-
GET_LEAF_PREIMAGE = 104,
|
|
12
|
-
GET_SIBLING_PATH = 105,
|
|
13
|
-
GET_BLOCK_NUMBERS_FOR_LEAF_INDICES = 106,
|
|
14
|
-
FIND_LEAF_INDICES = 107,
|
|
15
|
-
FIND_LOW_LEAF = 108,
|
|
16
|
-
APPEND_LEAVES = 109,
|
|
17
|
-
BATCH_INSERT = 110,
|
|
18
|
-
SEQUENTIAL_INSERT = 111,
|
|
19
|
-
UPDATE_ARCHIVE = 112,
|
|
20
|
-
COMMIT = 113,
|
|
21
|
-
ROLLBACK = 114,
|
|
22
|
-
SYNC_BLOCK = 115,
|
|
23
|
-
CREATE_FORK = 116,
|
|
24
|
-
DELETE_FORK = 117,
|
|
25
|
-
FINALISE_BLOCKS = 118,
|
|
26
|
-
UNWIND_BLOCKS = 119,
|
|
27
|
-
REMOVE_HISTORICAL_BLOCKS = 120,
|
|
28
|
-
GET_STATUS = 121,
|
|
29
|
-
CLOSE = 999
|
|
30
|
-
}
|
|
31
|
-
interface WithTreeId {
|
|
32
|
-
treeId: MerkleTreeId;
|
|
33
|
-
}
|
|
34
|
-
export interface WorldStateStatusSummary {
|
|
35
|
-
/** Last block number that can still be unwound. */
|
|
36
|
-
unfinalisedBlockNumber: bigint;
|
|
37
|
-
/** Last block number that is finalised and cannot be unwound. */
|
|
38
|
-
finalisedBlockNumber: bigint;
|
|
39
|
-
/** Oldest block still available for historical queries and forks. */
|
|
40
|
-
oldestHistoricalBlock: bigint;
|
|
41
|
-
/** Whether the trees are in sync with each other */
|
|
42
|
-
treesAreSynched: boolean;
|
|
43
|
-
}
|
|
44
|
-
export interface TreeMeta {
|
|
45
|
-
/** The name of the tree */
|
|
46
|
-
name: string;
|
|
47
|
-
/** The depth of the tree */
|
|
48
|
-
depth: number;
|
|
49
|
-
/** The current size of the tree (number of leaves) */
|
|
50
|
-
size: bigint;
|
|
51
|
-
/** The committed size of the tree */
|
|
52
|
-
committedSize: bigint;
|
|
53
|
-
/** The current root of the tree */
|
|
54
|
-
root: Fr;
|
|
55
|
-
/** The tree's initial size */
|
|
56
|
-
initialSize: bigint;
|
|
57
|
-
/** The tree's initial root value */
|
|
58
|
-
initialRoot: Fr;
|
|
59
|
-
/** The current oldest historical block number of the tree */
|
|
60
|
-
oldestHistoricBlock: bigint;
|
|
61
|
-
/** The current unfinalised block number of the tree */
|
|
62
|
-
unfinalisedBlockHeight: bigint;
|
|
63
|
-
/** The current finalised block number of the tree */
|
|
64
|
-
finalisedBlockHeight: bigint;
|
|
65
|
-
}
|
|
66
|
-
export interface DBStats {
|
|
67
|
-
/** The name of the DB */
|
|
68
|
-
name: string;
|
|
69
|
-
/** The total number of key/value pairs in the DB */
|
|
70
|
-
numDataItems: bigint;
|
|
71
|
-
/** The current mapped size of the DB */
|
|
72
|
-
totalUsedSize: bigint;
|
|
73
|
-
}
|
|
74
|
-
export interface TreeDBStats {
|
|
75
|
-
/** The configured max size of the DB mapping file (effectively the max possible size of the DB) */
|
|
76
|
-
mapSize: bigint;
|
|
77
|
-
/** Stats for the 'blocks' DB */
|
|
78
|
-
blocksDBStats: DBStats;
|
|
79
|
-
/** Stats for the 'nodes' DB */
|
|
80
|
-
nodesDBStats: DBStats;
|
|
81
|
-
/** Stats for the 'leaf pre-images' DB */
|
|
82
|
-
leafPreimagesDBStats: DBStats;
|
|
83
|
-
/** Stats for the 'leaf indices' DB */
|
|
84
|
-
leafIndicesDBStats: DBStats;
|
|
85
|
-
/** Stats for the 'block indices' DB */
|
|
86
|
-
blockIndicesDBStats: DBStats;
|
|
87
|
-
}
|
|
88
|
-
export interface WorldStateMeta {
|
|
89
|
-
/** Tree meta for the note hash tree */
|
|
90
|
-
noteHashTreeMeta: TreeMeta;
|
|
91
|
-
/** Tree meta for the message tree */
|
|
92
|
-
messageTreeMeta: TreeMeta;
|
|
93
|
-
/** Tree meta for the archive tree */
|
|
94
|
-
archiveTreeMeta: TreeMeta;
|
|
95
|
-
/** Tree meta for the public data tree */
|
|
96
|
-
publicDataTreeMeta: TreeMeta;
|
|
97
|
-
/** Tree meta for the nullifier tree */
|
|
98
|
-
nullifierTreeMeta: TreeMeta;
|
|
99
|
-
}
|
|
100
|
-
export interface WorldStateDBStats {
|
|
101
|
-
/** Full stats for the note hash tree */
|
|
102
|
-
noteHashTreeStats: TreeDBStats;
|
|
103
|
-
/** Full stats for the message tree */
|
|
104
|
-
messageTreeStats: TreeDBStats;
|
|
105
|
-
/** Full stats for the archive tree */
|
|
106
|
-
archiveTreeStats: TreeDBStats;
|
|
107
|
-
/** Full stats for the public data tree */
|
|
108
|
-
publicDataTreeStats: TreeDBStats;
|
|
109
|
-
/** Full stats for the nullifier tree */
|
|
110
|
-
nullifierTreeStats: TreeDBStats;
|
|
111
|
-
}
|
|
112
|
-
export interface WorldStateStatusFull {
|
|
113
|
-
summary: WorldStateStatusSummary;
|
|
114
|
-
dbStats: WorldStateDBStats;
|
|
115
|
-
meta: WorldStateMeta;
|
|
116
|
-
}
|
|
117
|
-
export declare function buildEmptyDBStats(): DBStats;
|
|
118
|
-
export declare function buildEmptyTreeDBStats(): TreeDBStats;
|
|
119
|
-
export declare function buildEmptyTreeMeta(): TreeMeta;
|
|
120
|
-
export declare function buildEmptyWorldStateMeta(): WorldStateMeta;
|
|
121
|
-
export declare function buildEmptyWorldStateDBStats(): WorldStateDBStats;
|
|
122
|
-
export declare function buildEmptyWorldStateSummary(): WorldStateStatusSummary;
|
|
123
|
-
export declare function buildEmptyWorldStateStatusFull(): WorldStateStatusFull;
|
|
124
|
-
export declare function sanitiseSummary(summary: WorldStateStatusSummary): WorldStateStatusSummary;
|
|
125
|
-
export declare function sanitiseDBStats(stats: DBStats): DBStats;
|
|
126
|
-
export declare function sanitiseMeta(meta: TreeMeta): TreeMeta;
|
|
127
|
-
export declare function sanitiseTreeDBStats(stats: TreeDBStats): TreeDBStats;
|
|
128
|
-
export declare function sanitiseWorldStateDBStats(stats: WorldStateDBStats): WorldStateDBStats;
|
|
129
|
-
export declare function sanitiseWorldStateTreeMeta(meta: WorldStateMeta): WorldStateMeta;
|
|
130
|
-
export declare function sanitiseFullStatus(status: WorldStateStatusFull): WorldStateStatusFull;
|
|
131
|
-
interface WithForkId {
|
|
132
|
-
forkId: number;
|
|
133
|
-
}
|
|
134
|
-
interface WithWorldStateRevision {
|
|
135
|
-
revision: WorldStateRevision;
|
|
136
|
-
}
|
|
137
|
-
interface WithCanonicalForkId {
|
|
138
|
-
canonical: true;
|
|
139
|
-
}
|
|
140
|
-
interface WithLeafIndex {
|
|
141
|
-
leafIndex: bigint;
|
|
142
|
-
}
|
|
143
|
-
export type SerializedLeafValue = Buffer | {
|
|
144
|
-
value: Buffer;
|
|
145
|
-
} | {
|
|
146
|
-
value: Buffer;
|
|
147
|
-
slot: Buffer;
|
|
148
|
-
};
|
|
149
|
-
export type SerializedIndexedLeaf = {
|
|
150
|
-
value: Exclude<SerializedLeafValue, Buffer>;
|
|
151
|
-
nextIndex: bigint | number;
|
|
152
|
-
nextValue: Buffer;
|
|
153
|
-
};
|
|
154
|
-
interface WithLeafValues {
|
|
155
|
-
leaves: SerializedLeafValue[];
|
|
156
|
-
}
|
|
157
|
-
interface BlockShiftRequest extends WithCanonicalForkId {
|
|
158
|
-
toBlockNumber: bigint;
|
|
159
|
-
}
|
|
160
|
-
interface WithLeaves {
|
|
161
|
-
leaves: SerializedLeafValue[];
|
|
162
|
-
}
|
|
163
|
-
interface GetTreeInfoRequest extends WithTreeId, WithWorldStateRevision {
|
|
164
|
-
}
|
|
165
|
-
interface GetTreeInfoResponse {
|
|
166
|
-
treeId: MerkleTreeId;
|
|
167
|
-
depth: UInt32;
|
|
168
|
-
size: bigint | number;
|
|
169
|
-
root: Buffer;
|
|
170
|
-
}
|
|
171
|
-
interface GetBlockNumbersForLeafIndicesRequest extends WithTreeId, WithWorldStateRevision {
|
|
172
|
-
leafIndices: bigint[];
|
|
173
|
-
}
|
|
174
|
-
interface GetBlockNumbersForLeafIndicesResponse {
|
|
175
|
-
blockNumbers: bigint[];
|
|
176
|
-
}
|
|
177
|
-
interface GetSiblingPathRequest extends WithTreeId, WithLeafIndex, WithWorldStateRevision {
|
|
178
|
-
}
|
|
179
|
-
type GetSiblingPathResponse = Buffer[];
|
|
180
|
-
interface GetStateReferenceRequest extends WithWorldStateRevision {
|
|
181
|
-
}
|
|
182
|
-
interface GetStateReferenceResponse {
|
|
183
|
-
state: Record<MerkleTreeId, TreeStateReference>;
|
|
184
|
-
}
|
|
185
|
-
interface GetLeafRequest extends WithTreeId, WithWorldStateRevision, WithLeafIndex {
|
|
186
|
-
}
|
|
187
|
-
type GetLeafResponse = SerializedLeafValue | undefined;
|
|
188
|
-
interface GetLeafPreImageRequest extends WithTreeId, WithLeafIndex, WithWorldStateRevision {
|
|
189
|
-
}
|
|
190
|
-
type GetLeafPreImageResponse = SerializedIndexedLeaf | undefined;
|
|
191
|
-
interface FindLeafIndicesRequest extends WithTreeId, WithLeafValues, WithWorldStateRevision {
|
|
192
|
-
startIndex: bigint;
|
|
193
|
-
}
|
|
194
|
-
interface FindLeafIndicesResponse {
|
|
195
|
-
indices: bigint[];
|
|
196
|
-
}
|
|
197
|
-
interface FindLowLeafRequest extends WithTreeId, WithWorldStateRevision {
|
|
198
|
-
key: Fr;
|
|
199
|
-
}
|
|
200
|
-
interface FindLowLeafResponse {
|
|
201
|
-
index: bigint | number;
|
|
202
|
-
alreadyPresent: boolean;
|
|
203
|
-
}
|
|
204
|
-
interface AppendLeavesRequest extends WithTreeId, WithForkId, WithLeaves {
|
|
205
|
-
}
|
|
206
|
-
interface BatchInsertRequest extends WithTreeId, WithForkId, WithLeaves {
|
|
207
|
-
subtreeDepth: number;
|
|
208
|
-
}
|
|
209
|
-
interface BatchInsertResponse {
|
|
210
|
-
low_leaf_witness_data: ReadonlyArray<{
|
|
211
|
-
leaf: SerializedIndexedLeaf;
|
|
212
|
-
index: bigint | number;
|
|
213
|
-
path: Tuple<Buffer, number>;
|
|
214
|
-
}>;
|
|
215
|
-
sorted_leaves: ReadonlyArray<[SerializedLeafValue, UInt32]>;
|
|
216
|
-
subtree_path: Tuple<Buffer, number>;
|
|
217
|
-
}
|
|
218
|
-
interface SequentialInsertRequest extends WithTreeId, WithForkId, WithLeaves {
|
|
219
|
-
}
|
|
220
|
-
interface SequentialInsertResponse {
|
|
221
|
-
low_leaf_witness_data: ReadonlyArray<{
|
|
222
|
-
leaf: SerializedIndexedLeaf;
|
|
223
|
-
index: bigint | number;
|
|
224
|
-
path: Tuple<Buffer, number>;
|
|
225
|
-
}>;
|
|
226
|
-
insertion_witness_data: ReadonlyArray<{
|
|
227
|
-
leaf: SerializedIndexedLeaf;
|
|
228
|
-
index: bigint | number;
|
|
229
|
-
path: Tuple<Buffer, number>;
|
|
230
|
-
}>;
|
|
231
|
-
}
|
|
232
|
-
interface UpdateArchiveRequest extends WithForkId {
|
|
233
|
-
blockStateRef: BlockStateReference;
|
|
234
|
-
blockHeaderHash: Buffer;
|
|
235
|
-
}
|
|
236
|
-
interface SyncBlockRequest extends WithCanonicalForkId {
|
|
237
|
-
blockNumber: number;
|
|
238
|
-
blockStateRef: BlockStateReference;
|
|
239
|
-
blockHeaderHash: Fr;
|
|
240
|
-
paddedNoteHashes: readonly SerializedLeafValue[];
|
|
241
|
-
paddedL1ToL2Messages: readonly SerializedLeafValue[];
|
|
242
|
-
paddedNullifiers: readonly SerializedLeafValue[];
|
|
243
|
-
publicDataWrites: readonly SerializedLeafValue[];
|
|
244
|
-
}
|
|
245
|
-
interface CreateForkRequest extends WithCanonicalForkId {
|
|
246
|
-
latest: boolean;
|
|
247
|
-
blockNumber: number;
|
|
248
|
-
}
|
|
249
|
-
interface CreateForkResponse {
|
|
250
|
-
forkId: number;
|
|
251
|
-
}
|
|
252
|
-
interface DeleteForkRequest extends WithForkId {
|
|
253
|
-
}
|
|
254
|
-
export type WorldStateRequestCategories = WithForkId | WithWorldStateRevision | WithCanonicalForkId;
|
|
255
|
-
export declare function isWithForkId(body: WorldStateRequestCategories): body is WithForkId;
|
|
256
|
-
export declare function isWithRevision(body: WorldStateRequestCategories): body is WithWorldStateRevision;
|
|
257
|
-
export declare function isWithCanonical(body: WorldStateRequestCategories): body is WithCanonicalForkId;
|
|
258
|
-
export type WorldStateRequest = {
|
|
259
|
-
[WorldStateMessageType.GET_TREE_INFO]: GetTreeInfoRequest;
|
|
260
|
-
[WorldStateMessageType.GET_STATE_REFERENCE]: GetStateReferenceRequest;
|
|
261
|
-
[WorldStateMessageType.GET_INITIAL_STATE_REFERENCE]: WithCanonicalForkId;
|
|
262
|
-
[WorldStateMessageType.GET_LEAF_VALUE]: GetLeafRequest;
|
|
263
|
-
[WorldStateMessageType.GET_LEAF_PREIMAGE]: GetLeafPreImageRequest;
|
|
264
|
-
[WorldStateMessageType.GET_SIBLING_PATH]: GetSiblingPathRequest;
|
|
265
|
-
[WorldStateMessageType.GET_BLOCK_NUMBERS_FOR_LEAF_INDICES]: GetBlockNumbersForLeafIndicesRequest;
|
|
266
|
-
[WorldStateMessageType.FIND_LEAF_INDICES]: FindLeafIndicesRequest;
|
|
267
|
-
[WorldStateMessageType.FIND_LOW_LEAF]: FindLowLeafRequest;
|
|
268
|
-
[WorldStateMessageType.APPEND_LEAVES]: AppendLeavesRequest;
|
|
269
|
-
[WorldStateMessageType.BATCH_INSERT]: BatchInsertRequest;
|
|
270
|
-
[WorldStateMessageType.SEQUENTIAL_INSERT]: SequentialInsertRequest;
|
|
271
|
-
[WorldStateMessageType.UPDATE_ARCHIVE]: UpdateArchiveRequest;
|
|
272
|
-
[WorldStateMessageType.COMMIT]: WithCanonicalForkId;
|
|
273
|
-
[WorldStateMessageType.ROLLBACK]: WithCanonicalForkId;
|
|
274
|
-
[WorldStateMessageType.SYNC_BLOCK]: SyncBlockRequest;
|
|
275
|
-
[WorldStateMessageType.CREATE_FORK]: CreateForkRequest;
|
|
276
|
-
[WorldStateMessageType.DELETE_FORK]: DeleteForkRequest;
|
|
277
|
-
[WorldStateMessageType.REMOVE_HISTORICAL_BLOCKS]: BlockShiftRequest;
|
|
278
|
-
[WorldStateMessageType.UNWIND_BLOCKS]: BlockShiftRequest;
|
|
279
|
-
[WorldStateMessageType.FINALISE_BLOCKS]: BlockShiftRequest;
|
|
280
|
-
[WorldStateMessageType.GET_STATUS]: WithCanonicalForkId;
|
|
281
|
-
[WorldStateMessageType.CLOSE]: WithCanonicalForkId;
|
|
282
|
-
};
|
|
283
|
-
export type WorldStateResponse = {
|
|
284
|
-
[WorldStateMessageType.GET_TREE_INFO]: GetTreeInfoResponse;
|
|
285
|
-
[WorldStateMessageType.GET_STATE_REFERENCE]: GetStateReferenceResponse;
|
|
286
|
-
[WorldStateMessageType.GET_INITIAL_STATE_REFERENCE]: GetStateReferenceResponse;
|
|
287
|
-
[WorldStateMessageType.GET_LEAF_VALUE]: GetLeafResponse;
|
|
288
|
-
[WorldStateMessageType.GET_LEAF_PREIMAGE]: GetLeafPreImageResponse;
|
|
289
|
-
[WorldStateMessageType.GET_SIBLING_PATH]: GetSiblingPathResponse;
|
|
290
|
-
[WorldStateMessageType.GET_BLOCK_NUMBERS_FOR_LEAF_INDICES]: GetBlockNumbersForLeafIndicesResponse;
|
|
291
|
-
[WorldStateMessageType.FIND_LEAF_INDICES]: FindLeafIndicesResponse;
|
|
292
|
-
[WorldStateMessageType.FIND_LOW_LEAF]: FindLowLeafResponse;
|
|
293
|
-
[WorldStateMessageType.APPEND_LEAVES]: void;
|
|
294
|
-
[WorldStateMessageType.BATCH_INSERT]: BatchInsertResponse;
|
|
295
|
-
[WorldStateMessageType.SEQUENTIAL_INSERT]: SequentialInsertResponse;
|
|
296
|
-
[WorldStateMessageType.UPDATE_ARCHIVE]: void;
|
|
297
|
-
[WorldStateMessageType.COMMIT]: void;
|
|
298
|
-
[WorldStateMessageType.ROLLBACK]: void;
|
|
299
|
-
[WorldStateMessageType.SYNC_BLOCK]: WorldStateStatusFull;
|
|
300
|
-
[WorldStateMessageType.CREATE_FORK]: CreateForkResponse;
|
|
301
|
-
[WorldStateMessageType.DELETE_FORK]: void;
|
|
302
|
-
[WorldStateMessageType.REMOVE_HISTORICAL_BLOCKS]: WorldStateStatusFull;
|
|
303
|
-
[WorldStateMessageType.UNWIND_BLOCKS]: WorldStateStatusFull;
|
|
304
|
-
[WorldStateMessageType.FINALISE_BLOCKS]: WorldStateStatusSummary;
|
|
305
|
-
[WorldStateMessageType.GET_STATUS]: WorldStateStatusSummary;
|
|
306
|
-
[WorldStateMessageType.CLOSE]: void;
|
|
307
|
-
};
|
|
308
|
-
export type WorldStateRevision = {
|
|
309
|
-
forkId: number;
|
|
310
|
-
blockNumber: number;
|
|
311
|
-
includeUncommitted: boolean;
|
|
312
|
-
};
|
|
313
|
-
export declare function worldStateRevision(includeUncommitted: boolean, forkId: number | undefined, blockNumber: number | undefined): WorldStateRevision;
|
|
314
|
-
type TreeStateReference = readonly [Buffer, number | bigint];
|
|
315
|
-
type BlockStateReference = Map<Exclude<MerkleTreeId, MerkleTreeId.ARCHIVE>, TreeStateReference>;
|
|
316
|
-
export declare function treeStateReferenceToSnapshot([root, size]: TreeStateReference): AppendOnlyTreeSnapshot;
|
|
317
|
-
export declare function treeStateReference(snapshot: AppendOnlyTreeSnapshot): readonly [Buffer, bigint];
|
|
318
|
-
export declare function blockStateReference(state: StateReference): BlockStateReference;
|
|
319
|
-
export {};
|
|
320
|
-
//# sourceMappingURL=message.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/native/message.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,KAAK,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAClG,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEzD,oBAAY,qBAAqB;IAC/B,aAAa,MAAM;IACnB,mBAAmB,MAAA;IACnB,2BAA2B,MAAA;IAE3B,cAAc,MAAA;IACd,iBAAiB,MAAA;IACjB,gBAAgB,MAAA;IAChB,kCAAkC,MAAA;IAElC,iBAAiB,MAAA;IACjB,aAAa,MAAA;IAEb,aAAa,MAAA;IACb,YAAY,MAAA;IACZ,iBAAiB,MAAA;IAEjB,cAAc,MAAA;IAEd,MAAM,MAAA;IACN,QAAQ,MAAA;IAER,UAAU,MAAA;IAEV,WAAW,MAAA;IACX,WAAW,MAAA;IAEX,eAAe,MAAA;IACf,aAAa,MAAA;IACb,wBAAwB,M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ElE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,GAAG,mBAAmB,CAO9E"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import { type IndexedTreeId, type L2Block, type MerkleTreeReadOperations, type MerkleTreeWriteOperations } from '@aztec/circuit-types';
|
|
4
|
-
import { BlockHeader, EthAddress, Fr, type NullifierLeafPreimage } from '@aztec/circuits.js';
|
|
5
|
-
import { WorldStateInstrumentation } from '../instrumentation/instrumentation.js';
|
|
6
|
-
import { type MerkleTreeAdminDatabase as MerkleTreeDatabase } from '../world-state-db/merkle_tree_db.js';
|
|
7
|
-
import { type WorldStateStatusFull, type WorldStateStatusSummary } from './message.js';
|
|
8
|
-
import { NativeWorldState } from './native_world_state_instance.js';
|
|
9
|
-
export declare const WORLD_STATE_VERSION_FILE = "version";
|
|
10
|
-
export declare const WORLD_STATE_DB_VERSION = 1;
|
|
11
|
-
export declare class NativeWorldStateService implements MerkleTreeDatabase {
|
|
12
|
-
protected readonly instance: NativeWorldState;
|
|
13
|
-
protected readonly worldStateInstrumentation: WorldStateInstrumentation;
|
|
14
|
-
protected readonly log: import("@aztec/foundation/log").Logger;
|
|
15
|
-
private readonly cleanup;
|
|
16
|
-
protected initialHeader: BlockHeader | undefined;
|
|
17
|
-
private cachedStatusSummary;
|
|
18
|
-
protected constructor(instance: NativeWorldState, worldStateInstrumentation: WorldStateInstrumentation, log?: import("@aztec/foundation/log").Logger, cleanup?: () => Promise<void>);
|
|
19
|
-
static new(rollupAddress: EthAddress, dataDir: string, dbMapSizeKb: number, instrumentation?: WorldStateInstrumentation, log?: import("@aztec/foundation/log").Logger, cleanup?: () => Promise<void>): Promise<NativeWorldStateService>;
|
|
20
|
-
static tmp(rollupAddress?: EthAddress, cleanupTmpDir?: boolean, instrumentation?: WorldStateInstrumentation): Promise<NativeWorldStateService>;
|
|
21
|
-
protected init(): Promise<void>;
|
|
22
|
-
getCommitted(): MerkleTreeReadOperations;
|
|
23
|
-
getSnapshot(blockNumber: number): MerkleTreeReadOperations;
|
|
24
|
-
fork(blockNumber?: number): Promise<MerkleTreeWriteOperations>;
|
|
25
|
-
getInitialHeader(): BlockHeader;
|
|
26
|
-
handleL2BlockAndMessages(l2Block: L2Block, l1ToL2Messages: Fr[]): Promise<WorldStateStatusFull>;
|
|
27
|
-
close(): Promise<void>;
|
|
28
|
-
private buildInitialHeader;
|
|
29
|
-
private sanitiseAndCacheSummaryFromFull;
|
|
30
|
-
private sanitiseAndCacheSummary;
|
|
31
|
-
private deleteCachedSummary;
|
|
32
|
-
/**
|
|
33
|
-
* Advances the finalised block number to be the number provided
|
|
34
|
-
* @param toBlockNumber The block number that is now the tip of the finalised chain
|
|
35
|
-
* @returns The new WorldStateStatus
|
|
36
|
-
*/
|
|
37
|
-
setFinalised(toBlockNumber: bigint): Promise<WorldStateStatusSummary>;
|
|
38
|
-
/**
|
|
39
|
-
* Removes all historical snapshots up to but not including the given block number
|
|
40
|
-
* @param toBlockNumber The block number of the new oldest historical block
|
|
41
|
-
* @returns The new WorldStateStatus
|
|
42
|
-
*/
|
|
43
|
-
removeHistoricalBlocks(toBlockNumber: bigint): Promise<WorldStateStatusFull>;
|
|
44
|
-
/**
|
|
45
|
-
* Removes all pending blocks down to but not including the given block number
|
|
46
|
-
* @param toBlockNumber The block number of the new tip of the pending chain,
|
|
47
|
-
* @returns The new WorldStateStatus
|
|
48
|
-
*/
|
|
49
|
-
unwindBlocks(toBlockNumber: bigint): Promise<WorldStateStatusFull>;
|
|
50
|
-
getStatusSummary(): Promise<WorldStateStatusSummary>;
|
|
51
|
-
updateLeaf<ID extends IndexedTreeId>(_treeId: ID, _leaf: NullifierLeafPreimage | Buffer, _index: bigint): Promise<void>;
|
|
52
|
-
private getInitialStateReference;
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=native_world_state.d.ts.map
|
|
@@ -1 +0,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uBAAuB,CAAC;WAiCtB,GAAG,CACd,aAAa,aAAkB,EAC/B,aAAa,UAAO,EACpB,eAAe,4BAAsD,GACpE,OAAO,CAAC,uBAAuB,CAAC;cAmBnB,IAAI;IAqBb,YAAY,IAAI,wBAAwB;IAIxC,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,wBAAwB;IAIpD,IAAI,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC;IASpE,gBAAgB,IAAI,WAAW;IAIzB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAqC/F,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAKrB,kBAAkB;IAKhC,OAAO,CAAC,+BAA+B;IAMvC,OAAO,CAAC,uBAAuB;IAM/B,OAAO,CAAC,mBAAmB;IAI3B;;;;OAIG;IACU,YAAY,CAAC,aAAa,EAAE,MAAM;IAa/C;;;;OAIG;IACU,sBAAsB,CAAC,aAAa,EAAE,MAAM;IAYzD;;;;OAIG;IACU,YAAY,CAAC,aAAa,EAAE,MAAM;IAYlC,gBAAgB;IAW7B,UAAU,CAAC,EAAE,SAAS,aAAa,EACjC,OAAO,EAAE,EAAE,EACX,KAAK,EAAE,qBAAqB,GAAG,MAAM,EACrC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC;YAIF,wBAAwB;CAYvC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { type WorldStateInstrumentation } from '../instrumentation/instrumentation.js';
|
|
2
|
-
import { WorldStateMessageType, type WorldStateRequest, type WorldStateRequestCategories, type WorldStateResponse } from './message.js';
|
|
3
|
-
export interface NativeWorldStateInstance {
|
|
4
|
-
call<T extends WorldStateMessageType>(messageType: T, body: WorldStateRequest[T] & WorldStateRequestCategories): Promise<WorldStateResponse[T]>;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Strongly-typed interface to access the WorldState class in the native world_state_napi module.
|
|
8
|
-
*/
|
|
9
|
-
export declare class NativeWorldState implements NativeWorldStateInstance {
|
|
10
|
-
private instrumentation;
|
|
11
|
-
private log;
|
|
12
|
-
private open;
|
|
13
|
-
private queues;
|
|
14
|
-
private instance;
|
|
15
|
-
/** Creates a new native WorldState instance */
|
|
16
|
-
constructor(dataDir: string, dbMapSizeKb: number, instrumentation: WorldStateInstrumentation, log?: import("@aztec/foundation/log").Logger);
|
|
17
|
-
/**
|
|
18
|
-
* Sends a message to the native instance and returns the response.
|
|
19
|
-
* @param messageType - The type of message to send
|
|
20
|
-
* @param body - The message body
|
|
21
|
-
* @param responseHandler - A callback accepting the response, executed on the job queue
|
|
22
|
-
* @param errorHandler - A callback called on request error, executed on the job queue
|
|
23
|
-
* @returns The response to the message
|
|
24
|
-
*/
|
|
25
|
-
call<T extends WorldStateMessageType>(messageType: T, body: WorldStateRequest[T] & WorldStateRequestCategories, responseHandler?: (response: WorldStateResponse[T]) => WorldStateResponse[T], errorHandler?: (_: string) => void): Promise<WorldStateResponse[T]>;
|
|
26
|
-
/**
|
|
27
|
-
* Stops the native instance.
|
|
28
|
-
*/
|
|
29
|
-
close(): Promise<void>;
|
|
30
|
-
private _sendMessage;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=native_world_state_instance.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"native_world_state_instance.d.ts","sourceRoot":"","sources":["../../src/native/native_world_state_instance.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,EACL,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,KAAK,2BAA2B,EAChC,KAAK,kBAAkB,EAIxB,MAAM,cAAc,CAAC;AAKtB,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,CAAC,SAAS,qBAAqB,EAClC,WAAW,EAAE,CAAC,EACd,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,2BAA2B,GACvD,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,qBAAa,gBAAiB,YAAW,wBAAwB;IAY7D,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,GAAG;IAZb,OAAO,CAAC,IAAI,CAAQ;IAGpB,OAAO,CAAC,MAAM,CAAyC;IAEvD,OAAO,CAAC,QAAQ,CAA+E;IAE/F,+CAA+C;gBAE7C,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACX,eAAe,EAAE,yBAAyB,EAC1C,GAAG,yCAAuC;IA4BpD;;;;;;;OAOG;IACU,IAAI,CAAC,CAAC,SAAS,qBAAqB,EAC/C,WAAW,EAAE,CAAC,EACd,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,2BAA2B,EAExD,eAAe,cAAc,kBAAkB,CAAC,CAAC,CAAC,KAAG,kBAAkB,CAAC,CAAC,CAAa,EACtF,YAAY,OAAO,MAAM,SAAO,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAuDjC;;OAEG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAiBrB,YAAY;CA8D3B"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { WorldStateMessageType } from './message.js';
|
|
2
|
-
export declare const MUTATING_MSG_TYPES: Set<WorldStateMessageType>;
|
|
3
|
-
export declare class WorldStateOpsQueue {
|
|
4
|
-
private requests;
|
|
5
|
-
private inFlightMutatingCount;
|
|
6
|
-
private inFlightCount;
|
|
7
|
-
private stopPromise?;
|
|
8
|
-
private stopResolve?;
|
|
9
|
-
private requestId;
|
|
10
|
-
private ops;
|
|
11
|
-
execute(request: () => Promise<any>, messageType: WorldStateMessageType, committedOnly: boolean): Promise<any>;
|
|
12
|
-
private executeMutating;
|
|
13
|
-
private executeNonMutatingUncommitted;
|
|
14
|
-
private executeNonMutatingCommitted;
|
|
15
|
-
private checkAndEnqueue;
|
|
16
|
-
private sendEnqueuedRequest;
|
|
17
|
-
stop(): Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=world_state_ops_queue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"world_state_ops_queue.d.ts","sourceRoot":"","sources":["../../src/native/world_state_ops_queue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAyBrD,eAAO,MAAM,kBAAkB,4BAa7B,CAAC;AAGH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,qBAAqB,CAAK;IAClC,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,WAAW,CAAC,CAAgB;IACpC,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,GAAG,CAAwC;IAI5C,OAAO,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,aAAa,EAAE,OAAO;IAyBtG,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,6BAA6B;IAYrC,OAAO,CAAC,2BAA2B;IAUnC,OAAO,CAAC,eAAe;IAyCvB,OAAO,CAAC,mBAAmB;IAgBpB,IAAI;CAiBZ"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { EthAddress } from '@aztec/circuits.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export declare class WorldStateVersion {
|
|
4
|
-
readonly version: number;
|
|
5
|
-
readonly rollupAddress: EthAddress;
|
|
6
|
-
constructor(version: number, rollupAddress: EthAddress);
|
|
7
|
-
static readVersion(filename: string): Promise<WorldStateVersion | undefined>;
|
|
8
|
-
writeVersionFile(filename: string): Promise<void>;
|
|
9
|
-
static get schema(): z.ZodEffects<z.ZodObject<{
|
|
10
|
-
version: z.ZodNumber;
|
|
11
|
-
rollupAddress: z.ZodType<EthAddress, any, string>;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
version: number;
|
|
14
|
-
rollupAddress: EthAddress;
|
|
15
|
-
}, {
|
|
16
|
-
version: number;
|
|
17
|
-
rollupAddress: string;
|
|
18
|
-
}>, WorldStateVersion, {
|
|
19
|
-
version: number;
|
|
20
|
-
rollupAddress: string;
|
|
21
|
-
}>;
|
|
22
|
-
static empty(): WorldStateVersion;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=world_state_version.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"world_state_version.d.ts","sourceRoot":"","sources":["../../src/native/world_state_version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIhD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,qBAAa,iBAAiB;aACA,OAAO,EAAE,MAAM;aAAkB,aAAa,EAAE,UAAU;gBAA1D,OAAO,EAAE,MAAM,EAAkB,aAAa,EAAE,UAAU;WAEzE,WAAW,CAAC,QAAQ,EAAE,MAAM;IAK5B,gBAAgB,CAAC,QAAQ,EAAE,MAAM;IAK9C,MAAM,KAAK,MAAM;;;;;;;;;;;;OAOhB;IAED,MAAM,CAAC,KAAK;CAGb"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type ConfigMappingsType } from '@aztec/foundation/config';
|
|
2
|
-
/** World State synchronizer configuration values. */
|
|
3
|
-
export interface WorldStateConfig {
|
|
4
|
-
/** The frequency in which to check. */
|
|
5
|
-
worldStateBlockCheckIntervalMS: number;
|
|
6
|
-
/** Whether to follow only the proven chain. */
|
|
7
|
-
worldStateProvenBlocksOnly: boolean;
|
|
8
|
-
/** Size of the batch for each get-blocks request from the synchronizer to the archiver. */
|
|
9
|
-
worldStateBlockRequestBatchSize?: number;
|
|
10
|
-
/** The map size to be provided to LMDB for each world state tree DB, optional, will inherit from the general dataStoreMapSizeKB if not specified*/
|
|
11
|
-
worldStateDbMapSizeKb?: number;
|
|
12
|
-
/** Optional directory for the world state DB, if unspecified will default to the general data directory */
|
|
13
|
-
worldStateDataDirectory?: string;
|
|
14
|
-
/** The number of historic blocks to maintain */
|
|
15
|
-
worldStateBlockHistory: number;
|
|
16
|
-
}
|
|
17
|
-
export declare const worldStateConfigMappings: ConfigMappingsType<WorldStateConfig>;
|
|
18
|
-
/**
|
|
19
|
-
* Returns the configuration values for the world state synchronizer.
|
|
20
|
-
* @returns The configuration values for the world state synchronizer.
|
|
21
|
-
*/
|
|
22
|
-
export declare function getWorldStateConfigFromEnv(): WorldStateConfig;
|
|
23
|
-
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/synchronizer/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,0BAA0B,CAAC;AAElC,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,8BAA8B,EAAE,MAAM,CAAC;IAEvC,+CAA+C;IAC/C,0BAA0B,EAAE,OAAO,CAAC;IAEpC,2FAA2F;IAC3F,+BAA+B,CAAC,EAAE,MAAM,CAAC;IAEzC,mJAAmJ;IACnJ,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,2GAA2G;IAC3G,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAEjC,gDAAgD;IAChD,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED,eAAO,MAAM,wBAAwB,EAAE,kBAAkB,CAAC,gBAAgB,CA+BzE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,gBAAgB,CAE7D"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type L1ToL2MessageSource, type L2BlockSource } from '@aztec/circuit-types';
|
|
2
|
-
import { type DataStoreConfig } from '@aztec/kv-store/config';
|
|
3
|
-
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
4
|
-
import { WorldStateInstrumentation } from '../instrumentation/instrumentation.js';
|
|
5
|
-
import { NativeWorldStateService } from '../native/native_world_state.js';
|
|
6
|
-
import { type WorldStateConfig } from './config.js';
|
|
7
|
-
import { ServerWorldStateSynchronizer } from './server_world_state_synchronizer.js';
|
|
8
|
-
export declare function createWorldStateSynchronizer(config: WorldStateConfig & DataStoreConfig, l2BlockSource: L2BlockSource & L1ToL2MessageSource, client?: TelemetryClient): Promise<ServerWorldStateSynchronizer>;
|
|
9
|
-
export declare function createWorldState(config: WorldStateConfig & DataStoreConfig, instrumentation: WorldStateInstrumentation): Promise<NativeWorldStateService>;
|
|
10
|
-
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/synchronizer/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,yBAAyB,CAAC;AAEnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAEpF,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,gBAAgB,GAAG,eAAe,EAC1C,aAAa,EAAE,aAAa,GAAG,mBAAmB,EAClD,MAAM,GAAE,eAAsC,yCAK/C;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,gBAAgB,GAAG,eAAe,EAC1C,eAAe,EAAE,yBAAyB,oCAyB3C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/synchronizer/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,cAAc,CAAC"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import { type L1ToL2MessageSource, type L2BlockSource, type L2BlockStream, type L2BlockStreamEvent, type L2BlockStreamEventHandler, type L2BlockStreamLocalDataProvider, type L2Tips, type MerkleTreeReadOperations, type MerkleTreeWriteOperations, type WorldStateSynchronizer, type WorldStateSynchronizerStatus } from '@aztec/circuit-types';
|
|
4
|
-
import { type Fr } from '@aztec/foundation/fields';
|
|
5
|
-
import { WorldStateInstrumentation } from '../instrumentation/instrumentation.js';
|
|
6
|
-
import { type MerkleTreeAdminDatabase } from '../world-state-db/merkle_tree_db.js';
|
|
7
|
-
import { type WorldStateConfig } from './config.js';
|
|
8
|
-
/**
|
|
9
|
-
* Synchronizes the world state with the L2 blocks from a L2BlockSource via a block stream.
|
|
10
|
-
* The synchronizer will download the L2 blocks from the L2BlockSource and update the merkle trees.
|
|
11
|
-
* Handles chain reorgs via the L2BlockStream.
|
|
12
|
-
*/
|
|
13
|
-
export declare class ServerWorldStateSynchronizer implements WorldStateSynchronizer, L2BlockStreamLocalDataProvider, L2BlockStreamEventHandler {
|
|
14
|
-
private readonly merkleTreeDb;
|
|
15
|
-
private readonly l2BlockSource;
|
|
16
|
-
private readonly config;
|
|
17
|
-
private instrumentation;
|
|
18
|
-
private readonly log;
|
|
19
|
-
private readonly merkleTreeCommitted;
|
|
20
|
-
private latestBlockNumberAtStart;
|
|
21
|
-
private historyToKeep;
|
|
22
|
-
private currentState;
|
|
23
|
-
private latestBlockHashQuery;
|
|
24
|
-
private syncPromise;
|
|
25
|
-
protected blockStream: L2BlockStream | undefined;
|
|
26
|
-
constructor(merkleTreeDb: MerkleTreeAdminDatabase, l2BlockSource: L2BlockSource & L1ToL2MessageSource, config: WorldStateConfig, instrumentation?: WorldStateInstrumentation, log?: import("@aztec/foundation/log").Logger);
|
|
27
|
-
getCommitted(): MerkleTreeReadOperations;
|
|
28
|
-
getSnapshot(blockNumber: number): MerkleTreeReadOperations;
|
|
29
|
-
fork(blockNumber?: number): Promise<MerkleTreeWriteOperations>;
|
|
30
|
-
start(): Promise<void | import("@aztec/foundation/promise").PromiseWithResolvers<void>>;
|
|
31
|
-
protected createBlockStream(): L2BlockStream;
|
|
32
|
-
stop(): Promise<void>;
|
|
33
|
-
status(): Promise<WorldStateSynchronizerStatus>;
|
|
34
|
-
getLatestBlockNumber(): Promise<number>;
|
|
35
|
-
/**
|
|
36
|
-
* Forces an immediate sync.
|
|
37
|
-
* @param targetBlockNumber - The target block number that we must sync to. Will download unproven blocks if needed to reach it. Throws if cannot be reached.
|
|
38
|
-
* @returns A promise that resolves with the block number the world state was synced to
|
|
39
|
-
*/
|
|
40
|
-
syncImmediate(targetBlockNumber?: number): Promise<number>;
|
|
41
|
-
/** Returns the L2 block hash for a given number. Used by the L2BlockStream for detecting reorgs. */
|
|
42
|
-
getL2BlockHash(number: number): Promise<string | undefined>;
|
|
43
|
-
/** Returns the latest L2 block number for each tip of the chain (latest, proven, finalized). */
|
|
44
|
-
getL2Tips(): Promise<L2Tips>;
|
|
45
|
-
/** Handles an event emitted by the block stream. */
|
|
46
|
-
handleBlockStreamEvent(event: L2BlockStreamEvent): Promise<void>;
|
|
47
|
-
/**
|
|
48
|
-
* Handles a list of L2 blocks (i.e. Inserts the new note hashes into the merkle tree).
|
|
49
|
-
* @param l2Blocks - The L2 blocks to handle.
|
|
50
|
-
* @returns Whether the block handled was produced by this same node.
|
|
51
|
-
*/
|
|
52
|
-
private handleL2Blocks;
|
|
53
|
-
/**
|
|
54
|
-
* Handles a single L2 block (i.e. Inserts the new note hashes into the merkle tree).
|
|
55
|
-
* @param l2Block - The L2 block to handle.
|
|
56
|
-
* @param l1ToL2Messages - The L1 to L2 messages for the block.
|
|
57
|
-
* @returns Whether the block handled was produced by this same node.
|
|
58
|
-
*/
|
|
59
|
-
private handleL2Block;
|
|
60
|
-
private handleChainFinalized;
|
|
61
|
-
private handleChainProven;
|
|
62
|
-
private handleChainPruned;
|
|
63
|
-
/**
|
|
64
|
-
* Method to set the value of the current state.
|
|
65
|
-
* @param newState - New state value.
|
|
66
|
-
*/
|
|
67
|
-
private setCurrentState;
|
|
68
|
-
/**
|
|
69
|
-
* Verifies that the L1 to L2 messages hash to the block inHash.
|
|
70
|
-
* @param l1ToL2Messages - The L1 to L2 messages for the block.
|
|
71
|
-
* @param inHash - The inHash of the block.
|
|
72
|
-
* @throws If the L1 to L2 messages do not hash to the block inHash.
|
|
73
|
-
*/
|
|
74
|
-
protected verifyMessagesHashToInHash(l1ToL2Messages: Fr[], inHash: Buffer): Promise<void>;
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=server_world_state_synchronizer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server_world_state_synchronizer.d.ts","sourceRoot":"","sources":["../../src/synchronizer/server_world_state_synchronizer.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,KAAK,mBAAmB,EAGxB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,MAAM,EAEX,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAE9B,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EAClC,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAOnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAElF,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,qCAAqC,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AM,CAAC;IAYzC,oDAAoD;IACvC,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB7E;;;;OAIG;YACW,cAAc;IAuB5B;;;;;OAKG;YACW,aAAa;YAkBb,oBAAoB;IAclC,OAAO,CAAC,iBAAiB;YAKX,iBAAiB;IAO/B;;;OAGG;IACH,OAAO,CAAC,eAAe;IAKvB;;;;;OAKG;cACa,0BAA0B,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM;CAahF"}
|
package/dest/test/index.d.ts
DELETED
package/dest/test/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|