[log] disable huge debug log in leader

the excessive logs have caused leader node out of space only after 8k
consensuses.

Signed-off-by: Leo Chen <leo@harmony.one>
pull/716/head
Leo Chen 6 years ago
parent daf6aa1e5d
commit 81abaaa922
  1. 16
      core/blockchain.go
  2. 6
      node/node_newblock.go

@ -1741,14 +1741,14 @@ func (bc *BlockChain) StoreNewShardState(block *types.Block, stakeInfo *map[comm
number := block.NumberU64()
rawdb.WriteShardState(bc.db, hash, number, shardState)
utils.GetLogInstance().Debug("[Resharding] Saved new shard state successfully", "epoch", GetEpochFromBlockNumber(block.NumberU64()))
for _, shard := range shardState {
output := shard.Leader.BlsPublicKey.Hex()
output = output + " \n"
for _, node := range shard.NodeList {
output = output + node.BlsPublicKey.Hex() + " \n"
}
utils.GetLogInstance().Debug(fmt.Sprintf("[Resharding][shard: %d] Leader: %s", shard.ShardID, output))
}
// for _, shard := range shardState {
// output := shard.Leader.BlsAddress
// output = output + " \n"
// for _, node := range shard.NodeList {
// output = output + node.BlsAddress + " \n"
// }
// utils.GetLogInstance().Debug(fmt.Sprintf("[Resharding][shard: %d] Leader: %s", shard.ShardID, output))
// }
}
return shardState
}

@ -89,9 +89,9 @@ func (node *Node) addNewShardStateHash(block *types.Block) {
if shardState != nil {
shardHash := shardState.Hash()
utils.GetLogInstance().Debug("[resharding] adding new shard state", "shardHash", shardHash)
for _, c := range shardState {
utils.GetLogInstance().Debug("new shard information", "shardID", c.ShardID, "NodeList", c.NodeList)
}
// for _, c := range shardState {
// utils.GetLogInstance().Debug("new shard information", "shardID", c.ShardID, "NodeList", c.NodeList)
// }
block.AddShardStateHash(shardHash)
}
}

Loading…
Cancel
Save