@aztec/world-state 0.0.0-test.1 → 0.0.1-commit.03f7ef2

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 (63) hide show
  1. package/dest/index.d.ts +1 -1
  2. package/dest/instrumentation/instrumentation.d.ts +6 -4
  3. package/dest/instrumentation/instrumentation.d.ts.map +1 -1
  4. package/dest/instrumentation/instrumentation.js +16 -8
  5. package/dest/native/bench_metrics.d.ts +23 -0
  6. package/dest/native/bench_metrics.d.ts.map +1 -0
  7. package/dest/native/bench_metrics.js +81 -0
  8. package/dest/native/fork_checkpoint.d.ts +1 -1
  9. package/dest/native/fork_checkpoint.d.ts.map +1 -1
  10. package/dest/native/index.d.ts +1 -1
  11. package/dest/native/merkle_trees_facade.d.ts +19 -7
  12. package/dest/native/merkle_trees_facade.d.ts.map +1 -1
  13. package/dest/native/merkle_trees_facade.js +62 -11
  14. package/dest/native/message.d.ts +72 -51
  15. package/dest/native/message.d.ts.map +1 -1
  16. package/dest/native/message.js +61 -61
  17. package/dest/native/native_world_state.d.ts +28 -20
  18. package/dest/native/native_world_state.d.ts.map +1 -1
  19. package/dest/native/native_world_state.js +97 -36
  20. package/dest/native/native_world_state_instance.d.ts +20 -4
  21. package/dest/native/native_world_state_instance.d.ts.map +1 -1
  22. package/dest/native/native_world_state_instance.js +42 -3
  23. package/dest/native/world_state_ops_queue.d.ts +1 -1
  24. package/dest/native/world_state_ops_queue.d.ts.map +1 -1
  25. package/dest/native/world_state_ops_queue.js +1 -1
  26. package/dest/synchronizer/config.d.ts +12 -2
  27. package/dest/synchronizer/config.d.ts.map +1 -1
  28. package/dest/synchronizer/config.js +26 -1
  29. package/dest/synchronizer/errors.d.ts +4 -0
  30. package/dest/synchronizer/errors.d.ts.map +1 -0
  31. package/dest/synchronizer/errors.js +5 -0
  32. package/dest/synchronizer/factory.d.ts +9 -2
  33. package/dest/synchronizer/factory.d.ts.map +1 -1
  34. package/dest/synchronizer/factory.js +9 -4
  35. package/dest/synchronizer/index.d.ts +1 -1
  36. package/dest/synchronizer/server_world_state_synchronizer.d.ts +20 -29
  37. package/dest/synchronizer/server_world_state_synchronizer.d.ts.map +1 -1
  38. package/dest/synchronizer/server_world_state_synchronizer.js +94 -70
  39. package/dest/test/index.d.ts +1 -1
  40. package/dest/test/utils.d.ts +16 -9
  41. package/dest/test/utils.d.ts.map +1 -1
  42. package/dest/test/utils.js +56 -49
  43. package/dest/testing.d.ts +3 -3
  44. package/dest/testing.d.ts.map +1 -1
  45. package/dest/testing.js +7 -11
  46. package/dest/world-state-db/index.d.ts +1 -1
  47. package/dest/world-state-db/merkle_tree_db.d.ts +12 -9
  48. package/dest/world-state-db/merkle_tree_db.d.ts.map +1 -1
  49. package/package.json +24 -24
  50. package/src/instrumentation/instrumentation.ts +22 -10
  51. package/src/native/bench_metrics.ts +91 -0
  52. package/src/native/merkle_trees_facade.ts +73 -17
  53. package/src/native/message.ts +92 -73
  54. package/src/native/native_world_state.ts +118 -50
  55. package/src/native/native_world_state_instance.ts +59 -8
  56. package/src/native/world_state_ops_queue.ts +1 -1
  57. package/src/synchronizer/config.ts +47 -2
  58. package/src/synchronizer/errors.ts +5 -0
  59. package/src/synchronizer/factory.ts +31 -8
  60. package/src/synchronizer/server_world_state_synchronizer.ts +132 -93
  61. package/src/test/utils.ts +94 -84
  62. package/src/testing.ts +4 -8
  63. package/src/world-state-db/merkle_tree_db.ts +12 -8
@@ -1,7 +1,8 @@
1
1
  import { MAX_NULLIFIERS_PER_TX, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX } from '@aztec/constants';
2
- import type { Fr } from '@aztec/foundation/fields';
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 } from '@aztec/stdlib/block';
5
+ import type { L2BlockNew } from '@aztec/stdlib/block';
5
6
  import type { ForkMerkleTreeOperations, MerkleTreeReadOperations } from '@aztec/stdlib/interfaces/server';
6
7
  import type { MerkleTreeId } from '@aztec/stdlib/trees';
7
8
 
@@ -40,7 +41,7 @@ export interface MerkleTreeAdminDatabase extends ForkMerkleTreeOperations {
40
41
  * @param block - The L2 block to handle.
41
42
  * @param l1ToL2Messages - The L1 to L2 messages for the block.
42
43
  */
43
- handleL2BlockAndMessages(block: L2Block, l1ToL2Messages: Fr[]): Promise<WorldStateStatusFull>;
44
+ handleL2BlockAndMessages(block: L2BlockNew, l1ToL2Messages: Fr[]): Promise<WorldStateStatusFull>;
44
45
 
45
46
  /**
46
47
  * Gets a handle that allows reading the latest committed state
@@ -52,21 +53,21 @@ export interface MerkleTreeAdminDatabase extends ForkMerkleTreeOperations {
52
53
  * @param toBlockNumber The block number of the new oldest historical block
53
54
  * @returns The new WorldStateStatus
54
55
  */
55
- removeHistoricalBlocks(toBlockNumber: bigint): Promise<WorldStateStatusFull>;
56
+ removeHistoricalBlocks(toBlockNumber: BlockNumber): Promise<WorldStateStatusFull>;
56
57
 
57
58
  /**
58
59
  * Removes all pending blocks down to but not including the given block number
59
60
  * @param toBlockNumber The block number of the new tip of the pending chain,
60
61
  * @returns The new WorldStateStatus
61
62
  */
62
- unwindBlocks(toBlockNumber: bigint): Promise<WorldStateStatusFull>;
63
+ unwindBlocks(toBlockNumber: BlockNumber): Promise<WorldStateStatusFull>;
63
64
 
64
65
  /**
65
- * Advances the finalised block number to be the number provided
66
- * @param toBlockNumber The block number that is now the tip of the finalised chain
66
+ * Advances the finalized block number to be the number provided
67
+ * @param toBlockNumber The block number that is now the tip of the finalized chain
67
68
  * @returns The new WorldStateStatus
68
69
  */
69
- setFinalised(toBlockNumber: bigint): Promise<WorldStateStatusSummary>;
70
+ setFinalized(toBlockNumber: BlockNumber): Promise<WorldStateStatusSummary>;
70
71
 
71
72
  /**
72
73
  * Gets the current status summary of the database.
@@ -76,4 +77,7 @@ export interface MerkleTreeAdminDatabase extends ForkMerkleTreeOperations {
76
77
 
77
78
  /** Stops the database */
78
79
  close(): Promise<void>;
80
+
81
+ /** Deletes the db. */
82
+ clear(): Promise<void>;
79
83
  }