Skip to content

fix: route all weight to recycle_uid when subnet price fetch fails#41

Open
Grizouforever wants to merge 1 commit intoentrius:testfrom
Grizouforever:fix/recycle-fallback-on-price-failure
Open

fix: route all weight to recycle_uid when subnet price fetch fails#41
Grizouforever wants to merge 1 commit intoentrius:testfrom
Grizouforever:fix/recycle-fallback-on-price-failure

Conversation

@Grizouforever
Copy link
Copy Markdown

Closes #40

Summary

apply_recycle previously returned (rewards, uids) unchanged when get_subnet_price raised an exception. Because rewards at that point contains the raw miner scores (which sum to ≤ 1.0 but exclude recycle_uid), calling update_scores with those values silently drops the recycled portion for that round — emissions are neither paid to miners nor recycled.

The fix falls back to (np.array([1.0]), {recycle_uid}), identical to the "no miners scored" path, ensuring emissions are always recycled rather than lost.

Changes

allways/validator/recycle.py:

  • On get_subnet_price exception, return ([1.0], {recycle_uid}) instead of the unchanged (rewards, uids)
  • Update the warning log message to describe what is actually happening

Testing

All 139 existing tests pass (uv run pytest).

@anderdc @LandynDev

Previously apply_recycle returned (rewards, uids) unchanged when
get_subnet_price raised an exception. Because rewards starts as all
zeros (from calculate_miner_rewards when there is nothing to score, or
as real values that have not yet been recycled), this caused
update_scores to be called with the original all-zero rewards and no
recycle entry, silently dropping one full scoring round's emission.

Fall back to returning ([1.0], {recycle_uid}) — the same behaviour used
when no miners are scored — so emissions are recycled rather than lost.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Silent emission drop when subnet price fetch fails in apply_recycle

1 participant