Add more log (#3519)

* Add more log

* Fix log
pull/3520/head
Rongjian Lan 4 years ago committed by GitHub
parent c1fbc64cef
commit df99d72b96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      consensus/consensus_service.go
  2. 14
      consensus/quorum/one-node-staked-vote.go

@ -410,12 +410,6 @@ func (consensus *Consensus) UpdateConsensusInformation() Mode {
return Syncing
}
consensus.getLogger().Info().
Uint64("block-number", curHeader.Number().Uint64()).
Uint64("curEpoch", curHeader.Epoch().Uint64()).
Uint32("shard-id", consensus.ShardID).
Msg("[UpdateConsensusInformation] changing committee")
// take care of possible leader change during the epoch
// TODO: in a very rare case, when a M1 view change happened, the block contains coinbase for last leader
// but the new leader is actually recognized by most of the nodes. At this time, if a node sync to this

@ -92,7 +92,12 @@ func (v *stakedVoteWeight) AddNewVote(
additionalVotePower := numeric.NewDec(0)
for _, pubKeyBytes := range pubKeysBytes {
additionalVotePower = additionalVotePower.Add(v.roster.Voters[pubKeyBytes].OverallPercent)
votingPower := v.roster.Voters[pubKeyBytes].OverallPercent
utils.Logger().Debug().
Str("signer", pubKeyBytes.Hex()).
Str("votingPower", votingPower.String()).
Msg("Signer vote counted")
additionalVotePower = additionalVotePower.Add(votingPower)
}
tallyQuorum := func() *tallyAndQuorum {
@ -123,6 +128,7 @@ func (v *stakedVoteWeight) AddNewVote(
utils.Logger().Info().
Str("phase", p.String()).
Int64("signer-count", v.SignersCount(p)).
Str("new-power-added", additionalVotePower.String()).
Str("total-power-of-signers", tallyQuorum.tally.String()).
Msg(msg)
return ballet, nil
@ -208,6 +214,12 @@ func (v *stakedVoteWeight) SetVoters(
}
// Hold onto this calculation
v.roster = *roster
utils.Logger().Info().
Uint64("curEpoch", epoch.Uint64()).
Uint32("shard-id", subCommittee.ShardID).
Str("committee", roster.String()).
Msg("[SetVoters] Successfully updated voters")
return &TallyResult{
roster.OurVotingPowerTotalPercentage,
roster.TheirVotingPowerTotalPercentage,

Loading…
Cancel
Save