@aztec/world-state 0.66.0 → 0.67.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 (34) hide show
  1. package/dest/native/merkle_trees_facade.d.ts +6 -6
  2. package/dest/native/merkle_trees_facade.d.ts.map +1 -1
  3. package/dest/native/merkle_trees_facade.js +1 -1
  4. package/dest/native/native_world_state.d.ts +3 -3
  5. package/dest/native/native_world_state.d.ts.map +1 -1
  6. package/dest/native/native_world_state.js +7 -7
  7. package/dest/native/native_world_state_instance.d.ts.map +1 -1
  8. package/dest/native/native_world_state_instance.js +3 -3
  9. package/dest/synchronizer/factory.d.ts.map +1 -1
  10. package/dest/synchronizer/factory.js +4 -4
  11. package/dest/synchronizer/instrumentation.d.ts +8 -1
  12. package/dest/synchronizer/instrumentation.d.ts.map +1 -1
  13. package/dest/synchronizer/instrumentation.js +51 -72
  14. package/dest/synchronizer/server_world_state_synchronizer.d.ts.map +1 -1
  15. package/dest/synchronizer/server_world_state_synchronizer.js +8 -9
  16. package/dest/world-state-db/merkle_tree_operations_facade.d.ts +3 -3
  17. package/dest/world-state-db/merkle_tree_operations_facade.d.ts.map +1 -1
  18. package/dest/world-state-db/merkle_tree_operations_facade.js +1 -1
  19. package/dest/world-state-db/merkle_tree_snapshot_operations_facade.d.ts +2 -2
  20. package/dest/world-state-db/merkle_tree_snapshot_operations_facade.d.ts.map +1 -1
  21. package/dest/world-state-db/merkle_tree_snapshot_operations_facade.js +2 -2
  22. package/dest/world-state-db/merkle_trees.d.ts +5 -4
  23. package/dest/world-state-db/merkle_trees.d.ts.map +1 -1
  24. package/dest/world-state-db/merkle_trees.js +7 -7
  25. package/package.json +12 -8
  26. package/src/native/merkle_trees_facade.ts +5 -5
  27. package/src/native/native_world_state.ts +9 -9
  28. package/src/native/native_world_state_instance.ts +2 -2
  29. package/src/synchronizer/factory.ts +3 -6
  30. package/src/synchronizer/instrumentation.ts +54 -84
  31. package/src/synchronizer/server_world_state_synchronizer.ts +7 -8
  32. package/src/world-state-db/merkle_tree_operations_facade.ts +3 -3
  33. package/src/world-state-db/merkle_tree_snapshot_operations_facade.ts +8 -2
  34. package/src/world-state-db/merkle_trees.ts +14 -10
@@ -1,7 +1,7 @@
1
1
  import { type L1ToL2MessageSource, type L2BlockSource } from '@aztec/circuit-types';
2
- import { createDebugLogger } from '@aztec/foundation/log';
2
+ import { createLogger } from '@aztec/foundation/log';
3
3
  import { type DataStoreConfig } from '@aztec/kv-store/config';
4
- import { createStore } from '@aztec/kv-store/utils';
4
+ import { createStore } from '@aztec/kv-store/lmdb';
5
5
  import { type TelemetryClient } from '@aztec/telemetry-client';
6
6
  import { NoopTelemetryClient } from '@aztec/telemetry-client/noop';
7
7
 
@@ -34,10 +34,7 @@ export async function createWorldState(
34
34
 
35
35
  // If a data directory is provided in config, then create a persistent store.
36
36
  const merkleTrees = ['true', '1'].includes(process.env.USE_LEGACY_WORLD_STATE ?? '')
37
- ? await MerkleTrees.new(
38
- await createStore('world-state', newConfig, createDebugLogger('aztec:world-state:lmdb')),
39
- client,
40
- )
37
+ ? await MerkleTrees.new(await createStore('world-state', newConfig, createLogger('world-state:lmdb')), client)
41
38
  : newConfig.dataDirectory
42
39
  ? await NativeWorldStateService.new(
43
40
  config.l1Contracts.rollupAddress,
@@ -1,121 +1,91 @@
1
1
  import { MerkleTreeId } from '@aztec/circuit-types';
2
- import { type DebugLogger, createDebugLogger } from '@aztec/foundation/log';
3
- import { type Gauge, type Meter, type TelemetryClient, ValueType } from '@aztec/telemetry-client';
2
+ import { createLogger } from '@aztec/foundation/log';
3
+ import { Attributes, type Gauge, type TelemetryClient, ValueType } from '@aztec/telemetry-client';
4
4
 
5
5
  import { type DBStats, type TreeDBStats, type TreeMeta, type WorldStateStatusFull } from '../native/message.js';
6
6
 
7
- type TreeTypeString = 'nullifier' | 'note_hash' | 'archive' | 'message' | 'public_data';
8
7
  type DBTypeString = 'leaf_preimage' | 'leaf_indices' | 'nodes' | 'blocks' | 'block_indices';
9
8
 
10
- class TreeDBInstrumentation {
9
+ export class WorldStateInstrumentation {
10
+ private dbMapSize: Gauge;
11
+ private treeSize: Gauge;
12
+ private unfinalisedHeight: Gauge;
13
+ private finalisedHeight: Gauge;
14
+ private oldestBlock: Gauge;
11
15
  private dbNumItems: Gauge;
12
16
  private dbUsedSize: Gauge;
13
17
 
14
- constructor(meter: Meter, treeName: TreeTypeString, dbName: DBTypeString) {
15
- this.dbUsedSize = meter.createGauge(`aztec.world_state.db_used_size.${dbName}.${treeName}`, {
16
- description: `The current used database size for the ${treeName} tree ${dbName} database`,
18
+ constructor(telemetry: TelemetryClient, private log = createLogger('world-state:instrumentation')) {
19
+ const meter = telemetry.getMeter('World State');
20
+ this.dbMapSize = meter.createGauge(`aztec.world_state.db_map_size`, {
21
+ description: `The current configured map size for each merkle tree`,
17
22
  valueType: ValueType.INT,
18
23
  });
19
24
 
20
- this.dbNumItems = meter.createGauge(`aztec.world_state.db_num_items.${dbName}.${treeName}`, {
21
- description: `The current number of items in the ${treeName} tree ${dbName} database`,
25
+ this.treeSize = meter.createGauge(`aztec.world_state.tree_size`, {
26
+ description: `The current number of leaves in each merkle tree`,
22
27
  valueType: ValueType.INT,
23
28
  });
24
- }
25
-
26
- public updateMetrics(treeDbStats: DBStats) {
27
- this.dbNumItems.record(Number(treeDbStats.numDataItems));
28
- this.dbUsedSize.record(Number(treeDbStats.totalUsedSize));
29
- }
30
- }
31
-
32
- class TreeInstrumentation {
33
- private treeDbInstrumentation: Map<DBTypeString, TreeDBInstrumentation> = new Map<
34
- DBTypeString,
35
- TreeDBInstrumentation
36
- >();
37
- private dbMapSize: Gauge;
38
- private treeSize: Gauge;
39
- private unfinalisedHeight: Gauge;
40
- private finalisedHeight: Gauge;
41
- private oldestBlock: Gauge;
42
29
 
43
- constructor(meter: Meter, treeName: TreeTypeString, private log: DebugLogger) {
44
- this.dbMapSize = meter.createGauge(`aztec.world_state.db_map_size.${treeName}`, {
45
- description: `The current configured map size for the ${treeName} tree`,
30
+ this.unfinalisedHeight = meter.createGauge(`aztec.world_state.unfinalised_height`, {
31
+ description: `The unfinalised block height of each merkle tree`,
46
32
  valueType: ValueType.INT,
47
33
  });
48
34
 
49
- this.treeSize = meter.createGauge(`aztec.world_state.tree_size.${treeName}`, {
50
- description: `The current number of leaves in the ${treeName} tree`,
35
+ this.finalisedHeight = meter.createGauge(`aztec.world_state.finalised_height`, {
36
+ description: `The finalised block height of each merkle tree`,
51
37
  valueType: ValueType.INT,
52
38
  });
53
39
 
54
- this.unfinalisedHeight = meter.createGauge(`aztec.world_state.unfinalised_height.${treeName}`, {
55
- description: `The unfinalised block height of the ${treeName} tree`,
40
+ this.oldestBlock = meter.createGauge(`aztec.world_state.oldest_block`, {
41
+ description: `The oldest historical block of each merkle tree`,
56
42
  valueType: ValueType.INT,
57
43
  });
58
44
 
59
- this.finalisedHeight = meter.createGauge(`aztec.world_state.finalised_height.${treeName}`, {
60
- description: `The finalised block height of the ${treeName} tree`,
45
+ this.dbUsedSize = meter.createGauge(`aztec.world_state.db_used_size`, {
46
+ description: `The current used database size for each db of each merkle tree`,
61
47
  valueType: ValueType.INT,
62
48
  });
63
49
 
64
- this.oldestBlock = meter.createGauge(`aztec.world_state.oldest_block.${treeName}`, {
65
- description: `The oldest historical block of the ${treeName} tree`,
50
+ this.dbNumItems = meter.createGauge(`aztec.world_state.db_num_items`, {
51
+ description: `The current number of items in each database of each merkle tree`,
66
52
  valueType: ValueType.INT,
67
53
  });
68
-
69
- this.treeDbInstrumentation.set('blocks', new TreeDBInstrumentation(meter, treeName, 'blocks'));
70
- this.treeDbInstrumentation.set('nodes', new TreeDBInstrumentation(meter, treeName, 'nodes'));
71
- this.treeDbInstrumentation.set('leaf_preimage', new TreeDBInstrumentation(meter, treeName, 'leaf_preimage'));
72
- this.treeDbInstrumentation.set('leaf_indices', new TreeDBInstrumentation(meter, treeName, 'leaf_indices'));
73
- this.treeDbInstrumentation.set('block_indices', new TreeDBInstrumentation(meter, treeName, 'block_indices'));
74
- }
75
-
76
- private updateDBMetrics(dbName: DBTypeString, dbStats: DBStats) {
77
- const inst = this.treeDbInstrumentation.get(dbName);
78
- if (!inst) {
79
- this.log.error(`Failed to find instrumentation for ${dbName}`);
80
- return;
81
- }
82
- inst.updateMetrics(dbStats);
83
54
  }
84
55
 
85
- public updateMetrics(treeDbStats: TreeDBStats, treeMeta: TreeMeta) {
86
- this.dbMapSize.record(Number(treeDbStats.mapSize));
87
- this.treeSize.record(Number(treeMeta.committedSize));
88
- this.finalisedHeight.record(Number(treeMeta.finalisedBlockHeight));
89
- this.unfinalisedHeight.record(Number(treeMeta.unfinalisedBlockHeight));
90
- this.oldestBlock.record(Number(treeMeta.oldestHistoricBlock));
91
-
92
- this.updateDBMetrics('leaf_indices', treeDbStats.leafIndicesDBStats);
93
- this.updateDBMetrics('leaf_preimage', treeDbStats.leafPreimagesDBStats);
94
- this.updateDBMetrics('blocks', treeDbStats.blocksDBStats);
95
- this.updateDBMetrics('nodes', treeDbStats.nodesDBStats);
96
- this.updateDBMetrics('block_indices', treeDbStats.blockIndicesDBStats);
97
- }
98
- }
99
-
100
- export class WorldStateInstrumentation {
101
- private treeInstrumentation: Map<MerkleTreeId, TreeInstrumentation> = new Map<MerkleTreeId, TreeInstrumentation>();
56
+ private updateTreeStats(treeDbStats: TreeDBStats, treeMeta: TreeMeta, tree: MerkleTreeId) {
57
+ this.dbMapSize.record(Number(treeDbStats.mapSize), {
58
+ [Attributes.MERKLE_TREE_NAME]: MerkleTreeId[tree],
59
+ });
60
+ this.treeSize.record(Number(treeMeta.size), {
61
+ [Attributes.MERKLE_TREE_NAME]: MerkleTreeId[tree],
62
+ });
63
+ this.unfinalisedHeight.record(Number(treeMeta.unfinalisedBlockHeight), {
64
+ [Attributes.MERKLE_TREE_NAME]: MerkleTreeId[tree],
65
+ });
66
+ this.finalisedHeight.record(Number(treeMeta.finalisedBlockHeight), {
67
+ [Attributes.MERKLE_TREE_NAME]: MerkleTreeId[tree],
68
+ });
69
+ this.oldestBlock.record(Number(treeMeta.oldestHistoricBlock), {
70
+ [Attributes.MERKLE_TREE_NAME]: MerkleTreeId[tree],
71
+ });
102
72
 
103
- constructor(telemetry: TelemetryClient, private log = createDebugLogger('aztec:world-state:instrumentation')) {
104
- const meter = telemetry.getMeter('World State');
105
- this.treeInstrumentation.set(MerkleTreeId.ARCHIVE, new TreeInstrumentation(meter, 'archive', log));
106
- this.treeInstrumentation.set(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, new TreeInstrumentation(meter, 'message', log));
107
- this.treeInstrumentation.set(MerkleTreeId.NOTE_HASH_TREE, new TreeInstrumentation(meter, 'note_hash', log));
108
- this.treeInstrumentation.set(MerkleTreeId.NULLIFIER_TREE, new TreeInstrumentation(meter, 'nullifier', log));
109
- this.treeInstrumentation.set(MerkleTreeId.PUBLIC_DATA_TREE, new TreeInstrumentation(meter, 'public_data', log));
73
+ this.updateTreeDBStats(treeDbStats.blockIndicesDBStats, 'block_indices', tree);
74
+ this.updateTreeDBStats(treeDbStats.blocksDBStats, 'blocks', tree);
75
+ this.updateTreeDBStats(treeDbStats.leafIndicesDBStats, 'leaf_indices', tree);
76
+ this.updateTreeDBStats(treeDbStats.leafPreimagesDBStats, 'leaf_preimage', tree);
77
+ this.updateTreeDBStats(treeDbStats.nodesDBStats, 'nodes', tree);
110
78
  }
111
79
 
112
- private updateTreeStats(treeDbStats: TreeDBStats, treeMeta: TreeMeta, tree: MerkleTreeId) {
113
- const instrumentation = this.treeInstrumentation.get(tree);
114
- if (!instrumentation) {
115
- this.log.error(`Failed to retrieve instrumentation for tree ${MerkleTreeId[tree]}`);
116
- return;
117
- }
118
- instrumentation.updateMetrics(treeDbStats, treeMeta);
80
+ private updateTreeDBStats(dbStats: DBStats, dbType: DBTypeString, tree: MerkleTreeId) {
81
+ this.dbNumItems.record(Number(dbStats.numDataItems), {
82
+ [Attributes.WS_DB_DATA_TYPE]: dbType,
83
+ [Attributes.MERKLE_TREE_NAME]: MerkleTreeId[tree],
84
+ });
85
+ this.dbUsedSize.record(Number(dbStats.totalUsedSize), {
86
+ [Attributes.WS_DB_DATA_TYPE]: dbType,
87
+ [Attributes.MERKLE_TREE_NAME]: MerkleTreeId[tree],
88
+ });
119
89
  }
120
90
 
121
91
  public updateWorldStateMetrics(worldStateStatus: WorldStateStatusFull) {
@@ -19,7 +19,7 @@ import { type L2BlockHandledStats } from '@aztec/circuit-types/stats';
19
19
  import { MerkleTreeCalculator } from '@aztec/circuits.js';
20
20
  import { L1_TO_L2_MSG_SUBTREE_HEIGHT } from '@aztec/circuits.js/constants';
21
21
  import { type Fr } from '@aztec/foundation/fields';
22
- import { createDebugLogger } from '@aztec/foundation/log';
22
+ import { createLogger } from '@aztec/foundation/log';
23
23
  import { promiseWithResolvers } from '@aztec/foundation/promise';
24
24
  import { elapsed } from '@aztec/foundation/timer';
25
25
  import { SHA256Trunc } from '@aztec/merkle-tree';
@@ -54,7 +54,7 @@ export class ServerWorldStateSynchronizer
54
54
  private readonly l2BlockSource: L2BlockSource & L1ToL2MessageSource,
55
55
  private readonly config: WorldStateConfig,
56
56
  telemetry: TelemetryClient,
57
- private readonly log = createDebugLogger('aztec:world_state'),
57
+ private readonly log = createLogger('world_state'),
58
58
  ) {
59
59
  this.instrumentation = new WorldStateInstrumentation(telemetry);
60
60
  this.merkleTreeCommitted = this.merkleTreeDb.getCommitted();
@@ -111,7 +111,7 @@ export class ServerWorldStateSynchronizer
111
111
  }
112
112
 
113
113
  protected createBlockStream() {
114
- return new L2BlockStream(this.l2BlockSource, this, this, {
114
+ return new L2BlockStream(this.l2BlockSource, this, this, createLogger('world_state:block_stream'), {
115
115
  proven: this.config.worldStateProvenBlocksOnly,
116
116
  pollIntervalMS: this.config.worldStateBlockCheckIntervalMS,
117
117
  batchSize: this.config.worldStateBlockRequestBatchSize,
@@ -224,14 +224,13 @@ export class ServerWorldStateSynchronizer
224
224
  * @returns Whether the block handled was produced by this same node.
225
225
  */
226
226
  private async handleL2Blocks(l2Blocks: L2Block[]) {
227
- this.log.verbose(`Handling new L2 blocks from ${l2Blocks[0].number} to ${l2Blocks[l2Blocks.length - 1].number}`);
228
227
  const messagePromises = l2Blocks.map(block => this.l2BlockSource.getL1ToL2Messages(BigInt(block.number)));
229
228
  const l1ToL2Messages: Fr[][] = await Promise.all(messagePromises);
230
229
  let updateStatus: WorldStateStatusFull | undefined = undefined;
231
230
 
232
231
  for (let i = 0; i < l2Blocks.length; i++) {
233
232
  const [duration, result] = await elapsed(() => this.handleL2Block(l2Blocks[i], l1ToL2Messages[i]));
234
- this.log.verbose(`Handled new L2 block`, {
233
+ this.log.verbose(`World state updated with L2 block ${l2Blocks[i].number}`, {
235
234
  eventName: 'l2-block-handled',
236
235
  duration,
237
236
  unfinalisedBlockNumber: result.summary.unfinalisedBlockNumber,
@@ -272,7 +271,7 @@ export class ServerWorldStateSynchronizer
272
271
  }
273
272
 
274
273
  private async handleChainFinalized(blockNumber: number) {
275
- this.log.verbose(`Chain finalized at block ${blockNumber}`);
274
+ this.log.verbose(`Finalized chain is now at block ${blockNumber}`);
276
275
  const summary = await this.merkleTreeDb.setFinalised(BigInt(blockNumber));
277
276
  if (this.historyToKeep === undefined) {
278
277
  return;
@@ -286,12 +285,12 @@ export class ServerWorldStateSynchronizer
286
285
  }
287
286
 
288
287
  private handleChainProven(blockNumber: number) {
289
- this.log.verbose(`Chain proven at block ${blockNumber}`);
288
+ this.log.debug(`Proven chain is now at block ${blockNumber}`);
290
289
  return Promise.resolve();
291
290
  }
292
291
 
293
292
  private async handleChainPruned(blockNumber: number) {
294
- this.log.info(`Chain pruned to block ${blockNumber}`);
293
+ this.log.warn(`Chain pruned to block ${blockNumber}`);
295
294
  const status = await this.merkleTreeDb.unwindBlocks(BigInt(blockNumber));
296
295
  this.latestBlockHashQuery = undefined;
297
296
  this.instrumentation.updateWorldStateMetrics(status);
@@ -6,7 +6,7 @@ import {
6
6
  type SequentialInsertionResult,
7
7
  type TreeInfo,
8
8
  } from '@aztec/circuit-types/interfaces';
9
- import { type Header, type StateReference } from '@aztec/circuits.js';
9
+ import { type BlockHeader, type StateReference } from '@aztec/circuits.js';
10
10
  import { type IndexedTreeLeafPreimage } from '@aztec/foundation/trees';
11
11
 
12
12
  import { type MerkleTrees } from './merkle_trees.js';
@@ -39,7 +39,7 @@ export class MerkleTreeReadOperationsFacade implements MerkleTreeWriteOperations
39
39
  * Returns the initial header for the chain before the first block.
40
40
  * @returns The initial header.
41
41
  */
42
- getInitialHeader(): Header {
42
+ getInitialHeader(): BlockHeader {
43
43
  return this.trees.getInitialHeader();
44
44
  }
45
45
 
@@ -149,7 +149,7 @@ export class MerkleTreeReadOperationsFacade implements MerkleTreeWriteOperations
149
149
  * This includes all of the current roots of all of the data trees and the current blocks global vars.
150
150
  * @param header - The header to insert into the archive.
151
151
  */
152
- public updateArchive(header: Header): Promise<void> {
152
+ public updateArchive(header: BlockHeader): Promise<void> {
153
153
  return this.trees.updateArchive(header);
154
154
  }
155
155
 
@@ -5,7 +5,13 @@ import {
5
5
  type MerkleTreeReadOperations,
6
6
  type TreeInfo,
7
7
  } from '@aztec/circuit-types/interfaces';
8
- import { AppendOnlyTreeSnapshot, Fr, type Header, PartialStateReference, StateReference } from '@aztec/circuits.js';
8
+ import {
9
+ AppendOnlyTreeSnapshot,
10
+ type BlockHeader,
11
+ Fr,
12
+ PartialStateReference,
13
+ StateReference,
14
+ } from '@aztec/circuits.js';
9
15
  import { type IndexedTreeLeafPreimage } from '@aztec/foundation/trees';
10
16
  import { type IndexedTreeSnapshot } from '@aztec/merkle-tree';
11
17
 
@@ -136,7 +142,7 @@ export class MerkleTreeSnapshotOperationsFacade implements MerkleTreeReadOperati
136
142
  );
137
143
  }
138
144
 
139
- getInitialHeader(): Header {
145
+ getInitialHeader(): BlockHeader {
140
146
  throw new Error('Getting initial header not supported on snapshot.');
141
147
  }
142
148
  }
@@ -10,8 +10,8 @@ import {
10
10
  import {
11
11
  ARCHIVE_HEIGHT,
12
12
  AppendOnlyTreeSnapshot,
13
+ BlockHeader,
13
14
  Fr,
14
- Header,
15
15
  L1_TO_L2_MSG_TREE_HEIGHT,
16
16
  MAX_NOTE_HASHES_PER_TX,
17
17
  MAX_NULLIFIERS_PER_TX,
@@ -31,12 +31,12 @@ import {
31
31
  StateReference,
32
32
  } from '@aztec/circuits.js';
33
33
  import { padArrayEnd } from '@aztec/foundation/collection';
34
- import { type DebugLogger, createDebugLogger } from '@aztec/foundation/log';
34
+ import { type Logger, createLogger } from '@aztec/foundation/log';
35
35
  import { SerialQueue } from '@aztec/foundation/queue';
36
36
  import { Timer, elapsed } from '@aztec/foundation/timer';
37
37
  import { type IndexedTreeLeafPreimage } from '@aztec/foundation/trees';
38
38
  import { type AztecKVStore, type AztecSingleton } from '@aztec/kv-store';
39
- import { openTmpStore } from '@aztec/kv-store/utils';
39
+ import { openTmpStore } from '@aztec/kv-store/lmdb';
40
40
  import {
41
41
  type AppendOnlyTree,
42
42
  type IndexedTree,
@@ -111,7 +111,7 @@ export class MerkleTrees implements MerkleTreeAdminDatabase {
111
111
  private initialStateReference: AztecSingleton<Buffer>;
112
112
  private metrics: WorldStateMetrics;
113
113
 
114
- private constructor(private store: AztecKVStore, private telemetryClient: TelemetryClient, private log: DebugLogger) {
114
+ private constructor(private store: AztecKVStore, private telemetryClient: TelemetryClient, private log: Logger) {
115
115
  this.initialStateReference = store.openSingleton('merkle_trees_initial_state_reference');
116
116
  this.metrics = new WorldStateMetrics(telemetryClient);
117
117
  }
@@ -121,7 +121,11 @@ export class MerkleTrees implements MerkleTreeAdminDatabase {
121
121
  * @param store - The db instance to use for data persistance.
122
122
  * @returns - A fully initialized MerkleTrees instance.
123
123
  */
124
- public static async new(store: AztecKVStore, client: TelemetryClient, log = createDebugLogger('aztec:merkle_trees')) {
124
+ public static async new(
125
+ store: AztecKVStore,
126
+ client: TelemetryClient,
127
+ log = createLogger('world-state:merkle_trees'),
128
+ ) {
125
129
  const merkleTrees = new MerkleTrees(store, client, log);
126
130
  await merkleTrees.#init();
127
131
  return merkleTrees;
@@ -239,7 +243,7 @@ export class MerkleTrees implements MerkleTreeAdminDatabase {
239
243
  const forked = new MerkleTrees(
240
244
  this.store,
241
245
  this.telemetryClient,
242
- createDebugLogger('aztec:merkle_trees:ephemeral_fork'),
246
+ createLogger('world-state:merkle_trees:ephemeral_fork'),
243
247
  );
244
248
  await forked.#init(true);
245
249
  return new MerkleTreeReadOperationsFacade(forked, true);
@@ -249,8 +253,8 @@ export class MerkleTrees implements MerkleTreeAdminDatabase {
249
253
  await this.store.delete();
250
254
  }
251
255
 
252
- public getInitialHeader(): Header {
253
- return Header.empty({ state: this.#loadInitialStateReference() });
256
+ public getInitialHeader(): BlockHeader {
257
+ return BlockHeader.empty({ state: this.#loadInitialStateReference() });
254
258
  }
255
259
 
256
260
  /**
@@ -285,7 +289,7 @@ export class MerkleTrees implements MerkleTreeAdminDatabase {
285
289
  * @param header - The header whose hash to insert into the archive.
286
290
  * @param includeUncommitted - Indicates whether to include uncommitted data.
287
291
  */
288
- public async updateArchive(header: Header) {
292
+ public async updateArchive(header: BlockHeader) {
289
293
  await this.synchronize(() => this.#updateArchive(header));
290
294
  }
291
295
 
@@ -519,7 +523,7 @@ export class MerkleTrees implements MerkleTreeAdminDatabase {
519
523
  return StateReference.fromBuffer(serialized);
520
524
  }
521
525
 
522
- async #updateArchive(header: Header) {
526
+ async #updateArchive(header: BlockHeader) {
523
527
  const state = await this.getStateReference(true);
524
528
 
525
529
  // This method should be called only when the block builder already updated the state so we sanity check that it's