Skip to content

Commit f95810a

Browse files
authored
Hotfix/fix ema update (#1289)
* spec bump * add ema update min 1.0
1 parent e2b8367 commit f95810a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pallets/subtensor/src/staking/stake_utils.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ impl<T: Config> Pallet<T> {
5959
pub fn update_moving_price(netuid: u16) {
6060
let alpha: I96F32 = SubnetMovingAlpha::<T>::get();
6161
let minus_alpha: I96F32 = I96F32::saturating_from_num(1.0).saturating_sub(alpha);
62-
let current_price: I96F32 = alpha.saturating_mul(Self::get_alpha_price(netuid));
62+
let current_price: I96F32 = alpha
63+
.saturating_mul(Self::get_alpha_price(netuid).min(I96F32::saturating_from_num(1.0)));
6364
let current_moving: I96F32 =
6465
minus_alpha.saturating_mul(Self::get_moving_alpha_price(netuid));
6566
let new_moving: I96F32 = current_price.saturating_add(current_moving);

runtime/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
229229
// `spec_version`, and `authoring_version` are the same between Wasm and native.
230230
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
231231
// the compatible custom types.
232-
spec_version: 233,
232+
spec_version: 234,
233233
impl_version: 1,
234234
apis: RUNTIME_API_VERSIONS,
235235
transaction_version: 1,

0 commit comments

Comments
 (0)