Skip to content

Commit 8c53032

Browse files
committed
fix: burn only unresolved portion within challenge's emission share
The burn calculation was 1.0 - assigned_weight, which burned the emission share belonging to OTHER challenges (auth, term-challenge) that have no weights. With emission_weight=0.5 for bounty-challenge, this always sent 50% to UID 0 burn even when all hotkeys resolved successfully. Fixed to: emission_weight - assigned_weight, so burn only covers unresolved hotkeys within this challenge. After max-upscaling, miners now get close to 100% of the weight when all hotkeys resolve. Applied to both CommitWindowOpen handler and RPC pre-compute path.
1 parent ca08a44 commit 8c53032

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bins/validator-node/src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,7 @@ async fn main() -> Result<()> {
16101610
let v = (w * 65535.0).round() as u16;
16111611
if v > 0 { uids.push(*uid); vals.push(v); }
16121612
}
1613-
let burn = 1.0 - assigned;
1613+
let burn = ew - assigned;
16141614
if burn > 0.001 {
16151615
let bv = (burn * 65535.0).round() as u16;
16161616
if let Some(pos) = uids.iter().position(|&u| u == 0) {
@@ -3749,8 +3749,9 @@ async fn handle_block_event(
37493749
}
37503750
}
37513751

3752-
// Remaining weight goes to burn (UID 0)
3753-
let burn_weight = 1.0 - assigned_weight;
3752+
// Burn only the unresolved portion within this challenge's emission share.
3753+
// Previously: 1.0 - assigned_weight (wrong: burned OTHER challenges' share)
3754+
let burn_weight = emission_weight - assigned_weight;
37543755
if burn_weight > 0.001 {
37553756
let burn_u16 = (burn_weight * 65535.0).round() as u16;
37563757
if let Some(pos) = uids.iter().position(|&u| u == 0) {

0 commit comments

Comments
 (0)