Skip to content

refactor(sync): Refactor the sync scoring system#1449

Open
romac wants to merge 11 commits intocirclefin:mainfrom
romac:sync/score-refactor
Open

refactor(sync): Refactor the sync scoring system#1449
romac wants to merge 11 commits intocirclefin:mainfrom
romac:sync/score-refactor

Conversation

@romac
Copy link
Contributor

@romac romac commented Feb 4, 2026

Follow-up to #1448

Actual changes:

@romac romac added the sync Synchronization protocols label Feb 10, 2026
@romac romac force-pushed the sync/score-refactor branch from ef5bf06 to 828c3f8 Compare February 13, 2026 15:02
Comment on lines +180 to +183
// Use a minimum floor so that even the lowest-scoring peers
// retain a non-zero probability of being selected.
const MIN_WEIGHT: f64 = 0.01;
let scores = peers.iter().map(|id| self.get_score(id).max(MIN_WEIGHT));
Copy link
Contributor Author

@romac romac Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether we want to keep this behavior or not? I've only added it so that the credit strategy would not cause scores to drop to 0, to match the emergent property of the EMA scoring system that scores are never quite zero (cf. See the pre-existing all_peers_selectable test).

At some point, we probably want to be ban/disconnect from peers whose score has dropped to zero.

@romac romac marked this pull request as ready for review February 13, 2026 15:35
@romac romac requested a review from ancazamfir as a code owner February 13, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sync Synchronization protocols

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant