@dedot/chaintypes 0.70.0 → 0.71.0

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.
package/aleph/consts.d.ts CHANGED
@@ -303,6 +303,8 @@ export interface ChainConsts<Rv extends RpcVersion> extends GenericChainConsts<R
303
303
  * Pallet `Aleph`'s constants
304
304
  **/
305
305
  aleph: {
306
+ scoreSubmissionPeriod: number;
307
+
306
308
  /**
307
309
  * Generic pallet constant
308
310
  **/
package/aleph/errors.d.ts CHANGED
@@ -1084,7 +1084,7 @@ export interface ChainErrors<Rv extends RpcVersion> extends GenericChainErrors<R
1084
1084
  **/
1085
1085
  committeeManagement: {
1086
1086
  /**
1087
- * Raised in any scenario [`BanConfig`] is invalid
1087
+ * Raised in any scenario [`ProductionBanConfig`] is invalid
1088
1088
  * * `performance_ratio_threshold` must be a number in range [0; 100]
1089
1089
  * * `underperformed_session_count_threshold` must be a positive number,
1090
1090
  * * `clean_session_counter_delay` must be a positive number.
package/aleph/events.d.ts CHANGED
@@ -15,7 +15,8 @@ import type {
15
15
  PalletNominationPoolsPoolState,
16
16
  PalletNominationPoolsCommissionChangeRate,
17
17
  PalletNominationPoolsCommissionClaimPermission,
18
- PrimitivesBanConfig,
18
+ PrimitivesProductionBanConfig,
19
+ PrimitivesFinalityBanConfig,
19
20
  PrimitivesBanInfo,
20
21
  AlephRuntimeProxyType,
21
22
  PalletSafeModeExitReason,
@@ -1242,7 +1243,17 @@ export interface ChainEvents<Rv extends RpcVersion> extends GenericChainEvents<R
1242
1243
  /**
1243
1244
  * Ban thresholds for the next era has changed
1244
1245
  **/
1245
- SetBanConfig: GenericPalletEvent<Rv, 'CommitteeManagement', 'SetBanConfig', PrimitivesBanConfig>;
1246
+ SetBanConfig: GenericPalletEvent<Rv, 'CommitteeManagement', 'SetBanConfig', PrimitivesProductionBanConfig>;
1247
+
1248
+ /**
1249
+ * Ban thresholds for the next era has changed
1250
+ **/
1251
+ SetFinalityBanConfig: GenericPalletEvent<
1252
+ Rv,
1253
+ 'CommitteeManagement',
1254
+ 'SetFinalityBanConfig',
1255
+ PrimitivesFinalityBanConfig
1256
+ >;
1246
1257
 
1247
1258
  /**
1248
1259
  * Validators have been banned from the committee
package/aleph/index.d.ts CHANGED
@@ -23,7 +23,7 @@ export interface VersionedAlephApi<Rv extends RpcVersion> extends GenericSubstra
23
23
 
24
24
  /**
25
25
  * @name: AlephApi
26
- * @specVersion: 14000000
26
+ * @specVersion: 15000000
27
27
  **/
28
28
  export interface AlephApi {
29
29
  legacy: VersionedAlephApi<RpcLegacy>;
package/aleph/query.d.ts CHANGED
@@ -48,6 +48,7 @@ import type {
48
48
  SpCoreCryptoKeyTypeId,
49
49
  PrimitivesAppPublic,
50
50
  PrimitivesVersionChange,
51
+ PrimitivesScore,
51
52
  PrimitivesCommitteeSeats,
52
53
  PrimitivesEraValidators,
53
54
  PrimitivesElectionOpenness,
@@ -68,9 +69,10 @@ import type {
68
69
  PalletIdentityRegistrarInfo,
69
70
  PalletIdentityAuthorityProperties,
70
71
  PalletCommitteeManagementValidatorTotalRewards,
71
- PrimitivesBanConfig,
72
+ PrimitivesProductionBanConfig,
72
73
  PrimitivesBanInfo,
73
74
  PalletCommitteeManagementCurrentAndNextSessionValidators,
75
+ PrimitivesFinalityBanConfig,
74
76
  PalletProxyProxyDefinition,
75
77
  PalletProxyAnnouncement,
76
78
  } from './types';
@@ -1076,6 +1078,19 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1076
1078
  **/
1077
1079
  finalityScheduledVersionChange: GenericStorageQuery<Rv, () => PrimitivesVersionChange | undefined>;
1078
1080
 
1081
+ /**
1082
+ *
1083
+ * @param {number} arg
1084
+ * @param {Callback<PrimitivesScore | undefined> =} callback
1085
+ **/
1086
+ abftScores: GenericStorageQuery<Rv, (arg: number) => PrimitivesScore | undefined, number>;
1087
+
1088
+ /**
1089
+ *
1090
+ * @param {Callback<number> =} callback
1091
+ **/
1092
+ lastScoreNonce: GenericStorageQuery<Rv, () => number>;
1093
+
1079
1094
  /**
1080
1095
  * Generic pallet storage query
1081
1096
  **/
@@ -1658,14 +1673,14 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1658
1673
  validatorEraTotalReward: GenericStorageQuery<Rv, () => PalletCommitteeManagementValidatorTotalRewards | undefined>;
1659
1674
 
1660
1675
  /**
1661
- * Current era config for ban functionality, see [`BanConfig`]
1676
+ * Current era config for ban functionality related to block production.
1662
1677
  *
1663
- * @param {Callback<PrimitivesBanConfig> =} callback
1678
+ * @param {Callback<PrimitivesProductionBanConfig> =} callback
1664
1679
  **/
1665
- banConfig: GenericStorageQuery<Rv, () => PrimitivesBanConfig>;
1680
+ productionBanConfig: GenericStorageQuery<Rv, () => PrimitivesProductionBanConfig>;
1666
1681
 
1667
1682
  /**
1668
- * A lookup for a number of underperformance sessions for a given validator
1683
+ * A lookup for a number of underperformance sessions in block production for a given validator
1669
1684
  *
1670
1685
  * @param {AccountId32Like} arg
1671
1686
  * @param {Callback<number> =} callback
@@ -1690,6 +1705,21 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1690
1705
  () => PalletCommitteeManagementCurrentAndNextSessionValidators
1691
1706
  >;
1692
1707
 
1708
+ /**
1709
+ * A lookup for a number of underperformance sessions in block finalization for a given validator
1710
+ *
1711
+ * @param {AccountId32Like} arg
1712
+ * @param {Callback<number> =} callback
1713
+ **/
1714
+ underperformedFinalizerSessionCount: GenericStorageQuery<Rv, (arg: AccountId32Like) => number, AccountId32>;
1715
+
1716
+ /**
1717
+ * Current era config for ban functionality related to block finality.
1718
+ *
1719
+ * @param {Callback<PrimitivesFinalityBanConfig> =} callback
1720
+ **/
1721
+ finalityBanConfig: GenericStorageQuery<Rv, () => PrimitivesFinalityBanConfig>;
1722
+
1693
1723
  /**
1694
1724
  * Generic pallet storage query
1695
1725
  **/
@@ -34,6 +34,8 @@ import type {
34
34
  PrimitivesSessionAuthorityData,
35
35
  PrimitivesSessionCommittee,
36
36
  PrimitivesSessionValidatorError,
37
+ PrimitivesScore,
38
+ PrimitivesCryptoSignatureSet,
37
39
  PalletContractsPrimitivesContractResult,
38
40
  PalletContractsPrimitivesContractResultResult,
39
41
  PalletContractsPrimitivesCode,
@@ -400,6 +402,12 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
400
402
  **/
401
403
  nextSessionFinalityVersion: GenericRuntimeApiMethod<Rv, () => Promise<number>>;
402
404
 
405
+ /**
406
+ *
407
+ * @callname: AlephSessionApi_score_submission_period
408
+ **/
409
+ scoreSubmissionPeriod: GenericRuntimeApiMethod<Rv, () => Promise<number>>;
410
+
403
411
  /**
404
412
  * Predict finality committee and block producers for the given session. `session` must be
405
413
  * within the current era (current, in the staking context).
@@ -450,6 +458,18 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
450
458
  **/
451
459
  currentEraPayout: GenericRuntimeApiMethod<Rv, () => Promise<[bigint, bigint]>>;
452
460
 
461
+ /**
462
+ * Submits score for a nonce in a session of performance of finality committee members.
463
+ *
464
+ * @callname: AlephSessionApi_submit_abft_score
465
+ * @param {PrimitivesScore} score
466
+ * @param {PrimitivesCryptoSignatureSet} signature
467
+ **/
468
+ submitAbftScore: GenericRuntimeApiMethod<
469
+ Rv,
470
+ (score: PrimitivesScore, signature: PrimitivesCryptoSignatureSet) => Promise<[] | undefined>
471
+ >;
472
+
453
473
  /**
454
474
  * Generic runtime api call
455
475
  **/
package/aleph/tx.d.ts CHANGED
@@ -33,6 +33,8 @@ import type {
33
33
  PalletStakingPalletConfigOpPerbill,
34
34
  PrimitivesAlephNodeSessionKeys,
35
35
  PrimitivesAppPublic,
36
+ PrimitivesScore,
37
+ PrimitivesCryptoSignatureSet,
36
38
  PrimitivesCommitteeSeats,
37
39
  PrimitivesElectionOpenness,
38
40
  PalletVestingVestingInfo,
@@ -1381,6 +1383,29 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
1381
1383
  >
1382
1384
  >;
1383
1385
 
1386
+ /**
1387
+ * See [`Pallet::unsigned_submit_abft_score`].
1388
+ *
1389
+ * @param {PrimitivesScore} score
1390
+ * @param {PrimitivesCryptoSignatureSet} signature
1391
+ **/
1392
+ unsignedSubmitAbftScore: GenericTxCall<
1393
+ Rv,
1394
+ (
1395
+ score: PrimitivesScore,
1396
+ signature: PrimitivesCryptoSignatureSet,
1397
+ ) => ChainSubmittableExtrinsic<
1398
+ Rv,
1399
+ {
1400
+ pallet: 'Aleph';
1401
+ palletCall: {
1402
+ name: 'UnsignedSubmitAbftScore';
1403
+ params: { score: PrimitivesScore; signature: PrimitivesCryptoSignatureSet };
1404
+ };
1405
+ }
1406
+ >
1407
+ >;
1408
+
1384
1409
  /**
1385
1410
  * Generic pallet tx call
1386
1411
  **/
@@ -3590,6 +3615,38 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
3590
3615
  >
3591
3616
  >;
3592
3617
 
3618
+ /**
3619
+ * See [`Pallet::set_finality_ban_config`].
3620
+ *
3621
+ * @param {number | undefined} minimalExpectedPerformance
3622
+ * @param {number | undefined} underperformedSessionCountThreshold
3623
+ * @param {number | undefined} banPeriod
3624
+ * @param {number | undefined} cleanSessionCounterDelay
3625
+ **/
3626
+ setFinalityBanConfig: GenericTxCall<
3627
+ Rv,
3628
+ (
3629
+ minimalExpectedPerformance: number | undefined,
3630
+ underperformedSessionCountThreshold: number | undefined,
3631
+ banPeriod: number | undefined,
3632
+ cleanSessionCounterDelay: number | undefined,
3633
+ ) => ChainSubmittableExtrinsic<
3634
+ Rv,
3635
+ {
3636
+ pallet: 'CommitteeManagement';
3637
+ palletCall: {
3638
+ name: 'SetFinalityBanConfig';
3639
+ params: {
3640
+ minimalExpectedPerformance: number | undefined;
3641
+ underperformedSessionCountThreshold: number | undefined;
3642
+ banPeriod: number | undefined;
3643
+ cleanSessionCounterDelay: number | undefined;
3644
+ };
3645
+ };
3646
+ }
3647
+ >
3648
+ >;
3649
+
3593
3650
  /**
3594
3651
  * Generic pallet tx call
3595
3652
  **/
package/aleph/types.d.ts CHANGED
@@ -929,22 +929,36 @@ export type PalletCommitteeManagementEvent =
929
929
  /**
930
930
  * Ban thresholds for the next era has changed
931
931
  **/
932
- | { name: 'SetBanConfig'; data: PrimitivesBanConfig }
932
+ | { name: 'SetBanConfig'; data: PrimitivesProductionBanConfig }
933
+ /**
934
+ * Ban thresholds for the next era has changed
935
+ **/
936
+ | { name: 'SetFinalityBanConfig'; data: PrimitivesFinalityBanConfig }
933
937
  /**
934
938
  * Validators have been banned from the committee
935
939
  **/
936
940
  | { name: 'BanValidators'; data: Array<[AccountId32, PrimitivesBanInfo]> };
937
941
 
938
- export type PrimitivesBanConfig = {
942
+ export type PrimitivesProductionBanConfig = {
939
943
  minimalExpectedPerformance: Perbill;
940
944
  underperformedSessionCountThreshold: number;
941
945
  cleanSessionCounterDelay: number;
942
946
  banPeriod: number;
943
947
  };
944
948
 
949
+ export type PrimitivesFinalityBanConfig = {
950
+ minimalExpectedPerformance: number;
951
+ underperformedSessionCountThreshold: number;
952
+ banPeriod: number;
953
+ cleanSessionCounterDelay: number;
954
+ };
955
+
945
956
  export type PrimitivesBanInfo = { reason: PrimitivesBanReason; start: number };
946
957
 
947
- export type PrimitivesBanReason = { type: 'InsufficientUptime'; value: number } | { type: 'OtherReason'; value: Bytes };
958
+ export type PrimitivesBanReason =
959
+ | { type: 'InsufficientProduction'; value: number }
960
+ | { type: 'InsufficientFinalization'; value: number }
961
+ | { type: 'OtherReason'; value: Bytes };
948
962
 
949
963
  /**
950
964
  * The `Event` enum of this pallet
@@ -1797,10 +1811,11 @@ export type PalletAlephCall =
1797
1811
  /**
1798
1812
  * See [`Pallet::set_inflation_parameters`].
1799
1813
  **/
1800
- | {
1801
- name: 'SetInflationParameters';
1802
- params: { azeroCap?: bigint | undefined; horizonMillisecs?: bigint | undefined };
1803
- };
1814
+ | { name: 'SetInflationParameters'; params: { azeroCap?: bigint | undefined; horizonMillisecs?: bigint | undefined } }
1815
+ /**
1816
+ * See [`Pallet::unsigned_submit_abft_score`].
1817
+ **/
1818
+ | { name: 'UnsignedSubmitAbftScore'; params: { score: PrimitivesScore; signature: PrimitivesCryptoSignatureSet } };
1804
1819
 
1805
1820
  export type PalletAlephCallLike =
1806
1821
  /**
@@ -1814,10 +1829,21 @@ export type PalletAlephCallLike =
1814
1829
  /**
1815
1830
  * See [`Pallet::set_inflation_parameters`].
1816
1831
  **/
1817
- | {
1818
- name: 'SetInflationParameters';
1819
- params: { azeroCap?: bigint | undefined; horizonMillisecs?: bigint | undefined };
1820
- };
1832
+ | { name: 'SetInflationParameters'; params: { azeroCap?: bigint | undefined; horizonMillisecs?: bigint | undefined } }
1833
+ /**
1834
+ * See [`Pallet::unsigned_submit_abft_score`].
1835
+ **/
1836
+ | { name: 'UnsignedSubmitAbftScore'; params: { score: PrimitivesScore; signature: PrimitivesCryptoSignatureSet } };
1837
+
1838
+ export type PrimitivesScore = { sessionId: number; nonce: number; points: Array<number> };
1839
+
1840
+ export type PrimitivesCryptoSignatureSet = Array<PrimitivesCryptoIndexedSignature>;
1841
+
1842
+ export type PrimitivesAppSignature = SpCoreEd25519Signature;
1843
+
1844
+ export type SpCoreEd25519Signature = FixedBytes<64>;
1845
+
1846
+ export type PrimitivesCryptoIndexedSignature = { index: bigint; signature: PrimitivesAppSignature };
1821
1847
 
1822
1848
  /**
1823
1849
  * Contains a variant per dispatchable extrinsic that this pallet has.
@@ -2925,8 +2951,6 @@ export type SpRuntimeMultiSignature =
2925
2951
  | { type: 'Sr25519'; value: SpCoreSr25519Signature }
2926
2952
  | { type: 'Ecdsa'; value: SpCoreEcdsaSignature };
2927
2953
 
2928
- export type SpCoreEd25519Signature = FixedBytes<64>;
2929
-
2930
2954
  export type SpCoreSr25519Signature = FixedBytes<64>;
2931
2955
 
2932
2956
  export type SpCoreEcdsaSignature = FixedBytes<65>;
@@ -2958,7 +2982,19 @@ export type PalletCommitteeManagementCall =
2958
2982
  /**
2959
2983
  * See [`Pallet::set_lenient_threshold`].
2960
2984
  **/
2961
- | { name: 'SetLenientThreshold'; params: { thresholdPercent: number } };
2985
+ | { name: 'SetLenientThreshold'; params: { thresholdPercent: number } }
2986
+ /**
2987
+ * See [`Pallet::set_finality_ban_config`].
2988
+ **/
2989
+ | {
2990
+ name: 'SetFinalityBanConfig';
2991
+ params: {
2992
+ minimalExpectedPerformance?: number | undefined;
2993
+ underperformedSessionCountThreshold?: number | undefined;
2994
+ banPeriod?: number | undefined;
2995
+ cleanSessionCounterDelay?: number | undefined;
2996
+ };
2997
+ };
2962
2998
 
2963
2999
  export type PalletCommitteeManagementCallLike =
2964
3000
  /**
@@ -2984,7 +3020,19 @@ export type PalletCommitteeManagementCallLike =
2984
3020
  /**
2985
3021
  * See [`Pallet::set_lenient_threshold`].
2986
3022
  **/
2987
- | { name: 'SetLenientThreshold'; params: { thresholdPercent: number } };
3023
+ | { name: 'SetLenientThreshold'; params: { thresholdPercent: number } }
3024
+ /**
3025
+ * See [`Pallet::set_finality_ban_config`].
3026
+ **/
3027
+ | {
3028
+ name: 'SetFinalityBanConfig';
3029
+ params: {
3030
+ minimalExpectedPerformance?: number | undefined;
3031
+ underperformedSessionCountThreshold?: number | undefined;
3032
+ banPeriod?: number | undefined;
3033
+ cleanSessionCounterDelay?: number | undefined;
3034
+ };
3035
+ };
2988
3036
 
2989
3037
  /**
2990
3038
  * Contains a variant per dispatchable extrinsic that this pallet has.
@@ -4321,14 +4369,18 @@ export type PalletCommitteeManagementCurrentAndNextSessionValidators = {
4321
4369
  current: PrimitivesSessionValidators;
4322
4370
  };
4323
4371
 
4324
- export type PrimitivesSessionValidators = { committee: Array<AccountId32>; nonCommittee: Array<AccountId32> };
4372
+ export type PrimitivesSessionValidators = {
4373
+ producers: Array<AccountId32>;
4374
+ finalizers: Array<AccountId32>;
4375
+ nonCommittee: Array<AccountId32>;
4376
+ };
4325
4377
 
4326
4378
  /**
4327
4379
  * The `Error` enum of this pallet.
4328
4380
  **/
4329
4381
  export type PalletCommitteeManagementError =
4330
4382
  /**
4331
- * Raised in any scenario [`BanConfig`] is invalid
4383
+ * Raised in any scenario [`ProductionBanConfig`] is invalid
4332
4384
  * * `performance_ratio_threshold` must be a number in range [0; 100]
4333
4385
  * * `underperformed_session_count_threshold` must be a positive number,
4334
4386
  * * `clean_session_counter_delay` must be a positive number.
@@ -4514,7 +4566,7 @@ export type PrimitivesSessionAuthorityData = {
4514
4566
  emergencyFinalizer?: PrimitivesAppPublic | undefined;
4515
4567
  };
4516
4568
 
4517
- export type PrimitivesSessionCommittee = { finalityCommittee: Array<AccountId32>; blockProducers: Array<AccountId32> };
4569
+ export type PrimitivesSessionCommittee = { finalizers: Array<AccountId32>; producers: Array<AccountId32> };
4518
4570
 
4519
4571
  export type PrimitivesSessionValidatorError =
4520
4572
  | { type: 'SessionNotWithinRange'; value: { lowerLimit: number; upperLimit: number } }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dedot/chaintypes",
3
- "version": "0.70.0",
3
+ "version": "0.71.0",
4
4
  "description": "Types for substrate-based chains",
5
5
  "author": "Thang X. Vu <thang@coongcrafts.io>",
6
6
  "main": "",
@@ -19,7 +19,7 @@
19
19
  "directory": "dist"
20
20
  },
21
21
  "license": "Apache-2.0",
22
- "gitHead": "1fe9aea0f268277d06948e19152baf6b86b3e43e",
22
+ "gitHead": "a2c1bc760e57283e0391c5b8966f00e52517491f",
23
23
  "module": "./index.js",
24
24
  "types": "./index.d.ts"
25
25
  }