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

Add option to unblind bids from all relays. #166

Merged
merged 1 commit into from
Jan 8, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dev:
- start validator registrations randomly in middle 80% of each epoch, to avoid overloading relays
- reduce CPU and memory requirements for refreshing validator information
- implement exclusion list for builders
- add option to attempt unblinding of payloads from all contacted relays

1.7.6:
- add User-Agent header to HTTP requests
Expand Down
7 changes: 7 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ graffiti:
static:
value: 'My graffiti'

# beaconblockproposer provides control of the beacon block proposal process.
beaconblockproposer:
# If unblind-from-all-relays is true then Vouch will use all relays that it asked for blocks to unblind the
# selected bid. This can potentially increase the reliability of obtaining an unblinded block, but will increment
# failures in the eth_builder_client_operations_total metric for the relays that do not know of the bid.
unblind-from-all-relays: false

# submitter submits data to beacon nodes. If not present the nodes in beacon-node-address above will be used.
submitter:
# style can currently only be 'multinode'
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ func startSigningServices(ctx context.Context,
standardbeaconblockproposer.WithRANDAORevealSigner(signerSvc.(signer.RANDAORevealSigner)),
standardbeaconblockproposer.WithBeaconBlockSigner(signerSvc.(signer.BeaconBlockSigner)),
standardbeaconblockproposer.WithBlobSidecarSigner(signerSvc.(signer.BlobSidecarSigner)),
standardbeaconblockproposer.WithUnblindFromAllRelays(viper.GetBool("beaconblockproposer.unblind-from-all-relays")),
)
if err != nil {
return nil, nil, nil, nil, errors.Wrap(err, "failed to start beacon block proposer service")
Expand Down
8 changes: 8 additions & 0 deletions services/beaconblockproposer/standard/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type parameters struct {
randaoRevealSigner signer.RANDAORevealSigner
beaconBlockSigner signer.BeaconBlockSigner
blobSidecarSigner signer.BlobSidecarSigner
unblindFromAllRelays bool
}

// Parameter is the interface for service parameters.
Expand Down Expand Up @@ -146,6 +147,13 @@ func WithBlobSidecarSigner(signer signer.BlobSidecarSigner) Parameter {
})
}

// WithUnblindFromAllRelays will unblind blocks from all relays if set.
func WithUnblindFromAllRelays(unblindFromAll bool) Parameter {
return parameterFunc(func(p *parameters) {
p.unblindFromAllRelays = unblindFromAll
})
}

// parseAndCheckParameters parses and checks parameters to ensure that mandatory parameters are present and correct.
func parseAndCheckParameters(params ...Parameter) (*parameters, error) {
parameters := parameters{
Expand Down
12 changes: 9 additions & 3 deletions services/beaconblockproposer/standard/propose.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,15 @@ func (s *Service) proposeBlockWithAuction(ctx context.Context,
return auctionResultFailedCanTryWithout
}

// Select the relays with the block we need that are capable of unblinding the block.
providers := make([]builderclient.UnblindedProposalProvider, 0, len(auctionResults.Providers))
for _, provider := range auctionResults.Providers {
// Select the relays to unblind the proposal.
providers := make([]builderclient.UnblindedProposalProvider, 0, len(auctionResults.AllProviders))
var unblindingCandidates []builderclient.BuilderBidProvider
if s.unblindFromAllRelays {
unblindingCandidates = auctionResults.AllProviders
} else {
unblindingCandidates = auctionResults.Providers
}
for _, provider := range unblindingCandidates {
unblindedProposalProvider, isProvider := provider.(builderclient.UnblindedProposalProvider)
if !isProvider {
log.Warn().Str("provider", provider.Name()).Msg("Auctioneer cannot unblind the proposal")
Expand Down
2 changes: 2 additions & 0 deletions services/beaconblockproposer/standard/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type Service struct {
randaoRevealSigner signer.RANDAORevealSigner
beaconBlockSigner signer.BeaconBlockSigner
blobSidecarSigner signer.BlobSidecarSigner
unblindFromAllRelays bool
}

// module-wide log.
Expand Down Expand Up @@ -82,6 +83,7 @@ func New(ctx context.Context, params ...Parameter) (*Service, error) {
randaoRevealSigner: parameters.randaoRevealSigner,
beaconBlockSigner: parameters.beaconBlockSigner,
blobSidecarSigner: parameters.blobSidecarSigner,
unblindFromAllRelays: parameters.unblindFromAllRelays,
}

return s, nil
Expand Down