Skip to content

Commit

Permalink
Add more log info during updateM1 and change log level on devnet to 3 (
Browse files Browse the repository at this point in the history
  • Loading branch information
wjrjerome authored Jan 22, 2023
1 parent 2ca1d04 commit 1430b74
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cicd/devnet/terraform/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
num_of_nodes=125
log_level=2
log_level=3
4 changes: 2 additions & 2 deletions consensus/XDPoS/engines/engine_v2/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,12 @@ func (x *XDPoS_v2) UpdateMasternodes(chain consensus.ChainReader, header *types.

x.lock.RLock()
snap := newSnapshot(number, header.Hash(), masterNodes)
log.Trace("[UpdateMasternodes] take snapshot", "number", number, "hash", header.Hash())
log.Info("[UpdateMasternodes] take snapshot", "number", number, "hash", header.Hash())
x.lock.RUnlock()

err := storeSnapshot(snap, x.db)
if err != nil {
log.Error("[UpdateMasternodes] Error while store snashot", "hash", header.Hash(), "currentRound", x.currentRound, "error", err)
log.Error("[UpdateMasternodes] Error while store snapshot", "hash", header.Hash(), "currentRound", x.currentRound, "error", err)
return err
}
x.snapshots.Add(snap.Hash, snap)
Expand Down
4 changes: 2 additions & 2 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.
if bc.chainConfig.XDPoS != nil && ((block.NumberU64() % bc.chainConfig.XDPoS.Epoch) == (bc.chainConfig.XDPoS.Epoch - bc.chainConfig.XDPoS.Gap)) {
err := bc.UpdateM1()
if err != nil {
log.Crit("Error when update masternodes set. Stopping node", "err", err)
log.Crit("Error when update masternodes set. Stopping node", "err", err, "blockNum", block.NumberU64())
}
}
}
Expand Down Expand Up @@ -2225,7 +2225,7 @@ func (bc *BlockChain) reorg(oldBlock, newBlock *types.Block) error {
if bc.chainConfig.XDPoS != nil && ((newChain[i].NumberU64() % bc.chainConfig.XDPoS.Epoch) == (bc.chainConfig.XDPoS.Epoch - bc.chainConfig.XDPoS.Gap)) {
err := bc.UpdateM1()
if err != nil {
log.Crit("Error when update masternodes set. Stopping node", "err", err)
log.Crit("Error when update masternodes set. Stopping node", "err", err, "blockNumber", newChain[i].NumberU64())
}
}
}
Expand Down

0 comments on commit 1430b74

Please sign in to comment.