Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Fix download scheduler #2628

Merged
merged 2 commits into from
Apr 15, 2021

Conversation

driftluo
Copy link
Collaborator

  1. disable penalty when download nodes are scarce
  2. allow the protection node to be disconnected due to sync judgment

@driftluo driftluo requested a review from a team March 24, 2021 07:42
@driftluo driftluo force-pushed the fix-download-scheduler branch from 40393eb to 34055d6 Compare March 25, 2021 09:35
//
// In order to protect the decentralization of the network and ensure the survival of low-performance
// nodes, the penalty mechanism will be closed when the number of download nodes is less than the number of protected nodes
let should_punish = self.download_schedulers.len() > self.protect_num;
Copy link
Member

@doitian doitian Apr 15, 2021

Choose a reason for hiding this comment

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

Just a small suggestion: this can be extracted as a small function self.should_punish()

@driftluo
Copy link
Collaborator Author

bors r=quake,doitian

@bors
Copy link
Contributor

bors bot commented Apr 15, 2021

Build succeeded:

@bors bors bot merged commit f84f391 into nervosnetwork:develop Apr 15, 2021
@driftluo driftluo deleted the fix-download-scheduler branch April 18, 2021 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants