feat: add response speed tracking in reward calculation#86
Open
0xsatoshi99 wants to merge 1 commit into
Open
Conversation
Implements issue shiftlayer-llc#35 - Consider response speed in reward calculation. Changes: - Add new response_speed.py module with: - ResponseMetrics: tracks per-miner response times - GameResponseTracker: manages metrics for all miners in a game - Speed multiplier calculation (bonus for fast, penalty for slow) - apply_speed_multipliers: applies speed adjustments to rewards - Update forward.py to: - Initialize GameResponseTracker at game start - Record response times for each miner query - Apply speed multipliers to final rewards - Log response speed summary at game end Speed multiplier logic: - Fast responses (<5s): up to +30% bonus - Normal responses (5-20s): no adjustment - Slow responses (>20s): up to -20% penalty - High timeout rate (>50%): maximum penalty This encourages miners to optimize their code for lowest latency.
Author
|
@ultrashiny Can you please check this PR and let me know your opinion? |
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.
Summary
Implements issue #35 - Consider response speed in reward calculation.
This PR adds response latency tracking and applies speed-based multipliers to miner rewards, encouraging miners to optimize their code for the shortest latency.
Changes
New File:
game/validator/response_speed.pyModified:
game/validator/forward.pyGameResponseTrackerat game startSpeed Multiplier Logic
Example Output
Benefits
Fixes #35
Contribution by Gittensor, learn more at https://gittensor.io/