consensus: some more informative logging
This commit is contained in:
parent
d93d754972
commit
de0153a1c4
|
@ -211,6 +211,8 @@ func (h *Handshaker) Handshake(proxyApp proxy.AppConns) error {
|
|||
return errors.New(Fmt("Error on replay: %v", err))
|
||||
}
|
||||
|
||||
log.Notice("Completed ABCI Handshake - Tendermint and App are synced", "appHeight", blockHeight, "appHash", appHash)
|
||||
|
||||
// TODO: (on restart) replay mempool
|
||||
|
||||
return nil
|
||||
|
|
|
@ -1160,13 +1160,13 @@ func (cs *ConsensusState) tryFinalizeCommit(height int) {
|
|||
|
||||
blockID, ok := cs.Votes.Precommits(cs.CommitRound).TwoThirdsMajority()
|
||||
if !ok || len(blockID.Hash) == 0 {
|
||||
log.Warn("Attempt to finalize failed. There was no +2/3 majority, or +2/3 was for <nil>.")
|
||||
log.Warn("Attempt to finalize failed. There was no +2/3 majority, or +2/3 was for <nil>.", "height", height)
|
||||
return
|
||||
}
|
||||
if !cs.ProposalBlock.HashesTo(blockID.Hash) {
|
||||
// TODO: this happens every time if we're not a validator (ugly logs)
|
||||
// TODO: ^^ wait, why does it matter that we're a validator?
|
||||
log.Warn("Attempt to finalize failed. We don't have the commit block.")
|
||||
log.Warn("Attempt to finalize failed. We don't have the commit block.", "height", height, "proposal-block", cs.ProposalBlock.Hash(), "commit-block", blockID.Hash)
|
||||
return
|
||||
}
|
||||
// go
|
||||
|
|
|
@ -96,7 +96,7 @@ func (b *Block) FillHeader() {
|
|||
// If the block is incomplete, block hash is nil for safety.
|
||||
func (b *Block) Hash() []byte {
|
||||
// fmt.Println(">>", b.Data)
|
||||
if b.Header == nil || b.Data == nil || b.LastCommit == nil {
|
||||
if b == nil || b.Header == nil || b.Data == nil || b.LastCommit == nil {
|
||||
return nil
|
||||
}
|
||||
b.FillHeader()
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"sort"
|
||||
"strings"
|
||||
|
||||
. "github.com/tendermint/go-common"
|
||||
cmn "github.com/tendermint/go-common"
|
||||
"github.com/tendermint/go-merkle"
|
||||
)
|
||||
|
||||
|
@ -48,7 +48,7 @@ func NewValidatorSet(vals []*Validator) *ValidatorSet {
|
|||
// TODO: mind the overflow when times and votingPower shares too large.
|
||||
func (valSet *ValidatorSet) IncrementAccum(times int) {
|
||||
// Add VotingPower * times to each validator and order into heap.
|
||||
validatorsHeap := NewHeap()
|
||||
validatorsHeap := cmn.NewHeap()
|
||||
for _, val := range valSet.Validators {
|
||||
val.Accum += int64(val.VotingPower) * int64(times) // TODO: mind overflow
|
||||
validatorsHeap.Push(val, accumComparable(val.Accum))
|
||||
|
|
Loading…
Reference in New Issue