Browse Source

Merge branch 'master' into wb/issue-8124

pull/8145/head
William Banfield 3 years ago
committed by GitHub
parent
commit
11d55ef9e4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 14 deletions
  1. +0
    -13
      internal/consensus/state.go
  2. +1
    -1
      spec/abci++/abci++_methods_002_draft.md

+ 0
- 13
internal/consensus/state.go View File

@ -171,9 +171,6 @@ type State struct {
doPrevote func(ctx context.Context, height int64, round int32) doPrevote func(ctx context.Context, height int64, round int32)
setProposal func(proposal *types.Proposal, t time.Time) error 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. // synchronous pubsub between consensus state and reactor.
// state only emits EventNewRoundStep, EventValidBlock, and EventVote // state only emits EventNewRoundStep, EventValidBlock, and EventVote
evsw tmevents.EventSwitch evsw tmevents.EventSwitch
@ -213,7 +210,6 @@ func NewState(
internalMsgQueue: make(chan msgInfo, msgQueueSize), internalMsgQueue: make(chan msgInfo, msgQueueSize),
timeoutTicker: NewTimeoutTicker(logger), timeoutTicker: NewTimeoutTicker(logger),
statsMsgQueue: make(chan msgInfo, msgQueueSize), statsMsgQueue: make(chan msgInfo, msgQueueSize),
done: make(chan struct{}),
doWALCatchup: true, doWALCatchup: true,
wal: nilWAL{}, wal: nilWAL{},
evpool: evpool, evpool: evpool,
@ -524,14 +520,6 @@ func (cs *State) OnStop() {
// WAL is stopped in receiveRoutine. // 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 // OpenWAL opens a file to log all consensus messages and timeouts for
// deterministic accountability. // deterministic accountability.
func (cs *State) OpenWAL(ctx context.Context, walFile string) (WAL, error) { 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 // close wal now that we're done writing to it
cs.wal.Stop() cs.wal.Stop()
cs.wal.Wait() cs.wal.Wait()
close(cs.done)
} }
defer func() { defer func() {


+ 1
- 1
spec/abci++/abci++_methods_002_draft.md View File

@ -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` * The parameters and types of `RequestProcessProposal` are the same as `RequestPrepareProposal`
and `RequestFinalizeBlock`. and `RequestFinalizeBlock`.
* The Application may fully execute the block as though it was handling `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. 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. * The header exactly matches the Tendermint header of the proposed block.
* In next-block execution mode, the header hashes _AppHash_, _LastResultHash_, _ValidatorHash_, * In next-block execution mode, the header hashes _AppHash_, _LastResultHash_, _ValidatorHash_,


Loading…
Cancel
Save