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

Vote spacing #2763

Merged
merged 18 commits into from
Jan 12, 2021
Merged

Vote spacing #2763

merged 18 commits into from
Jan 12, 2021

Conversation

clemahieu
Copy link
Contributor

Currently there is no rate limiter on vote generation for a particular root and this can lead to increased, unnecessary vote traffic.

The nano::vote_reserver class was created to track the last time a vote was generated for a particular root.

In order to accurately and globally throttle votes, all vote generation was moved to vote_generator::vote and should not be done elsewhere.

nano::vote_generator processes two separate vote pipelines: live traffic and requests.

@zhyatt zhyatt added this to the V21.0 milestone May 7, 2020
@zhyatt zhyatt added the quality improvements This item indicates the need for or supplies changes that improve maintainability label May 7, 2020
Copy link
Contributor

@guilhermelawless guilhermelawless left a comment

Choose a reason for hiding this comment

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

Added some tests to ensure full coverage. This showed a small consistency problem, now fixed by updating reservations after vote generation in edd9dd3. LGTM.

@zhyatt zhyatt modified the milestones: V21.0, V22.0 May 26, 2020
@zhyatt zhyatt removed this from the V22.0 milestone Sep 29, 2020
@zhyatt zhyatt closed this Sep 29, 2020
@zhyatt zhyatt added this to the V22.0 milestone Sep 29, 2020
@zhyatt zhyatt reopened this Sep 29, 2020
@clemahieu clemahieu force-pushed the vote_spacing branch 3 times, most recently from 9b2870c to 0994989 Compare November 18, 2020 13:12
…r root and this can lead to increased, unnecessary vote traffic.

This patch adds a delay between constructing non-cached votes.
wezrule
wezrule previously approved these changes Nov 19, 2020
@zhyatt zhyatt requested a review from SergiySW November 19, 2020 20:08
SergiySW
SergiySW previously approved these changes Nov 20, 2020
nano/node/voting.hpp Outdated Show resolved Hide resolved
wezrule
wezrule previously approved these changes Jan 11, 2021
argakiig pushed a commit that referenced this pull request Jan 11, 2021
@clemahieu clemahieu merged commit a74b506 into develop Jan 12, 2021
@zhyatt zhyatt deleted the vote_spacing branch September 21, 2021 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quality improvements This item indicates the need for or supplies changes that improve maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants