@typeberry/lib 0.0.5-6e657f4 → 0.0.5

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 (3) hide show
  1. package/index.d.ts +7 -25
  2. package/index.js +3 -14
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -8743,20 +8743,6 @@ declare class AccumulationOutput {
8743
8743
  ) {}
8744
8744
  }
8745
8745
 
8746
- declare function accumulationOutputComparator(a: AccumulationOutput, b: AccumulationOutput) {
8747
- const result = a.serviceId - b.serviceId;
8748
-
8749
- if (result < 0) {
8750
- return Ordering.Less;
8751
- }
8752
-
8753
- if (result > 0) {
8754
- return Ordering.Greater;
8755
- }
8756
-
8757
- return Ordering.Equal;
8758
- }
8759
-
8760
8746
  declare const codecWithHash = <T, V, H extends OpaqueHash>(val: Descriptor<T, V>): Descriptor<WithHash<H, T>, V> =>
8761
8747
  Descriptor.withView(
8762
8748
  val.name,
@@ -10057,7 +10043,7 @@ type State = {
10057
10043
  *
10058
10044
  * NOTE Maximum size of this array is unspecified in GP
10059
10045
  */
10060
- readonly accumulationOutputLog: SortedArray<AccumulationOutput>;
10046
+ readonly accumulationOutputLog: AccumulationOutput[];
10061
10047
 
10062
10048
  /**
10063
10049
  * Retrieve details about single service.
@@ -10645,7 +10631,7 @@ declare class InMemoryState extends WithDebug implements State, EnumerableState
10645
10631
  sealingKeySeries: SafroleSealingKeys;
10646
10632
  epochRoot: BandersnatchRingRoot;
10647
10633
  privilegedServices: PrivilegedServices;
10648
- accumulationOutputLog: SortedArray<AccumulationOutput>;
10634
+ accumulationOutputLog: AccumulationOutput[];
10649
10635
  services: Map<ServiceId, InMemoryService>;
10650
10636
 
10651
10637
  recentServiceIds(): readonly ServiceId[] {
@@ -10789,7 +10775,7 @@ declare class InMemoryState extends WithDebug implements State, EnumerableState
10789
10775
  validatorsManager: tryAsServiceId(0),
10790
10776
  autoAccumulateServices: [],
10791
10777
  }),
10792
- accumulationOutputLog: SortedArray.fromArray(accumulationOutputComparator, []),
10778
+ accumulationOutputLog: [],
10793
10779
  services: new Map(),
10794
10780
  });
10795
10781
  }
@@ -10914,7 +10900,6 @@ type index$d_ValidatorData = ValidatorData;
10914
10900
  declare const index$d_ValidatorData: typeof ValidatorData;
10915
10901
  type index$d_ValidatorStatistics = ValidatorStatistics;
10916
10902
  declare const index$d_ValidatorStatistics: typeof ValidatorStatistics;
10917
- declare const index$d_accumulationOutputComparator: typeof accumulationOutputComparator;
10918
10903
  declare const index$d_codecBandersnatchKey: typeof codecBandersnatchKey;
10919
10904
  declare const index$d_codecPerCore: typeof codecPerCore;
10920
10905
  declare const index$d_codecServiceId: typeof codecServiceId;
@@ -10931,7 +10916,7 @@ declare const index$d_tryAsPerCore: typeof tryAsPerCore;
10931
10916
  declare const index$d_workReportsSortedSetCodec: typeof workReportsSortedSetCodec;
10932
10917
  declare const index$d_zeroSizeHint: typeof zeroSizeHint;
10933
10918
  declare namespace index$d {
10934
- 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_accumulationOutputComparator as accumulationOutputComparator, 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 };
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 };
10935
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 };
10936
10921
  }
10937
10922
 
@@ -11206,10 +11191,7 @@ declare namespace serialize {
11206
11191
  /** C(16): https://graypaper.fluffylabs.dev/#/38c4e62/3b46033b4603?v=0.7.0 */
11207
11192
  export const accumulationOutputLog: StateCodec<State["accumulationOutputLog"]> = {
11208
11193
  key: stateKeys.index(StateKeyIdx.Theta),
11209
- Codec: codec.sequenceVarLen(AccumulationOutput.Codec).convert(
11210
- (i) => i.array,
11211
- (o) => SortedArray.fromSortedArray(accumulationOutputComparator, o),
11212
- ),
11194
+ Codec: codec.sequenceVarLen(AccumulationOutput.Codec),
11213
11195
  extract: (s) => s.accumulationOutputLog,
11214
11196
  };
11215
11197
 
@@ -18648,7 +18630,7 @@ type JsonStateDump = {
18648
18630
  pi: JsonStatisticsData;
18649
18631
  omega: State["accumulationQueue"];
18650
18632
  xi: PerEpochBlock<WorkPackageHash[]>;
18651
- theta: AccumulationOutput[] | null;
18633
+ theta: State["accumulationOutputLog"] | null;
18652
18634
  accounts: InMemoryService[];
18653
18635
  };
18654
18636
 
@@ -18750,7 +18732,7 @@ declare const fullStateDumpFromJson = (spec: ChainSpec) =>
18750
18732
  xi.map((x) => HashSet.from(x)),
18751
18733
  spec,
18752
18734
  ),
18753
- accumulationOutputLog: SortedArray.fromArray(accumulationOutputComparator, theta ?? []),
18735
+ accumulationOutputLog: theta ?? [],
18754
18736
  services: new Map(accounts.map((x) => [x.serviceId, x])),
18755
18737
  });
18756
18738
  },
package/index.js CHANGED
@@ -8214,16 +8214,6 @@ class AccumulationOutput {
8214
8214
  this.output = output;
8215
8215
  }
8216
8216
  }
8217
- function accumulationOutputComparator(a, b) {
8218
- const result = a.serviceId - b.serviceId;
8219
- if (result < 0) {
8220
- return Ordering.Less;
8221
- }
8222
- if (result > 0) {
8223
- return Ordering.Greater;
8224
- }
8225
- return Ordering.Equal;
8226
- }
8227
8217
 
8228
8218
  const codecWithHash = (val) => Descriptor.withView(val.name, val.sizeHint, (e, elem) => val.encode(e, elem.data), (d) => {
8229
8219
  const decoder2 = d.clone();
@@ -9622,7 +9612,7 @@ class InMemoryState extends WithDebug {
9622
9612
  validatorsManager: tryAsServiceId(0),
9623
9613
  autoAccumulateServices: [],
9624
9614
  }),
9625
- accumulationOutputLog: SortedArray.fromArray(accumulationOutputComparator, []),
9615
+ accumulationOutputLog: [],
9626
9616
  services: new Map(),
9627
9617
  });
9628
9618
  }
@@ -9676,7 +9666,6 @@ var index$f = /*#__PURE__*/Object.freeze({
9676
9666
  VALIDATOR_META_BYTES: VALIDATOR_META_BYTES,
9677
9667
  ValidatorData: ValidatorData,
9678
9668
  ValidatorStatistics: ValidatorStatistics,
9679
- accumulationOutputComparator: accumulationOutputComparator,
9680
9669
  codecPerCore: codecPerCore,
9681
9670
  hashComparator: hashComparator,
9682
9671
  ignoreValueWithDefault: ignoreValueWithDefault,
@@ -9832,7 +9821,7 @@ var serialize;
9832
9821
  /** C(16): https://graypaper.fluffylabs.dev/#/38c4e62/3b46033b4603?v=0.7.0 */
9833
9822
  serialize.accumulationOutputLog = {
9834
9823
  key: stateKeys.index(StateKeyIdx.Theta),
9835
- Codec: codec$1.sequenceVarLen(AccumulationOutput.Codec).convert((i) => i.array, (o) => SortedArray.fromSortedArray(accumulationOutputComparator, o)),
9824
+ Codec: codec$1.sequenceVarLen(AccumulationOutput.Codec),
9836
9825
  extract: (s) => s.accumulationOutputLog,
9837
9826
  };
9838
9827
  /** C(255, s): https://graypaper.fluffylabs.dev/#/85129da/383103383103?v=0.6.3 */
@@ -17134,7 +17123,7 @@ const fullStateDumpFromJson = (spec) => json.object({
17134
17123
  statistics: JsonStatisticsData.toStatisticsData(spec, pi),
17135
17124
  accumulationQueue: omega,
17136
17125
  recentlyAccumulated: tryAsPerEpochBlock(xi.map((x) => HashSet.from(x)), spec),
17137
- accumulationOutputLog: SortedArray.fromArray(accumulationOutputComparator, theta ?? []),
17126
+ accumulationOutputLog: theta ?? [],
17138
17127
  services: new Map(accounts.map((x) => [x.serviceId, x])),
17139
17128
  });
17140
17129
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typeberry/lib",
3
- "version": "0.0.5-6e657f4",
3
+ "version": "0.0.5",
4
4
  "main": "index.js",
5
5
  "author": "Fluffy Labs",
6
6
  "license": "MPL-2.0"