Skip to content

Commit e4139b7

Browse files
Refactor root_prop in run_coinbase
1 parent 8e3be93 commit e4139b7

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

pallets/subtensor/src/coinbase/run_coinbase.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,6 @@ impl<T: Config> Pallet<T> {
178178
// --- 3. Inject ALPHA for participants.
179179
let cut_percent: U96F32 = Self::get_float_subnet_owner_cut();
180180

181-
// Get total TAO on root.
182-
let root_tao: U96F32 = asfloat!(SubnetTAO::<T>::get(NetUid::ROOT));
183-
log::debug!("root_tao: {root_tao:?}");
184-
// Get tao_weight
185-
let tao_weight: U96F32 = root_tao.saturating_mul(Self::get_tao_weight());
186-
log::debug!("tao_weight: {tao_weight:?}");
187-
188181
for netuid_i in subnets_to_emit_to.iter() {
189182
// Get alpha_out for this block.
190183
let mut alpha_out_i: U96F32 = *alpha_out.get(netuid_i).unwrap_or(&asfloat!(0));
@@ -205,14 +198,8 @@ impl<T: Config> Pallet<T> {
205198
*total = total.saturating_add(tou64!(owner_cut_i).into());
206199
});
207200

208-
// Get ALPHA issuance.
209-
let alpha_issuance: U96F32 = asfloat!(Self::get_alpha_issuance(*netuid_i));
210-
log::debug!("alpha_issuance: {alpha_issuance:?}");
211-
212201
// Get root proportional dividends.
213-
let root_proportion: U96F32 = tao_weight
214-
.checked_div(tao_weight.saturating_add(alpha_issuance))
215-
.unwrap_or(asfloat!(0.0));
202+
let root_proportion = Self::root_proportion(*netuid_i);
216203
log::debug!("root_proportion: {root_proportion:?}");
217204

218205
// Get root alpha from root prop.

0 commit comments

Comments
 (0)