mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-17 07:01:20 +00:00
log whether node is a validator in each round
This commit is contained in:
committed by
Ethan Buchman
parent
e041b2eee6
commit
eb9ca23250
@ -775,15 +775,21 @@ func (cs *ConsensusState) enterPropose(height int, round int) {
|
|||||||
|
|
||||||
// Nothing more to do if we're not a validator
|
// Nothing more to do if we're not a validator
|
||||||
if cs.privValidator == nil {
|
if cs.privValidator == nil {
|
||||||
|
cs.Logger.Info("This node is not a validator")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !bytes.Equal(cs.Validators.GetProposer().Address, cs.privValidator.GetAddress()) {
|
if !bytes.Equal(cs.Validators.GetProposer().Address, cs.privValidator.GetAddress()) {
|
||||||
cs.Logger.Info("enterPropose: Not our turn to propose", "proposer", cs.Validators.GetProposer().Address, "privValidator", cs.privValidator)
|
cs.Logger.Info("enterPropose: Not our turn to propose", "proposer", cs.Validators.GetProposer().Address, "privValidator", cs.privValidator)
|
||||||
|
if cs.Validators.HasAddress(cs.privValidator.GetAddress()) {
|
||||||
|
cs.Logger.Info("This node is a validator")
|
||||||
|
} else {
|
||||||
|
cs.Logger.Info("This node is not a validator")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
cs.Logger.Info("enterPropose: Our turn to propose", "proposer", cs.Validators.GetProposer().Address, "privValidator", cs.privValidator)
|
cs.Logger.Info("enterPropose: Our turn to propose", "proposer", cs.Validators.GetProposer().Address, "privValidator", cs.privValidator)
|
||||||
|
cs.Logger.Info("This node is a validator")
|
||||||
cs.decideProposal(height, round)
|
cs.decideProposal(height, round)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1141,6 +1147,7 @@ func (cs *ConsensusState) tryFinalizeCommit(height int) {
|
|||||||
cs.Logger.Error("Attempt to finalize failed. We don't have the commit block.", "height", height, "proposal-block", cs.ProposalBlock.Hash(), "commit-block", blockID.Hash)
|
cs.Logger.Error("Attempt to finalize failed. We don't have the commit block.", "height", height, "proposal-block", cs.ProposalBlock.Hash(), "commit-block", blockID.Hash)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// go
|
// go
|
||||||
cs.finalizeCommit(height)
|
cs.finalizeCommit(height)
|
||||||
}
|
}
|
||||||
|
@ -123,6 +123,13 @@ func NewNode(config *cfg.Config, privValidator *types.PrivValidator, clientCreat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Log whether this node is a validator or an observer
|
||||||
|
if state.Validators.HasAddress(privValidator.Address) {
|
||||||
|
consensusLogger.Info("This node is a validator")
|
||||||
|
} else {
|
||||||
|
consensusLogger.Info("This node is not a validator")
|
||||||
|
}
|
||||||
|
|
||||||
// Make BlockchainReactor
|
// Make BlockchainReactor
|
||||||
bcReactor := bc.NewBlockchainReactor(state.Copy(), proxyApp.Consensus(), blockStore, fastSync)
|
bcReactor := bc.NewBlockchainReactor(state.Copy(), proxyApp.Consensus(), blockStore, fastSync)
|
||||||
bcReactor.SetLogger(logger.With("module", "blockchain"))
|
bcReactor.SetLogger(logger.With("module", "blockchain"))
|
||||||
|
@ -151,6 +151,7 @@ func (s *State) SetBlockAndValidators(header *types.Header, blockPartsHeader typ
|
|||||||
s.logger.Error("Error changing validator set", "error", err)
|
s.logger.Error("Error changing validator set", "error", err)
|
||||||
// TODO: err or carry on?
|
// TODO: err or carry on?
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update validator accums and set state variables
|
// Update validator accums and set state variables
|
||||||
nextValSet.IncrementAccum(1)
|
nextValSet.IncrementAccum(1)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user