-
Notifications
You must be signed in to change notification settings - Fork 795
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
Active elections loop tuning #2306
Merged
guilhermelawless
merged 13 commits into
nanocurrency:master
from
guilhermelawless:network/limit-single-confirm-req
Oct 11, 2019
Merged
Active elections loop tuning #2306
guilhermelawless
merged 13 commits into
nanocurrency:master
from
guilhermelawless:network/limit-single-confirm-req
Oct 11, 2019
Conversation
This file contains 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
67a7aad
to
686a097
Compare
Srayman
pushed a commit
to Srayman/nano-node
that referenced
this pull request
Oct 2, 2019
9414f34
to
9d1e2c4
Compare
Co-authored-by: Srayman <[email protected]>
9d1e2c4
to
f0a9ace
Compare
cryptocode
approved these changes
Oct 10, 2019
This was referenced Oct 10, 2019
SergiySW
reviewed
Oct 10, 2019
…m into escalate/broadcast/confirm_req methods
SergiySW
approved these changes
Oct 11, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
documentation
This item indicates the need for or supplies updated or expanded documentation
major
This item indicates the need for or supplies a major or notable change
networking
performance
Performance/resource utilization improvement
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.
Closes #2137 , closes #2139 (alternative to both)
Todo
Documentation
PR Description
This PR has 2 main changes:
Other things had to be tuned consequently, such as frontier prioritization timings. Data collected on the beta network shows there are large improvements to bandwidth usage under high load, much more agile PoW prioritization, and reduced tcp write drops.
The optimized bandwidth allows for doing a larger number of batch confirm_req directly to representatives in the same amount of time. The PoW prioritization being more agile means even under saturation the network should correctly prioritize blocks with the highest PoW such that those are confirmed fastest.
The active elections container is reduced to 10k soft maximum. As blocks arrive that would immediately be dropped due to a low work difficulty, the election is allowed to live for up to 10 seconds, after which it is dropped.
There is a minimum time of 1 second until an election is considered for confirm_req, and the same time for being consider for active difficulty.
Future improvements
Using a passive elections container to store a larger amount of elections that would otherwise be dropped. If the size of a passive election is small and not many operations are performed on the container, it can possibly be in the order of 100k in memory.
Consider not rebroadcasting votes if the node is saturating, at least for blocks that would go into passive elections. This means all blocks would be confirmed via confirm_req. A better alternative would be Vote stapling #1006 . Currently, even under saturation, there's a chance that blocks are confirmed via live elections even if they have a low PoW difficulty.
Acknowledgments
Thanks to @Srayman for the enormous help in tuning and testing, and @Joohansson for the blocks.