Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure secondary registrations take place.. #263

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading