@aztec/archiver 4.0.0-nightly.20260128 → 4.0.0-nightly.20260130

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 (42) hide show
  1. package/dest/archiver.d.ts +1 -1
  2. package/dest/archiver.d.ts.map +1 -1
  3. package/dest/archiver.js +15 -2
  4. package/dest/factory.d.ts +1 -1
  5. package/dest/factory.d.ts.map +1 -1
  6. package/dest/factory.js +1 -2
  7. package/dest/l1/validate_trace.d.ts +6 -3
  8. package/dest/l1/validate_trace.d.ts.map +1 -1
  9. package/dest/l1/validate_trace.js +13 -9
  10. package/dest/modules/data_source_base.d.ts +5 -5
  11. package/dest/modules/data_source_base.d.ts.map +1 -1
  12. package/dest/modules/instrumentation.d.ts +1 -1
  13. package/dest/modules/instrumentation.d.ts.map +1 -1
  14. package/dest/modules/instrumentation.js +17 -10
  15. package/dest/modules/l1_synchronizer.d.ts +1 -1
  16. package/dest/modules/l1_synchronizer.d.ts.map +1 -1
  17. package/dest/modules/l1_synchronizer.js +2 -3
  18. package/dest/store/block_store.d.ts +2 -2
  19. package/dest/store/block_store.d.ts.map +1 -1
  20. package/dest/store/block_store.js +2 -2
  21. package/dest/store/kv_archiver_store.d.ts +5 -5
  22. package/dest/store/kv_archiver_store.d.ts.map +1 -1
  23. package/dest/store/kv_archiver_store.js +2 -3
  24. package/dest/store/log_store.js +1 -1
  25. package/dest/test/index.d.ts +1 -2
  26. package/dest/test/index.d.ts.map +1 -1
  27. package/dest/test/index.js +3 -2
  28. package/dest/test/mock_l2_block_source.d.ts +4 -4
  29. package/dest/test/mock_l2_block_source.d.ts.map +1 -1
  30. package/dest/test/mock_l2_block_source.js +3 -3
  31. package/package.json +14 -13
  32. package/src/archiver.ts +21 -1
  33. package/src/factory.ts +1 -2
  34. package/src/l1/validate_trace.ts +24 -6
  35. package/src/modules/data_source_base.ts +4 -4
  36. package/src/modules/instrumentation.ts +15 -10
  37. package/src/modules/l1_synchronizer.ts +2 -3
  38. package/src/store/block_store.ts +2 -2
  39. package/src/store/kv_archiver_store.ts +5 -5
  40. package/src/store/log_store.ts +2 -2
  41. package/src/test/index.ts +3 -1
  42. package/src/test/mock_l2_block_source.ts +5 -5
@@ -291,7 +291,7 @@ export class KVArchiverDataStore implements ContractDataSource {
291
291
  * Returns the block for the given hash, or undefined if not exists.
292
292
  * @param blockHash - The block hash to return.
293
293
  */
294
- getCheckpointedBlockByHash(blockHash: Fr): Promise<CheckpointedL2Block | undefined> {
294
+ getCheckpointedBlockByHash(blockHash: BlockHash): Promise<CheckpointedL2Block | undefined> {
295
295
  return this.#blockStore.getCheckpointedBlockByHash(blockHash);
296
296
  }
297
297
  /**
@@ -312,8 +312,8 @@ export class KVArchiverDataStore implements ContractDataSource {
312
312
  * Returns the block for the given hash, or undefined if not exists.
313
313
  * @param blockHash - The block hash to return.
314
314
  */
315
- getBlockByHash(blockHash: Fr): Promise<L2Block | undefined> {
316
- return this.#blockStore.getBlockByHash(BlockHash.fromField(blockHash));
315
+ getBlockByHash(blockHash: BlockHash): Promise<L2Block | undefined> {
316
+ return this.#blockStore.getBlockByHash(blockHash);
317
317
  }
318
318
  /**
319
319
  * Returns the block for the given archive root, or undefined if not exists.
@@ -357,8 +357,8 @@ export class KVArchiverDataStore implements ContractDataSource {
357
357
  * Returns the block header for the given hash, or undefined if not exists.
358
358
  * @param blockHash - The block hash to return.
359
359
  */
360
- getBlockHeaderByHash(blockHash: Fr): Promise<BlockHeader | undefined> {
361
- return this.#blockStore.getBlockHeaderByHash(BlockHash.fromField(blockHash));
360
+ getBlockHeaderByHash(blockHash: BlockHash): Promise<BlockHeader | undefined> {
361
+ return this.#blockStore.getBlockHeaderByHash(blockHash);
362
362
  }
363
363
 
364
364
  /**
@@ -271,7 +271,7 @@ export class LogStore {
271
271
  });
272
272
  }
273
273
 
274
- #packWithBlockHash(blockHash: Fr, data: Buffer<ArrayBufferLike>[]): Buffer<ArrayBufferLike> {
274
+ #packWithBlockHash(blockHash: BlockHash, data: Buffer<ArrayBufferLike>[]): Buffer<ArrayBufferLike> {
275
275
  return Buffer.concat([blockHash.toBuffer(), ...data]);
276
276
  }
277
277
 
@@ -282,7 +282,7 @@ export class LogStore {
282
282
  throw new Error('Failed to read block hash from log entry buffer');
283
283
  }
284
284
 
285
- return BlockHash.fromField(blockHash);
285
+ return new BlockHash(blockHash);
286
286
  }
287
287
 
288
288
  deleteLogs(blocks: L2Block[]): Promise<boolean> {
package/src/test/index.ts CHANGED
@@ -2,4 +2,6 @@ export * from './mock_structs.js';
2
2
  export * from './mock_l2_block_source.js';
3
3
  export * from './mock_l1_to_l2_message_source.js';
4
4
  export * from './mock_archiver.js';
5
- export * from './noop_l1_archiver.js';
5
+ // NOTE: noop_l1_archiver.js is intentionally NOT exported here because it imports
6
+ // jest-mock-extended, which depends on @jest/globals and can only run inside Jest.
7
+ // Import it directly: import { NoopL1Archiver } from '@aztec/archiver/test/noop-l1';
@@ -195,7 +195,7 @@ export class MockL2BlockSource implements L2BlockSource, ContractDataSource {
195
195
  return checkpoint;
196
196
  }
197
197
 
198
- public async getCheckpointedBlockByHash(blockHash: Fr): Promise<CheckpointedL2Block | undefined> {
198
+ public async getCheckpointedBlockByHash(blockHash: BlockHash): Promise<CheckpointedL2Block | undefined> {
199
199
  for (const block of this.l2Blocks) {
200
200
  const hash = await block.hash();
201
201
  if (hash.equals(blockHash)) {
@@ -225,7 +225,7 @@ export class MockL2BlockSource implements L2BlockSource, ContractDataSource {
225
225
  );
226
226
  }
227
227
 
228
- public async getL2BlockByHash(blockHash: Fr): Promise<L2Block | undefined> {
228
+ public async getL2BlockByHash(blockHash: BlockHash): Promise<L2Block | undefined> {
229
229
  for (const block of this.l2Blocks) {
230
230
  const hash = await block.hash();
231
231
  if (hash.equals(blockHash)) {
@@ -240,7 +240,7 @@ export class MockL2BlockSource implements L2BlockSource, ContractDataSource {
240
240
  return Promise.resolve(block);
241
241
  }
242
242
 
243
- public async getBlockHeaderByHash(blockHash: Fr): Promise<BlockHeader | undefined> {
243
+ public async getBlockHeaderByHash(blockHash: BlockHash): Promise<BlockHeader | undefined> {
244
244
  for (const block of this.l2Blocks) {
245
245
  const hash = await block.hash();
246
246
  if (hash.equals(blockHash)) {
@@ -322,7 +322,7 @@ export class MockL2BlockSource implements L2BlockSource, ContractDataSource {
322
322
  return {
323
323
  data: txEffect,
324
324
  l2BlockNumber: block.number,
325
- l2BlockHash: BlockHash.fromField(await block.hash()),
325
+ l2BlockHash: await block.hash(),
326
326
  txIndexInBlock: block.body.txEffects.indexOf(txEffect),
327
327
  };
328
328
  }
@@ -343,7 +343,7 @@ export class MockL2BlockSource implements L2BlockSource, ContractDataSource {
343
343
  TxExecutionResult.SUCCESS,
344
344
  undefined,
345
345
  txEffect.transactionFee.toBigInt(),
346
- BlockHash.fromField(await block.hash()),
346
+ await block.hash(),
347
347
  block.number,
348
348
  );
349
349
  }