Repository navigation
consensus: ensure proposal receipt waits for maxWaitingTime - #7307
Merged
williambanfield merged 6 commits intoNov 30, 2021
Merged
williambanfield merged 6 commits into
williambanfield merged 6 commits into
Conversation
williambanfield
force-pushed
the
wb/validator-waits-for-proposal
branch
2 times, most recently
from
November 23, 2021 21:01
25e52b6 to
7fc1a4d
Compare
williambanfield
marked this pull request as ready for review
November 23, 2021 21:19
williambanfield
requested review from
alexanderbez,
cmwaters,
creachadair,
ebuchman,
tessr and
tychoish
as code owners
November 23, 2021 21:19
williambanfield
requested review from
cason
and removed request for
alexanderbez and
tessr
November 23, 2021 21:19
creachadair
reviewed
Nov 23, 2021
creachadair
left a comment
There was a problem hiding this comment.
I have a few comments, but on a whole this seems pretty solid. I would like to request a bit more documentation on some of the unexported plumbing, while it's still fresh in your mind, but it all seems to make sense.
williambanfield
force-pushed
the
wb/proposer-based-timestamps
branch
from
November 24, 2021 23:55
1bb11c3 to
6be5efa
Compare
williambanfield
force-pushed
the
wb/validator-waits-for-proposal
branch
from
November 24, 2021 23:56
d410577 to
2e0c654
Compare
cason
approved these changes
Nov 26, 2021
| // The test delivers the block to the validator after the configured `timeout-propose`, | ||
| // but before the proposer-based timestamp bound on block delivery and checks that | ||
| // the consensus algorithm correctly waits for the new block to be delivered | ||
| // and issues a prevote for it. |
There was a problem hiding this comment.
I think this test will become obsolete, as we don't plan to associate timeout-propose to MSGDELAY anymore, see: tendermint/spec#370
creachadair
approved these changes
Nov 29, 2021
| return ch | ||
| } | ||
|
|
||
| func subscribeToVoterBuffered(ctx context.Context, t *testing.T, cs *State, addr []byte) <-chan tmpubsub.Message { |
There was a problem hiding this comment.
You could probably omit "Buffered" here, since by the time this merges to master, that distinction won't exist.
| msg, err := votesSub.Next(ctx) | ||
| if err != nil { | ||
| if !errors.Is(err, pubsub.ErrTerminated) && !errors.Is(err, context.Canceled) { | ||
| t.Fatalf("error retrieving value of subscription %s", err) |
There was a problem hiding this comment.
Suggested change
| t.Fatalf("error retrieving value of subscription %s", err) | |
| t.Errorf("error retrieving value of subscription %s", err) |
This is in a different goroutine from the test, so it can't safely fatal (which terminates the goroutine, but not the right one)
williambanfield
added a commit
that referenced
this pull request
Jan 15, 2022
* consensus: ensure proposal receipt waits for maxWaitingTime * rebase fixups * lint++ * lint++ * register result chan separately * lint++
30 tasks done
1 task done
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 pull request implements the Propose Step Timeout changes described in ADR 71.
This code change implements this by taking the max of the recently added
proposalStepWaitingTime(...)method and the configuredtimeout-proposevalue and changes the scheduled RoundStepPropose timeout to occur after this maximum waiting time.This change also adds a small test harness for the ongoing proposer-based timestamp work. The test harness, aims to make it easier to write tests for the pbts timing logic. The first test cases that are added ensure that the consensus algorithm correctly prevotes nil when no block is delivered by the
waitingTimeand ensure that the consensus mechanism prevotes the block if it is delivered beforewaitingTimehas elapsed but aftertimeout-proposehas elapsed.related to: #6942