feat(scoring): hard-zero credibility above the timeout limit#435
Open
anderdc wants to merge 1 commit into
Open
feat(scoring): hard-zero credibility above the timeout limit#435anderdc wants to merge 1 commit into
anderdc wants to merge 1 commit into
Conversation
A miner's credibility ramp previously only ever ramped up — timeouts counted toward it as observations, so a high-volume miner could rack up many timeouts and still earn a 1.00x credibility multiplier, with the only penalty living in the cubed success-rate term. Add a rolling-window hard floor: more than CREDIBILITY_MAX_TIMEOUTS (3) timed-out swaps within CREDIBILITY_WINDOW_BLOCKS zeros credibility (and thus the whole reward) until the old timeouts age out of the window. The scoring trace mirrors the zero so the validator's own log is honest.
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.
What
Adds a rolling-window hard floor on miner credibility: more than
CREDIBILITY_MAX_TIMEOUTS(3) timed-out swaps withinCREDIBILITY_WINDOW_BLOCKS(~30d) forces the credibility ramp to0— which, sincerampis a multiplicand incrown × cap × vol × rate³ × ramp, zeros the miner's whole reward for the round.Why
Previously the credibility ramp only ever ramped up:
credibility_ramp()returnedmin(1.0, closed_swaps / 10), and a timeout counted toward the ramp as just another observation. So a high-volume miner could rack up many timeouts and still earn a1.00×credibility multiplier — the only penalty lived in the cubedsuccess_rateterm. We want repeated timeouts to be disqualifying, not merely dilutive.Behavior
0–3timeouts in the window: tolerated (ramp unchanged).4thtimeout: credibility →0(reward →0).Changes
constants.py: newCREDIBILITY_MAX_TIMEOUTS = 3.scoring.py:credibility_ramp()returns0.0whentimed_out > CREDIBILITY_MAX_TIMEOUTS.scoring_trace.py:record_credibility()mirrors the zero so the validator's own stdout log is honest.(8,3)→full,(8,4)→0, 5+5 swaps → reward 0).pytest tests/test_scoring_v1.py→ 127 passed.Related (must land together)
This is the source-of-truth change. The dashboard mirror + UI display land alongside: