@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.
Files changed (53) hide show
  1. package/dest/index.js +0 -1
  2. package/dest/instrumentation/instrumentation.js +29 -20
  3. package/dest/native/index.js +0 -1
  4. package/dest/native/merkle_trees_facade.js +69 -72
  5. package/dest/native/message.js +31 -17
  6. package/dest/native/native_world_state.js +78 -53
  7. package/dest/native/native_world_state_instance.js +37 -38
  8. package/dest/native/world_state_ops_queue.js +18 -29
  9. package/dest/native/world_state_version.js +7 -8
  10. package/dest/synchronizer/config.js +12 -14
  11. package/dest/synchronizer/factory.js +5 -5
  12. package/dest/synchronizer/index.js +0 -1
  13. package/dest/synchronizer/server_world_state_synchronizer.js +66 -61
  14. package/dest/test/index.js +0 -1
  15. package/dest/test/utils.js +14 -12
  16. package/dest/world-state-db/index.js +0 -1
  17. package/dest/world-state-db/merkle_tree_db.js +1 -3
  18. package/package.json +10 -10
  19. package/src/world-state-db/index.ts +1 -1
  20. package/dest/index.d.ts +0 -5
  21. package/dest/index.d.ts.map +0 -1
  22. package/dest/instrumentation/instrumentation.d.ts +0 -20
  23. package/dest/instrumentation/instrumentation.d.ts.map +0 -1
  24. package/dest/native/index.d.ts +0 -2
  25. package/dest/native/index.d.ts.map +0 -1
  26. package/dest/native/merkle_trees_facade.d.ts +0 -37
  27. package/dest/native/merkle_trees_facade.d.ts.map +0 -1
  28. package/dest/native/message.d.ts +0 -320
  29. package/dest/native/message.d.ts.map +0 -1
  30. package/dest/native/native_world_state.d.ts +0 -54
  31. package/dest/native/native_world_state.d.ts.map +0 -1
  32. package/dest/native/native_world_state_instance.d.ts +0 -32
  33. package/dest/native/native_world_state_instance.d.ts.map +0 -1
  34. package/dest/native/world_state_ops_queue.d.ts +0 -19
  35. package/dest/native/world_state_ops_queue.d.ts.map +0 -1
  36. package/dest/native/world_state_version.d.ts +0 -24
  37. package/dest/native/world_state_version.d.ts.map +0 -1
  38. package/dest/synchronizer/config.d.ts +0 -23
  39. package/dest/synchronizer/config.d.ts.map +0 -1
  40. package/dest/synchronizer/factory.d.ts +0 -10
  41. package/dest/synchronizer/factory.d.ts.map +0 -1
  42. package/dest/synchronizer/index.d.ts +0 -3
  43. package/dest/synchronizer/index.d.ts.map +0 -1
  44. package/dest/synchronizer/server_world_state_synchronizer.d.ts +0 -76
  45. package/dest/synchronizer/server_world_state_synchronizer.d.ts.map +0 -1
  46. package/dest/test/index.d.ts +0 -2
  47. package/dest/test/index.d.ts.map +0 -1
  48. package/dest/test/utils.d.ts +0 -14
  49. package/dest/test/utils.d.ts.map +0 -1
  50. package/dest/world-state-db/index.d.ts +0 -3
  51. package/dest/world-state-db/index.d.ts.map +0 -1
  52. package/dest/world-state-db/merkle_tree_db.d.ts +0 -67
  53. package/dest/world-state-db/merkle_tree_db.d.ts.map +0 -1
@@ -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
@@ -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,3 +0,0 @@
1
- export * from './merkle_tree_db.js';
2
- export { MerkleTreeReadOperations } from '@aztec/circuit-types/interfaces';
3
- //# sourceMappingURL=index.d.ts.map
@@ -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,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEjF,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/F;;;;;;;;;;;;;;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,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE9F;;OAEG;IACH,YAAY,IAAI,wBAAwB,CAAC;IAEzC;;;;OAIG;IACH,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE7E;;;;OAIG;IACH,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEnE;;;;OAIG;IACH,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAEtE;;;OAGG;IACH,gBAAgB,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAErD,yBAAyB;IACzB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}