Skip to content

Commit f5c3431

Browse files
camfairchildkeithtensor
authored andcommitted
Hotfix/skip root for emission accum (#933)
* skip netuid 0 for pending emission accum * comment
1 parent b0bce33 commit f5c3431

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pallets/subtensor/src/coinbase/run_coinbase.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ impl<T: Config> Pallet<T> {
4848
// --- 3. Drain the subnet block emission and accumulate it as subnet emission, which increases until the tempo is reached in #4.
4949
// subnet_blockwise_emission -> subnet_pending_emission
5050
for netuid in subnets.clone().iter() {
51+
if *netuid == 0 {
52+
continue;
53+
}
5154
// --- 3.1 Get the network's block-wise emission amount.
5255
// This value is newly minted TAO which has not reached staking accounts yet.
5356
let subnet_blockwise_emission: u64 = EmissionValues::<T>::get(*netuid);
@@ -87,6 +90,11 @@ impl<T: Config> Pallet<T> {
8790
Self::set_blocks_since_last_step(*netuid, 0);
8891
Self::set_last_mechanism_step_block(*netuid, current_block);
8992

93+
if *netuid == 0 {
94+
// Skip netuid 0 payouts
95+
continue;
96+
}
97+
9098
// --- 4.4 Distribute owner take.
9199
if SubnetOwner::<T>::contains_key(netuid) {
92100
// Does the subnet have an owner?

0 commit comments

Comments
 (0)