@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/test/utils.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { L2Block, type MerkleTreeReadOperations, type MerkleTreeWriteOperations } from '@aztec/circuit-types';
|
|
2
|
-
import { Fr } from '@aztec/circuits.js';
|
|
3
|
-
import { type NativeWorldStateService } from '../native/native_world_state.js';
|
|
4
|
-
export declare function mockBlock(blockNum: number, size: number, fork: MerkleTreeWriteOperations): Promise<{
|
|
5
|
-
block: L2Block;
|
|
6
|
-
messages: Fr[];
|
|
7
|
-
}>;
|
|
8
|
-
export declare function mockBlocks(from: number, count: number, numTxs: number, worldState: NativeWorldStateService): Promise<{
|
|
9
|
-
blocks: L2Block[];
|
|
10
|
-
messages: Fr[][];
|
|
11
|
-
}>;
|
|
12
|
-
export declare function assertSameState(forkA: MerkleTreeReadOperations, forkB: MerkleTreeReadOperations): Promise<void>;
|
|
13
|
-
export declare function compareChains(left: MerkleTreeReadOperations, right: MerkleTreeReadOperations): Promise<void>;
|
|
14
|
-
//# 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":"AAAA,OAAO,EACL,OAAO,EAEP,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,EAAE,EAKH,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,KAAK,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,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"}
|
|
@@ -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,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { type L2Block, type MerkleTreeId } from '@aztec/circuit-types';
|
|
2
|
-
import { type ForkMerkleTreeOperations, type MerkleTreeReadOperations } from '@aztec/circuit-types/interfaces';
|
|
3
|
-
import { type Fr } from '@aztec/circuits.js';
|
|
4
|
-
import { type IndexedTreeSnapshot, type TreeSnapshot } from '@aztec/merkle-tree';
|
|
5
|
-
import { type WorldStateStatusFull, type WorldStateStatusSummary } from '../native/message.js';
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @remarks Short explanation:
|
|
9
|
-
* The nullifier tree must be initially padded as the pre-populated 0 index prevents efficient subtree insertion.
|
|
10
|
-
* Padding with some values solves this issue.
|
|
11
|
-
*
|
|
12
|
-
* @remarks Thorough explanation:
|
|
13
|
-
* There needs to be an initial (0,0,0) leaf in the tree, so that when we insert the first 'proper' leaf, we can
|
|
14
|
-
* prove that any value greater than 0 doesn't exist in the tree yet. We prefill/pad the tree with "the number of
|
|
15
|
-
* leaves that are added by one block" so that the first 'proper' block can insert a full subtree.
|
|
16
|
-
*
|
|
17
|
-
* Without this padding, there would be a leaf (0,0,0) at leaf index 0, making it really difficult to insert e.g.
|
|
18
|
-
* 1024 leaves for the first block, because there's only neat space for 1023 leaves after 0. By padding with 1023
|
|
19
|
-
* more leaves, we can then insert the first block of 1024 leaves into indices 1024:2047.
|
|
20
|
-
*/
|
|
21
|
-
export declare const INITIAL_NULLIFIER_TREE_SIZE: number;
|
|
22
|
-
export declare const INITIAL_PUBLIC_DATA_TREE_SIZE: number;
|
|
23
|
-
export type TreeSnapshots = {
|
|
24
|
-
[MerkleTreeId.NULLIFIER_TREE]: IndexedTreeSnapshot;
|
|
25
|
-
[MerkleTreeId.NOTE_HASH_TREE]: TreeSnapshot<Fr>;
|
|
26
|
-
[MerkleTreeId.PUBLIC_DATA_TREE]: IndexedTreeSnapshot;
|
|
27
|
-
[MerkleTreeId.L1_TO_L2_MESSAGE_TREE]: TreeSnapshot<Fr>;
|
|
28
|
-
[MerkleTreeId.ARCHIVE]: TreeSnapshot<Fr>;
|
|
29
|
-
};
|
|
30
|
-
export interface MerkleTreeAdminDatabase extends ForkMerkleTreeOperations {
|
|
31
|
-
/**
|
|
32
|
-
* Handles a single L2 block (i.e. Inserts the new note hashes into the merkle tree).
|
|
33
|
-
* @param block - The L2 block to handle.
|
|
34
|
-
* @param l1ToL2Messages - The L1 to L2 messages for the block.
|
|
35
|
-
*/
|
|
36
|
-
handleL2BlockAndMessages(block: L2Block, l1ToL2Messages: Fr[]): Promise<WorldStateStatusFull>;
|
|
37
|
-
/**
|
|
38
|
-
* Gets a handle that allows reading the latest committed state
|
|
39
|
-
*/
|
|
40
|
-
getCommitted(): MerkleTreeReadOperations;
|
|
41
|
-
/**
|
|
42
|
-
* Removes all historical snapshots up to but not including the given block number
|
|
43
|
-
* @param toBlockNumber The block number of the new oldest historical block
|
|
44
|
-
* @returns The new WorldStateStatus
|
|
45
|
-
*/
|
|
46
|
-
removeHistoricalBlocks(toBlockNumber: bigint): Promise<WorldStateStatusFull>;
|
|
47
|
-
/**
|
|
48
|
-
* Removes all pending blocks down to but not including the given block number
|
|
49
|
-
* @param toBlockNumber The block number of the new tip of the pending chain,
|
|
50
|
-
* @returns The new WorldStateStatus
|
|
51
|
-
*/
|
|
52
|
-
unwindBlocks(toBlockNumber: bigint): Promise<WorldStateStatusFull>;
|
|
53
|
-
/**
|
|
54
|
-
* Advances the finalised block number to be the number provided
|
|
55
|
-
* @param toBlockNumber The block number that is now the tip of the finalised chain
|
|
56
|
-
* @returns The new WorldStateStatus
|
|
57
|
-
*/
|
|
58
|
-
setFinalised(toBlockNumber: bigint): Promise<WorldStateStatusSummary>;
|
|
59
|
-
/**
|
|
60
|
-
* Gets the current status summary of the database.
|
|
61
|
-
* @returns The current WorldStateStatus.
|
|
62
|
-
*/
|
|
63
|
-
getStatusSummary(): Promise<WorldStateStatusSummary>;
|
|
64
|
-
/** Stops the database */
|
|
65
|
-
close(): Promise<void>;
|
|
66
|
-
}
|
|
67
|
-
//# 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":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC/G,OAAO,EAAE,KAAK,EAAE,EAAuE,MAAM,oBAAoB,CAAC;AAClH,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK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