collator-protocol revamp: use ratio for peer eviction from DB #11576
Merged
collator-protocol revamp: use ratio for peer eviction from DB #11576
Conversation
…last_bump / score` ratio when deciding which peer to evict from the db
Contributor
Author
|
/cmd prdoc --audience node_dev --bump patch |
…e_dev --bump patch'
AlexandruCihodaru
approved these changes
Mar 31, 2026
AlexandruCihodaru
approved these changes
Mar 31, 2026
Contributor
AlexandruCihodaru
left a comment
There was a problem hiding this comment.
🚀 Nice work on testing
paritytech-release-backport-bot Bot
pushed a commit
that referenced
this pull request
Apr 3, 2026
The current implementation of `prune_for_para` gives edge to new peers because it uses only the timestamp of the last bump when evicting peers to the DB. As a result, a high score collator which is inactive for a while can easily be evicted by new peers with minimal score. To fix this we now calculate `score / time_since_last_bump` ratio for each peer and evict the one with the min value. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> (cherry picked from commit fea7d4d)
|
Successfully created backport PR for |
tdimitrov
added a commit
that referenced
this pull request
Apr 3, 2026
Backport #11576 into `stable2603` from tdimitrov. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.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.
The current implementation of
prune_for_paragives edge to new peers because it uses only the timestamp of the last bump when evicting peers to the DB. As a result, a high score collator which is inactive for a while can easily be evicted by new peers with minimal score.To fix this we now calculate
score / time_since_last_bumpratio for each peer and evict the one with the min value.