Skip to content

Commit

Permalink
[WIP] Add logging on 'processMining'
Browse files Browse the repository at this point in the history
  • Loading branch information
dzajkowski committed May 11, 2021
1 parent e15a338 commit 02d9cf9
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -12,6 +12,7 @@ import io.iohk.ethereum.jsonrpc.EthMiningService.SubmitHashRateRequest
import io.iohk.ethereum.jsonrpc.{EthInfoService, EthMiningService}
import io.iohk.ethereum.nodebuilder.Node
import io.iohk.ethereum.utils.BigIntExtensionMethods._
import io.iohk.ethereum.utils.ByteStringUtils.ByteStringOps
import io.iohk.ethereum.utils.{ByteStringUtils, ByteUtils}
import monix.execution.Scheduler

Expand Down Expand Up @@ -58,6 +59,7 @@ class EthashMiner(
.getBlockForMining(blockValue)
.map { case PendingBlockAndState(PendingBlock(block, _), _) =>
val blockNumber = block.header.number
log.debug("Processing mining block {}", blockNumber)
val (startTime, mineResult) =
// ECIP-1049 //TODO refactoring in ETCM-759 to remove the if clause
if (isKeccak(blockNumber)) doKeccakMining(block, blockCreator.miningConfig.mineRounds)
Expand All @@ -72,6 +74,7 @@ class EthashMiner(
log.info(
s"Mining successful with ${ByteStringUtils.hash2string(mixHash)} and nonce ${ByteStringUtils.hash2string(nonce)}"
)
log.debug("Block txs {}", block.body.transactionList.map(_.hash.toHex))
syncController ! SyncProtocol.MinedBlock(
block.copy(header = block.header.copy(nonce = nonce, mixHash = mixHash))
)
Expand Down

0 comments on commit 02d9cf9

Please sign in to comment.