fix: refresh stale repo weights on cached evaluations (#364)#365
Closed
jonathanchang31 wants to merge 2 commits intoentrius:testfrom
Closed
fix: refresh stale repo weights on cached evaluations (#364)#365jonathanchang31 wants to merge 2 commits intoentrius:testfrom
jonathanchang31 wants to merge 2 commits intoentrius:testfrom
Conversation
Cached miner evaluations retained repo_weight_multiplier from the round they were originally scored. When master_repositories.json was updated between rounds, cached evaluations used stale weights for scoring and persisted them to the DB, causing incorrect weights on PR pages.
…NULL Cached evaluations have patch data stripped by create_lightweight_copy(). Re-storing them would overwrite existing DB patches with NULL via the UPSERT query. Keep skip_uids for DB storage — the in-memory weight refresh in reward.py is sufficient for correct scoring.
Collaborator
|
if master repositories is updated mid round, it's from a push from test -> main, which causes the validator to restart and thus all cached evaluations are cleared/reset. The only case this happens is if a validator is trying to make their own repository weights, which would then cause them to lose vtrust, so this scenario you're fixing doesn't happen in production. |
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
repo_weight_multiplierfrom the round they were originally scored. Whenmaster_repositories.jsonwas updated between rounds, cached evaluations used stale weights for scoring, causing incorrect repository weights._refresh_cached_repo_weights()inreward.pythat updatesrepo_weight_multiplieron all PRs in cached evaluations using the currentmaster_repositoriesbeforefinalize_miner_scores()runs.Fixes #364
Test plan