|
|
@ -153,6 +153,7 @@ func (cs *ConsensusState) SetLogger(l log.Logger) { |
|
|
|
// SetEventBus sets event bus.
|
|
|
|
func (cs *ConsensusState) SetEventBus(b *types.EventBus) { |
|
|
|
cs.eventBus = b |
|
|
|
cs.blockExec.SetEventBus(b) |
|
|
|
} |
|
|
|
|
|
|
|
// String returns a string.
|
|
|
@ -922,7 +923,7 @@ func (cs *ConsensusState) defaultDoPrevote(height int64, round int) { |
|
|
|
} |
|
|
|
|
|
|
|
// Validate proposal block
|
|
|
|
err := sm.ValidateBlock(cs.state, cs.ProposalBlock) |
|
|
|
err := cs.blockExec.ValidateBlock(cs.state, cs.ProposalBlock) |
|
|
|
if err != nil { |
|
|
|
// ProposalBlock is invalid, prevote nil.
|
|
|
|
logger.Error("enterPrevote: ProposalBlock is invalid", "err", err) |
|
|
@ -1030,7 +1031,7 @@ func (cs *ConsensusState) enterPrecommit(height int64, round int) { |
|
|
|
if cs.ProposalBlock.HashesTo(blockID.Hash) { |
|
|
|
cs.Logger.Info("enterPrecommit: +2/3 prevoted proposal block. Locking", "hash", blockID.Hash) |
|
|
|
// Validate the block.
|
|
|
|
if err := sm.ValidateBlock(cs.state, cs.ProposalBlock); err != nil { |
|
|
|
if err := cs.blockExec.ValidateBlock(cs.state, cs.ProposalBlock); err != nil { |
|
|
|
cmn.PanicConsensus(cmn.Fmt("enterPrecommit: +2/3 prevoted for an invalid block: %v", err)) |
|
|
|
} |
|
|
|
cs.LockedRound = round |
|
|
@ -1165,7 +1166,7 @@ func (cs *ConsensusState) finalizeCommit(height int64) { |
|
|
|
if !block.HashesTo(blockID.Hash) { |
|
|
|
cmn.PanicSanity(cmn.Fmt("Cannot finalizeCommit, ProposalBlock does not hash to commit hash")) |
|
|
|
} |
|
|
|
if err := sm.ValidateBlock(cs.state, block); err != nil { |
|
|
|
if err := cs.blockExec.ValidateBlock(cs.state, block); err != nil { |
|
|
|
cmn.PanicConsensus(cmn.Fmt("+2/3 committed an invalid block: %v", err)) |
|
|
|
} |
|
|
|
|
|
|
|