mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-09 03:01:19 +00:00
abc81e6dde
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
30 lines
973 B
Go
30 lines
973 B
Go
package validator
|
|
|
|
import (
|
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/state"
|
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/interfaces"
|
|
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
|
"github.com/prysmaticlabs/prysm/v4/runtime/version"
|
|
)
|
|
|
|
// Sets the bls to exec data for a block.
|
|
func (vs *Server) setBlsToExecData(blk interfaces.SignedBeaconBlock, headState state.BeaconState) {
|
|
if blk.Version() < version.Capella {
|
|
return
|
|
}
|
|
if err := blk.SetBLSToExecutionChanges([]*ethpb.SignedBLSToExecutionChange{}); err != nil {
|
|
log.WithError(err).Error("Could not set bls to execution data in block")
|
|
return
|
|
}
|
|
changes, err := vs.BLSChangesPool.BLSToExecChangesForInclusion(headState)
|
|
if err != nil {
|
|
log.WithError(err).Error("Could not get bls to execution changes")
|
|
return
|
|
} else {
|
|
if err := blk.SetBLSToExecutionChanges(changes); err != nil {
|
|
log.WithError(err).Error("Could not set bls to execution changes")
|
|
return
|
|
}
|
|
}
|
|
}
|