|
|
|
@ -55,6 +55,7 @@ import org.hyperledger.besu.ethereum.rlp.RLPException; |
|
|
|
|
import org.hyperledger.besu.ethereum.trie.MerkleTrieException; |
|
|
|
|
import org.hyperledger.besu.plugin.services.exception.StorageException; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Collections; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Optional; |
|
|
|
@ -320,16 +321,24 @@ public abstract class AbstractEngineNewPayload extends ExecutionEngineJsonRpcMet |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void logImportedBlockInfo(final Block block, final double timeInS) { |
|
|
|
|
LOG.info( |
|
|
|
|
String.format( |
|
|
|
|
"Imported #%,d / %d tx / base fee %s / %,d (%01.1f%%) gas / (%s) in %01.3fs. Peers: %d", |
|
|
|
|
block.getHeader().getNumber(), |
|
|
|
|
block.getBody().getTransactions().size(), |
|
|
|
|
final StringBuilder message = new StringBuilder(); |
|
|
|
|
message.append("Imported #%,d / %d tx"); |
|
|
|
|
final List<Object> messageArgs = |
|
|
|
|
new ArrayList<>( |
|
|
|
|
List.of(block.getHeader().getNumber(), block.getBody().getTransactions().size())); |
|
|
|
|
if (block.getBody().getWithdrawals().isPresent()) { |
|
|
|
|
message.append(" / %d ws"); |
|
|
|
|
messageArgs.add(block.getBody().getWithdrawals().get().size()); |
|
|
|
|
} |
|
|
|
|
message.append(" / base fee %s / %,d (%01.1f%%) gas / (%s) in %01.3fs. Peers: %d"); |
|
|
|
|
messageArgs.addAll( |
|
|
|
|
List.of( |
|
|
|
|
block.getHeader().getBaseFee().map(Wei::toHumanReadableString).orElse("N/A"), |
|
|
|
|
block.getHeader().getGasUsed(), |
|
|
|
|
(block.getHeader().getGasUsed() * 100.0) / block.getHeader().getGasLimit(), |
|
|
|
|
block.getHash().toHexString(), |
|
|
|
|
timeInS, |
|
|
|
|
ethPeers.peerCount())); |
|
|
|
|
LOG.info(String.format(message.toString(), messageArgs.toArray())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|