internal/consensus: proposer waits for previous block time#7376
Merged
williambanfield merged 15 commits intowb/proposer-based-timestampsfrom Dec 8, 2021
Merged
internal/consensus: proposer waits for previous block time#7376williambanfield merged 15 commits intowb/proposer-based-timestampsfrom
williambanfield merged 15 commits intowb/proposer-based-timestampsfrom
Conversation
a01690f to
9d5d5d5
Compare
9d5d5d5 to
67d3fb3
Compare
creachadair
approved these changes
Dec 3, 2021
d3cb51c to
a9a56a1
Compare
cason
approved these changes
Dec 3, 2021
williambanfield
added a commit
that referenced
this pull request
Jan 15, 2022
This change introduces the logic to have the proposer wait until the previous block time has passed before attempting to propose the next block. The change achieves this by by adding a new clause into the enterPropose state machine method. The method now checks if the validator is the proposer and if the validator's clock is behind the previous block's time. If the validator's clock is behind the previous block time, it schedules a timeout to re-enter the enter propose method after enough time has passed.
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.
This change introduces the logic to have the proposer wait until the previous block time has passed before attempting to propose the next block.
The change achieves this by by adding a new clause into the
enterProposestate machine method. The method now checks if the validator is the proposer and if the validator's clock is behind the previous block's time. If the validator's clock is behind the previous block time, it schedules a timeout to re-enter the enter propose method after enough time has passed.This change also introduces a mild refactor to the
pbts_test.gofile. It updates the test harness to include a channel oftime.Time,pubsub.Messagepairs. This timestamped events channel provides a slightly more generalizable way to collect events from the observed validator associated with the time that they occured in the test.