@typeberry/jam 0.0.4 → 0.0.5-0f1acee

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.
@@ -9559,6 +9559,7 @@ function legacyServiceNested(serviceId, hash) {
9559
9559
  ;// CONCATENATED MODULE: ./packages/jam/state/accumulation-output.ts
9560
9560
 
9561
9561
 
9562
+
9562
9563
  /**
9563
9564
  * Single service-indexed commitment to accumulation output
9564
9565
  *
@@ -9579,6 +9580,16 @@ class AccumulationOutput {
9579
9580
  this.output = output;
9580
9581
  }
9581
9582
  }
9583
+ function accumulationOutputComparator(a, b) {
9584
+ const result = a.serviceId - b.serviceId;
9585
+ if (result < 0) {
9586
+ return Ordering.Less;
9587
+ }
9588
+ if (result > 0) {
9589
+ return Ordering.Greater;
9590
+ }
9591
+ return Ordering.Equal;
9592
+ }
9582
9593
 
9583
9594
  ;// CONCATENATED MODULE: ./packages/jam/state/assurances.ts
9584
9595
 
@@ -10684,6 +10695,7 @@ class StatisticsData {
10684
10695
 
10685
10696
 
10686
10697
 
10698
+
10687
10699
 
10688
10700
  var in_memory_state_UpdateError;
10689
10701
  (function (UpdateError) {
@@ -11087,7 +11099,7 @@ class InMemoryState extends WithDebug {
11087
11099
  validatorsManager: common_tryAsServiceId(0),
11088
11100
  autoAccumulateServices: [],
11089
11101
  }),
11090
- accumulationOutputLog: [],
11102
+ accumulationOutputLog: SortedArray.fromArray(accumulationOutputComparator, []),
11091
11103
  services: new Map(),
11092
11104
  });
11093
11105
  }
@@ -11286,7 +11298,7 @@ var serialize;
11286
11298
  /** C(16): https://graypaper.fluffylabs.dev/#/38c4e62/3b46033b4603?v=0.7.0 */
11287
11299
  serialize.accumulationOutputLog = {
11288
11300
  key: stateKeys.index(StateKeyIdx.Theta),
11289
- Codec: descriptors_codec.sequenceVarLen(AccumulationOutput.Codec),
11301
+ Codec: descriptors_codec.sequenceVarLen(AccumulationOutput.Codec).convert((i) => i.array, (o) => SortedArray.fromSortedArray(accumulationOutputComparator, o)),
11290
11302
  extract: (s) => s.accumulationOutputLog,
11291
11303
  };
11292
11304
  /** C(255, s): https://graypaper.fluffylabs.dev/#/85129da/383103383103?v=0.6.3 */
@@ -12958,7 +12970,6 @@ const GLOBAL_CONFIG = {
12958
12970
  */
12959
12971
  class Logger {
12960
12972
  moduleName;
12961
- fileName;
12962
12973
  config;
12963
12974
  /**
12964
12975
  * Create a new logger instance given filename and an optional module name.
@@ -12971,7 +12982,8 @@ class Logger {
12971
12982
  */
12972
12983
  static new(fileName, moduleName) {
12973
12984
  const fName = fileName ?? "unknown";
12974
- return new Logger(moduleName ?? fName, fName, GLOBAL_CONFIG);
12985
+ const module = moduleName ?? fName;
12986
+ return new Logger(module.padStart(8, " "), GLOBAL_CONFIG);
12975
12987
  }
12976
12988
  /**
12977
12989
  * Return currently configured level for given module. */
@@ -13008,9 +13020,8 @@ class Logger {
13008
13020
  const options = parseLoggerOptions(input, defaultLevel, workingDir);
13009
13021
  Logger.configureAllFromOptions(options);
13010
13022
  }
13011
- constructor(moduleName, fileName, config) {
13023
+ constructor(moduleName, config) {
13012
13024
  this.moduleName = moduleName;
13013
- this.fileName = fileName;
13014
13025
  this.config = config;
13015
13026
  }
13016
13027
  /** Log a message with `INSANE` level. */
@@ -18343,7 +18354,7 @@ class GeneratorReady extends State {
18343
18354
 
18344
18355
 
18345
18356
 
18346
- const block_generator_logger = Logger.new(import.meta.filename, "block-generator");
18357
+ const block_generator_logger = Logger.new(import.meta.filename, "generator");
18347
18358
  if (!external_node_worker_threads_namespaceObject.isMainThread) {
18348
18359
  Logger.configureAll(process.env.JAM_LOG ?? "", Level.LOG);
18349
18360
  const machine = generatorStateMachine();