Skip to content

Commit

Permalink
Merge pull request #264 from attestantio/backfill-secondary-registrat…
Browse files Browse the repository at this point in the history
…ions

Ensure secondary registrations take place
  • Loading branch information
Bez625 authored Oct 15, 2024
2 parents d71b773 + ce162c1 commit eb123f0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ dev:
- use multisign for contributions and proofs with enabled accounts
- use multisign for signing slot selections with enabled accounts
- standardise provider address format across client and strategy operations
- ensure that secondary validator registrations take place for all accounts

1.9.1:
- ensure that secondary validator registrations take place for all accounts

1.9.0:
- allow Vouch to start with some consensus nodes unavailable
Expand Down
20 changes: 15 additions & 5 deletions services/blockrelay/standard/submitvalidatorregistrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,15 @@ func (s *Service) submitValidatorRegistrationsForAccounts(ctx context.Context,
consensusRegistrations := make([]*consensusapi.VersionedSignedValidatorRegistration, 0, len(accounts))
relayRegistrations := make(map[string][]*builderapi.VersionedSignedValidatorRegistration)
for _, account := range accounts {
if err := s.generateValidatorRegistrationsForAccount(ctx, account, controlledValidators, consensusRegistrations, relayRegistrations); err != nil {
accountConsensusRegistrations, err := s.generateValidatorRegistrationsForAccount(ctx,
account,
controlledValidators,
relayRegistrations,
)
if err != nil {
return err
}
consensusRegistrations = append(consensusRegistrations, accountConsensusRegistrations...)
}
span.AddEvent("Generated registrations")

Expand Down Expand Up @@ -155,21 +161,25 @@ func (s *Service) submitValidatorRegistrationsForAccounts(ctx context.Context,
func (s *Service) generateValidatorRegistrationsForAccount(ctx context.Context,
account e2wtypes.Account,
controlledValidators map[phase0.BLSPubKey]struct{},
consensusRegistrations []*consensusapi.VersionedSignedValidatorRegistration,
relayRegistrations map[string][]*builderapi.VersionedSignedValidatorRegistration,
) error {
) (
[]*consensusapi.VersionedSignedValidatorRegistration,
error,
) {
pubkey := util.ValidatorPubkey(account)
controlledValidators[pubkey] = struct{}{}

proposerConfig, err := s.executionConfig.ProposerConfig(ctx, account, pubkey, s.fallbackFeeRecipient, s.fallbackGasLimit)
if err != nil {
return errors.Wrap(err, "No proposer configuration; cannot submit validator registrations")
return nil, errors.Wrap(err, "No proposer configuration; cannot submit validator registrations")
}
if proposerConfig.FeeRecipient.IsZero() {
s.log.Error().Stringer("validator", pubkey).Msg("Received 0 execution address for validator registration; using fallback")
proposerConfig.FeeRecipient = s.fallbackFeeRecipient
}

consensusRegistrations := make([]*consensusapi.VersionedSignedValidatorRegistration, 0, len(proposerConfig.Relays))

for index, relay := range proposerConfig.Relays {
relayRegistration, consensusRegistration, err := s.generateValidatorRegistrationForRelay(ctx, account, pubkey, relay)
if err != nil {
Expand All @@ -195,7 +205,7 @@ func (s *Service) generateValidatorRegistrationsForAccount(ctx context.Context,
}
}

return nil
return consensusRegistrations, nil
}

func (s *Service) submitRelayRegistrations(ctx context.Context,
Expand Down

0 comments on commit eb123f0

Please sign in to comment.