fix: return neutral speed score for miners with no timing data, remove dead all_chains#39
Open
Grizouforever wants to merge 1 commit intoentrius:testfrom
Open
Conversation
…e dead all_chains Miners whose completed swaps all have fulfilled_block == 0 get no fulfillment timing recorded, causing _chain_weighted_speed to return 0.0 and zeroing out their full reward despite successful completions. - Return 1.0 (neutral baseline) from _chain_weighted_speed when total_swaps == 0 but s.completed > 0, so timing-less completions are scored at parity rather than annihilated. - Remove the all_chains: set variable that was populated but never read (dead code introduced alongside avg_speeds_by_chain). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #38
Summary
_chain_weighted_speedreturned0.0whentotal_swaps == 0, which collapsedsuccess_rate * volume_weight * speed_scoreto zero for any miner whose completed swaps all hadfulfilled_block == 0(no timing recorded). Fix returns1.0(neutral baseline) whentotal_swaps == 0buts.completed > 0.all_chains: setvariable (populated in the loop, never consumed).Changes
allways/validator/forward.py:_chain_weighted_speed: add fallbackreturn 1.0branch when no timing data exists buts.completed > 0calculate_miner_rewards: remove unusedall_chainsvariable and itsall_chains.add(chain)callTesting
All 139 existing tests pass (
uv run pytest).@anderdc @LandynDev