@typeberry/jam 0.0.5-f91bac5 → 0.1.0-08a9db1

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.
@@ -6652,10 +6652,17 @@ async function initAll() {
6652
6652
  await init.ed25519();
6653
6653
  await init.reedSolomon();
6654
6654
  }
6655
+ function initOnce(doInit) {
6656
+ let ready = null;
6657
+ return async () => {
6658
+ if (ready === null) ready = doInit();
6659
+ return await ready;
6660
+ };
6661
+ }
6655
6662
  const init = {
6656
- bandersnatch: async () => await bandersnatch_default({ module_or_path: await bandersnatch_bg_default() }),
6657
- ed25519: async () => await ed25519_wasm_default({ module_or_path: await ed25519_wasm_bg_default() }),
6658
- reedSolomon: async () => await reed_solomon_wasm_default({ module_or_path: await reed_solomon_wasm_bg_default() })
6663
+ bandersnatch: initOnce(async () => await bandersnatch_default({ module_or_path: await bandersnatch_bg_default() })),
6664
+ ed25519: initOnce(async () => await ed25519_wasm_default({ module_or_path: await ed25519_wasm_bg_default() })),
6665
+ reedSolomon: initOnce(async () => await reed_solomon_wasm_default({ module_or_path: await reed_solomon_wasm_bg_default() }))
6659
6666
  };
6660
6667
 
6661
6668
  //#endregion
@@ -6766,6 +6773,7 @@ async function verifyBatch(input) {
6766
6773
 
6767
6774
  ;// CONCATENATED MODULE: ./packages/core/hash/hash.ts
6768
6775
 
6776
+
6769
6777
  /**
6770
6778
  * Size of the output of the hash functions.
6771
6779
  *
@@ -6775,6 +6783,7 @@ async function verifyBatch(input) {
6775
6783
  const hash_HASH_SIZE = 32;
6776
6784
  /** A hash without last byte (useful for trie representation). */
6777
6785
  const TRUNCATED_HASH_SIZE = 31;
6786
+ const ZERO_HASH = bytes_Bytes.zero(hash_HASH_SIZE);
6778
6787
  /**
6779
6788
  * Container for some object with a hash that is related to this object.
6780
6789
  *
@@ -15502,14 +15511,12 @@ class writeable_page_WriteablePage extends MemoryPage {
15502
15511
 
15503
15512
 
15504
15513
 
15505
-
15506
-
15507
15514
  var AccessType;
15508
15515
  (function (AccessType) {
15509
15516
  AccessType[AccessType["READ"] = 0] = "READ";
15510
15517
  AccessType[AccessType["WRITE"] = 1] = "WRITE";
15511
15518
  })(AccessType || (AccessType = {}));
15512
- const memory_logger = Logger.new(import.meta.filename, "pvm:mem");
15519
+ // const logger = Logger.new(import.meta.filename, "pvm:mem");
15513
15520
  class memory_Memory {
15514
15521
  sbrkIndex;
15515
15522
  virtualSbrkIndex;
@@ -15540,7 +15547,7 @@ class memory_Memory {
15540
15547
  if (bytes.length === 0) {
15541
15548
  return Result.ok(OK);
15542
15549
  }
15543
- memory_logger.insane(`MEM[${address}] <- ${BytesBlob.blobFrom(bytes)}`);
15550
+ // logger.insane(`MEM[${address}] <- ${BytesBlob.blobFrom(bytes)}`);
15544
15551
  const pagesResult = this.getPages(address, bytes.length, AccessType.WRITE);
15545
15552
  if (pagesResult.isError) {
15546
15553
  return Result.error(pagesResult.error);
@@ -15607,7 +15614,7 @@ class memory_Memory {
15607
15614
  currentPosition += bytesToRead;
15608
15615
  bytesLeft -= bytesToRead;
15609
15616
  }
15610
- memory_logger.insane(`MEM[${startAddress}] => ${BytesBlob.blobFrom(result)}`);
15617
+ // logger.insane(`MEM[${startAddress}] => ${BytesBlob.blobFrom(result)}`);
15611
15618
  return Result.ok(OK);
15612
15619
  }
15613
15620
  sbrk(length) {