diff --git a/operator/duties/proposer.go b/operator/duties/proposer.go index 373625d7e7..cbfa6ae150 100644 --- a/operator/duties/proposer.go +++ b/operator/duties/proposer.go @@ -3,6 +3,7 @@ package duties import ( "context" "fmt" + genesisspectypes "github.com/ssvlabs/ssv-spec-pre-cc/types" "time" eth2apiv1 "github.com/attestantio/go-eth2-client/api/v1" @@ -134,6 +135,17 @@ func (h *ProposerHandler) processExecution(epoch phase0.Epoch, slot phase0.Slot) return } + if !h.network.PastAlanForkAtEpoch(h.network.Beacon.EstimatedEpochAtSlot(slot)) { + toExecute := make([]*genesisspectypes.Duty, 0, len(duties)*2) + for _, d := range duties { + if h.shouldExecute(d) { + toExecute = append(toExecute, h.toGenesisSpecDuty(d, genesisspectypes.BNRoleProposer)) + } + } + + h.dutiesExecutor.ExecuteGenesisDuties(h.logger, toExecute) + return + } // range over duties and execute toExecute := make([]*spectypes.ValidatorDuty, 0, len(duties)) for _, d := range duties { @@ -191,6 +203,15 @@ func (h *ProposerHandler) toSpecDuty(duty *eth2apiv1.ProposerDuty, role spectype } } +func (h *ProposerHandler) toGenesisSpecDuty(duty *eth2apiv1.ProposerDuty, role genesisspectypes.BeaconRole) *genesisspectypes.Duty { + return &genesisspectypes.Duty{ + Type: role, + PubKey: duty.PubKey, + Slot: duty.Slot, + ValidatorIndex: duty.ValidatorIndex, + } +} + func (h *ProposerHandler) shouldExecute(duty *eth2apiv1.ProposerDuty) bool { currentSlot := h.network.Beacon.EstimatedCurrentSlot() // execute task if slot already began and not pass 1 slot