@aztec/world-state 0.0.1-commit.9593d84 → 0.0.1-commit.96dac018d
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/instrumentation/instrumentation.d.ts +1 -1
- package/dest/instrumentation/instrumentation.d.ts.map +1 -1
- package/dest/instrumentation/instrumentation.js +17 -41
- package/dest/native/merkle_trees_facade.d.ts +10 -4
- package/dest/native/merkle_trees_facade.d.ts.map +1 -1
- package/dest/native/merkle_trees_facade.js +37 -7
- package/dest/native/message.d.ts +14 -12
- package/dest/native/message.d.ts.map +1 -1
- package/dest/native/message.js +14 -13
- package/dest/native/native_world_state.d.ts +16 -13
- package/dest/native/native_world_state.d.ts.map +1 -1
- package/dest/native/native_world_state.js +22 -17
- package/dest/native/native_world_state_instance.d.ts +3 -3
- package/dest/native/native_world_state_instance.d.ts.map +1 -1
- package/dest/native/native_world_state_instance.js +4 -4
- package/dest/synchronizer/config.d.ts +3 -5
- package/dest/synchronizer/config.d.ts.map +1 -1
- package/dest/synchronizer/config.js +7 -9
- package/dest/synchronizer/factory.d.ts +4 -3
- package/dest/synchronizer/factory.d.ts.map +1 -1
- package/dest/synchronizer/factory.js +5 -5
- package/dest/synchronizer/server_world_state_synchronizer.d.ts +10 -16
- package/dest/synchronizer/server_world_state_synchronizer.d.ts.map +1 -1
- package/dest/synchronizer/server_world_state_synchronizer.js +107 -75
- package/dest/test/utils.d.ts +12 -5
- package/dest/test/utils.d.ts.map +1 -1
- package/dest/test/utils.js +54 -50
- package/dest/testing.d.ts +2 -2
- package/dest/testing.d.ts.map +1 -1
- package/dest/testing.js +1 -1
- package/dest/world-state-db/merkle_tree_db.d.ts +10 -11
- package/dest/world-state-db/merkle_tree_db.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/instrumentation/instrumentation.ts +17 -41
- package/src/native/merkle_trees_facade.ts +39 -5
- package/src/native/message.ts +25 -23
- package/src/native/native_world_state.ts +52 -28
- package/src/native/native_world_state_instance.ts +6 -4
- package/src/synchronizer/config.ts +8 -19
- package/src/synchronizer/factory.ts +7 -1
- package/src/synchronizer/server_world_state_synchronizer.ts +126 -101
- package/src/test/utils.ts +86 -91
- package/src/testing.ts +1 -1
- package/src/world-state-db/merkle_tree_db.ts +13 -14
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { MAX_NULLIFIERS_PER_TX, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX } from '@aztec/constants';
|
|
2
|
-
import type {
|
|
2
|
+
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
4
|
import type { IndexedTreeSnapshot, TreeSnapshot } from '@aztec/merkle-tree';
|
|
4
|
-
import type { L2Block
|
|
5
|
-
import type {
|
|
5
|
+
import type { L2Block } from '@aztec/stdlib/block';
|
|
6
|
+
import type {
|
|
7
|
+
ForkMerkleTreeOperations,
|
|
8
|
+
MerkleTreeReadOperations,
|
|
9
|
+
ReadonlyWorldStateAccess,
|
|
10
|
+
} from '@aztec/stdlib/interfaces/server';
|
|
6
11
|
import type { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
7
12
|
|
|
8
13
|
import type { WorldStateStatusFull, WorldStateStatusSummary } from '../native/message.js';
|
|
@@ -34,19 +39,13 @@ export type TreeSnapshots = {
|
|
|
34
39
|
[MerkleTreeId.ARCHIVE]: TreeSnapshot<Fr>;
|
|
35
40
|
};
|
|
36
41
|
|
|
37
|
-
export interface MerkleTreeAdminDatabase extends ForkMerkleTreeOperations {
|
|
42
|
+
export interface MerkleTreeAdminDatabase extends ForkMerkleTreeOperations, ReadonlyWorldStateAccess {
|
|
38
43
|
/**
|
|
39
44
|
* Handles a single L2 block (i.e. Inserts the new note hashes into the merkle tree).
|
|
40
45
|
* @param block - The L2 block to handle.
|
|
41
46
|
* @param l1ToL2Messages - The L1 to L2 messages for the block.
|
|
42
|
-
* @param isFirstBlock - Whether the block is the first block in a checkpoint. Temporary hack to only insert l1 to l2
|
|
43
|
-
* messages for the first block in a checkpoint. TODO(#17027) Remove this.
|
|
44
47
|
*/
|
|
45
|
-
handleL2BlockAndMessages(
|
|
46
|
-
block: L2Block | L2BlockNew,
|
|
47
|
-
l1ToL2Messages: Fr[],
|
|
48
|
-
isFirstBlock?: boolean,
|
|
49
|
-
): Promise<WorldStateStatusFull>;
|
|
48
|
+
handleL2BlockAndMessages(block: L2Block, l1ToL2Messages: Fr[]): Promise<WorldStateStatusFull>;
|
|
50
49
|
|
|
51
50
|
/**
|
|
52
51
|
* Gets a handle that allows reading the latest committed state
|
|
@@ -58,21 +57,21 @@ export interface MerkleTreeAdminDatabase extends ForkMerkleTreeOperations {
|
|
|
58
57
|
* @param toBlockNumber The block number of the new oldest historical block
|
|
59
58
|
* @returns The new WorldStateStatus
|
|
60
59
|
*/
|
|
61
|
-
removeHistoricalBlocks(toBlockNumber:
|
|
60
|
+
removeHistoricalBlocks(toBlockNumber: BlockNumber): Promise<WorldStateStatusFull>;
|
|
62
61
|
|
|
63
62
|
/**
|
|
64
63
|
* Removes all pending blocks down to but not including the given block number
|
|
65
64
|
* @param toBlockNumber The block number of the new tip of the pending chain,
|
|
66
65
|
* @returns The new WorldStateStatus
|
|
67
66
|
*/
|
|
68
|
-
unwindBlocks(toBlockNumber:
|
|
67
|
+
unwindBlocks(toBlockNumber: BlockNumber): Promise<WorldStateStatusFull>;
|
|
69
68
|
|
|
70
69
|
/**
|
|
71
70
|
* Advances the finalized block number to be the number provided
|
|
72
71
|
* @param toBlockNumber The block number that is now the tip of the finalized chain
|
|
73
72
|
* @returns The new WorldStateStatus
|
|
74
73
|
*/
|
|
75
|
-
setFinalized(toBlockNumber:
|
|
74
|
+
setFinalized(toBlockNumber: BlockNumber): Promise<WorldStateStatusSummary>;
|
|
76
75
|
|
|
77
76
|
/**
|
|
78
77
|
* Gets the current status summary of the database.
|