Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pallets/subtensor/src/coinbase/run_coinbase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ impl<T: Config> Pallet<T> {
);

// Reset per-block root sell counters from the previous block.
// Root sells (step 8 in block_step) happen after coinbase, so their
// accumulated values are consumed here at the start of the next block.
// Root sells happen after coinbase, so their accumulated values
// are consumed here at the start of the next block.
let _ = SubnetRootSellTao::<T>::clear(u32::MAX, None);

// --- 1. Get all subnets (excluding root).
Expand Down
4 changes: 2 additions & 2 deletions pallets/subtensor/src/coinbase/subnet_emissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl<T: Config> Pallet<T> {
SubnetProtocolFlow::<T>::remove(netuid);
}

fn get_ema_protocol_flow(netuid: NetUid) -> I64F64 {
fn update_ema_protocol_flow(netuid: NetUid) -> I64F64 {
let current_block: u64 = Self::get_current_block_as_u64();

let block_flow = I64F64::saturating_from_num(SubnetProtocolFlow::<T>::get(netuid));
Expand Down Expand Up @@ -223,8 +223,8 @@ impl<T: Config> Pallet<T> {
.iter()
.map(|netuid| {
let user_ema = Self::get_ema_flow(*netuid);
let protocol_ema = Self::get_ema_protocol_flow(*netuid);
let net = if net_flow_enabled {
let protocol_ema = Self::update_ema_protocol_flow(*netuid);
user_ema.saturating_sub(protocol_ema)
} else {
user_ema
Expand Down
Loading