Execution Payload / Header Interface Wrappers (#11025)

* exec payload iface

* begin using iface

* use iface more

* build beacon

* builds

* txs field

* fix

* merge test

* pass

* test

* refactor

* fix up builder case

* gaz

* comments

* el test

* build

* no mask

* patch up

* exec wrap

* Terence feedback

* builds

* potuz suggestion

* exec data error

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Raul Jordan
2022-07-13 01:49:38 +00:00
committed by GitHub
parent 7c30533870
commit e01a898264
53 changed files with 845 additions and 378 deletions

View File

@@ -145,19 +145,24 @@ func (v *validator) ProposeBlock(ctx context.Context, slot types.Slot, pubKey [f
)
if blk.Version() == version.Bellatrix {
p, err := blk.Block().Body().ExecutionPayload()
p, err := blk.Block().Body().Execution()
if err != nil {
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)),
"payloadHash": fmt.Sprintf("%#x", bytesutil.Trunc(p.BlockHash())),
"parentHash": fmt.Sprintf("%#x", bytesutil.Trunc(p.ParentHash())),
"blockNumber": p.BlockNumber,
"txCount": len(p.Transactions),
"txCount": len(txs),
})
if p.GasLimit != 0 {
log = log.WithField("gasUtilized", float64(p.GasUsed)/float64(p.GasLimit))
if p.GasLimit() != 0 {
log = log.WithField("gasUtilized", float64(p.GasUsed())/float64(p.GasLimit()))
}
}