Add additional logging fields for post-merge transition blocks (#10944)

Added additional logging information to Bellatrix blocks.

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Sammy Rosso 2022-06-28 15:55:36 +02:00 committed by GitHub
parent b82e2e7d40
commit 8510743406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,8 +152,15 @@ func (v *validator) ProposeBlock(ctx context.Context, slot types.Slot, pubKey [f
log.WithError(err).Error("Failed to get execution payload")
return
}
log = log.WithField("payloadHash", fmt.Sprintf("%#x", bytesutil.Trunc(p.BlockHash)))
log = log.WithField("txCount", len(p.Transactions))
log = log.WithFields(logrus.Fields{
"payloadHash": fmt.Sprintf("%#x", bytesutil.Trunc(p.BlockHash)),
"parentHash": fmt.Sprintf("%#x", bytesutil.Trunc(p.ParentHash)),
"blockNumber": p.BlockNumber,
"txCount": len(p.Transactions),
})
if p.GasLimit != 0 {
log = log.WithField("gasUtilized", float64(p.GasUsed)/float64(p.GasLimit))
}
}
blkRoot := fmt.Sprintf("%#x", bytesutil.Trunc(blkResp.BlockRoot))