Optimize Vote Request Behavior During Bootstrapping#4798
Merged
pwojcikdev merged 1 commit intonanocurrency:developfrom Dec 14, 2024
Merged
Optimize Vote Request Behavior During Bootstrapping#4798pwojcikdev merged 1 commit intonanocurrency:developfrom
pwojcikdev merged 1 commit intonanocurrency:developfrom
Conversation
Test Results for Commit 6c81e6bPull Request 4798: Results Test Case Results
Last updated: 2024-12-13 20:13:16 UTC |
pwojcikdev
reviewed
Dec 11, 2024
pwojcikdev
reviewed
Dec 11, 2024
6d28a3e to
543db79
Compare
pwojcikdev
reviewed
Dec 13, 2024
543db79 to
6c81e6b
Compare
pwojcikdev
approved these changes
Dec 14, 2024
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.
With bounded backlog there's a need to minimize the gap between checked and cemented blocks especially during bootstrapping phase. Currently, elections stay passive for 5 seconds by default, during which we don't request votes. However, during bootstrapping, we need to request votes to confirm blocks.
This PR implements a heuristic to identify if a block is actively being voted on. If there are no recent votes in the vote cache for a block, it likely indicates we're in bootstrapping phase, and we should request votes immediately rather than waiting for the default 5-second passive period.
The election will transition to active state immediately if the block's hash is not found in the vote cache.