mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Capella: validator log withdrawals (#11657)
* Capella: validator log withdrawals * Capella: validator log withdrawals
This commit is contained in:
@@ -145,7 +145,7 @@ func (v *validator) ProposeBlock(ctx context.Context, slot types.Slot, pubKey [f
|
||||
trace.Int64Attribute("numAttestations", int64(len(blk.Block().Body().Attestations()))),
|
||||
)
|
||||
|
||||
if blk.Version() == version.Bellatrix {
|
||||
if blk.Version() >= version.Bellatrix {
|
||||
p, err := blk.Block().Body().Execution()
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to get execution payload")
|
||||
@@ -167,6 +167,14 @@ func (v *validator) ProposeBlock(ctx context.Context, slot types.Slot, pubKey [f
|
||||
if p.GasLimit() != 0 {
|
||||
log = log.WithField("gasUtilized", float64(p.GasUsed())/float64(p.GasLimit()))
|
||||
}
|
||||
if blk.Version() >= version.Capella && !blk.IsBlinded() {
|
||||
withdrawals, err := p.Withdrawals()
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to get execution payload withdrawals")
|
||||
return
|
||||
}
|
||||
log = log.WithField("withdrawalCount", len(withdrawals))
|
||||
}
|
||||
}
|
||||
|
||||
blkRoot := fmt.Sprintf("%#x", bytesutil.Trunc(blkResp.BlockRoot))
|
||||
|
||||
@@ -561,6 +561,30 @@ func testProposeBlock(t *testing.T, graffiti []byte) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "capella",
|
||||
block: ðpb.GenericBeaconBlock{
|
||||
Block: ðpb.GenericBeaconBlock_Capella{
|
||||
Capella: func() *ethpb.BeaconBlockCapella {
|
||||
blk := util.NewBeaconBlockCapella()
|
||||
blk.Block.Body.Graffiti = graffiti
|
||||
return blk.Block
|
||||
}(),
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "capella blind block",
|
||||
block: ðpb.GenericBeaconBlock{
|
||||
Block: ðpb.GenericBeaconBlock_BlindedCapella{
|
||||
BlindedCapella: func() *ethpb.BlindedBeaconBlockCapella {
|
||||
blk := util.NewBlindedBeaconBlockCapella()
|
||||
blk.Block.Body.Graffiti = graffiti
|
||||
return blk.Block
|
||||
}(),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user