Fix can propose blind block (#11346)

This commit is contained in:
terencechain
2022-08-29 13:30:28 -07:00
committed by GitHub
parent be9847f23c
commit cff3b99918
2 changed files with 22 additions and 6 deletions

View File

@@ -150,17 +150,19 @@ func (v *validator) ProposeBlock(ctx context.Context, slot types.Slot, pubKey [f
log.WithError(err).Error("Failed to get execution payload")
return
}
txs, err := p.Transactions()
if err != nil {
log.WithError(err).Error("Failed to get execution payload transactions")
return
}
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(txs),
})
if !blk.IsBlinded() {
txs, err := p.Transactions()
if err != nil {
log.WithError(err).Error("Failed to get execution payload transactions")
return
}
log = log.WithField("txCount", len(txs))
}
if p.GasLimit() != 0 {
log = log.WithField("gasUtilized", float64(p.GasUsed())/float64(p.GasLimit()))
}