Skip to content

Commit cb74b1f

Browse files
committed
Merge branch 'devnet-ready' into refactor-neuron-deregistration
2 parents 2bc6a9e + 40e9df6 commit cb74b1f

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

pallets/admin-utils/src/lib.rs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,7 @@ pub mod pallet {
10151015
#[pallet::call_index(33)]
10161016
#[pallet::weight((
10171017
Weight::from_parts(2_875_000, 0)
1018+
.saturating_add(T::DbWeight::get().reads(0_u64))
10181019
.saturating_add(T::DbWeight::get().writes(1_u64)),
10191020
DispatchClass::Operational,
10201021
Pays::Yes
@@ -1146,7 +1147,9 @@ pub mod pallet {
11461147
/// The extrinsic will call the Subtensor pallet to set the weights min stake.
11471148
#[pallet::call_index(42)]
11481149
#[pallet::weight((
1149-
Weight::from_parts(5_000_000, 0).saturating_add(T::DbWeight::get().writes(1_u64)),
1150+
Weight::from_parts(5_000_000, 0)
1151+
.saturating_add(T::DbWeight::get().reads(0_u64))
1152+
.saturating_add(T::DbWeight::get().writes(1_u64)),
11501153
DispatchClass::Operational,
11511154
Pays::Yes
11521155
))]
@@ -1189,7 +1192,9 @@ pub mod pallet {
11891192
/// The extrinsic will call the Subtensor pallet to set the rate limit for delegate take transactions.
11901193
#[pallet::call_index(45)]
11911194
#[pallet::weight((
1192-
Weight::from_parts(5_019_000, 0).saturating_add(T::DbWeight::get().writes(1_u64)),
1195+
Weight::from_parts(5_019_000, 0)
1196+
.saturating_add(T::DbWeight::get().reads(0_u64))
1197+
.saturating_add(T::DbWeight::get().writes(1_u64)),
11931198
DispatchClass::Operational,
11941199
Pays::Yes
11951200
))]
@@ -1210,7 +1215,9 @@ pub mod pallet {
12101215
/// The extrinsic will call the Subtensor pallet to set the minimum delegate take.
12111216
#[pallet::call_index(46)]
12121217
#[pallet::weight((
1213-
Weight::from_parts(7_214_000, 0).saturating_add(T::DbWeight::get().writes(1_u64)),
1218+
Weight::from_parts(7_214_000, 0)
1219+
.saturating_add(T::DbWeight::get().reads(0_u64))
1220+
.saturating_add(T::DbWeight::get().writes(1_u64)),
12141221
DispatchClass::Operational,
12151222
Pays::Yes
12161223
))]
@@ -1266,6 +1273,7 @@ pub mod pallet {
12661273
#[pallet::call_index(50)]
12671274
#[pallet::weight((
12681275
Weight::from_parts(18_300_000, 0)
1276+
.saturating_add(T::DbWeight::get().reads(2_u64))
12691277
.saturating_add(T::DbWeight::get().writes(1_u64)),
12701278
DispatchClass::Normal,
12711279
Pays::Yes
@@ -1340,6 +1348,7 @@ pub mod pallet {
13401348
#[pallet::call_index(54)]
13411349
#[pallet::weight((
13421350
Weight::from_parts(5_000_000, 0)
1351+
.saturating_add(T::DbWeight::get().reads(0_u64))
13431352
.saturating_add(T::DbWeight::get().writes(1_u64)),
13441353
DispatchClass::Operational,
13451354
Pays::Yes
@@ -1377,6 +1386,7 @@ pub mod pallet {
13771386
#[pallet::call_index(55)]
13781387
#[pallet::weight((
13791388
Weight::from_parts(5_000_000, 0)
1389+
.saturating_add(T::DbWeight::get().reads(0_u64))
13801390
.saturating_add(T::DbWeight::get().writes(1_u64)),
13811391
DispatchClass::Operational,
13821392
Pays::Yes
@@ -1510,6 +1520,7 @@ pub mod pallet {
15101520
#[pallet::call_index(61)]
15111521
#[pallet::weight((
15121522
Weight::from_parts(20_460_000, 0)
1523+
.saturating_add(T::DbWeight::get().reads(2_u64))
15131524
.saturating_add(T::DbWeight::get().writes(1_u64)),
15141525
DispatchClass::Normal,
15151526
Pays::Yes
@@ -1582,7 +1593,8 @@ pub mod pallet {
15821593
#[pallet::call_index(62)]
15831594
#[pallet::weight((
15841595
Weight::from_parts(10_020_000, 3507)
1585-
.saturating_add(T::DbWeight::get().reads(1_u64)),
1596+
.saturating_add(T::DbWeight::get().reads(1_u64))
1597+
.saturating_add(T::DbWeight::get().writes(0_u64)),
15861598
DispatchClass::Operational,
15871599
Pays::Yes
15881600
))]
@@ -1616,6 +1628,7 @@ pub mod pallet {
16161628
#[pallet::call_index(63)]
16171629
#[pallet::weight((
16181630
Weight::from_parts(3_000_000, 0)
1631+
.saturating_add(T::DbWeight::get().reads(0_u64))
16191632
.saturating_add(T::DbWeight::get().writes(1_u64)),
16201633
DispatchClass::Operational,
16211634
Pays::Yes
@@ -1669,6 +1682,7 @@ pub mod pallet {
16691682
#[pallet::call_index(65)]
16701683
#[pallet::weight((
16711684
Weight::from_parts(6_201_000, 0)
1685+
.saturating_add(T::DbWeight::get().reads(0_u64))
16721686
.saturating_add(T::DbWeight::get().writes(1_u64)),
16731687
DispatchClass::Operational,
16741688
Pays::Yes
@@ -1755,6 +1769,7 @@ pub mod pallet {
17551769
#[pallet::call_index(69)]
17561770
#[pallet::weight((
17571771
Weight::from_parts(20_460_000, 0)
1772+
.saturating_add(T::DbWeight::get().reads(2_u64))
17581773
.saturating_add(T::DbWeight::get().writes(1_u64)),
17591774
DispatchClass::Normal,
17601775
Pays::Yes
@@ -1792,7 +1807,8 @@ pub mod pallet {
17921807
/// This function has a fixed weight of 0 and is classified as an operational transaction that does not incur any fees.
17931808
#[pallet::call_index(70)]
17941809
#[pallet::weight((
1795-
Weight::from_parts(22_340_000, 0)
1810+
Weight::from_parts(32_930_000, 0)
1811+
.saturating_add(T::DbWeight::get().reads(2_u64))
17961812
.saturating_add(T::DbWeight::get().writes(1_u64)),
17971813
DispatchClass::Normal,
17981814
Pays::Yes
@@ -1880,6 +1896,7 @@ pub mod pallet {
18801896
#[pallet::call_index(66)]
18811897
#[pallet::weight((
18821898
Weight::from_parts(17_980_000, 0)
1899+
.saturating_add(T::DbWeight::get().reads(2_u64))
18831900
.saturating_add(T::DbWeight::get().writes(1_u64)),
18841901
DispatchClass::Operational,
18851902
Pays::Yes

pallets/subtensor/src/coinbase/subnet_emissions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl<T: Config> Pallet<T> {
5959
// EMA flow already initialized
6060
if last_block != current_block {
6161
let flow_alpha = I64F64::saturating_from_num(FlowEmaSmoothingFactor::<T>::get())
62-
.safe_div(I64F64::saturating_from_num(u16::MAX));
62+
.safe_div(I64F64::saturating_from_num(i64::MAX));
6363
let one = I64F64::saturating_from_num(1);
6464
let ema_flow = (one.saturating_sub(flow_alpha))
6565
.saturating_mul(last_block_ema)

pallets/subtensor/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,10 +1308,10 @@ pub mod pallet {
13081308
/// Default value for flow EMA smoothing.
13091309
pub fn DefaultFlowEmaSmoothingFactor<T: Config>() -> u64 {
13101310
// Example values:
1311-
// half-life factor value u64 normalized
1312-
// 216000 (1 month) --> 0.000003209009576 ( 59_195_778_378_555)
1313-
// 50400 (1 week) --> 0.000013752825678 (253_694_855_576_670)
1314-
59_195_778_378_555
1311+
// half-life factor value i64 normalized
1312+
// 216000 (1 month) --> 0.000003209009576 ( 29_597_889_189_277)
1313+
// 50400 (1 week) --> 0.000013752825678 (126_847_427_788_335)
1314+
29_597_889_189_277
13151315
}
13161316
#[pallet::type_value]
13171317
/// Flow EMA smoothing half-life.

runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
220220
// `spec_version`, and `authoring_version` are the same between Wasm and native.
221221
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
222222
// the compatible custom types.
223-
spec_version: 331,
223+
spec_version: 333,
224224
impl_version: 1,
225225
apis: RUNTIME_API_VERSIONS,
226226
transaction_version: 1,

0 commit comments

Comments
 (0)