From a68e356596cd77fde3e91961b04c35a6ab9b1fd1 Mon Sep 17 00:00:00 2001 From: Sam Kleinman Date: Thu, 17 Mar 2022 16:27:20 -0400 Subject: [PATCH 1/2] consensus: avoid extra close channel (#8144) Saw this in a test panic, doesn't seem neccessary. --- internal/consensus/state.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/internal/consensus/state.go b/internal/consensus/state.go index 4f0f2c680..00519a884 100644 --- a/internal/consensus/state.go +++ b/internal/consensus/state.go @@ -171,9 +171,6 @@ type State struct { doPrevote func(ctx context.Context, height int64, round int32) setProposal func(proposal *types.Proposal, t time.Time) error - // closed when we finish shutting down - done chan struct{} - // synchronous pubsub between consensus state and reactor. // state only emits EventNewRoundStep, EventValidBlock, and EventVote evsw tmevents.EventSwitch @@ -213,7 +210,6 @@ func NewState( internalMsgQueue: make(chan msgInfo, msgQueueSize), timeoutTicker: NewTimeoutTicker(logger), statsMsgQueue: make(chan msgInfo, msgQueueSize), - done: make(chan struct{}), doWALCatchup: true, wal: nilWAL{}, evpool: evpool, @@ -524,14 +520,6 @@ func (cs *State) OnStop() { // WAL is stopped in receiveRoutine. } -// Wait waits for the the main routine to return. -// NOTE: be sure to Stop() the event switch and drain -// any event channels or this may deadlock -func (cs *State) Wait() { - cs.evsw.Wait() - <-cs.done -} - // OpenWAL opens a file to log all consensus messages and timeouts for // deterministic accountability. func (cs *State) OpenWAL(ctx context.Context, walFile string) (WAL, error) { @@ -864,7 +852,6 @@ func (cs *State) receiveRoutine(ctx context.Context, maxSteps int) { // close wal now that we're done writing to it cs.wal.Stop() cs.wal.Wait() - close(cs.done) } defer func() { From 5b6849ccf7d4e608af849d87e286f9335d6e2558 Mon Sep 17 00:00:00 2001 From: frog power 4000 Date: Thu, 17 Mar 2022 13:44:29 -0700 Subject: [PATCH 2/2] Docs: abci++ typo (#8147) --- spec/abci++/abci++_methods_002_draft.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/abci++/abci++_methods_002_draft.md b/spec/abci++/abci++_methods_002_draft.md index 834c161bd..4114bb9b8 100644 --- a/spec/abci++/abci++_methods_002_draft.md +++ b/spec/abci++/abci++_methods_002_draft.md @@ -422,7 +422,7 @@ Note that, if _p_ has a non-`nil` _validValue_, Tendermint will use it as propos * The parameters and types of `RequestProcessProposal` are the same as `RequestPrepareProposal` and `RequestFinalizeBlock`. * The Application may fully execute the block as though it was handling `RequestFinalizeBlock`. - However, any resulting state changes must be kept as _canditade state_, + However, any resulting state changes must be kept as _candidate state_, and the Application should be ready to backtrack/discard it in case the decided block is different. * The header exactly matches the Tendermint header of the proposed block. * In next-block execution mode, the header hashes _AppHash_, _LastResultHash_, _ValidatorHash_,