|
@ -186,7 +186,7 @@ func WithMetrics(metrics *Metrics) CSOption { |
|
|
// String returns a string.
|
|
|
// String returns a string.
|
|
|
func (cs *ConsensusState) String() string { |
|
|
func (cs *ConsensusState) String() string { |
|
|
// better not to access shared variables
|
|
|
// better not to access shared variables
|
|
|
return cmn.Fmt("ConsensusState") //(H:%v R:%v S:%v", cs.Height, cs.Round, cs.Step)
|
|
|
|
|
|
|
|
|
return fmt.Sprintf("ConsensusState") //(H:%v R:%v S:%v", cs.Height, cs.Round, cs.Step)
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// GetState returns a copy of the chain state.
|
|
|
// GetState returns a copy of the chain state.
|
|
@ -459,7 +459,7 @@ func (cs *ConsensusState) reconstructLastCommit(state sm.State) { |
|
|
} |
|
|
} |
|
|
added, err := lastPrecommits.AddVote(precommit) |
|
|
added, err := lastPrecommits.AddVote(precommit) |
|
|
if !added || err != nil { |
|
|
if !added || err != nil { |
|
|
cmn.PanicCrisis(cmn.Fmt("Failed to reconstruct LastCommit: %v", err)) |
|
|
|
|
|
|
|
|
cmn.PanicCrisis(fmt.Sprintf("Failed to reconstruct LastCommit: %v", err)) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if !lastPrecommits.HasTwoThirdsMajority() { |
|
|
if !lastPrecommits.HasTwoThirdsMajority() { |
|
@ -472,13 +472,13 @@ func (cs *ConsensusState) reconstructLastCommit(state sm.State) { |
|
|
// The round becomes 0 and cs.Step becomes cstypes.RoundStepNewHeight.
|
|
|
// The round becomes 0 and cs.Step becomes cstypes.RoundStepNewHeight.
|
|
|
func (cs *ConsensusState) updateToState(state sm.State) { |
|
|
func (cs *ConsensusState) updateToState(state sm.State) { |
|
|
if cs.CommitRound > -1 && 0 < cs.Height && cs.Height != state.LastBlockHeight { |
|
|
if cs.CommitRound > -1 && 0 < cs.Height && cs.Height != state.LastBlockHeight { |
|
|
cmn.PanicSanity(cmn.Fmt("updateToState() expected state height of %v but found %v", |
|
|
|
|
|
|
|
|
cmn.PanicSanity(fmt.Sprintf("updateToState() expected state height of %v but found %v", |
|
|
cs.Height, state.LastBlockHeight)) |
|
|
cs.Height, state.LastBlockHeight)) |
|
|
} |
|
|
} |
|
|
if !cs.state.IsEmpty() && cs.state.LastBlockHeight+1 != cs.Height { |
|
|
if !cs.state.IsEmpty() && cs.state.LastBlockHeight+1 != cs.Height { |
|
|
// This might happen when someone else is mutating cs.state.
|
|
|
// This might happen when someone else is mutating cs.state.
|
|
|
// Someone forgot to pass in state.Copy() somewhere?!
|
|
|
// Someone forgot to pass in state.Copy() somewhere?!
|
|
|
cmn.PanicSanity(cmn.Fmt("Inconsistent cs.state.LastBlockHeight+1 %v vs cs.Height %v", |
|
|
|
|
|
|
|
|
cmn.PanicSanity(fmt.Sprintf("Inconsistent cs.state.LastBlockHeight+1 %v vs cs.Height %v", |
|
|
cs.state.LastBlockHeight+1, cs.Height)) |
|
|
cs.state.LastBlockHeight+1, cs.Height)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -698,7 +698,7 @@ func (cs *ConsensusState) handleTimeout(ti timeoutInfo, rs cstypes.RoundState) { |
|
|
cs.eventBus.PublishEventTimeoutWait(cs.RoundStateEvent()) |
|
|
cs.eventBus.PublishEventTimeoutWait(cs.RoundStateEvent()) |
|
|
cs.enterNewRound(ti.Height, ti.Round+1) |
|
|
cs.enterNewRound(ti.Height, ti.Round+1) |
|
|
default: |
|
|
default: |
|
|
panic(cmn.Fmt("Invalid timeout step: %v", ti.Step)) |
|
|
|
|
|
|
|
|
panic(fmt.Sprintf("Invalid timeout step: %v", ti.Step)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -724,7 +724,7 @@ func (cs *ConsensusState) enterNewRound(height int64, round int) { |
|
|
logger := cs.Logger.With("height", height, "round", round) |
|
|
logger := cs.Logger.With("height", height, "round", round) |
|
|
|
|
|
|
|
|
if cs.Height != height || round < cs.Round || (cs.Round == round && cs.Step != cstypes.RoundStepNewHeight) { |
|
|
if cs.Height != height || round < cs.Round || (cs.Round == round && cs.Step != cstypes.RoundStepNewHeight) { |
|
|
logger.Debug(cmn.Fmt("enterNewRound(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
logger.Debug(fmt.Sprintf("enterNewRound(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -732,7 +732,7 @@ func (cs *ConsensusState) enterNewRound(height int64, round int) { |
|
|
logger.Info("Need to set a buffer and log message here for sanity.", "startTime", cs.StartTime, "now", now) |
|
|
logger.Info("Need to set a buffer and log message here for sanity.", "startTime", cs.StartTime, "now", now) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
logger.Info(cmn.Fmt("enterNewRound(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
logger.Info(fmt.Sprintf("enterNewRound(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
// Increment validators if necessary
|
|
|
// Increment validators if necessary
|
|
|
validators := cs.Validators |
|
|
validators := cs.Validators |
|
@ -819,10 +819,10 @@ func (cs *ConsensusState) enterPropose(height int64, round int) { |
|
|
logger := cs.Logger.With("height", height, "round", round) |
|
|
logger := cs.Logger.With("height", height, "round", round) |
|
|
|
|
|
|
|
|
if cs.Height != height || round < cs.Round || (cs.Round == round && cstypes.RoundStepPropose <= cs.Step) { |
|
|
if cs.Height != height || round < cs.Round || (cs.Round == round && cstypes.RoundStepPropose <= cs.Step) { |
|
|
logger.Debug(cmn.Fmt("enterPropose(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
logger.Debug(fmt.Sprintf("enterPropose(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
logger.Info(cmn.Fmt("enterPropose(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
logger.Info(fmt.Sprintf("enterPropose(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
defer func() { |
|
|
defer func() { |
|
|
// Done enterPropose:
|
|
|
// Done enterPropose:
|
|
@ -902,7 +902,7 @@ func (cs *ConsensusState) defaultDecideProposal(height int64, round int) { |
|
|
cs.sendInternalMessage(msgInfo{&BlockPartMessage{cs.Height, cs.Round, part}, ""}) |
|
|
cs.sendInternalMessage(msgInfo{&BlockPartMessage{cs.Height, cs.Round, part}, ""}) |
|
|
} |
|
|
} |
|
|
cs.Logger.Info("Signed proposal", "height", height, "round", round, "proposal", proposal) |
|
|
cs.Logger.Info("Signed proposal", "height", height, "round", round, "proposal", proposal) |
|
|
cs.Logger.Debug(cmn.Fmt("Signed proposal block: %v", block)) |
|
|
|
|
|
|
|
|
cs.Logger.Debug(fmt.Sprintf("Signed proposal block: %v", block)) |
|
|
} else { |
|
|
} else { |
|
|
if !cs.replayMode { |
|
|
if !cs.replayMode { |
|
|
cs.Logger.Error("enterPropose: Error signing proposal", "height", height, "round", round, "err", err) |
|
|
cs.Logger.Error("enterPropose: Error signing proposal", "height", height, "round", round, "err", err) |
|
@ -961,7 +961,7 @@ func (cs *ConsensusState) createProposalBlock() (block *types.Block, blockParts |
|
|
// Otherwise vote nil.
|
|
|
// Otherwise vote nil.
|
|
|
func (cs *ConsensusState) enterPrevote(height int64, round int) { |
|
|
func (cs *ConsensusState) enterPrevote(height int64, round int) { |
|
|
if cs.Height != height || round < cs.Round || (cs.Round == round && cstypes.RoundStepPrevote <= cs.Step) { |
|
|
if cs.Height != height || round < cs.Round || (cs.Round == round && cstypes.RoundStepPrevote <= cs.Step) { |
|
|
cs.Logger.Debug(cmn.Fmt("enterPrevote(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
cs.Logger.Debug(fmt.Sprintf("enterPrevote(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -979,7 +979,7 @@ func (cs *ConsensusState) enterPrevote(height int64, round int) { |
|
|
// TODO: catchup event?
|
|
|
// TODO: catchup event?
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
cs.Logger.Info(cmn.Fmt("enterPrevote(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
cs.Logger.Info(fmt.Sprintf("enterPrevote(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
// Sign and broadcast vote as necessary
|
|
|
// Sign and broadcast vote as necessary
|
|
|
cs.doPrevote(height, round) |
|
|
cs.doPrevote(height, round) |
|
@ -1025,13 +1025,13 @@ func (cs *ConsensusState) enterPrevoteWait(height int64, round int) { |
|
|
logger := cs.Logger.With("height", height, "round", round) |
|
|
logger := cs.Logger.With("height", height, "round", round) |
|
|
|
|
|
|
|
|
if cs.Height != height || round < cs.Round || (cs.Round == round && cstypes.RoundStepPrevoteWait <= cs.Step) { |
|
|
if cs.Height != height || round < cs.Round || (cs.Round == round && cstypes.RoundStepPrevoteWait <= cs.Step) { |
|
|
logger.Debug(cmn.Fmt("enterPrevoteWait(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
logger.Debug(fmt.Sprintf("enterPrevoteWait(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if !cs.Votes.Prevotes(round).HasTwoThirdsAny() { |
|
|
if !cs.Votes.Prevotes(round).HasTwoThirdsAny() { |
|
|
cmn.PanicSanity(cmn.Fmt("enterPrevoteWait(%v/%v), but Prevotes does not have any +2/3 votes", height, round)) |
|
|
|
|
|
|
|
|
cmn.PanicSanity(fmt.Sprintf("enterPrevoteWait(%v/%v), but Prevotes does not have any +2/3 votes", height, round)) |
|
|
} |
|
|
} |
|
|
logger.Info(cmn.Fmt("enterPrevoteWait(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
logger.Info(fmt.Sprintf("enterPrevoteWait(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
defer func() { |
|
|
defer func() { |
|
|
// Done enterPrevoteWait:
|
|
|
// Done enterPrevoteWait:
|
|
@ -1053,11 +1053,11 @@ func (cs *ConsensusState) enterPrecommit(height int64, round int) { |
|
|
logger := cs.Logger.With("height", height, "round", round) |
|
|
logger := cs.Logger.With("height", height, "round", round) |
|
|
|
|
|
|
|
|
if cs.Height != height || round < cs.Round || (cs.Round == round && cstypes.RoundStepPrecommit <= cs.Step) { |
|
|
if cs.Height != height || round < cs.Round || (cs.Round == round && cstypes.RoundStepPrecommit <= cs.Step) { |
|
|
logger.Debug(cmn.Fmt("enterPrecommit(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
logger.Debug(fmt.Sprintf("enterPrecommit(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
logger.Info(cmn.Fmt("enterPrecommit(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
logger.Info(fmt.Sprintf("enterPrecommit(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
defer func() { |
|
|
defer func() { |
|
|
// Done enterPrecommit:
|
|
|
// Done enterPrecommit:
|
|
@ -1085,7 +1085,7 @@ func (cs *ConsensusState) enterPrecommit(height int64, round int) { |
|
|
// the latest POLRound should be this round.
|
|
|
// the latest POLRound should be this round.
|
|
|
polRound, _ := cs.Votes.POLInfo() |
|
|
polRound, _ := cs.Votes.POLInfo() |
|
|
if polRound < round { |
|
|
if polRound < round { |
|
|
cmn.PanicSanity(cmn.Fmt("This POLRound should be %v but got %", round, polRound)) |
|
|
|
|
|
|
|
|
cmn.PanicSanity(fmt.Sprintf("This POLRound should be %v but got %v", round, polRound)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// +2/3 prevoted nil. Unlock and precommit nil.
|
|
|
// +2/3 prevoted nil. Unlock and precommit nil.
|
|
@ -1119,7 +1119,7 @@ func (cs *ConsensusState) enterPrecommit(height int64, round int) { |
|
|
logger.Info("enterPrecommit: +2/3 prevoted proposal block. Locking", "hash", blockID.Hash) |
|
|
logger.Info("enterPrecommit: +2/3 prevoted proposal block. Locking", "hash", blockID.Hash) |
|
|
// Validate the block.
|
|
|
// Validate the block.
|
|
|
if err := cs.blockExec.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)) |
|
|
|
|
|
|
|
|
cmn.PanicConsensus(fmt.Sprintf("enterPrecommit: +2/3 prevoted for an invalid block: %v", err)) |
|
|
} |
|
|
} |
|
|
cs.LockedRound = round |
|
|
cs.LockedRound = round |
|
|
cs.LockedBlock = cs.ProposalBlock |
|
|
cs.LockedBlock = cs.ProposalBlock |
|
@ -1149,13 +1149,13 @@ func (cs *ConsensusState) enterPrecommitWait(height int64, round int) { |
|
|
logger := cs.Logger.With("height", height, "round", round) |
|
|
logger := cs.Logger.With("height", height, "round", round) |
|
|
|
|
|
|
|
|
if cs.Height != height || round < cs.Round || (cs.Round == round && cstypes.RoundStepPrecommitWait <= cs.Step) { |
|
|
if cs.Height != height || round < cs.Round || (cs.Round == round && cstypes.RoundStepPrecommitWait <= cs.Step) { |
|
|
logger.Debug(cmn.Fmt("enterPrecommitWait(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
logger.Debug(fmt.Sprintf("enterPrecommitWait(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if !cs.Votes.Precommits(round).HasTwoThirdsAny() { |
|
|
if !cs.Votes.Precommits(round).HasTwoThirdsAny() { |
|
|
cmn.PanicSanity(cmn.Fmt("enterPrecommitWait(%v/%v), but Precommits does not have any +2/3 votes", height, round)) |
|
|
|
|
|
|
|
|
cmn.PanicSanity(fmt.Sprintf("enterPrecommitWait(%v/%v), but Precommits does not have any +2/3 votes", height, round)) |
|
|
} |
|
|
} |
|
|
logger.Info(cmn.Fmt("enterPrecommitWait(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
logger.Info(fmt.Sprintf("enterPrecommitWait(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
defer func() { |
|
|
defer func() { |
|
|
// Done enterPrecommitWait:
|
|
|
// Done enterPrecommitWait:
|
|
@ -1173,10 +1173,10 @@ func (cs *ConsensusState) enterCommit(height int64, commitRound int) { |
|
|
logger := cs.Logger.With("height", height, "commitRound", commitRound) |
|
|
logger := cs.Logger.With("height", height, "commitRound", commitRound) |
|
|
|
|
|
|
|
|
if cs.Height != height || cstypes.RoundStepCommit <= cs.Step { |
|
|
if cs.Height != height || cstypes.RoundStepCommit <= cs.Step { |
|
|
logger.Debug(cmn.Fmt("enterCommit(%v/%v): Invalid args. Current step: %v/%v/%v", height, commitRound, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
logger.Debug(fmt.Sprintf("enterCommit(%v/%v): Invalid args. Current step: %v/%v/%v", height, commitRound, cs.Height, cs.Round, cs.Step)) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
logger.Info(cmn.Fmt("enterCommit(%v/%v). Current: %v/%v/%v", height, commitRound, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
logger.Info(fmt.Sprintf("enterCommit(%v/%v). Current: %v/%v/%v", height, commitRound, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
defer func() { |
|
|
defer func() { |
|
|
// Done enterCommit:
|
|
|
// Done enterCommit:
|
|
@ -1223,7 +1223,7 @@ func (cs *ConsensusState) tryFinalizeCommit(height int64) { |
|
|
logger := cs.Logger.With("height", height) |
|
|
logger := cs.Logger.With("height", height) |
|
|
|
|
|
|
|
|
if cs.Height != height { |
|
|
if cs.Height != height { |
|
|
cmn.PanicSanity(cmn.Fmt("tryFinalizeCommit() cs.Height: %v vs height: %v", cs.Height, height)) |
|
|
|
|
|
|
|
|
cmn.PanicSanity(fmt.Sprintf("tryFinalizeCommit() cs.Height: %v vs height: %v", cs.Height, height)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
blockID, ok := cs.Votes.Precommits(cs.CommitRound).TwoThirdsMajority() |
|
|
blockID, ok := cs.Votes.Precommits(cs.CommitRound).TwoThirdsMajority() |
|
@ -1245,7 +1245,7 @@ func (cs *ConsensusState) tryFinalizeCommit(height int64) { |
|
|
// Increment height and goto cstypes.RoundStepNewHeight
|
|
|
// Increment height and goto cstypes.RoundStepNewHeight
|
|
|
func (cs *ConsensusState) finalizeCommit(height int64) { |
|
|
func (cs *ConsensusState) finalizeCommit(height int64) { |
|
|
if cs.Height != height || cs.Step != cstypes.RoundStepCommit { |
|
|
if cs.Height != height || cs.Step != cstypes.RoundStepCommit { |
|
|
cs.Logger.Debug(cmn.Fmt("finalizeCommit(%v): Invalid args. Current step: %v/%v/%v", height, cs.Height, cs.Round, cs.Step)) |
|
|
|
|
|
|
|
|
cs.Logger.Debug(fmt.Sprintf("finalizeCommit(%v): Invalid args. Current step: %v/%v/%v", height, cs.Height, cs.Round, cs.Step)) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1253,21 +1253,21 @@ func (cs *ConsensusState) finalizeCommit(height int64) { |
|
|
block, blockParts := cs.ProposalBlock, cs.ProposalBlockParts |
|
|
block, blockParts := cs.ProposalBlock, cs.ProposalBlockParts |
|
|
|
|
|
|
|
|
if !ok { |
|
|
if !ok { |
|
|
cmn.PanicSanity(cmn.Fmt("Cannot finalizeCommit, commit does not have two thirds majority")) |
|
|
|
|
|
|
|
|
cmn.PanicSanity(fmt.Sprintf("Cannot finalizeCommit, commit does not have two thirds majority")) |
|
|
} |
|
|
} |
|
|
if !blockParts.HasHeader(blockID.PartsHeader) { |
|
|
if !blockParts.HasHeader(blockID.PartsHeader) { |
|
|
cmn.PanicSanity(cmn.Fmt("Expected ProposalBlockParts header to be commit header")) |
|
|
|
|
|
|
|
|
cmn.PanicSanity(fmt.Sprintf("Expected ProposalBlockParts header to be commit header")) |
|
|
} |
|
|
} |
|
|
if !block.HashesTo(blockID.Hash) { |
|
|
if !block.HashesTo(blockID.Hash) { |
|
|
cmn.PanicSanity(cmn.Fmt("Cannot finalizeCommit, ProposalBlock does not hash to commit hash")) |
|
|
|
|
|
|
|
|
cmn.PanicSanity(fmt.Sprintf("Cannot finalizeCommit, ProposalBlock does not hash to commit hash")) |
|
|
} |
|
|
} |
|
|
if err := cs.blockExec.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)) |
|
|
|
|
|
|
|
|
cmn.PanicConsensus(fmt.Sprintf("+2/3 committed an invalid block: %v", err)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
cs.Logger.Info(cmn.Fmt("Finalizing commit of block with %d txs", block.NumTxs), |
|
|
|
|
|
|
|
|
cs.Logger.Info(fmt.Sprintf("Finalizing commit of block with %d txs", block.NumTxs), |
|
|
"height", block.Height, "hash", block.Hash(), "root", block.AppHash) |
|
|
"height", block.Height, "hash", block.Hash(), "root", block.AppHash) |
|
|
cs.Logger.Info(cmn.Fmt("%v", block)) |
|
|
|
|
|
|
|
|
cs.Logger.Info(fmt.Sprintf("%v", block)) |
|
|
|
|
|
|
|
|
fail.Fail() // XXX
|
|
|
fail.Fail() // XXX
|
|
|
|
|
|
|
|
@ -1519,7 +1519,7 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, |
|
|
return added, err |
|
|
return added, err |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
cs.Logger.Info(cmn.Fmt("Added to lastPrecommits: %v", cs.LastCommit.StringShort())) |
|
|
|
|
|
|
|
|
cs.Logger.Info(fmt.Sprintf("Added to lastPrecommits: %v", cs.LastCommit.StringShort())) |
|
|
cs.eventBus.PublishEventVote(types.EventDataVote{vote}) |
|
|
cs.eventBus.PublishEventVote(types.EventDataVote{vote}) |
|
|
cs.evsw.FireEvent(types.EventVote, vote) |
|
|
cs.evsw.FireEvent(types.EventVote, vote) |
|
|
|
|
|
|
|
@ -1635,7 +1635,7 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, |
|
|
cs.enterPrecommitWait(height, vote.Round) |
|
|
cs.enterPrecommitWait(height, vote.Round) |
|
|
} |
|
|
} |
|
|
default: |
|
|
default: |
|
|
panic(cmn.Fmt("Unexpected vote type %X", vote.Type)) // go-wire should prevent this.
|
|
|
|
|
|
|
|
|
panic(fmt.Sprintf("Unexpected vote type %X", vote.Type)) // go-wire should prevent this.
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return |
|
|
return |
|
|