Skip to content

Commit

Permalink
Merge pull request #263 from attestantio/ensure-secondary-registrations
Browse files Browse the repository at this point in the history
Ensure secondary registrations take place..
  • Loading branch information
Bez625 authored Oct 15, 2024
2 parents 5c4facc + b8eaf3c commit d9ab64d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
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
- allow Vouch to act as an MEV-boost client for non-Vouch validators
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ import (
)

// ReleaseVersion is the release version for the code.
var ReleaseVersion = "1.9.0"
var ReleaseVersion = "1.9.1"

func main() {
exitCode := main2()
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 d9ab64d

Please sign in to comment.