@aztec/world-state 0.0.0-test.0

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 (74) hide show
  1. package/README.md +40 -0
  2. package/dest/index.d.ts +5 -0
  3. package/dest/index.d.ts.map +1 -0
  4. package/dest/index.js +4 -0
  5. package/dest/instrumentation/instrumentation.d.ts +22 -0
  6. package/dest/instrumentation/instrumentation.d.ts.map +1 -0
  7. package/dest/instrumentation/instrumentation.js +117 -0
  8. package/dest/native/fork_checkpoint.d.ts +10 -0
  9. package/dest/native/fork_checkpoint.d.ts.map +1 -0
  10. package/dest/native/fork_checkpoint.js +26 -0
  11. package/dest/native/index.d.ts +3 -0
  12. package/dest/native/index.d.ts.map +1 -0
  13. package/dest/native/index.js +2 -0
  14. package/dest/native/merkle_trees_facade.d.ts +42 -0
  15. package/dest/native/merkle_trees_facade.d.ts.map +1 -0
  16. package/dest/native/merkle_trees_facade.js +240 -0
  17. package/dest/native/message.d.ts +331 -0
  18. package/dest/native/message.d.ts.map +1 -0
  19. package/dest/native/message.js +192 -0
  20. package/dest/native/native_world_state.d.ts +57 -0
  21. package/dest/native/native_world_state.d.ts.map +1 -0
  22. package/dest/native/native_world_state.js +229 -0
  23. package/dest/native/native_world_state_instance.d.ts +33 -0
  24. package/dest/native/native_world_state_instance.d.ts.map +1 -0
  25. package/dest/native/native_world_state_instance.js +164 -0
  26. package/dest/native/world_state_ops_queue.d.ts +19 -0
  27. package/dest/native/world_state_ops_queue.d.ts.map +1 -0
  28. package/dest/native/world_state_ops_queue.js +146 -0
  29. package/dest/synchronizer/config.d.ts +23 -0
  30. package/dest/synchronizer/config.d.ts.map +1 -0
  31. package/dest/synchronizer/config.js +39 -0
  32. package/dest/synchronizer/factory.d.ts +12 -0
  33. package/dest/synchronizer/factory.d.ts.map +1 -0
  34. package/dest/synchronizer/factory.js +24 -0
  35. package/dest/synchronizer/index.d.ts +3 -0
  36. package/dest/synchronizer/index.d.ts.map +1 -0
  37. package/dest/synchronizer/index.js +2 -0
  38. package/dest/synchronizer/server_world_state_synchronizer.d.ts +79 -0
  39. package/dest/synchronizer/server_world_state_synchronizer.d.ts.map +1 -0
  40. package/dest/synchronizer/server_world_state_synchronizer.js +277 -0
  41. package/dest/test/index.d.ts +2 -0
  42. package/dest/test/index.d.ts.map +1 -0
  43. package/dest/test/index.js +1 -0
  44. package/dest/test/utils.d.ts +19 -0
  45. package/dest/test/utils.d.ts.map +1 -0
  46. package/dest/test/utils.js +99 -0
  47. package/dest/testing.d.ts +10 -0
  48. package/dest/testing.d.ts.map +1 -0
  49. package/dest/testing.js +37 -0
  50. package/dest/world-state-db/index.d.ts +3 -0
  51. package/dest/world-state-db/index.d.ts.map +1 -0
  52. package/dest/world-state-db/index.js +1 -0
  53. package/dest/world-state-db/merkle_tree_db.d.ts +68 -0
  54. package/dest/world-state-db/merkle_tree_db.d.ts.map +1 -0
  55. package/dest/world-state-db/merkle_tree_db.js +17 -0
  56. package/package.json +98 -0
  57. package/src/index.ts +4 -0
  58. package/src/instrumentation/instrumentation.ts +174 -0
  59. package/src/native/fork_checkpoint.ts +30 -0
  60. package/src/native/index.ts +2 -0
  61. package/src/native/merkle_trees_facade.ts +331 -0
  62. package/src/native/message.ts +541 -0
  63. package/src/native/native_world_state.ts +317 -0
  64. package/src/native/native_world_state_instance.ts +238 -0
  65. package/src/native/world_state_ops_queue.ts +190 -0
  66. package/src/synchronizer/config.ts +68 -0
  67. package/src/synchronizer/factory.ts +53 -0
  68. package/src/synchronizer/index.ts +2 -0
  69. package/src/synchronizer/server_world_state_synchronizer.ts +344 -0
  70. package/src/test/index.ts +1 -0
  71. package/src/test/utils.ts +153 -0
  72. package/src/testing.ts +60 -0
  73. package/src/world-state-db/index.ts +3 -0
  74. package/src/world-state-db/merkle_tree_db.ts +79 -0
@@ -0,0 +1,12 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,24 @@
1
+ import { getTelemetryClient } from '@aztec/telemetry-client';
2
+ import { WorldStateInstrumentation } from '../instrumentation/instrumentation.js';
3
+ import { NativeWorldStateService } from '../native/native_world_state.js';
4
+ import { ServerWorldStateSynchronizer } from './server_world_state_synchronizer.js';
5
+ export async function createWorldStateSynchronizer(config, l2BlockSource, prefilledPublicData = [], client = getTelemetryClient()) {
6
+ const instrumentation = new WorldStateInstrumentation(client);
7
+ const merkleTrees = await createWorldState(config, prefilledPublicData, instrumentation);
8
+ return new ServerWorldStateSynchronizer(merkleTrees, l2BlockSource, config, instrumentation);
9
+ }
10
+ export async function createWorldState(config, prefilledPublicData = [], instrumentation = new WorldStateInstrumentation(getTelemetryClient())) {
11
+ const newConfig = {
12
+ dataDirectory: config.worldStateDataDirectory ?? config.dataDirectory,
13
+ dataStoreMapSizeKB: config.worldStateDbMapSizeKb ?? config.dataStoreMapSizeKB
14
+ };
15
+ if (!config.l1Contracts?.rollupAddress) {
16
+ throw new Error('Rollup address is required to create a world state synchronizer.');
17
+ }
18
+ // If a data directory is provided in config, then create a persistent store.
19
+ const merkleTrees = newConfig.dataDirectory ? await NativeWorldStateService.new(config.l1Contracts.rollupAddress, newConfig.dataDirectory, newConfig.dataStoreMapSizeKB, prefilledPublicData, instrumentation) : await NativeWorldStateService.tmp(config.l1Contracts.rollupAddress, ![
20
+ 'true',
21
+ '1'
22
+ ].includes(process.env.DEBUG_WORLD_STATE), prefilledPublicData);
23
+ return merkleTrees;
24
+ }
@@ -0,0 +1,3 @@
1
+ export * from './server_world_state_synchronizer.js';
2
+ export * from './factory.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/synchronizer/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './server_world_state_synchronizer.js';
2
+ export * from './factory.js';
@@ -0,0 +1,79 @@
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
@@ -0,0 +1 @@
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,kBAAkB,EAClB,yBAAyB,EACzB,8BAA8B,EAC9B,MAAM,EACP,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EAClC,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAgB,KAAK,wBAAwB,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAGlH,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAElF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;;;GAIG;AACH,qBAAa,4BACX,YAAW,sBAAsB,EAAE,8BAA8B,EAAE,yBAAyB;IAa1F,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAftB,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA2B;IAE/D,OAAO,CAAC,wBAAwB,CAAK;IACrC,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,YAAY,CAAuD;IAC3E,OAAO,CAAC,oBAAoB,CAA4E;IAExG,OAAO,CAAC,WAAW,CAAgC;IACnD,SAAS,CAAC,WAAW,EAAE,aAAa,GAAG,SAAS,CAAC;gBAG9B,YAAY,EAAE,uBAAuB,EACrC,aAAa,EAAE,aAAa,GAAG,mBAAmB,EAClD,MAAM,EAAE,gBAAgB,EACjC,eAAe,4BAAsD,EAC5D,GAAG,yCAA8B;IAW7C,YAAY,IAAI,wBAAwB;IAIxC,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,wBAAwB;IAI1D,IAAI,CAAC,WAAW,CAAC,EAAE,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"}
@@ -0,0 +1,277 @@
1
+ import { L1_TO_L2_MSG_SUBTREE_HEIGHT } from '@aztec/constants';
2
+ import { createLogger } from '@aztec/foundation/log';
3
+ import { promiseWithResolvers } from '@aztec/foundation/promise';
4
+ import { elapsed } from '@aztec/foundation/timer';
5
+ import { MerkleTreeCalculator } from '@aztec/foundation/trees';
6
+ import { SHA256Trunc } from '@aztec/merkle-tree';
7
+ import { WorldStateRunningState } from '@aztec/stdlib/interfaces/server';
8
+ import { MerkleTreeId } from '@aztec/stdlib/trees';
9
+ import { TraceableL2BlockStream, getTelemetryClient } from '@aztec/telemetry-client';
10
+ import { WorldStateInstrumentation } from '../instrumentation/instrumentation.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
+ */ export class ServerWorldStateSynchronizer {
16
+ merkleTreeDb;
17
+ l2BlockSource;
18
+ config;
19
+ instrumentation;
20
+ log;
21
+ merkleTreeCommitted;
22
+ latestBlockNumberAtStart;
23
+ historyToKeep;
24
+ currentState;
25
+ latestBlockHashQuery;
26
+ syncPromise;
27
+ blockStream;
28
+ constructor(merkleTreeDb, l2BlockSource, config, instrumentation = new WorldStateInstrumentation(getTelemetryClient()), log = createLogger('world_state')){
29
+ this.merkleTreeDb = merkleTreeDb;
30
+ this.l2BlockSource = l2BlockSource;
31
+ this.config = config;
32
+ this.instrumentation = instrumentation;
33
+ this.log = log;
34
+ this.latestBlockNumberAtStart = 0;
35
+ this.currentState = WorldStateRunningState.IDLE;
36
+ this.latestBlockHashQuery = undefined;
37
+ this.syncPromise = promiseWithResolvers();
38
+ this.merkleTreeCommitted = this.merkleTreeDb.getCommitted();
39
+ this.historyToKeep = config.worldStateBlockHistory < 1 ? undefined : config.worldStateBlockHistory;
40
+ this.log.info(`Created world state synchroniser with block history of ${this.historyToKeep === undefined ? 'infinity' : this.historyToKeep}`);
41
+ }
42
+ getCommitted() {
43
+ return this.merkleTreeDb.getCommitted();
44
+ }
45
+ getSnapshot(blockNumber) {
46
+ return this.merkleTreeDb.getSnapshot(blockNumber);
47
+ }
48
+ fork(blockNumber) {
49
+ return this.merkleTreeDb.fork(blockNumber);
50
+ }
51
+ async start() {
52
+ if (this.currentState === WorldStateRunningState.STOPPED) {
53
+ throw new Error('Synchronizer already stopped');
54
+ }
55
+ if (this.currentState !== WorldStateRunningState.IDLE) {
56
+ return this.syncPromise;
57
+ }
58
+ // Get the current latest block number
59
+ this.latestBlockNumberAtStart = await (this.config.worldStateProvenBlocksOnly ? this.l2BlockSource.getProvenBlockNumber() : this.l2BlockSource.getBlockNumber());
60
+ const blockToDownloadFrom = await this.getLatestBlockNumber() + 1;
61
+ if (blockToDownloadFrom <= this.latestBlockNumberAtStart) {
62
+ // If there are blocks to be retrieved, go to a synching state
63
+ this.setCurrentState(WorldStateRunningState.SYNCHING);
64
+ this.log.verbose(`Starting sync from ${blockToDownloadFrom} to latest block ${this.latestBlockNumberAtStart}`);
65
+ } else {
66
+ // If no blocks to be retrieved, go straight to running
67
+ this.setCurrentState(WorldStateRunningState.RUNNING);
68
+ this.syncPromise.resolve();
69
+ this.log.debug(`Next block ${blockToDownloadFrom} already beyond latest block ${this.latestBlockNumberAtStart}`);
70
+ }
71
+ this.blockStream = this.createBlockStream();
72
+ this.blockStream.start();
73
+ this.log.info(`Started world state synchronizer from block ${blockToDownloadFrom}`);
74
+ return this.syncPromise.promise;
75
+ }
76
+ createBlockStream() {
77
+ const tracer = this.instrumentation.telemetry.getTracer('WorldStateL2BlockStream');
78
+ const logger = createLogger('world-state:block_stream');
79
+ return new TraceableL2BlockStream(this.l2BlockSource, this, this, tracer, 'WorldStateL2BlockStream', logger, {
80
+ proven: this.config.worldStateProvenBlocksOnly,
81
+ pollIntervalMS: this.config.worldStateBlockCheckIntervalMS,
82
+ batchSize: this.config.worldStateBlockRequestBatchSize
83
+ });
84
+ }
85
+ async stop() {
86
+ this.log.debug('Stopping block stream...');
87
+ await this.blockStream?.stop();
88
+ this.log.debug('Stopping merkle trees...');
89
+ await this.merkleTreeDb.close();
90
+ this.setCurrentState(WorldStateRunningState.STOPPED);
91
+ this.log.info(`Stopped world state synchronizer`);
92
+ }
93
+ async status() {
94
+ const summary = await this.merkleTreeDb.getStatusSummary();
95
+ const status = {
96
+ latestBlockNumber: Number(summary.unfinalisedBlockNumber),
97
+ latestBlockHash: await this.getL2BlockHash(Number(summary.unfinalisedBlockNumber)) ?? '',
98
+ finalisedBlockNumber: Number(summary.finalisedBlockNumber),
99
+ oldestHistoricBlockNumber: Number(summary.oldestHistoricalBlock),
100
+ treesAreSynched: summary.treesAreSynched
101
+ };
102
+ return {
103
+ syncSummary: status,
104
+ state: this.currentState
105
+ };
106
+ }
107
+ async getLatestBlockNumber() {
108
+ return (await this.getL2Tips()).latest.number;
109
+ }
110
+ /**
111
+ * Forces an immediate sync.
112
+ * @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.
113
+ * @returns A promise that resolves with the block number the world state was synced to
114
+ */ async syncImmediate(targetBlockNumber) {
115
+ if (this.currentState !== WorldStateRunningState.RUNNING || this.blockStream === undefined) {
116
+ throw new Error(`World State is not running. Unable to perform sync.`);
117
+ }
118
+ // If we have been given a block number to sync to and we have reached that number then return
119
+ const currentBlockNumber = await this.getLatestBlockNumber();
120
+ if (targetBlockNumber !== undefined && targetBlockNumber <= currentBlockNumber) {
121
+ return currentBlockNumber;
122
+ }
123
+ this.log.debug(`World State at ${currentBlockNumber} told to sync to ${targetBlockNumber ?? 'latest'}`);
124
+ // Force the block stream to sync against the archiver now
125
+ await this.blockStream.sync();
126
+ // If we have been given a block number to sync to and we have not reached that number then fail
127
+ const updatedBlockNumber = await this.getLatestBlockNumber();
128
+ if (targetBlockNumber !== undefined && targetBlockNumber > updatedBlockNumber) {
129
+ throw new Error(`Unable to sync to block number ${targetBlockNumber} (last synced is ${updatedBlockNumber})`);
130
+ }
131
+ return updatedBlockNumber;
132
+ }
133
+ /** Returns the L2 block hash for a given number. Used by the L2BlockStream for detecting reorgs. */ async getL2BlockHash(number) {
134
+ if (number === 0) {
135
+ return (await this.merkleTreeCommitted.getInitialHeader().hash()).toString();
136
+ }
137
+ if (this.latestBlockHashQuery?.hash === undefined || number !== this.latestBlockHashQuery.blockNumber) {
138
+ this.latestBlockHashQuery = {
139
+ hash: await this.merkleTreeCommitted.getLeafValue(MerkleTreeId.ARCHIVE, BigInt(number)).then((leaf)=>leaf?.toString()),
140
+ blockNumber: number
141
+ };
142
+ }
143
+ return this.latestBlockHashQuery.hash;
144
+ }
145
+ /** Returns the latest L2 block number for each tip of the chain (latest, proven, finalized). */ async getL2Tips() {
146
+ const status = await this.merkleTreeDb.getStatusSummary();
147
+ const unfinalisedBlockHash = await this.getL2BlockHash(Number(status.unfinalisedBlockNumber));
148
+ const latestBlockId = {
149
+ number: Number(status.unfinalisedBlockNumber),
150
+ hash: unfinalisedBlockHash
151
+ };
152
+ return {
153
+ latest: latestBlockId,
154
+ finalized: {
155
+ number: Number(status.finalisedBlockNumber),
156
+ hash: ''
157
+ },
158
+ proven: {
159
+ number: Number(status.finalisedBlockNumber),
160
+ hash: ''
161
+ }
162
+ };
163
+ }
164
+ /** Handles an event emitted by the block stream. */ async handleBlockStreamEvent(event) {
165
+ try {
166
+ switch(event.type){
167
+ case 'blocks-added':
168
+ await this.handleL2Blocks(event.blocks);
169
+ break;
170
+ case 'chain-pruned':
171
+ await this.handleChainPruned(event.blockNumber);
172
+ break;
173
+ case 'chain-proven':
174
+ await this.handleChainProven(event.blockNumber);
175
+ break;
176
+ case 'chain-finalized':
177
+ await this.handleChainFinalized(event.blockNumber);
178
+ break;
179
+ }
180
+ } catch (err) {
181
+ this.log.error('Error processing block stream', err);
182
+ }
183
+ }
184
+ /**
185
+ * Handles a list of L2 blocks (i.e. Inserts the new note hashes into the merkle tree).
186
+ * @param l2Blocks - The L2 blocks to handle.
187
+ * @returns Whether the block handled was produced by this same node.
188
+ */ async handleL2Blocks(l2Blocks) {
189
+ this.log.trace(`Handling L2 blocks ${l2Blocks[0].number} to ${l2Blocks.at(-1).number}`);
190
+ const messagePromises = l2Blocks.map((block)=>this.l2BlockSource.getL1ToL2Messages(BigInt(block.number)));
191
+ const l1ToL2Messages = await Promise.all(messagePromises);
192
+ let updateStatus = undefined;
193
+ for(let i = 0; i < l2Blocks.length; i++){
194
+ const [duration, result] = await elapsed(()=>this.handleL2Block(l2Blocks[i], l1ToL2Messages[i]));
195
+ this.log.verbose(`World state updated with L2 block ${l2Blocks[i].number}`, {
196
+ eventName: 'l2-block-handled',
197
+ duration,
198
+ unfinalisedBlockNumber: result.summary.unfinalisedBlockNumber,
199
+ finalisedBlockNumber: result.summary.finalisedBlockNumber,
200
+ oldestHistoricBlock: result.summary.oldestHistoricalBlock,
201
+ ...l2Blocks[i].getStats()
202
+ });
203
+ updateStatus = result;
204
+ }
205
+ if (!updateStatus) {
206
+ return;
207
+ }
208
+ this.instrumentation.updateWorldStateMetrics(updateStatus);
209
+ }
210
+ /**
211
+ * Handles a single L2 block (i.e. Inserts the new note hashes into the merkle tree).
212
+ * @param l2Block - The L2 block to handle.
213
+ * @param l1ToL2Messages - The L1 to L2 messages for the block.
214
+ * @returns Whether the block handled was produced by this same node.
215
+ */ async handleL2Block(l2Block, l1ToL2Messages) {
216
+ // First we check that the L1 to L2 messages hash to the block inHash.
217
+ // Note that we cannot optimize this check by checking the root of the subtree after inserting the messages
218
+ // to the real L1_TO_L2_MESSAGE_TREE (like we do in merkleTreeDb.handleL2BlockAndMessages(...)) because that
219
+ // tree uses pedersen and we don't have access to the converted root.
220
+ await this.verifyMessagesHashToInHash(l1ToL2Messages, l2Block.header.contentCommitment.inHash);
221
+ // If the above check succeeds, we can proceed to handle the block.
222
+ this.log.trace(`Pushing L2 block ${l2Block.number} to merkle tree db `, {
223
+ blockNumber: l2Block.number,
224
+ blockHash: await l2Block.hash().then((h)=>h.toString()),
225
+ l1ToL2Messages: l1ToL2Messages.map((msg)=>msg.toString())
226
+ });
227
+ const result = await this.merkleTreeDb.handleL2BlockAndMessages(l2Block, l1ToL2Messages);
228
+ if (this.currentState === WorldStateRunningState.SYNCHING && l2Block.number >= this.latestBlockNumberAtStart) {
229
+ this.setCurrentState(WorldStateRunningState.RUNNING);
230
+ this.syncPromise.resolve();
231
+ }
232
+ return result;
233
+ }
234
+ async handleChainFinalized(blockNumber) {
235
+ this.log.verbose(`Finalized chain is now at block ${blockNumber}`);
236
+ const summary = await this.merkleTreeDb.setFinalised(BigInt(blockNumber));
237
+ if (this.historyToKeep === undefined) {
238
+ return;
239
+ }
240
+ const newHistoricBlock = summary.finalisedBlockNumber - BigInt(this.historyToKeep) + 1n;
241
+ if (newHistoricBlock <= 1) {
242
+ return;
243
+ }
244
+ this.log.verbose(`Pruning historic blocks to ${newHistoricBlock}`);
245
+ const status = await this.merkleTreeDb.removeHistoricalBlocks(newHistoricBlock);
246
+ this.log.debug(`World state summary `, status.summary);
247
+ }
248
+ handleChainProven(blockNumber) {
249
+ this.log.debug(`Proven chain is now at block ${blockNumber}`);
250
+ return Promise.resolve();
251
+ }
252
+ async handleChainPruned(blockNumber) {
253
+ this.log.warn(`Chain pruned to block ${blockNumber}`);
254
+ const status = await this.merkleTreeDb.unwindBlocks(BigInt(blockNumber));
255
+ this.latestBlockHashQuery = undefined;
256
+ this.instrumentation.updateWorldStateMetrics(status);
257
+ }
258
+ /**
259
+ * Method to set the value of the current state.
260
+ * @param newState - New state value.
261
+ */ setCurrentState(newState) {
262
+ this.currentState = newState;
263
+ this.log.debug(`Moved to state ${WorldStateRunningState[this.currentState]}`);
264
+ }
265
+ /**
266
+ * Verifies that the L1 to L2 messages hash to the block inHash.
267
+ * @param l1ToL2Messages - The L1 to L2 messages for the block.
268
+ * @param inHash - The inHash of the block.
269
+ * @throws If the L1 to L2 messages do not hash to the block inHash.
270
+ */ async verifyMessagesHashToInHash(l1ToL2Messages, inHash) {
271
+ const treeCalculator = await MerkleTreeCalculator.create(L1_TO_L2_MSG_SUBTREE_HEIGHT, Buffer.alloc(32), (lhs, rhs)=>Promise.resolve(new SHA256Trunc().hash(lhs, rhs)));
272
+ const root = await treeCalculator.computeTreeRoot(l1ToL2Messages.map((msg)=>msg.toBuffer()));
273
+ if (!root.equals(inHash)) {
274
+ throw new Error('Obtained L1 to L2 messages failed to be hashed to the block inHash');
275
+ }
276
+ }
277
+ }
@@ -0,0 +1,2 @@
1
+ export * from './utils.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './utils.js';
@@ -0,0 +1,19 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,99 @@
1
+ import { MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, NULLIFIER_SUBTREE_HEIGHT, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
2
+ import { padArrayEnd } from '@aztec/foundation/collection';
3
+ import { Fr } from '@aztec/foundation/fields';
4
+ import { L2Block } from '@aztec/stdlib/block';
5
+ import { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
6
+ export async function mockBlock(blockNum, size, fork) {
7
+ const l2Block = await L2Block.random(blockNum, size);
8
+ const l1ToL2Messages = Array(16).fill(0).map(Fr.random);
9
+ // Sync the append only trees
10
+ {
11
+ const noteHashesPadded = l2Block.body.txEffects.flatMap((txEffect)=>padArrayEnd(txEffect.noteHashes, Fr.ZERO, MAX_NOTE_HASHES_PER_TX));
12
+ await fork.appendLeaves(MerkleTreeId.NOTE_HASH_TREE, noteHashesPadded);
13
+ const l1ToL2MessagesPadded = padArrayEnd(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
14
+ await fork.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, l1ToL2MessagesPadded);
15
+ }
16
+ // Sync the indexed trees
17
+ {
18
+ // We insert the public data tree leaves with one batch per tx to avoid updating the same key twice
19
+ for (const txEffect of l2Block.body.txEffects){
20
+ await fork.batchInsert(MerkleTreeId.PUBLIC_DATA_TREE, txEffect.publicDataWrites.map((write)=>write.toBuffer()), 0);
21
+ const nullifiersPadded = padArrayEnd(txEffect.nullifiers, Fr.ZERO, MAX_NULLIFIERS_PER_TX);
22
+ await fork.batchInsert(MerkleTreeId.NULLIFIER_TREE, nullifiersPadded.map((nullifier)=>nullifier.toBuffer()), NULLIFIER_SUBTREE_HEIGHT);
23
+ }
24
+ }
25
+ const state = await fork.getStateReference();
26
+ l2Block.header.state = state;
27
+ await fork.updateArchive(l2Block.header);
28
+ const archiveState = await fork.getTreeInfo(MerkleTreeId.ARCHIVE);
29
+ l2Block.archive = new AppendOnlyTreeSnapshot(Fr.fromBuffer(archiveState.root), Number(archiveState.size));
30
+ return {
31
+ block: l2Block,
32
+ messages: l1ToL2Messages
33
+ };
34
+ }
35
+ export async function mockEmptyBlock(blockNum, fork) {
36
+ const l2Block = L2Block.empty();
37
+ const l1ToL2Messages = Array(16).fill(0).map(Fr.zero);
38
+ l2Block.header.globalVariables.blockNumber = new Fr(blockNum);
39
+ // Sync the append only trees
40
+ {
41
+ const noteHashesPadded = l2Block.body.txEffects.flatMap((txEffect)=>padArrayEnd(txEffect.noteHashes, Fr.ZERO, MAX_NOTE_HASHES_PER_TX));
42
+ await fork.appendLeaves(MerkleTreeId.NOTE_HASH_TREE, noteHashesPadded);
43
+ const l1ToL2MessagesPadded = padArrayEnd(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
44
+ await fork.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, l1ToL2MessagesPadded);
45
+ }
46
+ // Sync the indexed trees
47
+ {
48
+ // We insert the public data tree leaves with one batch per tx to avoid updating the same key twice
49
+ for (const txEffect of l2Block.body.txEffects){
50
+ await fork.batchInsert(MerkleTreeId.PUBLIC_DATA_TREE, txEffect.publicDataWrites.map((write)=>write.toBuffer()), 0);
51
+ const nullifiersPadded = padArrayEnd(txEffect.nullifiers, Fr.ZERO, MAX_NULLIFIERS_PER_TX);
52
+ await fork.batchInsert(MerkleTreeId.NULLIFIER_TREE, nullifiersPadded.map((nullifier)=>nullifier.toBuffer()), NULLIFIER_SUBTREE_HEIGHT);
53
+ }
54
+ }
55
+ const state = await fork.getStateReference();
56
+ l2Block.header.state = state;
57
+ await fork.updateArchive(l2Block.header);
58
+ const archiveState = await fork.getTreeInfo(MerkleTreeId.ARCHIVE);
59
+ l2Block.archive = new AppendOnlyTreeSnapshot(Fr.fromBuffer(archiveState.root), Number(archiveState.size));
60
+ return {
61
+ block: l2Block,
62
+ messages: l1ToL2Messages
63
+ };
64
+ }
65
+ export async function mockBlocks(from, count, numTxs, worldState) {
66
+ const tempFork = await worldState.fork(from - 1);
67
+ const blocks = [];
68
+ const messagesArray = [];
69
+ for(let blockNumber = from; blockNumber < from + count; blockNumber++){
70
+ const { block, messages } = await mockBlock(blockNumber, numTxs, tempFork);
71
+ blocks.push(block);
72
+ messagesArray.push(messages);
73
+ }
74
+ await tempFork.close();
75
+ return {
76
+ blocks,
77
+ messages: messagesArray
78
+ };
79
+ }
80
+ export async function assertSameState(forkA, forkB) {
81
+ const nativeStateRef = await forkA.getStateReference();
82
+ const nativeArchive = await forkA.getTreeInfo(MerkleTreeId.ARCHIVE);
83
+ const legacyStateRef = await forkB.getStateReference();
84
+ const legacyArchive = await forkB.getTreeInfo(MerkleTreeId.ARCHIVE);
85
+ expect(nativeStateRef).toEqual(legacyStateRef);
86
+ expect(nativeArchive).toEqual(legacyArchive);
87
+ }
88
+ export async function compareChains(left, right) {
89
+ for (const treeId of [
90
+ MerkleTreeId.ARCHIVE,
91
+ MerkleTreeId.L1_TO_L2_MESSAGE_TREE,
92
+ MerkleTreeId.NOTE_HASH_TREE,
93
+ MerkleTreeId.NULLIFIER_TREE,
94
+ MerkleTreeId.PUBLIC_DATA_TREE
95
+ ]){
96
+ expect(await left.getTreeInfo(treeId)).toEqual(await right.getTreeInfo(treeId));
97
+ expect(await left.getSiblingPath(treeId, 0n)).toEqual(await right.getSiblingPath(treeId, 0n));
98
+ }
99
+ }
@@ -0,0 +1,10 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,37 @@
1
+ import { GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH } from '@aztec/constants';
2
+ import { Fr } from '@aztec/foundation/fields';
3
+ import { computeFeePayerBalanceLeafSlot } from '@aztec/protocol-contracts/fee-juice';
4
+ import { MerkleTreeId, PublicDataTreeLeaf } from '@aztec/stdlib/trees';
5
+ import { NativeWorldStateService } from './native/index.js';
6
+ async function generateGenesisValues(prefilledPublicData) {
7
+ if (!prefilledPublicData.length) {
8
+ return {
9
+ genesisArchiveRoot: new Fr(GENESIS_ARCHIVE_ROOT),
10
+ genesisBlockHash: new Fr(GENESIS_BLOCK_HASH)
11
+ };
12
+ }
13
+ // Create a temporary world state to compute the genesis values.
14
+ const ws = await NativeWorldStateService.tmp(undefined /* rollupAddress */ , true, prefilledPublicData);
15
+ const initialHeader = ws.getInitialHeader();
16
+ const genesisBlockHash = await initialHeader.hash();
17
+ const genesisArchiveRoot = new Fr((await ws.getCommitted().getTreeInfo(MerkleTreeId.ARCHIVE)).root);
18
+ await ws.close();
19
+ return {
20
+ genesisArchiveRoot,
21
+ genesisBlockHash
22
+ };
23
+ }
24
+ export const defaultInitialAccountFeeJuice = new Fr(10n ** 22n);
25
+ export async function getGenesisValues(initialAccounts, initialAccountFeeJuice = defaultInitialAccountFeeJuice, genesisPublicData = []) {
26
+ // Top up the accounts with fee juice.
27
+ let prefilledPublicData = await Promise.all(initialAccounts.map(async (address)=>new PublicDataTreeLeaf(await computeFeePayerBalanceLeafSlot(address), initialAccountFeeJuice)));
28
+ // Add user-defined public data
29
+ prefilledPublicData = prefilledPublicData.concat(genesisPublicData);
30
+ prefilledPublicData.sort((a, b)=>b.slot.lt(a.slot) ? 1 : -1);
31
+ const { genesisBlockHash, genesisArchiveRoot } = await generateGenesisValues(prefilledPublicData);
32
+ return {
33
+ genesisArchiveRoot,
34
+ genesisBlockHash,
35
+ prefilledPublicData
36
+ };
37
+ }
@@ -0,0 +1,3 @@
1
+ export * from './merkle_tree_db.js';
2
+ export type { MerkleTreeReadOperations } from '@aztec/stdlib/interfaces/server';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1 @@
1
+ export * from './merkle_tree_db.js';