@typeberry/lib 0.0.5-1ef0e31 → 0.0.5-ab52154

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 (4) hide show
  1. package/configs/index.d.ts +30 -28
  2. package/index.d.ts +441 -417
  3. package/index.js +810 -794
  4. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -7852,6 +7852,173 @@ declare class JipChainSpec extends WithDebug {
7852
7852
  }
7853
7853
  }
7854
7854
 
7855
+ declare enum Level {
7856
+ INSANE = 1,
7857
+ TRACE = 2,
7858
+ LOG = 3,
7859
+ INFO = 4,
7860
+ WARN = 5,
7861
+ ERROR = 6,
7862
+ }
7863
+
7864
+ type Options = {
7865
+ defaultLevel: Level;
7866
+ workingDir: string;
7867
+ modules: Map<string, Level>;
7868
+ };
7869
+
7870
+ /**
7871
+ * A function to parse logger definition (including modules) given as a string.
7872
+ *
7873
+ * Examples
7874
+ * - `info` - setup default logging level to `info`.
7875
+ * - `trace` - default logging level set to `trace`.
7876
+ * - `debug;consensus=trace` - default level is set to `debug/log`, but consensus is in trace mode.
7877
+ */
7878
+ declare function parseLoggerOptions(input: string, defaultLevel: Level, workingDir?: string): Options {
7879
+ const modules = new Map<string, Level>();
7880
+ const parts = input.toLowerCase().split(",");
7881
+ let defLevel = defaultLevel;
7882
+
7883
+ for (const p of parts) {
7884
+ const clean = p.trim();
7885
+ // skip empty objects (forgotten `,` removed)
7886
+ if (clean.length === 0) {
7887
+ continue;
7888
+ }
7889
+ // we just have the default level
7890
+ if (clean.includes("=")) {
7891
+ const [mod, lvl] = clean.split("=");
7892
+ modules.set(mod.trim(), parseLevel(lvl.trim()));
7893
+ } else {
7894
+ defLevel = parseLevel(clean);
7895
+ }
7896
+ }
7897
+
7898
+ // TODO [ToDr] Fix dirname for workers.
7899
+ const myDir = (import.meta.dirname ?? "").split("/");
7900
+ myDir.pop();
7901
+ myDir.pop();
7902
+ return {
7903
+ defaultLevel: defLevel,
7904
+ modules,
7905
+ workingDir: workingDir ?? myDir.join("/"),
7906
+ };
7907
+ }
7908
+
7909
+ declare const GLOBAL_CONFIG = {
7910
+ options: DEFAULT_OPTIONS,
7911
+ transport: ConsoleTransport.create(DEFAULT_OPTIONS.defaultLevel, DEFAULT_OPTIONS),
7912
+ };
7913
+
7914
+ /**
7915
+ * A logger instance.
7916
+ */
7917
+ declare class Logger {
7918
+ /**
7919
+ * Create a new logger instance given filename and an optional module name.
7920
+ *
7921
+ * If the module name is not given, `fileName` becomes the module name.
7922
+ * The module name can be composed from multiple parts separated with `/`.
7923
+ *
7924
+ * The logger will use a global configuration which can be changed using
7925
+ * [`configureLogger`] function.
7926
+ */
7927
+ static new(fileName?: string, moduleName?: string) {
7928
+ const fName = fileName ?? "unknown";
7929
+ const module = moduleName ?? fName;
7930
+ return new Logger(module.padStart(8, " "), GLOBAL_CONFIG);
7931
+ }
7932
+
7933
+ /**
7934
+ * Return currently configured level for given module. */
7935
+ static getLevel(moduleName: string): Level {
7936
+ return findLevel(GLOBAL_CONFIG.options, moduleName);
7937
+ }
7938
+
7939
+ /**
7940
+ * Global configuration of all loggers.
7941
+ *
7942
+ * One can specify a default logging level (only logs with level >= default will be printed).
7943
+ * It's also possible to configure per-module logging level that takes precedence
7944
+ * over the default one.
7945
+ *
7946
+ * Changing the options affects all previously created loggers.
7947
+ */
7948
+ static configureAllFromOptions(options: Options) {
7949
+ // find minimal level to optimise logging in case
7950
+ // we don't care about low-level logs.
7951
+ const minimalLevel = Array.from(options.modules.values()).reduce((level, modLevel) => {
7952
+ return level < modLevel ? level : modLevel;
7953
+ }, options.defaultLevel);
7954
+
7955
+ const transport = ConsoleTransport.create(minimalLevel, options);
7956
+
7957
+ // set the global config
7958
+ GLOBAL_CONFIG.options = options;
7959
+ GLOBAL_CONFIG.transport = transport;
7960
+ }
7961
+
7962
+ /**
7963
+ * Global configuration of all loggers.
7964
+ *
7965
+ * Parse configuration options from an input string typically obtained
7966
+ * from environment variable `JAM_LOG`.
7967
+ */
7968
+ static configureAll(input: string, defaultLevel: Level, workingDir?: string) {
7969
+ const options = parseLoggerOptions(input, defaultLevel, workingDir);
7970
+ Logger.configureAllFromOptions(options);
7971
+ }
7972
+
7973
+ private constructor(
7974
+ private readonly moduleName: string,
7975
+ private readonly config: typeof GLOBAL_CONFIG,
7976
+ ) {}
7977
+
7978
+ /** Log a message with `INSANE` level. */
7979
+ insane(val: string) {
7980
+ this.config.transport.insane(this.moduleName, val);
7981
+ }
7982
+
7983
+ /** Log a message with `TRACE` level. */
7984
+ trace(val: string) {
7985
+ this.config.transport.trace(this.moduleName, val);
7986
+ }
7987
+
7988
+ /** Log a message with `DEBUG`/`LOG` level. */
7989
+ log(val: string) {
7990
+ this.config.transport.log(this.moduleName, val);
7991
+ }
7992
+
7993
+ /** Log a message with `INFO` level. */
7994
+ info(val: string) {
7995
+ this.config.transport.info(this.moduleName, val);
7996
+ }
7997
+
7998
+ /** Log a message with `WARN` level. */
7999
+ warn(val: string) {
8000
+ this.config.transport.warn(this.moduleName, val);
8001
+ }
8002
+
8003
+ /** Log a message with `ERROR` level. */
8004
+ error(val: string) {
8005
+ this.config.transport.error(this.moduleName, val);
8006
+ }
8007
+ }
8008
+
8009
+ type index$g_Level = Level;
8010
+ declare const index$g_Level: typeof Level;
8011
+ type index$g_Logger = Logger;
8012
+ declare const index$g_Logger: typeof Logger;
8013
+ declare const index$g_parseLoggerOptions: typeof parseLoggerOptions;
8014
+ declare namespace index$g {
8015
+ export {
8016
+ index$g_Level as Level,
8017
+ index$g_Logger as Logger,
8018
+ index$g_parseLoggerOptions as parseLoggerOptions,
8019
+ };
8020
+ }
8021
+
7855
8022
  /** Block authorship options. */
7856
8023
  declare class AuthorshipOptions {
7857
8024
  static fromJson = json.object<JsonObject<AuthorshipOptions>, AuthorshipOptions>(
@@ -7871,6 +8038,8 @@ declare class AuthorshipOptions {
7871
8038
  ) {}
7872
8039
  }
7873
8040
 
8041
+ declare const logger$1 = Logger.new(import.meta.filename, "config");
8042
+
7874
8043
  /** Development config. Will accept unsealed blocks for now. */
7875
8044
  declare const DEV_CONFIG = "dev";
7876
8045
  /** Default config file. */
@@ -7932,14 +8101,17 @@ declare class NodeConfiguration {
7932
8101
 
7933
8102
  declare function loadConfig(configPath: string): NodeConfiguration {
7934
8103
  if (configPath === DEFAULT_CONFIG) {
8104
+ logger.log("🔧 Loading DEFAULT config");
7935
8105
  return parseFromJson(configs.default, NodeConfiguration.fromJson);
7936
8106
  }
7937
8107
 
7938
8108
  if (configPath === DEV_CONFIG) {
8109
+ logger.log("🔧 Loading DEV config");
7939
8110
  return parseFromJson(configs.dev, NodeConfiguration.fromJson);
7940
8111
  }
7941
8112
 
7942
8113
  try {
8114
+ logger.log(`🔧 Loading config from ${configPath}`);
7943
8115
  const configFile = fs.readFileSync(configPath, "utf8");
7944
8116
  const parsed = JSON.parse(configFile);
7945
8117
  return parseFromJson(parsed, NodeConfiguration.fromJson);
@@ -7948,29 +8120,30 @@ declare function loadConfig(configPath: string): NodeConfiguration {
7948
8120
  }
7949
8121
  }
7950
8122
 
7951
- declare const index$g_DEFAULT_CONFIG: typeof DEFAULT_CONFIG;
7952
- declare const index$g_DEV_CONFIG: typeof DEV_CONFIG;
7953
- type index$g_JipChainSpec = JipChainSpec;
7954
- declare const index$g_JipChainSpec: typeof JipChainSpec;
7955
- type index$g_KnownChainSpec = KnownChainSpec;
7956
- declare const index$g_KnownChainSpec: typeof KnownChainSpec;
7957
- declare const index$g_NODE_DEFAULTS: typeof NODE_DEFAULTS;
7958
- type index$g_NodeConfiguration = NodeConfiguration;
7959
- declare const index$g_NodeConfiguration: typeof NodeConfiguration;
7960
- declare const index$g_knownChainSpecFromJson: typeof knownChainSpecFromJson;
7961
- declare const index$g_loadConfig: typeof loadConfig;
7962
- declare const index$g_parseBootnode: typeof parseBootnode;
7963
- declare namespace index$g {
8123
+ declare const index$f_DEFAULT_CONFIG: typeof DEFAULT_CONFIG;
8124
+ declare const index$f_DEV_CONFIG: typeof DEV_CONFIG;
8125
+ type index$f_JipChainSpec = JipChainSpec;
8126
+ declare const index$f_JipChainSpec: typeof JipChainSpec;
8127
+ type index$f_KnownChainSpec = KnownChainSpec;
8128
+ declare const index$f_KnownChainSpec: typeof KnownChainSpec;
8129
+ declare const index$f_NODE_DEFAULTS: typeof NODE_DEFAULTS;
8130
+ type index$f_NodeConfiguration = NodeConfiguration;
8131
+ declare const index$f_NodeConfiguration: typeof NodeConfiguration;
8132
+ declare const index$f_knownChainSpecFromJson: typeof knownChainSpecFromJson;
8133
+ declare const index$f_loadConfig: typeof loadConfig;
8134
+ declare const index$f_parseBootnode: typeof parseBootnode;
8135
+ declare namespace index$f {
7964
8136
  export {
7965
- index$g_DEFAULT_CONFIG as DEFAULT_CONFIG,
7966
- index$g_DEV_CONFIG as DEV_CONFIG,
7967
- index$g_JipChainSpec as JipChainSpec,
7968
- index$g_KnownChainSpec as KnownChainSpec,
7969
- index$g_NODE_DEFAULTS as NODE_DEFAULTS,
7970
- index$g_NodeConfiguration as NodeConfiguration,
7971
- index$g_knownChainSpecFromJson as knownChainSpecFromJson,
7972
- index$g_loadConfig as loadConfig,
7973
- index$g_parseBootnode as parseBootnode,
8137
+ index$f_DEFAULT_CONFIG as DEFAULT_CONFIG,
8138
+ index$f_DEV_CONFIG as DEV_CONFIG,
8139
+ index$f_JipChainSpec as JipChainSpec,
8140
+ index$f_KnownChainSpec as KnownChainSpec,
8141
+ index$f_NODE_DEFAULTS as NODE_DEFAULTS,
8142
+ index$f_NodeConfiguration as NodeConfiguration,
8143
+ index$f_knownChainSpecFromJson as knownChainSpecFromJson,
8144
+ index$f_loadConfig as loadConfig,
8145
+ logger$1 as logger,
8146
+ index$f_parseBootnode as parseBootnode,
7974
8147
  };
7975
8148
  }
7976
8149
 
@@ -8654,40 +8827,40 @@ declare function trieStringify(root: TrieNode | null, nodes: NodesDb): string {
8654
8827
  return `\nLeaf('${leaf.getKey().toString()}',${value})`;
8655
8828
  }
8656
8829
 
8657
- type index$f_BranchNode = BranchNode;
8658
- declare const index$f_BranchNode: typeof BranchNode;
8659
- type index$f_InMemoryTrie = InMemoryTrie;
8660
- declare const index$f_InMemoryTrie: typeof InMemoryTrie;
8661
- type index$f_InputKey = InputKey;
8662
- type index$f_LeafNode = LeafNode;
8663
- declare const index$f_LeafNode: typeof LeafNode;
8664
- type index$f_NodeType = NodeType;
8665
- declare const index$f_NodeType: typeof NodeType;
8666
- type index$f_NodesDb = NodesDb;
8667
- declare const index$f_NodesDb: typeof NodesDb;
8668
- declare const index$f_TRIE_NODE_BYTES: typeof TRIE_NODE_BYTES;
8669
- declare const index$f_TRUNCATED_KEY_BITS: typeof TRUNCATED_KEY_BITS;
8670
- type index$f_TRUNCATED_KEY_BYTES = TRUNCATED_KEY_BYTES;
8671
- type index$f_TraversedPath = TraversedPath;
8672
- declare const index$f_TraversedPath: typeof TraversedPath;
8673
- type index$f_TrieHasher = TrieHasher;
8674
- type index$f_TrieNode = TrieNode;
8675
- declare const index$f_TrieNode: typeof TrieNode;
8676
- type index$f_TrieNodeHash = TrieNodeHash;
8677
- type index$f_TruncatedStateKey = TruncatedStateKey;
8678
- type index$f_ValueHash = ValueHash;
8679
- type index$f_WriteableNodesDb = WriteableNodesDb;
8680
- declare const index$f_WriteableNodesDb: typeof WriteableNodesDb;
8681
- declare const index$f_createSubtreeForBothLeaves: typeof createSubtreeForBothLeaves;
8682
- declare const index$f_findNodeToReplace: typeof findNodeToReplace;
8683
- declare const index$f_getBit: typeof getBit;
8684
- declare const index$f_leafComparator: typeof leafComparator;
8685
- declare const index$f_parseInputKey: typeof parseInputKey;
8686
- declare const index$f_trieInsert: typeof trieInsert;
8687
- declare const index$f_trieStringify: typeof trieStringify;
8688
- declare namespace index$f {
8689
- export { index$f_BranchNode as BranchNode, index$f_InMemoryTrie as InMemoryTrie, index$f_LeafNode as LeafNode, index$f_NodeType as NodeType, index$f_NodesDb as NodesDb, index$f_TRIE_NODE_BYTES as TRIE_NODE_BYTES, index$f_TRUNCATED_KEY_BITS as TRUNCATED_KEY_BITS, index$f_TraversedPath as TraversedPath, index$f_TrieNode as TrieNode, index$f_WriteableNodesDb as WriteableNodesDb, index$f_createSubtreeForBothLeaves as createSubtreeForBothLeaves, index$f_findNodeToReplace as findNodeToReplace, index$f_getBit as getBit, index$f_leafComparator as leafComparator, index$f_parseInputKey as parseInputKey, index$f_trieInsert as trieInsert, index$f_trieStringify as trieStringify };
8690
- export type { index$f_InputKey as InputKey, StateKey$1 as StateKey, index$f_TRUNCATED_KEY_BYTES as TRUNCATED_KEY_BYTES, index$f_TrieHasher as TrieHasher, index$f_TrieNodeHash as TrieNodeHash, index$f_TruncatedStateKey as TruncatedStateKey, index$f_ValueHash as ValueHash };
8830
+ type index$e_BranchNode = BranchNode;
8831
+ declare const index$e_BranchNode: typeof BranchNode;
8832
+ type index$e_InMemoryTrie = InMemoryTrie;
8833
+ declare const index$e_InMemoryTrie: typeof InMemoryTrie;
8834
+ type index$e_InputKey = InputKey;
8835
+ type index$e_LeafNode = LeafNode;
8836
+ declare const index$e_LeafNode: typeof LeafNode;
8837
+ type index$e_NodeType = NodeType;
8838
+ declare const index$e_NodeType: typeof NodeType;
8839
+ type index$e_NodesDb = NodesDb;
8840
+ declare const index$e_NodesDb: typeof NodesDb;
8841
+ declare const index$e_TRIE_NODE_BYTES: typeof TRIE_NODE_BYTES;
8842
+ declare const index$e_TRUNCATED_KEY_BITS: typeof TRUNCATED_KEY_BITS;
8843
+ type index$e_TRUNCATED_KEY_BYTES = TRUNCATED_KEY_BYTES;
8844
+ type index$e_TraversedPath = TraversedPath;
8845
+ declare const index$e_TraversedPath: typeof TraversedPath;
8846
+ type index$e_TrieHasher = TrieHasher;
8847
+ type index$e_TrieNode = TrieNode;
8848
+ declare const index$e_TrieNode: typeof TrieNode;
8849
+ type index$e_TrieNodeHash = TrieNodeHash;
8850
+ type index$e_TruncatedStateKey = TruncatedStateKey;
8851
+ type index$e_ValueHash = ValueHash;
8852
+ type index$e_WriteableNodesDb = WriteableNodesDb;
8853
+ declare const index$e_WriteableNodesDb: typeof WriteableNodesDb;
8854
+ declare const index$e_createSubtreeForBothLeaves: typeof createSubtreeForBothLeaves;
8855
+ declare const index$e_findNodeToReplace: typeof findNodeToReplace;
8856
+ declare const index$e_getBit: typeof getBit;
8857
+ declare const index$e_leafComparator: typeof leafComparator;
8858
+ declare const index$e_parseInputKey: typeof parseInputKey;
8859
+ declare const index$e_trieInsert: typeof trieInsert;
8860
+ declare const index$e_trieStringify: typeof trieStringify;
8861
+ declare namespace index$e {
8862
+ export { index$e_BranchNode as BranchNode, index$e_InMemoryTrie as InMemoryTrie, index$e_LeafNode as LeafNode, index$e_NodeType as NodeType, index$e_NodesDb as NodesDb, index$e_TRIE_NODE_BYTES as TRIE_NODE_BYTES, index$e_TRUNCATED_KEY_BITS as TRUNCATED_KEY_BITS, index$e_TraversedPath as TraversedPath, index$e_TrieNode as TrieNode, index$e_WriteableNodesDb as WriteableNodesDb, index$e_createSubtreeForBothLeaves as createSubtreeForBothLeaves, index$e_findNodeToReplace as findNodeToReplace, index$e_getBit as getBit, index$e_leafComparator as leafComparator, index$e_parseInputKey as parseInputKey, index$e_trieInsert as trieInsert, index$e_trieStringify as trieStringify };
8863
+ export type { index$e_InputKey as InputKey, StateKey$1 as StateKey, index$e_TRUNCATED_KEY_BYTES as TRUNCATED_KEY_BYTES, index$e_TrieHasher as TrieHasher, index$e_TrieNodeHash as TrieNodeHash, index$e_TruncatedStateKey as TruncatedStateKey, index$e_ValueHash as ValueHash };
8691
8864
  }
8692
8865
 
8693
8866
  /**
@@ -8743,6 +8916,20 @@ declare class AccumulationOutput {
8743
8916
  ) {}
8744
8917
  }
8745
8918
 
8919
+ declare function accumulationOutputComparator(a: AccumulationOutput, b: AccumulationOutput) {
8920
+ const result = a.serviceId - b.serviceId;
8921
+
8922
+ if (result < 0) {
8923
+ return Ordering.Less;
8924
+ }
8925
+
8926
+ if (result > 0) {
8927
+ return Ordering.Greater;
8928
+ }
8929
+
8930
+ return Ordering.Equal;
8931
+ }
8932
+
8746
8933
  declare const codecWithHash = <T, V, H extends OpaqueHash>(val: Descriptor<T, V>): Descriptor<WithHash<H, T>, V> =>
8747
8934
  Descriptor.withView(
8748
8935
  val.name,
@@ -9115,16 +9302,16 @@ declare class Mountain<H extends OpaqueHash> {
9115
9302
  }
9116
9303
  }
9117
9304
 
9118
- type index$e_MerkleMountainRange<H extends OpaqueHash> = MerkleMountainRange<H>;
9119
- declare const index$e_MerkleMountainRange: typeof MerkleMountainRange;
9120
- type index$e_MmrHasher<H extends OpaqueHash> = MmrHasher<H>;
9121
- type index$e_MmrPeaks<H extends OpaqueHash> = MmrPeaks<H>;
9122
- type index$e_Mountain<H extends OpaqueHash> = Mountain<H>;
9123
- declare const index$e_Mountain: typeof Mountain;
9124
- declare const index$e_SUPER_PEAK_STRING: typeof SUPER_PEAK_STRING;
9125
- declare namespace index$e {
9126
- export { index$e_MerkleMountainRange as MerkleMountainRange, index$e_Mountain as Mountain, index$e_SUPER_PEAK_STRING as SUPER_PEAK_STRING };
9127
- export type { index$e_MmrHasher as MmrHasher, index$e_MmrPeaks as MmrPeaks };
9305
+ type index$d_MerkleMountainRange<H extends OpaqueHash> = MerkleMountainRange<H>;
9306
+ declare const index$d_MerkleMountainRange: typeof MerkleMountainRange;
9307
+ type index$d_MmrHasher<H extends OpaqueHash> = MmrHasher<H>;
9308
+ type index$d_MmrPeaks<H extends OpaqueHash> = MmrPeaks<H>;
9309
+ type index$d_Mountain<H extends OpaqueHash> = Mountain<H>;
9310
+ declare const index$d_Mountain: typeof Mountain;
9311
+ declare const index$d_SUPER_PEAK_STRING: typeof SUPER_PEAK_STRING;
9312
+ declare namespace index$d {
9313
+ export { index$d_MerkleMountainRange as MerkleMountainRange, index$d_Mountain as Mountain, index$d_SUPER_PEAK_STRING as SUPER_PEAK_STRING };
9314
+ export type { index$d_MmrHasher as MmrHasher, index$d_MmrPeaks as MmrPeaks };
9128
9315
  }
9129
9316
 
9130
9317
  /**
@@ -10043,7 +10230,7 @@ type State = {
10043
10230
  *
10044
10231
  * NOTE Maximum size of this array is unspecified in GP
10045
10232
  */
10046
- readonly accumulationOutputLog: AccumulationOutput[];
10233
+ readonly accumulationOutputLog: SortedArray<AccumulationOutput>;
10047
10234
 
10048
10235
  /**
10049
10236
  * Retrieve details about single service.
@@ -10631,7 +10818,7 @@ declare class InMemoryState extends WithDebug implements State, EnumerableState
10631
10818
  sealingKeySeries: SafroleSealingKeys;
10632
10819
  epochRoot: BandersnatchRingRoot;
10633
10820
  privilegedServices: PrivilegedServices;
10634
- accumulationOutputLog: AccumulationOutput[];
10821
+ accumulationOutputLog: SortedArray<AccumulationOutput>;
10635
10822
  services: Map<ServiceId, InMemoryService>;
10636
10823
 
10637
10824
  recentServiceIds(): readonly ServiceId[] {
@@ -10775,7 +10962,7 @@ declare class InMemoryState extends WithDebug implements State, EnumerableState
10775
10962
  validatorsManager: tryAsServiceId(0),
10776
10963
  autoAccumulateServices: [],
10777
10964
  }),
10778
- accumulationOutputLog: [],
10965
+ accumulationOutputLog: SortedArray.fromArray(accumulationOutputComparator, []),
10779
10966
  services: new Map(),
10780
10967
  });
10781
10968
  }
@@ -10822,102 +11009,103 @@ type FieldNames<T> = {
10822
11009
  [K in keyof T]: T[K] extends Function ? never : K;
10823
11010
  }[keyof T];
10824
11011
 
10825
- type index$d_AccumulationOutput = AccumulationOutput;
10826
- declare const index$d_AccumulationOutput: typeof AccumulationOutput;
10827
- type index$d_AutoAccumulate = AutoAccumulate;
10828
- declare const index$d_AutoAccumulate: typeof AutoAccumulate;
10829
- type index$d_AvailabilityAssignment = AvailabilityAssignment;
10830
- declare const index$d_AvailabilityAssignment: typeof AvailabilityAssignment;
10831
- declare const index$d_BASE_SERVICE_BALANCE: typeof BASE_SERVICE_BALANCE;
10832
- type index$d_BlockState = BlockState;
10833
- declare const index$d_BlockState: typeof BlockState;
10834
- type index$d_BlocksState = BlocksState;
10835
- type index$d_CoreStatistics = CoreStatistics;
10836
- declare const index$d_CoreStatistics: typeof CoreStatistics;
10837
- type index$d_DisputesRecords = DisputesRecords;
10838
- declare const index$d_DisputesRecords: typeof DisputesRecords;
10839
- declare const index$d_ELECTIVE_BYTE_BALANCE: typeof ELECTIVE_BYTE_BALANCE;
10840
- declare const index$d_ELECTIVE_ITEM_BALANCE: typeof ELECTIVE_ITEM_BALANCE;
10841
- type index$d_ENTROPY_ENTRIES = ENTROPY_ENTRIES;
10842
- type index$d_EnumerableState = EnumerableState;
10843
- type index$d_FieldNames<T> = FieldNames<T>;
10844
- type index$d_InMemoryService = InMemoryService;
10845
- declare const index$d_InMemoryService: typeof InMemoryService;
10846
- type index$d_InMemoryState = InMemoryState;
10847
- declare const index$d_InMemoryState: typeof InMemoryState;
10848
- type index$d_InMemoryStateFields = InMemoryStateFields;
10849
- type index$d_LookupHistoryItem = LookupHistoryItem;
10850
- declare const index$d_LookupHistoryItem: typeof LookupHistoryItem;
10851
- type index$d_LookupHistorySlots = LookupHistorySlots;
10852
- declare const index$d_MAX_LOOKUP_HISTORY_SLOTS: typeof MAX_LOOKUP_HISTORY_SLOTS;
10853
- type index$d_MAX_RECENT_HISTORY = MAX_RECENT_HISTORY;
10854
- type index$d_PerCore<T> = PerCore<T>;
10855
- type index$d_PreimageItem = PreimageItem;
10856
- declare const index$d_PreimageItem: typeof PreimageItem;
10857
- type index$d_PrivilegedServices = PrivilegedServices;
10858
- declare const index$d_PrivilegedServices: typeof PrivilegedServices;
10859
- type index$d_RecentBlocks = RecentBlocks;
10860
- declare const index$d_RecentBlocks: typeof RecentBlocks;
10861
- type index$d_RecentBlocksHistory = RecentBlocksHistory;
10862
- declare const index$d_RecentBlocksHistory: typeof RecentBlocksHistory;
10863
- type index$d_SafroleData = SafroleData;
10864
- declare const index$d_SafroleData: typeof SafroleData;
10865
- type index$d_SafroleSealingKeys = SafroleSealingKeys;
10866
- type index$d_SafroleSealingKeysData = SafroleSealingKeysData;
10867
- declare const index$d_SafroleSealingKeysData: typeof SafroleSealingKeysData;
10868
- type index$d_SafroleSealingKeysKind = SafroleSealingKeysKind;
10869
- declare const index$d_SafroleSealingKeysKind: typeof SafroleSealingKeysKind;
10870
- type index$d_Service = Service;
10871
- type index$d_ServiceAccountInfo = ServiceAccountInfo;
10872
- declare const index$d_ServiceAccountInfo: typeof ServiceAccountInfo;
10873
- type index$d_ServiceData = ServiceData;
10874
- type index$d_ServiceEntries = ServiceEntries;
10875
- type index$d_ServiceStatistics = ServiceStatistics;
10876
- declare const index$d_ServiceStatistics: typeof ServiceStatistics;
10877
- type index$d_ServicesUpdate = ServicesUpdate;
10878
- type index$d_State = State;
10879
- type index$d_StatisticsData = StatisticsData;
10880
- declare const index$d_StatisticsData: typeof StatisticsData;
10881
- type index$d_StorageItem = StorageItem;
10882
- declare const index$d_StorageItem: typeof StorageItem;
10883
- type index$d_StorageKey = StorageKey;
10884
- type index$d_UpdateError = UpdateError;
10885
- declare const index$d_UpdateError: typeof UpdateError;
10886
- type index$d_UpdatePreimage = UpdatePreimage;
10887
- declare const index$d_UpdatePreimage: typeof UpdatePreimage;
10888
- type index$d_UpdatePreimageKind = UpdatePreimageKind;
10889
- declare const index$d_UpdatePreimageKind: typeof UpdatePreimageKind;
10890
- type index$d_UpdateService = UpdateService;
10891
- declare const index$d_UpdateService: typeof UpdateService;
10892
- type index$d_UpdateServiceKind = UpdateServiceKind;
10893
- declare const index$d_UpdateServiceKind: typeof UpdateServiceKind;
10894
- type index$d_UpdateStorage = UpdateStorage;
10895
- declare const index$d_UpdateStorage: typeof UpdateStorage;
10896
- type index$d_UpdateStorageKind = UpdateStorageKind;
10897
- declare const index$d_UpdateStorageKind: typeof UpdateStorageKind;
10898
- type index$d_VALIDATOR_META_BYTES = VALIDATOR_META_BYTES;
10899
- type index$d_ValidatorData = ValidatorData;
10900
- declare const index$d_ValidatorData: typeof ValidatorData;
10901
- type index$d_ValidatorStatistics = ValidatorStatistics;
10902
- declare const index$d_ValidatorStatistics: typeof ValidatorStatistics;
10903
- declare const index$d_codecBandersnatchKey: typeof codecBandersnatchKey;
10904
- declare const index$d_codecPerCore: typeof codecPerCore;
10905
- declare const index$d_codecServiceId: typeof codecServiceId;
10906
- declare const index$d_codecVarGas: typeof codecVarGas;
10907
- declare const index$d_codecVarU16: typeof codecVarU16;
10908
- declare const index$d_codecWithHash: typeof codecWithHash;
10909
- declare const index$d_hashComparator: typeof hashComparator;
10910
- declare const index$d_ignoreValueWithDefault: typeof ignoreValueWithDefault;
10911
- declare const index$d_serviceDataCodec: typeof serviceDataCodec;
10912
- declare const index$d_serviceEntriesCodec: typeof serviceEntriesCodec;
10913
- declare const index$d_sortedSetCodec: typeof sortedSetCodec;
10914
- declare const index$d_tryAsLookupHistorySlots: typeof tryAsLookupHistorySlots;
10915
- declare const index$d_tryAsPerCore: typeof tryAsPerCore;
10916
- declare const index$d_workReportsSortedSetCodec: typeof workReportsSortedSetCodec;
10917
- declare const index$d_zeroSizeHint: typeof zeroSizeHint;
10918
- declare namespace index$d {
10919
- export { index$d_AccumulationOutput as AccumulationOutput, index$d_AutoAccumulate as AutoAccumulate, index$d_AvailabilityAssignment as AvailabilityAssignment, index$d_BASE_SERVICE_BALANCE as BASE_SERVICE_BALANCE, index$d_BlockState as BlockState, index$d_CoreStatistics as CoreStatistics, index$d_DisputesRecords as DisputesRecords, index$d_ELECTIVE_BYTE_BALANCE as ELECTIVE_BYTE_BALANCE, index$d_ELECTIVE_ITEM_BALANCE as ELECTIVE_ITEM_BALANCE, index$d_InMemoryService as InMemoryService, index$d_InMemoryState as InMemoryState, index$d_LookupHistoryItem as LookupHistoryItem, index$d_MAX_LOOKUP_HISTORY_SLOTS as MAX_LOOKUP_HISTORY_SLOTS, index$d_PreimageItem as PreimageItem, index$d_PrivilegedServices as PrivilegedServices, index$d_RecentBlocks as RecentBlocks, index$d_RecentBlocksHistory as RecentBlocksHistory, index$d_SafroleData as SafroleData, index$d_SafroleSealingKeysData as SafroleSealingKeysData, index$d_SafroleSealingKeysKind as SafroleSealingKeysKind, index$d_ServiceAccountInfo as ServiceAccountInfo, index$d_ServiceStatistics as ServiceStatistics, index$d_StatisticsData as StatisticsData, index$d_StorageItem as StorageItem, index$d_UpdateError as UpdateError, index$d_UpdatePreimage as UpdatePreimage, index$d_UpdatePreimageKind as UpdatePreimageKind, index$d_UpdateService as UpdateService, index$d_UpdateServiceKind as UpdateServiceKind, index$d_UpdateStorage as UpdateStorage, index$d_UpdateStorageKind as UpdateStorageKind, index$d_ValidatorData as ValidatorData, index$d_ValidatorStatistics as ValidatorStatistics, index$d_codecBandersnatchKey as codecBandersnatchKey, index$d_codecPerCore as codecPerCore, index$d_codecServiceId as codecServiceId, index$d_codecVarGas as codecVarGas, index$d_codecVarU16 as codecVarU16, index$d_codecWithHash as codecWithHash, index$d_hashComparator as hashComparator, index$d_ignoreValueWithDefault as ignoreValueWithDefault, index$d_serviceDataCodec as serviceDataCodec, index$d_serviceEntriesCodec as serviceEntriesCodec, index$d_sortedSetCodec as sortedSetCodec, index$d_tryAsLookupHistorySlots as tryAsLookupHistorySlots, index$d_tryAsPerCore as tryAsPerCore, index$d_workReportsSortedSetCodec as workReportsSortedSetCodec, index$d_zeroSizeHint as zeroSizeHint };
10920
- export type { index$d_BlocksState as BlocksState, index$d_ENTROPY_ENTRIES as ENTROPY_ENTRIES, index$d_EnumerableState as EnumerableState, index$d_FieldNames as FieldNames, index$d_InMemoryStateFields as InMemoryStateFields, index$d_LookupHistorySlots as LookupHistorySlots, index$d_MAX_RECENT_HISTORY as MAX_RECENT_HISTORY, index$d_PerCore as PerCore, index$d_SafroleSealingKeys as SafroleSealingKeys, index$d_Service as Service, index$d_ServiceData as ServiceData, index$d_ServiceEntries as ServiceEntries, index$d_ServicesUpdate as ServicesUpdate, index$d_State as State, index$d_StorageKey as StorageKey, index$d_VALIDATOR_META_BYTES as VALIDATOR_META_BYTES };
11012
+ type index$c_AccumulationOutput = AccumulationOutput;
11013
+ declare const index$c_AccumulationOutput: typeof AccumulationOutput;
11014
+ type index$c_AutoAccumulate = AutoAccumulate;
11015
+ declare const index$c_AutoAccumulate: typeof AutoAccumulate;
11016
+ type index$c_AvailabilityAssignment = AvailabilityAssignment;
11017
+ declare const index$c_AvailabilityAssignment: typeof AvailabilityAssignment;
11018
+ declare const index$c_BASE_SERVICE_BALANCE: typeof BASE_SERVICE_BALANCE;
11019
+ type index$c_BlockState = BlockState;
11020
+ declare const index$c_BlockState: typeof BlockState;
11021
+ type index$c_BlocksState = BlocksState;
11022
+ type index$c_CoreStatistics = CoreStatistics;
11023
+ declare const index$c_CoreStatistics: typeof CoreStatistics;
11024
+ type index$c_DisputesRecords = DisputesRecords;
11025
+ declare const index$c_DisputesRecords: typeof DisputesRecords;
11026
+ declare const index$c_ELECTIVE_BYTE_BALANCE: typeof ELECTIVE_BYTE_BALANCE;
11027
+ declare const index$c_ELECTIVE_ITEM_BALANCE: typeof ELECTIVE_ITEM_BALANCE;
11028
+ type index$c_ENTROPY_ENTRIES = ENTROPY_ENTRIES;
11029
+ type index$c_EnumerableState = EnumerableState;
11030
+ type index$c_FieldNames<T> = FieldNames<T>;
11031
+ type index$c_InMemoryService = InMemoryService;
11032
+ declare const index$c_InMemoryService: typeof InMemoryService;
11033
+ type index$c_InMemoryState = InMemoryState;
11034
+ declare const index$c_InMemoryState: typeof InMemoryState;
11035
+ type index$c_InMemoryStateFields = InMemoryStateFields;
11036
+ type index$c_LookupHistoryItem = LookupHistoryItem;
11037
+ declare const index$c_LookupHistoryItem: typeof LookupHistoryItem;
11038
+ type index$c_LookupHistorySlots = LookupHistorySlots;
11039
+ declare const index$c_MAX_LOOKUP_HISTORY_SLOTS: typeof MAX_LOOKUP_HISTORY_SLOTS;
11040
+ type index$c_MAX_RECENT_HISTORY = MAX_RECENT_HISTORY;
11041
+ type index$c_PerCore<T> = PerCore<T>;
11042
+ type index$c_PreimageItem = PreimageItem;
11043
+ declare const index$c_PreimageItem: typeof PreimageItem;
11044
+ type index$c_PrivilegedServices = PrivilegedServices;
11045
+ declare const index$c_PrivilegedServices: typeof PrivilegedServices;
11046
+ type index$c_RecentBlocks = RecentBlocks;
11047
+ declare const index$c_RecentBlocks: typeof RecentBlocks;
11048
+ type index$c_RecentBlocksHistory = RecentBlocksHistory;
11049
+ declare const index$c_RecentBlocksHistory: typeof RecentBlocksHistory;
11050
+ type index$c_SafroleData = SafroleData;
11051
+ declare const index$c_SafroleData: typeof SafroleData;
11052
+ type index$c_SafroleSealingKeys = SafroleSealingKeys;
11053
+ type index$c_SafroleSealingKeysData = SafroleSealingKeysData;
11054
+ declare const index$c_SafroleSealingKeysData: typeof SafroleSealingKeysData;
11055
+ type index$c_SafroleSealingKeysKind = SafroleSealingKeysKind;
11056
+ declare const index$c_SafroleSealingKeysKind: typeof SafroleSealingKeysKind;
11057
+ type index$c_Service = Service;
11058
+ type index$c_ServiceAccountInfo = ServiceAccountInfo;
11059
+ declare const index$c_ServiceAccountInfo: typeof ServiceAccountInfo;
11060
+ type index$c_ServiceData = ServiceData;
11061
+ type index$c_ServiceEntries = ServiceEntries;
11062
+ type index$c_ServiceStatistics = ServiceStatistics;
11063
+ declare const index$c_ServiceStatistics: typeof ServiceStatistics;
11064
+ type index$c_ServicesUpdate = ServicesUpdate;
11065
+ type index$c_State = State;
11066
+ type index$c_StatisticsData = StatisticsData;
11067
+ declare const index$c_StatisticsData: typeof StatisticsData;
11068
+ type index$c_StorageItem = StorageItem;
11069
+ declare const index$c_StorageItem: typeof StorageItem;
11070
+ type index$c_StorageKey = StorageKey;
11071
+ type index$c_UpdateError = UpdateError;
11072
+ declare const index$c_UpdateError: typeof UpdateError;
11073
+ type index$c_UpdatePreimage = UpdatePreimage;
11074
+ declare const index$c_UpdatePreimage: typeof UpdatePreimage;
11075
+ type index$c_UpdatePreimageKind = UpdatePreimageKind;
11076
+ declare const index$c_UpdatePreimageKind: typeof UpdatePreimageKind;
11077
+ type index$c_UpdateService = UpdateService;
11078
+ declare const index$c_UpdateService: typeof UpdateService;
11079
+ type index$c_UpdateServiceKind = UpdateServiceKind;
11080
+ declare const index$c_UpdateServiceKind: typeof UpdateServiceKind;
11081
+ type index$c_UpdateStorage = UpdateStorage;
11082
+ declare const index$c_UpdateStorage: typeof UpdateStorage;
11083
+ type index$c_UpdateStorageKind = UpdateStorageKind;
11084
+ declare const index$c_UpdateStorageKind: typeof UpdateStorageKind;
11085
+ type index$c_VALIDATOR_META_BYTES = VALIDATOR_META_BYTES;
11086
+ type index$c_ValidatorData = ValidatorData;
11087
+ declare const index$c_ValidatorData: typeof ValidatorData;
11088
+ type index$c_ValidatorStatistics = ValidatorStatistics;
11089
+ declare const index$c_ValidatorStatistics: typeof ValidatorStatistics;
11090
+ declare const index$c_accumulationOutputComparator: typeof accumulationOutputComparator;
11091
+ declare const index$c_codecBandersnatchKey: typeof codecBandersnatchKey;
11092
+ declare const index$c_codecPerCore: typeof codecPerCore;
11093
+ declare const index$c_codecServiceId: typeof codecServiceId;
11094
+ declare const index$c_codecVarGas: typeof codecVarGas;
11095
+ declare const index$c_codecVarU16: typeof codecVarU16;
11096
+ declare const index$c_codecWithHash: typeof codecWithHash;
11097
+ declare const index$c_hashComparator: typeof hashComparator;
11098
+ declare const index$c_ignoreValueWithDefault: typeof ignoreValueWithDefault;
11099
+ declare const index$c_serviceDataCodec: typeof serviceDataCodec;
11100
+ declare const index$c_serviceEntriesCodec: typeof serviceEntriesCodec;
11101
+ declare const index$c_sortedSetCodec: typeof sortedSetCodec;
11102
+ declare const index$c_tryAsLookupHistorySlots: typeof tryAsLookupHistorySlots;
11103
+ declare const index$c_tryAsPerCore: typeof tryAsPerCore;
11104
+ declare const index$c_workReportsSortedSetCodec: typeof workReportsSortedSetCodec;
11105
+ declare const index$c_zeroSizeHint: typeof zeroSizeHint;
11106
+ declare namespace index$c {
11107
+ export { index$c_AccumulationOutput as AccumulationOutput, index$c_AutoAccumulate as AutoAccumulate, index$c_AvailabilityAssignment as AvailabilityAssignment, index$c_BASE_SERVICE_BALANCE as BASE_SERVICE_BALANCE, index$c_BlockState as BlockState, index$c_CoreStatistics as CoreStatistics, index$c_DisputesRecords as DisputesRecords, index$c_ELECTIVE_BYTE_BALANCE as ELECTIVE_BYTE_BALANCE, index$c_ELECTIVE_ITEM_BALANCE as ELECTIVE_ITEM_BALANCE, index$c_InMemoryService as InMemoryService, index$c_InMemoryState as InMemoryState, index$c_LookupHistoryItem as LookupHistoryItem, index$c_MAX_LOOKUP_HISTORY_SLOTS as MAX_LOOKUP_HISTORY_SLOTS, index$c_PreimageItem as PreimageItem, index$c_PrivilegedServices as PrivilegedServices, index$c_RecentBlocks as RecentBlocks, index$c_RecentBlocksHistory as RecentBlocksHistory, index$c_SafroleData as SafroleData, index$c_SafroleSealingKeysData as SafroleSealingKeysData, index$c_SafroleSealingKeysKind as SafroleSealingKeysKind, index$c_ServiceAccountInfo as ServiceAccountInfo, index$c_ServiceStatistics as ServiceStatistics, index$c_StatisticsData as StatisticsData, index$c_StorageItem as StorageItem, index$c_UpdateError as UpdateError, index$c_UpdatePreimage as UpdatePreimage, index$c_UpdatePreimageKind as UpdatePreimageKind, index$c_UpdateService as UpdateService, index$c_UpdateServiceKind as UpdateServiceKind, index$c_UpdateStorage as UpdateStorage, index$c_UpdateStorageKind as UpdateStorageKind, index$c_ValidatorData as ValidatorData, index$c_ValidatorStatistics as ValidatorStatistics, index$c_accumulationOutputComparator as accumulationOutputComparator, index$c_codecBandersnatchKey as codecBandersnatchKey, index$c_codecPerCore as codecPerCore, index$c_codecServiceId as codecServiceId, index$c_codecVarGas as codecVarGas, index$c_codecVarU16 as codecVarU16, index$c_codecWithHash as codecWithHash, index$c_hashComparator as hashComparator, index$c_ignoreValueWithDefault as ignoreValueWithDefault, index$c_serviceDataCodec as serviceDataCodec, index$c_serviceEntriesCodec as serviceEntriesCodec, index$c_sortedSetCodec as sortedSetCodec, index$c_tryAsLookupHistorySlots as tryAsLookupHistorySlots, index$c_tryAsPerCore as tryAsPerCore, index$c_workReportsSortedSetCodec as workReportsSortedSetCodec, index$c_zeroSizeHint as zeroSizeHint };
11108
+ export type { index$c_BlocksState as BlocksState, index$c_ENTROPY_ENTRIES as ENTROPY_ENTRIES, index$c_EnumerableState as EnumerableState, index$c_FieldNames as FieldNames, index$c_InMemoryStateFields as InMemoryStateFields, index$c_LookupHistorySlots as LookupHistorySlots, index$c_MAX_RECENT_HISTORY as MAX_RECENT_HISTORY, index$c_PerCore as PerCore, index$c_SafroleSealingKeys as SafroleSealingKeys, index$c_Service as Service, index$c_ServiceData as ServiceData, index$c_ServiceEntries as ServiceEntries, index$c_ServicesUpdate as ServicesUpdate, index$c_State as State, index$c_StorageKey as StorageKey, index$c_VALIDATOR_META_BYTES as VALIDATOR_META_BYTES };
10921
11109
  }
10922
11110
 
10923
11111
  type StateKey = Opaque<OpaqueHash, "stateKey">;
@@ -11191,7 +11379,10 @@ declare namespace serialize {
11191
11379
  /** C(16): https://graypaper.fluffylabs.dev/#/38c4e62/3b46033b4603?v=0.7.0 */
11192
11380
  export const accumulationOutputLog: StateCodec<State["accumulationOutputLog"]> = {
11193
11381
  key: stateKeys.index(StateKeyIdx.Theta),
11194
- Codec: codec.sequenceVarLen(AccumulationOutput.Codec),
11382
+ Codec: codec.sequenceVarLen(AccumulationOutput.Codec).convert(
11383
+ (i) => i.array,
11384
+ (o) => SortedArray.fromSortedArray(accumulationOutputComparator, o),
11385
+ ),
11195
11386
  extract: (s) => s.accumulationOutputLog,
11196
11387
  };
11197
11388
 
@@ -11866,44 +12057,44 @@ declare function loadState(spec: ChainSpec, entries: Iterable<[StateKey | Trunca
11866
12057
  * hashmap of `key -> value` entries.
11867
12058
  */
11868
12059
 
11869
- declare const index$c_EMPTY_BLOB: typeof EMPTY_BLOB;
11870
- type index$c_EncodeFun = EncodeFun;
11871
- type index$c_KeyAndCodec<T> = KeyAndCodec<T>;
11872
- type index$c_SerializedService = SerializedService;
11873
- declare const index$c_SerializedService: typeof SerializedService;
11874
- type index$c_SerializedState<T extends SerializedStateBackend = SerializedStateBackend> = SerializedState<T>;
11875
- declare const index$c_SerializedState: typeof SerializedState;
11876
- type index$c_SerializedStateBackend = SerializedStateBackend;
11877
- type index$c_StateCodec<T> = StateCodec<T>;
11878
- type index$c_StateEntries = StateEntries;
11879
- declare const index$c_StateEntries: typeof StateEntries;
11880
- type index$c_StateEntryUpdate = StateEntryUpdate;
11881
- type index$c_StateEntryUpdateAction = StateEntryUpdateAction;
11882
- declare const index$c_StateEntryUpdateAction: typeof StateEntryUpdateAction;
11883
- type index$c_StateKey = StateKey;
11884
- type index$c_StateKeyIdx = StateKeyIdx;
11885
- declare const index$c_StateKeyIdx: typeof StateKeyIdx;
11886
- declare const index$c_TYPICAL_STATE_ITEMS: typeof TYPICAL_STATE_ITEMS;
11887
- declare const index$c_TYPICAL_STATE_ITEM_LEN: typeof TYPICAL_STATE_ITEM_LEN;
11888
- declare const index$c_U32_BYTES: typeof U32_BYTES;
11889
- declare const index$c_binaryMerkleization: typeof binaryMerkleization;
11890
- declare const index$c_convertInMemoryStateToDictionary: typeof convertInMemoryStateToDictionary;
11891
- declare const index$c_dumpCodec: typeof dumpCodec;
11892
- declare const index$c_getSafroleData: typeof getSafroleData;
11893
- declare const index$c_legacyServiceNested: typeof legacyServiceNested;
11894
- declare const index$c_loadState: typeof loadState;
11895
- import index$c_serialize = serialize;
11896
- declare const index$c_serializeBasicKeys: typeof serializeBasicKeys;
11897
- declare const index$c_serializePreimages: typeof serializePreimages;
11898
- declare const index$c_serializeRemovedServices: typeof serializeRemovedServices;
11899
- declare const index$c_serializeServiceUpdates: typeof serializeServiceUpdates;
11900
- declare const index$c_serializeStateUpdate: typeof serializeStateUpdate;
11901
- declare const index$c_serializeStorage: typeof serializeStorage;
11902
- declare const index$c_stateEntriesSequenceCodec: typeof stateEntriesSequenceCodec;
11903
- import index$c_stateKeys = stateKeys;
11904
- declare namespace index$c {
11905
- export { index$c_EMPTY_BLOB as EMPTY_BLOB, index$c_SerializedService as SerializedService, index$c_SerializedState as SerializedState, index$c_StateEntries as StateEntries, index$c_StateEntryUpdateAction as StateEntryUpdateAction, index$c_StateKeyIdx as StateKeyIdx, index$c_TYPICAL_STATE_ITEMS as TYPICAL_STATE_ITEMS, index$c_TYPICAL_STATE_ITEM_LEN as TYPICAL_STATE_ITEM_LEN, index$c_U32_BYTES as U32_BYTES, index$c_binaryMerkleization as binaryMerkleization, index$c_convertInMemoryStateToDictionary as convertInMemoryStateToDictionary, index$c_dumpCodec as dumpCodec, index$c_getSafroleData as getSafroleData, index$c_legacyServiceNested as legacyServiceNested, index$c_loadState as loadState, index$c_serialize as serialize, index$c_serializeBasicKeys as serializeBasicKeys, index$c_serializePreimages as serializePreimages, index$c_serializeRemovedServices as serializeRemovedServices, index$c_serializeServiceUpdates as serializeServiceUpdates, index$c_serializeStateUpdate as serializeStateUpdate, index$c_serializeStorage as serializeStorage, index$c_stateEntriesSequenceCodec as stateEntriesSequenceCodec, index$c_stateKeys as stateKeys };
11906
- export type { index$c_EncodeFun as EncodeFun, index$c_KeyAndCodec as KeyAndCodec, index$c_SerializedStateBackend as SerializedStateBackend, index$c_StateCodec as StateCodec, index$c_StateEntryUpdate as StateEntryUpdate, index$c_StateKey as StateKey };
12060
+ declare const index$b_EMPTY_BLOB: typeof EMPTY_BLOB;
12061
+ type index$b_EncodeFun = EncodeFun;
12062
+ type index$b_KeyAndCodec<T> = KeyAndCodec<T>;
12063
+ type index$b_SerializedService = SerializedService;
12064
+ declare const index$b_SerializedService: typeof SerializedService;
12065
+ type index$b_SerializedState<T extends SerializedStateBackend = SerializedStateBackend> = SerializedState<T>;
12066
+ declare const index$b_SerializedState: typeof SerializedState;
12067
+ type index$b_SerializedStateBackend = SerializedStateBackend;
12068
+ type index$b_StateCodec<T> = StateCodec<T>;
12069
+ type index$b_StateEntries = StateEntries;
12070
+ declare const index$b_StateEntries: typeof StateEntries;
12071
+ type index$b_StateEntryUpdate = StateEntryUpdate;
12072
+ type index$b_StateEntryUpdateAction = StateEntryUpdateAction;
12073
+ declare const index$b_StateEntryUpdateAction: typeof StateEntryUpdateAction;
12074
+ type index$b_StateKey = StateKey;
12075
+ type index$b_StateKeyIdx = StateKeyIdx;
12076
+ declare const index$b_StateKeyIdx: typeof StateKeyIdx;
12077
+ declare const index$b_TYPICAL_STATE_ITEMS: typeof TYPICAL_STATE_ITEMS;
12078
+ declare const index$b_TYPICAL_STATE_ITEM_LEN: typeof TYPICAL_STATE_ITEM_LEN;
12079
+ declare const index$b_U32_BYTES: typeof U32_BYTES;
12080
+ declare const index$b_binaryMerkleization: typeof binaryMerkleization;
12081
+ declare const index$b_convertInMemoryStateToDictionary: typeof convertInMemoryStateToDictionary;
12082
+ declare const index$b_dumpCodec: typeof dumpCodec;
12083
+ declare const index$b_getSafroleData: typeof getSafroleData;
12084
+ declare const index$b_legacyServiceNested: typeof legacyServiceNested;
12085
+ declare const index$b_loadState: typeof loadState;
12086
+ import index$b_serialize = serialize;
12087
+ declare const index$b_serializeBasicKeys: typeof serializeBasicKeys;
12088
+ declare const index$b_serializePreimages: typeof serializePreimages;
12089
+ declare const index$b_serializeRemovedServices: typeof serializeRemovedServices;
12090
+ declare const index$b_serializeServiceUpdates: typeof serializeServiceUpdates;
12091
+ declare const index$b_serializeStateUpdate: typeof serializeStateUpdate;
12092
+ declare const index$b_serializeStorage: typeof serializeStorage;
12093
+ declare const index$b_stateEntriesSequenceCodec: typeof stateEntriesSequenceCodec;
12094
+ import index$b_stateKeys = stateKeys;
12095
+ declare namespace index$b {
12096
+ export { index$b_EMPTY_BLOB as EMPTY_BLOB, index$b_SerializedService as SerializedService, index$b_SerializedState as SerializedState, index$b_StateEntries as StateEntries, index$b_StateEntryUpdateAction as StateEntryUpdateAction, index$b_StateKeyIdx as StateKeyIdx, index$b_TYPICAL_STATE_ITEMS as TYPICAL_STATE_ITEMS, index$b_TYPICAL_STATE_ITEM_LEN as TYPICAL_STATE_ITEM_LEN, index$b_U32_BYTES as U32_BYTES, index$b_binaryMerkleization as binaryMerkleization, index$b_convertInMemoryStateToDictionary as convertInMemoryStateToDictionary, index$b_dumpCodec as dumpCodec, index$b_getSafroleData as getSafroleData, index$b_legacyServiceNested as legacyServiceNested, index$b_loadState as loadState, index$b_serialize as serialize, index$b_serializeBasicKeys as serializeBasicKeys, index$b_serializePreimages as serializePreimages, index$b_serializeRemovedServices as serializeRemovedServices, index$b_serializeServiceUpdates as serializeServiceUpdates, index$b_serializeStateUpdate as serializeStateUpdate, index$b_serializeStorage as serializeStorage, index$b_stateEntriesSequenceCodec as stateEntriesSequenceCodec, index$b_stateKeys as stateKeys };
12097
+ export type { index$b_EncodeFun as EncodeFun, index$b_KeyAndCodec as KeyAndCodec, index$b_SerializedStateBackend as SerializedStateBackend, index$b_StateCodec as StateCodec, index$b_StateEntryUpdate as StateEntryUpdate, index$b_StateKey as StateKey };
11907
12098
  }
11908
12099
 
11909
12100
  /** Error during `LeafDb` creation. */
@@ -12111,25 +12302,25 @@ declare class InMemoryStates implements StatesDb<InMemoryState> {
12111
12302
  }
12112
12303
  }
12113
12304
 
12114
- type index$b_BlocksDb = BlocksDb;
12115
- type index$b_InMemoryBlocks = InMemoryBlocks;
12116
- declare const index$b_InMemoryBlocks: typeof InMemoryBlocks;
12117
- type index$b_InMemoryStates = InMemoryStates;
12118
- declare const index$b_InMemoryStates: typeof InMemoryStates;
12119
- type index$b_LeafDb = LeafDb;
12120
- declare const index$b_LeafDb: typeof LeafDb;
12121
- type index$b_LeafDbError = LeafDbError;
12122
- declare const index$b_LeafDbError: typeof LeafDbError;
12123
- type index$b_Lookup = Lookup;
12124
- type index$b_LookupKind = LookupKind;
12125
- declare const index$b_LookupKind: typeof LookupKind;
12126
- type index$b_StateUpdateError = StateUpdateError;
12127
- declare const index$b_StateUpdateError: typeof StateUpdateError;
12128
- type index$b_StatesDb<T extends State = State> = StatesDb<T>;
12129
- type index$b_ValuesDb = ValuesDb;
12130
- declare namespace index$b {
12131
- export { index$b_InMemoryBlocks as InMemoryBlocks, index$b_InMemoryStates as InMemoryStates, index$b_LeafDb as LeafDb, index$b_LeafDbError as LeafDbError, index$b_LookupKind as LookupKind, index$b_StateUpdateError as StateUpdateError };
12132
- export type { index$b_BlocksDb as BlocksDb, index$b_Lookup as Lookup, index$b_StatesDb as StatesDb, index$b_ValuesDb as ValuesDb };
12305
+ type index$a_BlocksDb = BlocksDb;
12306
+ type index$a_InMemoryBlocks = InMemoryBlocks;
12307
+ declare const index$a_InMemoryBlocks: typeof InMemoryBlocks;
12308
+ type index$a_InMemoryStates = InMemoryStates;
12309
+ declare const index$a_InMemoryStates: typeof InMemoryStates;
12310
+ type index$a_LeafDb = LeafDb;
12311
+ declare const index$a_LeafDb: typeof LeafDb;
12312
+ type index$a_LeafDbError = LeafDbError;
12313
+ declare const index$a_LeafDbError: typeof LeafDbError;
12314
+ type index$a_Lookup = Lookup;
12315
+ type index$a_LookupKind = LookupKind;
12316
+ declare const index$a_LookupKind: typeof LookupKind;
12317
+ type index$a_StateUpdateError = StateUpdateError;
12318
+ declare const index$a_StateUpdateError: typeof StateUpdateError;
12319
+ type index$a_StatesDb<T extends State = State> = StatesDb<T>;
12320
+ type index$a_ValuesDb = ValuesDb;
12321
+ declare namespace index$a {
12322
+ export { index$a_InMemoryBlocks as InMemoryBlocks, index$a_InMemoryStates as InMemoryStates, index$a_LeafDb as LeafDb, index$a_LeafDbError as LeafDbError, index$a_LookupKind as LookupKind, index$a_StateUpdateError as StateUpdateError };
12323
+ export type { index$a_BlocksDb as BlocksDb, index$a_Lookup as Lookup, index$a_StatesDb as StatesDb, index$a_ValuesDb as ValuesDb };
12133
12324
  }
12134
12325
 
12135
12326
  /**
@@ -12548,30 +12739,30 @@ declare const initEc = async () => {
12548
12739
  await init.reedSolomon();
12549
12740
  };
12550
12741
 
12551
- declare const index$a_HALF_POINT_SIZE: typeof HALF_POINT_SIZE;
12552
- declare const index$a_N_CHUNKS_REDUNDANCY: typeof N_CHUNKS_REDUNDANCY;
12553
- type index$a_N_CHUNKS_REQUIRED = N_CHUNKS_REQUIRED;
12554
- type index$a_N_CHUNKS_TOTAL = N_CHUNKS_TOTAL;
12555
- type index$a_PIECE_SIZE = PIECE_SIZE;
12556
- declare const index$a_POINT_ALIGNMENT: typeof POINT_ALIGNMENT;
12557
- type index$a_POINT_LENGTH = POINT_LENGTH;
12558
- declare const index$a_chunkingFunction: typeof chunkingFunction;
12559
- declare const index$a_chunksToShards: typeof chunksToShards;
12560
- declare const index$a_decodeData: typeof decodeData;
12561
- declare const index$a_decodeDataAndTrim: typeof decodeDataAndTrim;
12562
- declare const index$a_decodePiece: typeof decodePiece;
12563
- declare const index$a_encodePoints: typeof encodePoints;
12564
- declare const index$a_initEc: typeof initEc;
12565
- declare const index$a_join: typeof join;
12566
- declare const index$a_lace: typeof lace;
12567
- declare const index$a_padAndEncodeData: typeof padAndEncodeData;
12568
- declare const index$a_shardsToChunks: typeof shardsToChunks;
12569
- declare const index$a_split: typeof split;
12570
- declare const index$a_transpose: typeof transpose;
12571
- declare const index$a_unzip: typeof unzip;
12572
- declare namespace index$a {
12573
- export { index$a_HALF_POINT_SIZE as HALF_POINT_SIZE, index$a_N_CHUNKS_REDUNDANCY as N_CHUNKS_REDUNDANCY, index$a_POINT_ALIGNMENT as POINT_ALIGNMENT, index$a_chunkingFunction as chunkingFunction, index$a_chunksToShards as chunksToShards, index$a_decodeData as decodeData, index$a_decodeDataAndTrim as decodeDataAndTrim, index$a_decodePiece as decodePiece, index$a_encodePoints as encodePoints, index$a_initEc as initEc, index$a_join as join, index$a_lace as lace, index$a_padAndEncodeData as padAndEncodeData, index$a_shardsToChunks as shardsToChunks, index$a_split as split, index$a_transpose as transpose, index$a_unzip as unzip };
12574
- export type { index$a_N_CHUNKS_REQUIRED as N_CHUNKS_REQUIRED, index$a_N_CHUNKS_TOTAL as N_CHUNKS_TOTAL, index$a_PIECE_SIZE as PIECE_SIZE, index$a_POINT_LENGTH as POINT_LENGTH };
12742
+ declare const index$9_HALF_POINT_SIZE: typeof HALF_POINT_SIZE;
12743
+ declare const index$9_N_CHUNKS_REDUNDANCY: typeof N_CHUNKS_REDUNDANCY;
12744
+ type index$9_N_CHUNKS_REQUIRED = N_CHUNKS_REQUIRED;
12745
+ type index$9_N_CHUNKS_TOTAL = N_CHUNKS_TOTAL;
12746
+ type index$9_PIECE_SIZE = PIECE_SIZE;
12747
+ declare const index$9_POINT_ALIGNMENT: typeof POINT_ALIGNMENT;
12748
+ type index$9_POINT_LENGTH = POINT_LENGTH;
12749
+ declare const index$9_chunkingFunction: typeof chunkingFunction;
12750
+ declare const index$9_chunksToShards: typeof chunksToShards;
12751
+ declare const index$9_decodeData: typeof decodeData;
12752
+ declare const index$9_decodeDataAndTrim: typeof decodeDataAndTrim;
12753
+ declare const index$9_decodePiece: typeof decodePiece;
12754
+ declare const index$9_encodePoints: typeof encodePoints;
12755
+ declare const index$9_initEc: typeof initEc;
12756
+ declare const index$9_join: typeof join;
12757
+ declare const index$9_lace: typeof lace;
12758
+ declare const index$9_padAndEncodeData: typeof padAndEncodeData;
12759
+ declare const index$9_shardsToChunks: typeof shardsToChunks;
12760
+ declare const index$9_split: typeof split;
12761
+ declare const index$9_transpose: typeof transpose;
12762
+ declare const index$9_unzip: typeof unzip;
12763
+ declare namespace index$9 {
12764
+ export { index$9_HALF_POINT_SIZE as HALF_POINT_SIZE, index$9_N_CHUNKS_REDUNDANCY as N_CHUNKS_REDUNDANCY, index$9_POINT_ALIGNMENT as POINT_ALIGNMENT, index$9_chunkingFunction as chunkingFunction, index$9_chunksToShards as chunksToShards, index$9_decodeData as decodeData, index$9_decodeDataAndTrim as decodeDataAndTrim, index$9_decodePiece as decodePiece, index$9_encodePoints as encodePoints, index$9_initEc as initEc, index$9_join as join, index$9_lace as lace, index$9_padAndEncodeData as padAndEncodeData, index$9_shardsToChunks as shardsToChunks, index$9_split as split, index$9_transpose as transpose, index$9_unzip as unzip };
12765
+ export type { index$9_N_CHUNKS_REQUIRED as N_CHUNKS_REQUIRED, index$9_N_CHUNKS_TOTAL as N_CHUNKS_TOTAL, index$9_PIECE_SIZE as PIECE_SIZE, index$9_POINT_LENGTH as POINT_LENGTH };
12575
12766
  }
12576
12767
 
12577
12768
  /** Size of the transfer memo. */
@@ -12914,173 +13105,6 @@ interface GasCounter {
12914
13105
  sub(g: Gas): boolean;
12915
13106
  }
12916
13107
 
12917
- declare enum Level {
12918
- INSANE = 1,
12919
- TRACE = 2,
12920
- LOG = 3,
12921
- INFO = 4,
12922
- WARN = 5,
12923
- ERROR = 6,
12924
- }
12925
-
12926
- type Options = {
12927
- defaultLevel: Level;
12928
- workingDir: string;
12929
- modules: Map<string, Level>;
12930
- };
12931
-
12932
- /**
12933
- * A function to parse logger definition (including modules) given as a string.
12934
- *
12935
- * Examples
12936
- * - `info` - setup default logging level to `info`.
12937
- * - `trace` - default logging level set to `trace`.
12938
- * - `debug;consensus=trace` - default level is set to `debug/log`, but consensus is in trace mode.
12939
- */
12940
- declare function parseLoggerOptions(input: string, defaultLevel: Level, workingDir?: string): Options {
12941
- const modules = new Map<string, Level>();
12942
- const parts = input.toLowerCase().split(",");
12943
- let defLevel = defaultLevel;
12944
-
12945
- for (const p of parts) {
12946
- const clean = p.trim();
12947
- // skip empty objects (forgotten `,` removed)
12948
- if (clean.length === 0) {
12949
- continue;
12950
- }
12951
- // we just have the default level
12952
- if (clean.includes("=")) {
12953
- const [mod, lvl] = clean.split("=");
12954
- modules.set(mod.trim(), parseLevel(lvl.trim()));
12955
- } else {
12956
- defLevel = parseLevel(clean);
12957
- }
12958
- }
12959
-
12960
- // TODO [ToDr] Fix dirname for workers.
12961
- const myDir = (import.meta.dirname ?? "").split("/");
12962
- myDir.pop();
12963
- myDir.pop();
12964
- return {
12965
- defaultLevel: defLevel,
12966
- modules,
12967
- workingDir: workingDir ?? myDir.join("/"),
12968
- };
12969
- }
12970
-
12971
- declare const GLOBAL_CONFIG = {
12972
- options: DEFAULT_OPTIONS,
12973
- transport: ConsoleTransport.create(DEFAULT_OPTIONS.defaultLevel, DEFAULT_OPTIONS),
12974
- };
12975
-
12976
- /**
12977
- * A logger instance.
12978
- */
12979
- declare class Logger {
12980
- /**
12981
- * Create a new logger instance given filename and an optional module name.
12982
- *
12983
- * If the module name is not given, `fileName` becomes the module name.
12984
- * The module name can be composed from multiple parts separated with `/`.
12985
- *
12986
- * The logger will use a global configuration which can be changed using
12987
- * [`configureLogger`] function.
12988
- */
12989
- static new(fileName?: string, moduleName?: string) {
12990
- const fName = fileName ?? "unknown";
12991
- return new Logger(moduleName ?? fName, fName, GLOBAL_CONFIG);
12992
- }
12993
-
12994
- /**
12995
- * Return currently configured level for given module. */
12996
- static getLevel(moduleName: string): Level {
12997
- return findLevel(GLOBAL_CONFIG.options, moduleName);
12998
- }
12999
-
13000
- /**
13001
- * Global configuration of all loggers.
13002
- *
13003
- * One can specify a default logging level (only logs with level >= default will be printed).
13004
- * It's also possible to configure per-module logging level that takes precedence
13005
- * over the default one.
13006
- *
13007
- * Changing the options affects all previously created loggers.
13008
- */
13009
- static configureAllFromOptions(options: Options) {
13010
- // find minimal level to optimise logging in case
13011
- // we don't care about low-level logs.
13012
- const minimalLevel = Array.from(options.modules.values()).reduce((level, modLevel) => {
13013
- return level < modLevel ? level : modLevel;
13014
- }, options.defaultLevel);
13015
-
13016
- const transport = ConsoleTransport.create(minimalLevel, options);
13017
-
13018
- // set the global config
13019
- GLOBAL_CONFIG.options = options;
13020
- GLOBAL_CONFIG.transport = transport;
13021
- }
13022
-
13023
- /**
13024
- * Global configuration of all loggers.
13025
- *
13026
- * Parse configuration options from an input string typically obtained
13027
- * from environment variable `JAM_LOG`.
13028
- */
13029
- static configureAll(input: string, defaultLevel: Level, workingDir?: string) {
13030
- const options = parseLoggerOptions(input, defaultLevel, workingDir);
13031
- Logger.configureAllFromOptions(options);
13032
- }
13033
-
13034
- constructor(
13035
- private readonly moduleName: string,
13036
- private readonly fileName: string,
13037
- private readonly config: typeof GLOBAL_CONFIG,
13038
- ) {}
13039
-
13040
- /** Log a message with `INSANE` level. */
13041
- insane(val: string) {
13042
- this.config.transport.insane(this.moduleName, val);
13043
- }
13044
-
13045
- /** Log a message with `TRACE` level. */
13046
- trace(val: string) {
13047
- this.config.transport.trace(this.moduleName, val);
13048
- }
13049
-
13050
- /** Log a message with `DEBUG`/`LOG` level. */
13051
- log(val: string) {
13052
- this.config.transport.log(this.moduleName, val);
13053
- }
13054
-
13055
- /** Log a message with `INFO` level. */
13056
- info(val: string) {
13057
- this.config.transport.info(this.moduleName, val);
13058
- }
13059
-
13060
- /** Log a message with `WARN` level. */
13061
- warn(val: string) {
13062
- this.config.transport.warn(this.moduleName, val);
13063
- }
13064
-
13065
- /** Log a message with `ERROR` level. */
13066
- error(val: string) {
13067
- this.config.transport.error(this.moduleName, val);
13068
- }
13069
- }
13070
-
13071
- type index$9_Level = Level;
13072
- declare const index$9_Level: typeof Level;
13073
- type index$9_Logger = Logger;
13074
- declare const index$9_Logger: typeof Logger;
13075
- declare const index$9_parseLoggerOptions: typeof parseLoggerOptions;
13076
- declare namespace index$9 {
13077
- export {
13078
- index$9_Level as Level,
13079
- index$9_Logger as Logger,
13080
- index$9_parseLoggerOptions as parseLoggerOptions,
13081
- };
13082
- }
13083
-
13084
13108
  /**
13085
13109
  * Mask class is an implementation of skip function defined in GP.
13086
13110
  *
@@ -18630,7 +18654,7 @@ type JsonStateDump = {
18630
18654
  pi: JsonStatisticsData;
18631
18655
  omega: State["accumulationQueue"];
18632
18656
  xi: PerEpochBlock<WorkPackageHash[]>;
18633
- theta: State["accumulationOutputLog"] | null;
18657
+ theta: AccumulationOutput[] | null;
18634
18658
  accounts: InMemoryService[];
18635
18659
  };
18636
18660
 
@@ -18732,7 +18756,7 @@ declare const fullStateDumpFromJson = (spec: ChainSpec) =>
18732
18756
  xi.map((x) => HashSet.from(x)),
18733
18757
  spec,
18734
18758
  ),
18735
- accumulationOutputLog: theta ?? [],
18759
+ accumulationOutputLog: SortedArray.fromArray(accumulationOutputComparator, theta ?? []),
18736
18760
  services: new Map(accounts.map((x) => [x.serviceId, x])),
18737
18761
  });
18738
18762
  },
@@ -19090,4 +19114,4 @@ declare namespace index {
19090
19114
  export type { index_PreimagesInput as PreimagesInput, index_PreimagesState as PreimagesState, index_PreimagesStateUpdate as PreimagesStateUpdate };
19091
19115
  }
19092
19116
 
19093
- export { index$j as block, index$h as block_json, index$q as bytes, index$o as codec, index$m as collections, index$k as config, index$g as config_node, index$l as crypto, index$b as database, index$a as erasure_coding, index$n as hash, index$6 as jam_host_calls, index$i as json_parser, index$9 as logger, index$e as mmr, index$p as numbers, index$r as ordering, index$3 as pvm, index$7 as pvm_host_calls, index$8 as pvm_interpreter, index$4 as pvm_program, index$5 as pvm_spi_decoder, index$2 as shuffling, index$d as state, index$1 as state_json, index$c as state_merkleization, index as transition, index$f as trie, index$s as utils };
19117
+ export { index$j as block, index$h as block_json, index$q as bytes, index$o as codec, index$m as collections, index$k as config, index$f as config_node, index$l as crypto, index$a as database, index$9 as erasure_coding, index$n as hash, index$6 as jam_host_calls, index$i as json_parser, index$g as logger, index$d as mmr, index$p as numbers, index$r as ordering, index$3 as pvm, index$7 as pvm_host_calls, index$8 as pvm_interpreter, index$4 as pvm_program, index$5 as pvm_spi_decoder, index$2 as shuffling, index$c as state, index$1 as state_json, index$b as state_merkleization, index as transition, index$e as trie, index$s as utils };