mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 11:32:09 +00:00
ad680d3417
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
29 lines
908 B
Go
29 lines
908 B
Go
package sync
|
|
|
|
import (
|
|
"github.com/pkg/errors"
|
|
"github.com/prysmaticlabs/prysm/v3/config/params"
|
|
types "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives"
|
|
"github.com/prysmaticlabs/prysm/v3/time/slots"
|
|
)
|
|
|
|
// This routine broadcasts all known BLS changes at the Capella fork.
|
|
func (s *Service) broadcastBLSChanges(currSlot types.Slot) error {
|
|
capellaSlotStart, err := slots.EpochStart(params.BeaconConfig().CapellaForkEpoch)
|
|
if err != nil {
|
|
return errors.Wrap(err, "unable to compute Capella slot start")
|
|
}
|
|
if currSlot == capellaSlotStart {
|
|
changes, err := s.cfg.blsToExecPool.PendingBLSToExecChanges()
|
|
if err != nil {
|
|
return errors.Wrap(err, "could not get BLS to execution changes")
|
|
}
|
|
for _, ch := range changes {
|
|
if err := s.cfg.p2p.Broadcast(s.ctx, ch); err != nil {
|
|
return errors.Wrap(err, "could not broadcast BLS to execution changes.")
|
|
}
|
|
}
|
|
}
|
|
return nil
|
|
}
|