@aztec/world-state 0.77.0-testnet-ignition.26 → 0.77.0-testnet-ignition.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -10
- package/dest/index.d.ts +0 -5
- package/dest/index.d.ts.map +0 -1
- package/dest/instrumentation/instrumentation.d.ts +0 -22
- package/dest/instrumentation/instrumentation.d.ts.map +0 -1
- package/dest/native/fork_checkpoint.d.ts +0 -10
- package/dest/native/fork_checkpoint.d.ts.map +0 -1
- package/dest/native/index.d.ts +0 -3
- package/dest/native/index.d.ts.map +0 -1
- package/dest/native/merkle_trees_facade.d.ts +0 -42
- package/dest/native/merkle_trees_facade.d.ts.map +0 -1
- package/dest/native/message.d.ts +0 -331
- package/dest/native/message.d.ts.map +0 -1
- package/dest/native/native_world_state.d.ts +0 -58
- package/dest/native/native_world_state.d.ts.map +0 -1
- package/dest/native/native_world_state_instance.d.ts +0 -33
- 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 -12
- 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 -79
- 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 -19
- package/dest/test/utils.d.ts.map +0 -1
- package/dest/testing.d.ts +0 -10
- package/dest/testing.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 -68
- package/dest/world-state-db/merkle_tree_db.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/world-state",
|
|
3
|
-
"version": "0.77.0-testnet-ignition.
|
|
3
|
+
"version": "0.77.0-testnet-ignition.28",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -62,19 +62,19 @@
|
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@aztec/constants": "0.77.0-testnet-ignition.
|
|
66
|
-
"@aztec/foundation": "0.77.0-testnet-ignition.
|
|
67
|
-
"@aztec/kv-store": "0.77.0-testnet-ignition.
|
|
68
|
-
"@aztec/merkle-tree": "0.77.0-testnet-ignition.
|
|
69
|
-
"@aztec/native": "0.77.0-testnet-ignition.
|
|
70
|
-
"@aztec/protocol-contracts": "0.77.0-testnet-ignition.
|
|
71
|
-
"@aztec/stdlib": "0.77.0-testnet-ignition.
|
|
72
|
-
"@aztec/telemetry-client": "0.77.0-testnet-ignition.
|
|
65
|
+
"@aztec/constants": "0.77.0-testnet-ignition.28",
|
|
66
|
+
"@aztec/foundation": "0.77.0-testnet-ignition.28",
|
|
67
|
+
"@aztec/kv-store": "0.77.0-testnet-ignition.28",
|
|
68
|
+
"@aztec/merkle-tree": "0.77.0-testnet-ignition.28",
|
|
69
|
+
"@aztec/native": "0.77.0-testnet-ignition.28",
|
|
70
|
+
"@aztec/protocol-contracts": "0.77.0-testnet-ignition.28",
|
|
71
|
+
"@aztec/stdlib": "0.77.0-testnet-ignition.28",
|
|
72
|
+
"@aztec/telemetry-client": "0.77.0-testnet-ignition.28",
|
|
73
73
|
"tslib": "^2.4.0",
|
|
74
74
|
"zod": "^3.23.8"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@aztec/archiver": "0.77.0-testnet-ignition.
|
|
77
|
+
"@aztec/archiver": "0.77.0-testnet-ignition.28",
|
|
78
78
|
"@jest/globals": "^29.5.0",
|
|
79
79
|
"@types/jest": "^29.5.0",
|
|
80
80
|
"@types/levelup": "^5.1.2",
|
package/dest/index.d.ts
DELETED
package/dest/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
2
|
-
import { WorldStateMessageType, type WorldStateStatusFull } from '../native/message.js';
|
|
3
|
-
export declare class WorldStateInstrumentation {
|
|
4
|
-
readonly telemetry: TelemetryClient;
|
|
5
|
-
private log;
|
|
6
|
-
private dbMapSize;
|
|
7
|
-
private treeSize;
|
|
8
|
-
private unfinalisedHeight;
|
|
9
|
-
private finalisedHeight;
|
|
10
|
-
private oldestBlock;
|
|
11
|
-
private dbNumItems;
|
|
12
|
-
private dbUsedSize;
|
|
13
|
-
private requestHistogram;
|
|
14
|
-
private criticalErrors;
|
|
15
|
-
constructor(telemetry: TelemetryClient, log?: import("@aztec/foundation/log").Logger);
|
|
16
|
-
private updateTreeStats;
|
|
17
|
-
private updateTreeDBStats;
|
|
18
|
-
updateWorldStateMetrics(worldStateStatus: WorldStateStatusFull): void;
|
|
19
|
-
recordRoundTrip(timeUs: number, request: WorldStateMessageType): void;
|
|
20
|
-
incCriticalErrors(errorType: 'synch_pending_block' | 'finalize_block' | 'prune_pending_block' | 'prune_historical_block'): void;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=instrumentation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../src/instrumentation/instrumentation.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAIL,qBAAqB,EACrB,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAa9B,qBAAa,yBAAyB;aAWR,SAAS,EAAE,eAAe;IAAE,OAAO,CAAC,GAAG;IAVnE,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,iBAAiB,CAAQ;IACjC,OAAO,CAAC,eAAe,CAAQ;IAC/B,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,gBAAgB,CAAY;IACpC,OAAO,CAAC,cAAc,CAAgB;gBAEV,SAAS,EAAE,eAAe,EAAU,GAAG,yCAA8C;IAiDjH,OAAO,CAAC,eAAe;IAwBvB,OAAO,CAAC,iBAAiB;IAWlB,uBAAuB,CAAC,gBAAgB,EAAE,oBAAoB;IAgC9D,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB;IAQ9D,iBAAiB,CACtB,SAAS,EAAE,qBAAqB,GAAG,gBAAgB,GAAG,qBAAqB,GAAG,wBAAwB;CAMzG"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { MerkleTreeCheckpointOperations } from '@aztec/stdlib/interfaces/server';
|
|
2
|
-
export declare class ForkCheckpoint {
|
|
3
|
-
private readonly fork;
|
|
4
|
-
private completed;
|
|
5
|
-
private constructor();
|
|
6
|
-
static new(fork: MerkleTreeCheckpointOperations): Promise<ForkCheckpoint>;
|
|
7
|
-
commit(): Promise<void>;
|
|
8
|
-
revert(): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=fork_checkpoint.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fork_checkpoint.d.ts","sourceRoot":"","sources":["../../src/native/fork_checkpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AAEtF,qBAAa,cAAc;IAGL,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFzC,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO;WAEM,GAAG,CAAC,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,cAAc,CAAC;IAKzE,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IASvB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ9B"}
|
package/dest/native/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/native/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
4
|
-
import { type IndexedTreeLeafPreimage, SiblingPath } from '@aztec/foundation/trees';
|
|
5
|
-
import type { BatchInsertionResult, IndexedTreeId, MerkleTreeLeafType, MerkleTreeReadOperations, MerkleTreeWriteOperations, SequentialInsertionResult, TreeInfo } from '@aztec/stdlib/interfaces/server';
|
|
6
|
-
import { MerkleTreeId, NullifierLeaf, PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
7
|
-
import { type BlockHeader, StateReference } from '@aztec/stdlib/tx';
|
|
8
|
-
import { type SerializedLeafValue, type WorldStateRevision } from './message.js';
|
|
9
|
-
import type { NativeWorldStateInstance } from './native_world_state_instance.js';
|
|
10
|
-
export declare class MerkleTreesFacade implements MerkleTreeReadOperations {
|
|
11
|
-
protected readonly instance: NativeWorldStateInstance;
|
|
12
|
-
protected readonly initialHeader: BlockHeader;
|
|
13
|
-
protected readonly revision: WorldStateRevision;
|
|
14
|
-
constructor(instance: NativeWorldStateInstance, initialHeader: BlockHeader, revision: WorldStateRevision);
|
|
15
|
-
getInitialHeader(): BlockHeader;
|
|
16
|
-
findLeafIndices(treeId: MerkleTreeId, values: MerkleTreeLeafType<MerkleTreeId>[]): Promise<(bigint | undefined)[]>;
|
|
17
|
-
findLeafIndicesAfter(treeId: MerkleTreeId, leaves: MerkleTreeLeafType<MerkleTreeId>[], startIndex: bigint): Promise<(bigint | undefined)[]>;
|
|
18
|
-
getLeafPreimage(treeId: IndexedTreeId, leafIndex: bigint): Promise<IndexedTreeLeafPreimage | undefined>;
|
|
19
|
-
getLeafValue<ID extends MerkleTreeId>(treeId: ID, leafIndex: bigint): Promise<MerkleTreeLeafType<ID> | undefined>;
|
|
20
|
-
getPreviousValueIndex(treeId: IndexedTreeId, value: bigint): Promise<{
|
|
21
|
-
index: bigint;
|
|
22
|
-
alreadyPresent: boolean;
|
|
23
|
-
} | undefined>;
|
|
24
|
-
getSiblingPath<N extends number>(treeId: MerkleTreeId, leafIndex: bigint): Promise<SiblingPath<N>>;
|
|
25
|
-
getStateReference(): Promise<StateReference>;
|
|
26
|
-
getInitialStateReference(): Promise<StateReference>;
|
|
27
|
-
getTreeInfo(treeId: MerkleTreeId): Promise<TreeInfo>;
|
|
28
|
-
getBlockNumbersForLeafIndices<ID extends MerkleTreeId>(treeId: ID, leafIndices: bigint[]): Promise<(bigint | undefined)[]>;
|
|
29
|
-
}
|
|
30
|
-
export declare class MerkleTreesForkFacade extends MerkleTreesFacade implements MerkleTreeWriteOperations {
|
|
31
|
-
constructor(instance: NativeWorldStateInstance, initialHeader: BlockHeader, revision: WorldStateRevision);
|
|
32
|
-
updateArchive(header: BlockHeader): Promise<void>;
|
|
33
|
-
appendLeaves<ID extends MerkleTreeId>(treeId: ID, leaves: MerkleTreeLeafType<ID>[]): Promise<void>;
|
|
34
|
-
batchInsert<TreeHeight extends number, SubtreeSiblingPathHeight extends number, ID extends IndexedTreeId>(treeId: ID, rawLeaves: Buffer[], subtreeHeight: number): Promise<BatchInsertionResult<TreeHeight, SubtreeSiblingPathHeight>>;
|
|
35
|
-
sequentialInsert<TreeHeight extends number, ID extends IndexedTreeId>(treeId: ID, rawLeaves: Buffer[]): Promise<SequentialInsertionResult<TreeHeight>>;
|
|
36
|
-
close(): Promise<void>;
|
|
37
|
-
createCheckpoint(): Promise<void>;
|
|
38
|
-
commitCheckpoint(): Promise<void>;
|
|
39
|
-
revertCheckpoint(): Promise<void>;
|
|
40
|
-
}
|
|
41
|
-
export declare function serializeLeaf(leaf: Fr | NullifierLeaf | PublicDataTreeLeaf): SerializedLeafValue;
|
|
42
|
-
//# sourceMappingURL=merkle_trees_facade.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"merkle_trees_facade.d.ts","sourceRoot":"","sources":["../../src/native/merkle_trees_facade.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,KAAK,uBAAuB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,QAAQ,EACT,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,aAAa,EAEb,kBAAkB,EAEnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,WAAW,EAAyB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAI3F,OAAO,EAEL,KAAK,mBAAmB,EAExB,KAAK,kBAAkB,EAGxB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAEjF,qBAAa,iBAAkB,YAAW,wBAAwB;IAE9D,SAAS,CAAC,QAAQ,CA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dest/native/message.d.ts
DELETED
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
4
|
-
import type { Tuple } from '@aztec/foundation/serialize';
|
|
5
|
-
import { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
|
|
6
|
-
import type { StateReference } from '@aztec/stdlib/tx';
|
|
7
|
-
import type { UInt32 } from '@aztec/stdlib/types';
|
|
8
|
-
export declare enum WorldStateMessageType {
|
|
9
|
-
GET_TREE_INFO = 100,
|
|
10
|
-
GET_STATE_REFERENCE = 101,
|
|
11
|
-
GET_INITIAL_STATE_REFERENCE = 102,
|
|
12
|
-
GET_LEAF_VALUE = 103,
|
|
13
|
-
GET_LEAF_PREIMAGE = 104,
|
|
14
|
-
GET_SIBLING_PATH = 105,
|
|
15
|
-
GET_BLOCK_NUMBERS_FOR_LEAF_INDICES = 106,
|
|
16
|
-
FIND_LEAF_INDICES = 107,
|
|
17
|
-
FIND_LOW_LEAF = 108,
|
|
18
|
-
APPEND_LEAVES = 109,
|
|
19
|
-
BATCH_INSERT = 110,
|
|
20
|
-
SEQUENTIAL_INSERT = 111,
|
|
21
|
-
UPDATE_ARCHIVE = 112,
|
|
22
|
-
COMMIT = 113,
|
|
23
|
-
ROLLBACK = 114,
|
|
24
|
-
SYNC_BLOCK = 115,
|
|
25
|
-
CREATE_FORK = 116,
|
|
26
|
-
DELETE_FORK = 117,
|
|
27
|
-
FINALISE_BLOCKS = 118,
|
|
28
|
-
UNWIND_BLOCKS = 119,
|
|
29
|
-
REMOVE_HISTORICAL_BLOCKS = 120,
|
|
30
|
-
GET_STATUS = 121,
|
|
31
|
-
CREATE_CHECKPOINT = 122,
|
|
32
|
-
COMMIT_CHECKPOINT = 123,
|
|
33
|
-
REVERT_CHECKPOINT = 124,
|
|
34
|
-
CLOSE = 999
|
|
35
|
-
}
|
|
36
|
-
interface WithTreeId {
|
|
37
|
-
treeId: MerkleTreeId;
|
|
38
|
-
}
|
|
39
|
-
export interface WorldStateStatusSummary {
|
|
40
|
-
/** Last block number that can still be unwound. */
|
|
41
|
-
unfinalisedBlockNumber: bigint;
|
|
42
|
-
/** Last block number that is finalised and cannot be unwound. */
|
|
43
|
-
finalisedBlockNumber: bigint;
|
|
44
|
-
/** Oldest block still available for historical queries and forks. */
|
|
45
|
-
oldestHistoricalBlock: bigint;
|
|
46
|
-
/** Whether the trees are in sync with each other */
|
|
47
|
-
treesAreSynched: boolean;
|
|
48
|
-
}
|
|
49
|
-
export interface TreeMeta {
|
|
50
|
-
/** The name of the tree */
|
|
51
|
-
name: string;
|
|
52
|
-
/** The depth of the tree */
|
|
53
|
-
depth: number;
|
|
54
|
-
/** The current size of the tree (number of leaves) */
|
|
55
|
-
size: bigint;
|
|
56
|
-
/** The committed size of the tree */
|
|
57
|
-
committedSize: bigint;
|
|
58
|
-
/** The current root of the tree */
|
|
59
|
-
root: Fr;
|
|
60
|
-
/** The tree's initial size */
|
|
61
|
-
initialSize: bigint;
|
|
62
|
-
/** The tree's initial root value */
|
|
63
|
-
initialRoot: Fr;
|
|
64
|
-
/** The current oldest historical block number of the tree */
|
|
65
|
-
oldestHistoricBlock: bigint;
|
|
66
|
-
/** The current unfinalised block number of the tree */
|
|
67
|
-
unfinalisedBlockHeight: bigint;
|
|
68
|
-
/** The current finalised block number of the tree */
|
|
69
|
-
finalisedBlockHeight: bigint;
|
|
70
|
-
}
|
|
71
|
-
export interface DBStats {
|
|
72
|
-
/** The name of the DB */
|
|
73
|
-
name: string;
|
|
74
|
-
/** The total number of key/value pairs in the DB */
|
|
75
|
-
numDataItems: bigint;
|
|
76
|
-
/** The current mapped size of the DB */
|
|
77
|
-
totalUsedSize: bigint;
|
|
78
|
-
}
|
|
79
|
-
export interface TreeDBStats {
|
|
80
|
-
/** The configured max size of the DB mapping file (effectively the max possible size of the DB) */
|
|
81
|
-
mapSize: bigint;
|
|
82
|
-
/** Stats for the 'blocks' DB */
|
|
83
|
-
blocksDBStats: DBStats;
|
|
84
|
-
/** Stats for the 'nodes' DB */
|
|
85
|
-
nodesDBStats: DBStats;
|
|
86
|
-
/** Stats for the 'leaf pre-images' DB */
|
|
87
|
-
leafPreimagesDBStats: DBStats;
|
|
88
|
-
/** Stats for the 'leaf indices' DB */
|
|
89
|
-
leafIndicesDBStats: DBStats;
|
|
90
|
-
/** Stats for the 'block indices' DB */
|
|
91
|
-
blockIndicesDBStats: DBStats;
|
|
92
|
-
}
|
|
93
|
-
export interface WorldStateMeta {
|
|
94
|
-
/** Tree meta for the note hash tree */
|
|
95
|
-
noteHashTreeMeta: TreeMeta;
|
|
96
|
-
/** Tree meta for the message tree */
|
|
97
|
-
messageTreeMeta: TreeMeta;
|
|
98
|
-
/** Tree meta for the archive tree */
|
|
99
|
-
archiveTreeMeta: TreeMeta;
|
|
100
|
-
/** Tree meta for the public data tree */
|
|
101
|
-
publicDataTreeMeta: TreeMeta;
|
|
102
|
-
/** Tree meta for the nullifier tree */
|
|
103
|
-
nullifierTreeMeta: TreeMeta;
|
|
104
|
-
}
|
|
105
|
-
export interface WorldStateDBStats {
|
|
106
|
-
/** Full stats for the note hash tree */
|
|
107
|
-
noteHashTreeStats: TreeDBStats;
|
|
108
|
-
/** Full stats for the message tree */
|
|
109
|
-
messageTreeStats: TreeDBStats;
|
|
110
|
-
/** Full stats for the archive tree */
|
|
111
|
-
archiveTreeStats: TreeDBStats;
|
|
112
|
-
/** Full stats for the public data tree */
|
|
113
|
-
publicDataTreeStats: TreeDBStats;
|
|
114
|
-
/** Full stats for the nullifier tree */
|
|
115
|
-
nullifierTreeStats: TreeDBStats;
|
|
116
|
-
}
|
|
117
|
-
export interface WorldStateStatusFull {
|
|
118
|
-
summary: WorldStateStatusSummary;
|
|
119
|
-
dbStats: WorldStateDBStats;
|
|
120
|
-
meta: WorldStateMeta;
|
|
121
|
-
}
|
|
122
|
-
export declare function buildEmptyDBStats(): DBStats;
|
|
123
|
-
export declare function buildEmptyTreeDBStats(): TreeDBStats;
|
|
124
|
-
export declare function buildEmptyTreeMeta(): TreeMeta;
|
|
125
|
-
export declare function buildEmptyWorldStateMeta(): WorldStateMeta;
|
|
126
|
-
export declare function buildEmptyWorldStateDBStats(): WorldStateDBStats;
|
|
127
|
-
export declare function buildEmptyWorldStateSummary(): WorldStateStatusSummary;
|
|
128
|
-
export declare function buildEmptyWorldStateStatusFull(): WorldStateStatusFull;
|
|
129
|
-
export declare function sanitiseSummary(summary: WorldStateStatusSummary): WorldStateStatusSummary;
|
|
130
|
-
export declare function sanitiseDBStats(stats: DBStats): DBStats;
|
|
131
|
-
export declare function sanitiseMeta(meta: TreeMeta): TreeMeta;
|
|
132
|
-
export declare function sanitiseTreeDBStats(stats: TreeDBStats): TreeDBStats;
|
|
133
|
-
export declare function sanitiseWorldStateDBStats(stats: WorldStateDBStats): WorldStateDBStats;
|
|
134
|
-
export declare function sanitiseWorldStateTreeMeta(meta: WorldStateMeta): WorldStateMeta;
|
|
135
|
-
export declare function sanitiseFullStatus(status: WorldStateStatusFull): WorldStateStatusFull;
|
|
136
|
-
interface WithForkId {
|
|
137
|
-
forkId: number;
|
|
138
|
-
}
|
|
139
|
-
interface WithWorldStateRevision {
|
|
140
|
-
revision: WorldStateRevision;
|
|
141
|
-
}
|
|
142
|
-
interface WithCanonicalForkId {
|
|
143
|
-
canonical: true;
|
|
144
|
-
}
|
|
145
|
-
interface WithLeafIndex {
|
|
146
|
-
leafIndex: bigint;
|
|
147
|
-
}
|
|
148
|
-
export type SerializedLeafValue = Buffer | {
|
|
149
|
-
value: Buffer;
|
|
150
|
-
} | {
|
|
151
|
-
value: Buffer;
|
|
152
|
-
slot: Buffer;
|
|
153
|
-
};
|
|
154
|
-
export type SerializedIndexedLeaf = {
|
|
155
|
-
value: Exclude<SerializedLeafValue, Buffer>;
|
|
156
|
-
nextIndex: bigint | number;
|
|
157
|
-
nextValue: Buffer;
|
|
158
|
-
};
|
|
159
|
-
interface WithLeafValues {
|
|
160
|
-
leaves: SerializedLeafValue[];
|
|
161
|
-
}
|
|
162
|
-
interface BlockShiftRequest extends WithCanonicalForkId {
|
|
163
|
-
toBlockNumber: bigint;
|
|
164
|
-
}
|
|
165
|
-
interface WithLeaves {
|
|
166
|
-
leaves: SerializedLeafValue[];
|
|
167
|
-
}
|
|
168
|
-
interface GetTreeInfoRequest extends WithTreeId, WithWorldStateRevision {
|
|
169
|
-
}
|
|
170
|
-
interface GetTreeInfoResponse {
|
|
171
|
-
treeId: MerkleTreeId;
|
|
172
|
-
depth: UInt32;
|
|
173
|
-
size: bigint | number;
|
|
174
|
-
root: Buffer;
|
|
175
|
-
}
|
|
176
|
-
interface GetBlockNumbersForLeafIndicesRequest extends WithTreeId, WithWorldStateRevision {
|
|
177
|
-
leafIndices: bigint[];
|
|
178
|
-
}
|
|
179
|
-
interface GetBlockNumbersForLeafIndicesResponse {
|
|
180
|
-
blockNumbers: bigint[];
|
|
181
|
-
}
|
|
182
|
-
interface GetSiblingPathRequest extends WithTreeId, WithLeafIndex, WithWorldStateRevision {
|
|
183
|
-
}
|
|
184
|
-
type GetSiblingPathResponse = Buffer[];
|
|
185
|
-
interface GetStateReferenceRequest extends WithWorldStateRevision {
|
|
186
|
-
}
|
|
187
|
-
interface GetStateReferenceResponse {
|
|
188
|
-
state: Record<MerkleTreeId, TreeStateReference>;
|
|
189
|
-
}
|
|
190
|
-
interface GetLeafRequest extends WithTreeId, WithWorldStateRevision, WithLeafIndex {
|
|
191
|
-
}
|
|
192
|
-
type GetLeafResponse = SerializedLeafValue | undefined;
|
|
193
|
-
interface GetLeafPreImageRequest extends WithTreeId, WithLeafIndex, WithWorldStateRevision {
|
|
194
|
-
}
|
|
195
|
-
type GetLeafPreImageResponse = SerializedIndexedLeaf | undefined;
|
|
196
|
-
interface FindLeafIndicesRequest extends WithTreeId, WithLeafValues, WithWorldStateRevision {
|
|
197
|
-
startIndex: bigint;
|
|
198
|
-
}
|
|
199
|
-
interface FindLeafIndicesResponse {
|
|
200
|
-
indices: bigint[];
|
|
201
|
-
}
|
|
202
|
-
interface FindLowLeafRequest extends WithTreeId, WithWorldStateRevision {
|
|
203
|
-
key: Fr;
|
|
204
|
-
}
|
|
205
|
-
interface FindLowLeafResponse {
|
|
206
|
-
index: bigint | number;
|
|
207
|
-
alreadyPresent: boolean;
|
|
208
|
-
}
|
|
209
|
-
interface AppendLeavesRequest extends WithTreeId, WithForkId, WithLeaves {
|
|
210
|
-
}
|
|
211
|
-
interface BatchInsertRequest extends WithTreeId, WithForkId, WithLeaves {
|
|
212
|
-
subtreeDepth: number;
|
|
213
|
-
}
|
|
214
|
-
interface BatchInsertResponse {
|
|
215
|
-
low_leaf_witness_data: ReadonlyArray<{
|
|
216
|
-
leaf: SerializedIndexedLeaf;
|
|
217
|
-
index: bigint | number;
|
|
218
|
-
path: Tuple<Buffer, number>;
|
|
219
|
-
}>;
|
|
220
|
-
sorted_leaves: ReadonlyArray<[SerializedLeafValue, UInt32]>;
|
|
221
|
-
subtree_path: Tuple<Buffer, number>;
|
|
222
|
-
}
|
|
223
|
-
interface SequentialInsertRequest extends WithTreeId, WithForkId, WithLeaves {
|
|
224
|
-
}
|
|
225
|
-
interface SequentialInsertResponse {
|
|
226
|
-
low_leaf_witness_data: ReadonlyArray<{
|
|
227
|
-
leaf: SerializedIndexedLeaf;
|
|
228
|
-
index: bigint | number;
|
|
229
|
-
path: Tuple<Buffer, number>;
|
|
230
|
-
}>;
|
|
231
|
-
insertion_witness_data: ReadonlyArray<{
|
|
232
|
-
leaf: SerializedIndexedLeaf;
|
|
233
|
-
index: bigint | number;
|
|
234
|
-
path: Tuple<Buffer, number>;
|
|
235
|
-
}>;
|
|
236
|
-
}
|
|
237
|
-
interface UpdateArchiveRequest extends WithForkId {
|
|
238
|
-
blockStateRef: BlockStateReference;
|
|
239
|
-
blockHeaderHash: Buffer;
|
|
240
|
-
}
|
|
241
|
-
interface SyncBlockRequest extends WithCanonicalForkId {
|
|
242
|
-
blockNumber: number;
|
|
243
|
-
blockStateRef: BlockStateReference;
|
|
244
|
-
blockHeaderHash: Fr;
|
|
245
|
-
paddedNoteHashes: readonly SerializedLeafValue[];
|
|
246
|
-
paddedL1ToL2Messages: readonly SerializedLeafValue[];
|
|
247
|
-
paddedNullifiers: readonly SerializedLeafValue[];
|
|
248
|
-
publicDataWrites: readonly SerializedLeafValue[];
|
|
249
|
-
}
|
|
250
|
-
interface CreateForkRequest extends WithCanonicalForkId {
|
|
251
|
-
latest: boolean;
|
|
252
|
-
blockNumber: number;
|
|
253
|
-
}
|
|
254
|
-
interface CreateForkResponse {
|
|
255
|
-
forkId: number;
|
|
256
|
-
}
|
|
257
|
-
interface DeleteForkRequest extends WithForkId {
|
|
258
|
-
}
|
|
259
|
-
export type WorldStateRequestCategories = WithForkId | WithWorldStateRevision | WithCanonicalForkId;
|
|
260
|
-
export declare function isWithForkId(body: WorldStateRequestCategories): body is WithForkId;
|
|
261
|
-
export declare function isWithRevision(body: WorldStateRequestCategories): body is WithWorldStateRevision;
|
|
262
|
-
export declare function isWithCanonical(body: WorldStateRequestCategories): body is WithCanonicalForkId;
|
|
263
|
-
export type WorldStateRequest = {
|
|
264
|
-
[WorldStateMessageType.GET_TREE_INFO]: GetTreeInfoRequest;
|
|
265
|
-
[WorldStateMessageType.GET_STATE_REFERENCE]: GetStateReferenceRequest;
|
|
266
|
-
[WorldStateMessageType.GET_INITIAL_STATE_REFERENCE]: WithCanonicalForkId;
|
|
267
|
-
[WorldStateMessageType.GET_LEAF_VALUE]: GetLeafRequest;
|
|
268
|
-
[WorldStateMessageType.GET_LEAF_PREIMAGE]: GetLeafPreImageRequest;
|
|
269
|
-
[WorldStateMessageType.GET_SIBLING_PATH]: GetSiblingPathRequest;
|
|
270
|
-
[WorldStateMessageType.GET_BLOCK_NUMBERS_FOR_LEAF_INDICES]: GetBlockNumbersForLeafIndicesRequest;
|
|
271
|
-
[WorldStateMessageType.FIND_LEAF_INDICES]: FindLeafIndicesRequest;
|
|
272
|
-
[WorldStateMessageType.FIND_LOW_LEAF]: FindLowLeafRequest;
|
|
273
|
-
[WorldStateMessageType.APPEND_LEAVES]: AppendLeavesRequest;
|
|
274
|
-
[WorldStateMessageType.BATCH_INSERT]: BatchInsertRequest;
|
|
275
|
-
[WorldStateMessageType.SEQUENTIAL_INSERT]: SequentialInsertRequest;
|
|
276
|
-
[WorldStateMessageType.UPDATE_ARCHIVE]: UpdateArchiveRequest;
|
|
277
|
-
[WorldStateMessageType.COMMIT]: WithCanonicalForkId;
|
|
278
|
-
[WorldStateMessageType.ROLLBACK]: WithCanonicalForkId;
|
|
279
|
-
[WorldStateMessageType.SYNC_BLOCK]: SyncBlockRequest;
|
|
280
|
-
[WorldStateMessageType.CREATE_FORK]: CreateForkRequest;
|
|
281
|
-
[WorldStateMessageType.DELETE_FORK]: DeleteForkRequest;
|
|
282
|
-
[WorldStateMessageType.REMOVE_HISTORICAL_BLOCKS]: BlockShiftRequest;
|
|
283
|
-
[WorldStateMessageType.UNWIND_BLOCKS]: BlockShiftRequest;
|
|
284
|
-
[WorldStateMessageType.FINALISE_BLOCKS]: BlockShiftRequest;
|
|
285
|
-
[WorldStateMessageType.GET_STATUS]: WithCanonicalForkId;
|
|
286
|
-
[WorldStateMessageType.CREATE_CHECKPOINT]: WithForkId;
|
|
287
|
-
[WorldStateMessageType.COMMIT_CHECKPOINT]: WithForkId;
|
|
288
|
-
[WorldStateMessageType.REVERT_CHECKPOINT]: WithForkId;
|
|
289
|
-
[WorldStateMessageType.CLOSE]: WithCanonicalForkId;
|
|
290
|
-
};
|
|
291
|
-
export type WorldStateResponse = {
|
|
292
|
-
[WorldStateMessageType.GET_TREE_INFO]: GetTreeInfoResponse;
|
|
293
|
-
[WorldStateMessageType.GET_STATE_REFERENCE]: GetStateReferenceResponse;
|
|
294
|
-
[WorldStateMessageType.GET_INITIAL_STATE_REFERENCE]: GetStateReferenceResponse;
|
|
295
|
-
[WorldStateMessageType.GET_LEAF_VALUE]: GetLeafResponse;
|
|
296
|
-
[WorldStateMessageType.GET_LEAF_PREIMAGE]: GetLeafPreImageResponse;
|
|
297
|
-
[WorldStateMessageType.GET_SIBLING_PATH]: GetSiblingPathResponse;
|
|
298
|
-
[WorldStateMessageType.GET_BLOCK_NUMBERS_FOR_LEAF_INDICES]: GetBlockNumbersForLeafIndicesResponse;
|
|
299
|
-
[WorldStateMessageType.FIND_LEAF_INDICES]: FindLeafIndicesResponse;
|
|
300
|
-
[WorldStateMessageType.FIND_LOW_LEAF]: FindLowLeafResponse;
|
|
301
|
-
[WorldStateMessageType.APPEND_LEAVES]: void;
|
|
302
|
-
[WorldStateMessageType.BATCH_INSERT]: BatchInsertResponse;
|
|
303
|
-
[WorldStateMessageType.SEQUENTIAL_INSERT]: SequentialInsertResponse;
|
|
304
|
-
[WorldStateMessageType.UPDATE_ARCHIVE]: void;
|
|
305
|
-
[WorldStateMessageType.COMMIT]: void;
|
|
306
|
-
[WorldStateMessageType.ROLLBACK]: void;
|
|
307
|
-
[WorldStateMessageType.SYNC_BLOCK]: WorldStateStatusFull;
|
|
308
|
-
[WorldStateMessageType.CREATE_FORK]: CreateForkResponse;
|
|
309
|
-
[WorldStateMessageType.DELETE_FORK]: void;
|
|
310
|
-
[WorldStateMessageType.REMOVE_HISTORICAL_BLOCKS]: WorldStateStatusFull;
|
|
311
|
-
[WorldStateMessageType.UNWIND_BLOCKS]: WorldStateStatusFull;
|
|
312
|
-
[WorldStateMessageType.FINALISE_BLOCKS]: WorldStateStatusSummary;
|
|
313
|
-
[WorldStateMessageType.GET_STATUS]: WorldStateStatusSummary;
|
|
314
|
-
[WorldStateMessageType.CREATE_CHECKPOINT]: void;
|
|
315
|
-
[WorldStateMessageType.COMMIT_CHECKPOINT]: void;
|
|
316
|
-
[WorldStateMessageType.REVERT_CHECKPOINT]: void;
|
|
317
|
-
[WorldStateMessageType.CLOSE]: void;
|
|
318
|
-
};
|
|
319
|
-
export type WorldStateRevision = {
|
|
320
|
-
forkId: number;
|
|
321
|
-
blockNumber: number;
|
|
322
|
-
includeUncommitted: boolean;
|
|
323
|
-
};
|
|
324
|
-
export declare function worldStateRevision(includeUncommitted: boolean, forkId: number | undefined, blockNumber: number | undefined): WorldStateRevision;
|
|
325
|
-
type TreeStateReference = readonly [Buffer, number | bigint];
|
|
326
|
-
type BlockStateReference = Map<Exclude<MerkleTreeId, MerkleTreeId.ARCHIVE>, TreeStateReference>;
|
|
327
|
-
export declare function treeStateReferenceToSnapshot([root, size]: TreeStateReference): AppendOnlyTreeSnapshot;
|
|
328
|
-
export declare function treeStateReference(snapshot: AppendOnlyTreeSnapshot): readonly [Buffer, bigint];
|
|
329
|
-
export declare function blockStateReference(state: StateReference): BlockStateReference;
|
|
330
|
-
export {};
|
|
331
|
-
//# 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,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,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,UA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OAAO,CAAC;CAC7B,CAAC;AACF,wBAAgB,kBAAkB,CAChC,kBAAkB,EAAE,OAAO,EAC3B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,kBAAkB,CAMpB;AAED,KAAK,kBAAkB,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAC7D,KAAK,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC;AAEhG,wBAAgB,4BAA4B,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,kBAAkB,GAAG,sBAAsB,CAErG;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,sBAAsB,6BAElE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,GAAG,mBAAmB,CAO9E"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
5
|
-
import type { L2Block } from '@aztec/stdlib/block';
|
|
6
|
-
import type { IndexedTreeId, MerkleTreeReadOperations, MerkleTreeWriteOperations } from '@aztec/stdlib/interfaces/server';
|
|
7
|
-
import { type NullifierLeafPreimage, PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
8
|
-
import { BlockHeader } from '@aztec/stdlib/tx';
|
|
9
|
-
import { WorldStateInstrumentation } from '../instrumentation/instrumentation.js';
|
|
10
|
-
import type { MerkleTreeAdminDatabase as MerkleTreeDatabase } from '../world-state-db/merkle_tree_db.js';
|
|
11
|
-
import { type WorldStateStatusFull, type WorldStateStatusSummary } from './message.js';
|
|
12
|
-
import { NativeWorldState } from './native_world_state_instance.js';
|
|
13
|
-
export declare const WORLD_STATE_VERSION_FILE = "version";
|
|
14
|
-
export declare const WORLD_STATE_DB_VERSION = 1;
|
|
15
|
-
export declare class NativeWorldStateService implements MerkleTreeDatabase {
|
|
16
|
-
protected readonly instance: NativeWorldState;
|
|
17
|
-
protected readonly worldStateInstrumentation: WorldStateInstrumentation;
|
|
18
|
-
protected readonly log: import("@aztec/foundation/log").Logger;
|
|
19
|
-
private readonly cleanup;
|
|
20
|
-
protected initialHeader: BlockHeader | undefined;
|
|
21
|
-
private cachedStatusSummary;
|
|
22
|
-
protected constructor(instance: NativeWorldState, worldStateInstrumentation: WorldStateInstrumentation, log?: import("@aztec/foundation/log").Logger, cleanup?: () => Promise<void>);
|
|
23
|
-
static new(rollupAddress: EthAddress, dataDir: string, dbMapSizeKb: number, prefilledPublicData?: PublicDataTreeLeaf[], instrumentation?: WorldStateInstrumentation, log?: import("@aztec/foundation/log").Logger, cleanup?: () => Promise<void>): Promise<NativeWorldStateService>;
|
|
24
|
-
static tmp(rollupAddress?: EthAddress, cleanupTmpDir?: boolean, prefilledPublicData?: PublicDataTreeLeaf[], instrumentation?: WorldStateInstrumentation): Promise<NativeWorldStateService>;
|
|
25
|
-
protected init(): Promise<void>;
|
|
26
|
-
getCommitted(): MerkleTreeReadOperations;
|
|
27
|
-
getSnapshot(blockNumber: number): MerkleTreeReadOperations;
|
|
28
|
-
fork(blockNumber?: number): Promise<MerkleTreeWriteOperations>;
|
|
29
|
-
getInitialHeader(): BlockHeader;
|
|
30
|
-
handleL2BlockAndMessages(l2Block: L2Block, l1ToL2Messages: Fr[]): Promise<WorldStateStatusFull>;
|
|
31
|
-
close(): Promise<void>;
|
|
32
|
-
private buildInitialHeader;
|
|
33
|
-
private sanitiseAndCacheSummaryFromFull;
|
|
34
|
-
private sanitiseAndCacheSummary;
|
|
35
|
-
private deleteCachedSummary;
|
|
36
|
-
/**
|
|
37
|
-
* Advances the finalised block number to be the number provided
|
|
38
|
-
* @param toBlockNumber The block number that is now the tip of the finalised chain
|
|
39
|
-
* @returns The new WorldStateStatus
|
|
40
|
-
*/
|
|
41
|
-
setFinalised(toBlockNumber: bigint): Promise<WorldStateStatusSummary>;
|
|
42
|
-
/**
|
|
43
|
-
* Removes all historical snapshots up to but not including the given block number
|
|
44
|
-
* @param toBlockNumber The block number of the new oldest historical block
|
|
45
|
-
* @returns The new WorldStateStatus
|
|
46
|
-
*/
|
|
47
|
-
removeHistoricalBlocks(toBlockNumber: bigint): Promise<WorldStateStatusFull>;
|
|
48
|
-
/**
|
|
49
|
-
* Removes all pending blocks down to but not including the given block number
|
|
50
|
-
* @param toBlockNumber The block number of the new tip of the pending chain,
|
|
51
|
-
* @returns The new WorldStateStatus
|
|
52
|
-
*/
|
|
53
|
-
unwindBlocks(toBlockNumber: bigint): Promise<WorldStateStatusFull>;
|
|
54
|
-
getStatusSummary(): Promise<WorldStateStatusSummary>;
|
|
55
|
-
updateLeaf<ID extends IndexedTreeId>(_treeId: ID, _leaf: NullifierLeafPreimage | Buffer, _index: bigint): Promise<void>;
|
|
56
|
-
private getInitialStateReference;
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=native_world_state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"native_world_state.d.ts","sourceRoot":"","sources":["../../src/native/native_world_state.ts"],"names":[],"mappings":";;AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAA+B,KAAK,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAClH,OAAO,EAAE,WAAW,EAAyC,MAAM,kBAAkB,CAAC;AAQtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,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yBAAyB,CAAC;IASpE,gBAAgB,IAAI,WAAW;IAIzB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA0C/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;IAkB/C;;;;OAIG;IACU,sBAAsB,CAAC,aAAa,EAAE,MAAM;IAiBzD;;;;OAIG;IACU,YAAY,CAAC,aAAa,EAAE,MAAM;IAiBlC,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,33 +0,0 @@
|
|
|
1
|
-
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
2
|
-
import type { WorldStateInstrumentation } from '../instrumentation/instrumentation.js';
|
|
3
|
-
import { WorldStateMessageType, type WorldStateRequest, type WorldStateRequestCategories, type WorldStateResponse } from './message.js';
|
|
4
|
-
export interface NativeWorldStateInstance {
|
|
5
|
-
call<T extends WorldStateMessageType>(messageType: T, body: WorldStateRequest[T] & WorldStateRequestCategories): Promise<WorldStateResponse[T]>;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Strongly-typed interface to access the WorldState class in the native world_state_napi module.
|
|
9
|
-
*/
|
|
10
|
-
export declare class NativeWorldState implements NativeWorldStateInstance {
|
|
11
|
-
private instrumentation;
|
|
12
|
-
private log;
|
|
13
|
-
private open;
|
|
14
|
-
private queues;
|
|
15
|
-
private instance;
|
|
16
|
-
/** Creates a new native WorldState instance */
|
|
17
|
-
constructor(dataDir: string, dbMapSizeKb: number, prefilledPublicData: PublicDataTreeLeaf[] | undefined, instrumentation: WorldStateInstrumentation, log?: import("@aztec/foundation/log").Logger);
|
|
18
|
-
/**
|
|
19
|
-
* Sends a message to the native instance and returns the response.
|
|
20
|
-
* @param messageType - The type of message to send
|
|
21
|
-
* @param body - The message body
|
|
22
|
-
* @param responseHandler - A callback accepting the response, executed on the job queue
|
|
23
|
-
* @param errorHandler - A callback called on request error, executed on the job queue
|
|
24
|
-
* @returns The response to the message
|
|
25
|
-
*/
|
|
26
|
-
call<T extends WorldStateMessageType>(messageType: T, body: WorldStateRequest[T] & WorldStateRequestCategories, responseHandler?: (response: WorldStateResponse[T]) => WorldStateResponse[T], errorHandler?: (_: string) => void): Promise<WorldStateResponse[T]>;
|
|
27
|
-
/**
|
|
28
|
-
* Stops the native instance.
|
|
29
|
-
*/
|
|
30
|
-
close(): Promise<void>;
|
|
31
|
-
private _sendMessage;
|
|
32
|
-
}
|
|
33
|
-
//# 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":"AAaA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAK9D,OAAO,KAAK,EAAE,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;IAa7D,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,GAAG;IAbb,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,EACnB,mBAAmB,kCAA2B,EACtC,eAAe,EAAE,yBAAyB,EAC1C,GAAG,yCAAuC;IA8BpD;;;;;;;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,4BAgB7B,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/foundation/eth-address';
|
|
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,+BAA+B,CAAC;AAK3D,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,12 +0,0 @@
|
|
|
1
|
-
import type { DataStoreConfig } from '@aztec/kv-store/config';
|
|
2
|
-
import type { L2BlockSource } from '@aztec/stdlib/block';
|
|
3
|
-
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
4
|
-
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
5
|
-
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
6
|
-
import { WorldStateInstrumentation } from '../instrumentation/instrumentation.js';
|
|
7
|
-
import { NativeWorldStateService } from '../native/native_world_state.js';
|
|
8
|
-
import type { WorldStateConfig } from './config.js';
|
|
9
|
-
import { ServerWorldStateSynchronizer } from './server_world_state_synchronizer.js';
|
|
10
|
-
export declare function createWorldStateSynchronizer(config: WorldStateConfig & DataStoreConfig, l2BlockSource: L2BlockSource & L1ToL2MessageSource, prefilledPublicData?: PublicDataTreeLeaf[], client?: TelemetryClient): Promise<ServerWorldStateSynchronizer>;
|
|
11
|
-
export declare function createWorldState(config: WorldStateConfig & DataStoreConfig, prefilledPublicData?: PublicDataTreeLeaf[], instrumentation?: WorldStateInstrumentation): Promise<NativeWorldStateService>;
|
|
12
|
-
//# 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,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,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,KAAK,EAAE,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,mBAAmB,GAAE,kBAAkB,EAAO,EAC9C,MAAM,GAAE,eAAsC,yCAK/C;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,gBAAgB,GAAG,eAAe,EAC1C,mBAAmB,GAAE,kBAAkB,EAAO,EAC9C,eAAe,GAAE,yBAA+E,oCA2BjG"}
|
|
@@ -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,79 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
4
|
-
import type { L2BlockSource, L2BlockStream, L2BlockStreamEvent, L2BlockStreamEventHandler, L2BlockStreamLocalDataProvider, L2Tips } from '@aztec/stdlib/block';
|
|
5
|
-
import { type WorldStateSynchronizer, type WorldStateSynchronizerStatus } from '@aztec/stdlib/interfaces/server';
|
|
6
|
-
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
7
|
-
import { type MerkleTreeReadOperations, type MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
8
|
-
import { WorldStateInstrumentation } from '../instrumentation/instrumentation.js';
|
|
9
|
-
import type { MerkleTreeAdminDatabase } from '../world-state-db/merkle_tree_db.js';
|
|
10
|
-
import type { WorldStateConfig } from './config.js';
|
|
11
|
-
/**
|
|
12
|
-
* Synchronizes the world state with the L2 blocks from a L2BlockSource via a block stream.
|
|
13
|
-
* The synchronizer will download the L2 blocks from the L2BlockSource and update the merkle trees.
|
|
14
|
-
* Handles chain reorgs via the L2BlockStream.
|
|
15
|
-
*/
|
|
16
|
-
export declare class ServerWorldStateSynchronizer implements WorldStateSynchronizer, L2BlockStreamLocalDataProvider, L2BlockStreamEventHandler {
|
|
17
|
-
private readonly merkleTreeDb;
|
|
18
|
-
private readonly l2BlockSource;
|
|
19
|
-
private readonly config;
|
|
20
|
-
private instrumentation;
|
|
21
|
-
private readonly log;
|
|
22
|
-
private readonly merkleTreeCommitted;
|
|
23
|
-
private latestBlockNumberAtStart;
|
|
24
|
-
private historyToKeep;
|
|
25
|
-
private currentState;
|
|
26
|
-
private latestBlockHashQuery;
|
|
27
|
-
private syncPromise;
|
|
28
|
-
protected blockStream: L2BlockStream | undefined;
|
|
29
|
-
constructor(merkleTreeDb: MerkleTreeAdminDatabase, l2BlockSource: L2BlockSource & L1ToL2MessageSource, config: WorldStateConfig, instrumentation?: WorldStateInstrumentation, log?: import("@aztec/foundation/log").Logger);
|
|
30
|
-
getCommitted(): MerkleTreeReadOperations;
|
|
31
|
-
getSnapshot(blockNumber: number): MerkleTreeReadOperations;
|
|
32
|
-
fork(blockNumber?: number): Promise<MerkleTreeWriteOperations>;
|
|
33
|
-
start(): Promise<void | import("@aztec/foundation/promise").PromiseWithResolvers<void>>;
|
|
34
|
-
protected createBlockStream(): L2BlockStream;
|
|
35
|
-
stop(): Promise<void>;
|
|
36
|
-
status(): Promise<WorldStateSynchronizerStatus>;
|
|
37
|
-
getLatestBlockNumber(): Promise<number>;
|
|
38
|
-
/**
|
|
39
|
-
* Forces an immediate sync.
|
|
40
|
-
* @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.
|
|
41
|
-
* @returns A promise that resolves with the block number the world state was synced to
|
|
42
|
-
*/
|
|
43
|
-
syncImmediate(targetBlockNumber?: number): Promise<number>;
|
|
44
|
-
/** Returns the L2 block hash for a given number. Used by the L2BlockStream for detecting reorgs. */
|
|
45
|
-
getL2BlockHash(number: number): Promise<string | undefined>;
|
|
46
|
-
/** Returns the latest L2 block number for each tip of the chain (latest, proven, finalized). */
|
|
47
|
-
getL2Tips(): Promise<L2Tips>;
|
|
48
|
-
/** Handles an event emitted by the block stream. */
|
|
49
|
-
handleBlockStreamEvent(event: L2BlockStreamEvent): Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* Handles a list of L2 blocks (i.e. Inserts the new note hashes into the merkle tree).
|
|
52
|
-
* @param l2Blocks - The L2 blocks to handle.
|
|
53
|
-
* @returns Whether the block handled was produced by this same node.
|
|
54
|
-
*/
|
|
55
|
-
private handleL2Blocks;
|
|
56
|
-
/**
|
|
57
|
-
* Handles a single L2 block (i.e. Inserts the new note hashes into the merkle tree).
|
|
58
|
-
* @param l2Block - The L2 block to handle.
|
|
59
|
-
* @param l1ToL2Messages - The L1 to L2 messages for the block.
|
|
60
|
-
* @returns Whether the block handled was produced by this same node.
|
|
61
|
-
*/
|
|
62
|
-
private handleL2Block;
|
|
63
|
-
private handleChainFinalized;
|
|
64
|
-
private handleChainProven;
|
|
65
|
-
private handleChainPruned;
|
|
66
|
-
/**
|
|
67
|
-
* Method to set the value of the current state.
|
|
68
|
-
* @param newState - New state value.
|
|
69
|
-
*/
|
|
70
|
-
private setCurrentState;
|
|
71
|
-
/**
|
|
72
|
-
* Verifies that the L1 to L2 messages hash to the block inHash.
|
|
73
|
-
* @param l1ToL2Messages - The L1 to L2 messages for the block.
|
|
74
|
-
* @param inHash - The inHash of the block.
|
|
75
|
-
* @throws If the L1 to L2 messages do not hash to the block inHash.
|
|
76
|
-
*/
|
|
77
|
-
protected verifyMessagesHashToInHash(l1ToL2Messages: Fr[], inHash: Buffer): Promise<void>;
|
|
78
|
-
}
|
|
79
|
-
//# 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":";;AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAMnD,OAAO,KAAK,EAGV,aAAa,EACb,aAAa,EACb,kBA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AAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAIxD,KAAK;IAgClB,SAAS,CAAC,iBAAiB,IAAI,aAAa;IAU/B,IAAI;IASJ,MAAM,IAAI,OAAO,CAAC,4BAA4B,CAAC;IAe/C,oBAAoB;IAIjC;;;;OAIG;IACU,aAAa,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAwBvE,oGAAoG;IACvF,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAexE,gGAAgG;IACnF,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAYzC,oDAAoD;IACvC,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB7E;;;;OAIG;YACW,cAAc;IAyB5B;;;;;OAKG;YACW,aAAa;YAuBb,oBAAoB;IAelC,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"}
|
package/dest/test/utils.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { L2Block } from '@aztec/stdlib/block';
|
|
3
|
-
import type { MerkleTreeReadOperations, MerkleTreeWriteOperations } from '@aztec/stdlib/interfaces/server';
|
|
4
|
-
import type { NativeWorldStateService } from '../native/native_world_state.js';
|
|
5
|
-
export declare function mockBlock(blockNum: number, size: number, fork: MerkleTreeWriteOperations): Promise<{
|
|
6
|
-
block: L2Block;
|
|
7
|
-
messages: Fr[];
|
|
8
|
-
}>;
|
|
9
|
-
export declare function mockEmptyBlock(blockNum: number, fork: MerkleTreeWriteOperations): Promise<{
|
|
10
|
-
block: L2Block;
|
|
11
|
-
messages: Fr[];
|
|
12
|
-
}>;
|
|
13
|
-
export declare function mockBlocks(from: number, count: number, numTxs: number, worldState: NativeWorldStateService): Promise<{
|
|
14
|
-
blocks: L2Block[];
|
|
15
|
-
messages: Fr[][];
|
|
16
|
-
}>;
|
|
17
|
-
export declare function assertSameState(forkA: MerkleTreeReadOperations, forkB: MerkleTreeReadOperations): Promise<void>;
|
|
18
|
-
export declare function compareChains(left: MerkleTreeReadOperations, right: MerkleTreeReadOperations): Promise<void>;
|
|
19
|
-
//# sourceMappingURL=utils.d.ts.map
|
package/dest/test/utils.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/test/utils.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAG3G,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE/E,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB;;;GA+C9F;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB;;;GAiDrF;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,uBAAuB;;;GAchH;AAED,wBAAsB,eAAe,CAAC,KAAK,EAAE,wBAAwB,EAAE,KAAK,EAAE,wBAAwB,iBAQrG;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,wBAAwB,EAAE,KAAK,EAAE,wBAAwB,iBAYlG"}
|
package/dest/testing.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
-
import { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
4
|
-
export declare const defaultInitialAccountFeeJuice: Fr;
|
|
5
|
-
export declare function getGenesisValues(initialAccounts: AztecAddress[], initialAccountFeeJuice?: Fr, genesisPublicData?: PublicDataTreeLeaf[]): Promise<{
|
|
6
|
-
genesisArchiveRoot: Fr;
|
|
7
|
-
genesisBlockHash: Fr;
|
|
8
|
-
prefilledPublicData: PublicDataTreeLeaf[];
|
|
9
|
-
}>;
|
|
10
|
-
//# sourceMappingURL=testing.d.ts.map
|
package/dest/testing.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAgB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AA6BvE,eAAO,MAAM,6BAA6B,IAAqB,CAAC;AAEhE,wBAAsB,gBAAgB,CACpC,eAAe,EAAE,YAAY,EAAE,EAC/B,sBAAsB,KAAgC,EACtD,iBAAiB,GAAE,kBAAkB,EAAO;;;;GAqB7C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/world-state-db/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AAEpC,YAAY,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { IndexedTreeSnapshot, TreeSnapshot } from '@aztec/merkle-tree';
|
|
3
|
-
import type { L2Block } from '@aztec/stdlib/block';
|
|
4
|
-
import type { ForkMerkleTreeOperations, MerkleTreeReadOperations } from '@aztec/stdlib/interfaces/server';
|
|
5
|
-
import type { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
6
|
-
import type { WorldStateStatusFull, WorldStateStatusSummary } from '../native/message.js';
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @remarks Short explanation:
|
|
10
|
-
* The nullifier tree must be initially padded as the pre-populated 0 index prevents efficient subtree insertion.
|
|
11
|
-
* Padding with some values solves this issue.
|
|
12
|
-
*
|
|
13
|
-
* @remarks Thorough explanation:
|
|
14
|
-
* There needs to be an initial (0,0,0) leaf in the tree, so that when we insert the first 'proper' leaf, we can
|
|
15
|
-
* prove that any value greater than 0 doesn't exist in the tree yet. We prefill/pad the tree with "the number of
|
|
16
|
-
* leaves that are added by one block" so that the first 'proper' block can insert a full subtree.
|
|
17
|
-
*
|
|
18
|
-
* Without this padding, there would be a leaf (0,0,0) at leaf index 0, making it really difficult to insert e.g.
|
|
19
|
-
* 1024 leaves for the first block, because there's only neat space for 1023 leaves after 0. By padding with 1023
|
|
20
|
-
* more leaves, we can then insert the first block of 1024 leaves into indices 1024:2047.
|
|
21
|
-
*/
|
|
22
|
-
export declare const INITIAL_NULLIFIER_TREE_SIZE: number;
|
|
23
|
-
export declare const INITIAL_PUBLIC_DATA_TREE_SIZE: number;
|
|
24
|
-
export type TreeSnapshots = {
|
|
25
|
-
[MerkleTreeId.NULLIFIER_TREE]: IndexedTreeSnapshot;
|
|
26
|
-
[MerkleTreeId.NOTE_HASH_TREE]: TreeSnapshot<Fr>;
|
|
27
|
-
[MerkleTreeId.PUBLIC_DATA_TREE]: IndexedTreeSnapshot;
|
|
28
|
-
[MerkleTreeId.L1_TO_L2_MESSAGE_TREE]: TreeSnapshot<Fr>;
|
|
29
|
-
[MerkleTreeId.ARCHIVE]: TreeSnapshot<Fr>;
|
|
30
|
-
};
|
|
31
|
-
export interface MerkleTreeAdminDatabase extends ForkMerkleTreeOperations {
|
|
32
|
-
/**
|
|
33
|
-
* Handles a single L2 block (i.e. Inserts the new note hashes into the merkle tree).
|
|
34
|
-
* @param block - The L2 block to handle.
|
|
35
|
-
* @param l1ToL2Messages - The L1 to L2 messages for the block.
|
|
36
|
-
*/
|
|
37
|
-
handleL2BlockAndMessages(block: L2Block, l1ToL2Messages: Fr[]): Promise<WorldStateStatusFull>;
|
|
38
|
-
/**
|
|
39
|
-
* Gets a handle that allows reading the latest committed state
|
|
40
|
-
*/
|
|
41
|
-
getCommitted(): MerkleTreeReadOperations;
|
|
42
|
-
/**
|
|
43
|
-
* Removes all historical snapshots up to but not including the given block number
|
|
44
|
-
* @param toBlockNumber The block number of the new oldest historical block
|
|
45
|
-
* @returns The new WorldStateStatus
|
|
46
|
-
*/
|
|
47
|
-
removeHistoricalBlocks(toBlockNumber: bigint): Promise<WorldStateStatusFull>;
|
|
48
|
-
/**
|
|
49
|
-
* Removes all pending blocks down to but not including the given block number
|
|
50
|
-
* @param toBlockNumber The block number of the new tip of the pending chain,
|
|
51
|
-
* @returns The new WorldStateStatus
|
|
52
|
-
*/
|
|
53
|
-
unwindBlocks(toBlockNumber: bigint): Promise<WorldStateStatusFull>;
|
|
54
|
-
/**
|
|
55
|
-
* Advances the finalised block number to be the number provided
|
|
56
|
-
* @param toBlockNumber The block number that is now the tip of the finalised chain
|
|
57
|
-
* @returns The new WorldStateStatus
|
|
58
|
-
*/
|
|
59
|
-
setFinalised(toBlockNumber: bigint): Promise<WorldStateStatusSummary>;
|
|
60
|
-
/**
|
|
61
|
-
* Gets the current status summary of the database.
|
|
62
|
-
* @returns The current WorldStateStatus.
|
|
63
|
-
*/
|
|
64
|
-
getStatusSummary(): Promise<WorldStateStatusSummary>;
|
|
65
|
-
/** Stops the database */
|
|
66
|
-
close(): Promise<void>;
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=merkle_tree_db.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"merkle_tree_db.d.ts","sourceRoot":"","sources":["../../src/world-state-db/merkle_tree_db.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC1G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE1F;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,2BAA2B,QAA4B,CAAC;AAErE,eAAO,MAAM,6BAA6B,QAAmD,CAAC;AAE9F,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACnD,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;IACrD,CAAC,YAAY,CAAC,qBAAqB,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;IACvD,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,WAAW,uBAAwB,SAAQ,wBAAwB;IACvE;;;;OAIG;IACH,wBAAwB,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,GA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