builder beacon apis for gloas - #17392
Open
james-prysm wants to merge 15 commits into
Open
Conversation
james-prysm
force-pushed
the
builder-rest-endpoints
branch
from
August 20, 2026 21:46
c223af1 to
fd8a063
Compare
terencechain
force-pushed
the
builder-rest-endpoints
branch
from
August 21, 2026 00:43
1166034 to
471bbd4
Compare
james-prysm
force-pushed
the
builder-rest-endpoints
branch
from
August 21, 2026 14:57
82b3ffd to
9018adc
Compare
james-prysm
marked this pull request as ready for review
August 21, 2026 14:57
syjn99
reviewed
Aug 24, 2026
syjn99
reviewed
Aug 24, 2026
james-prysm
force-pushed
the
builder-rest-endpoints
branch
from
August 24, 2026 16:49
f8ca32f to
606349a
Compare
james-prysm
force-pushed
the
builder-rest-endpoints
branch
3 times, most recently
from
August 25, 2026 18:33
4e9f1df to
cd0827a
Compare
4 tasks
syjn99
self-requested a review
August 26, 2026 05:16
syjn99
reviewed
Aug 26, 2026
syjn99
reviewed
Aug 26, 2026
james-prysm
force-pushed
the
builder-rest-endpoints
branch
3 times, most recently
from
August 26, 2026 18:48
6548fa4 to
cc476da
Compare
syjn99
self-requested a review
August 27, 2026 02:30
syjn99
reviewed
Aug 27, 2026
| func (s *Service) SubmitBuilderPreferences(ctx context.Context, proposerPubkey [48]byte, url string, req *ethpb.BuilderPreferencesRequest) error { | ||
| // SubmitBuilderPreferences forwards each entry to its own builder url concurrently, returning | ||
| // failure messages keyed by entry position. Nil entries are skipped; auth is forwarded unchanged. | ||
| func (s *Service) SubmitBuilderPreferences(ctx context.Context, entries []*ethpb.BuilderPreferencesEntry) map[int]string { |
Member
There was a problem hiding this comment.
func (s *Service) SubmitBuilderPreferences(ctx context.Context, entries []*ethpb.BuilderPreferencesEntry) []string {
ctx, span := trace.StartSpan(ctx, "builder.SubmitBuilderPreferences")
defer span.End()
var (
wg sync.WaitGroup
failures = make([]string, len(entries))
)
for i, e := range entries {
if e == nil {
continue
}
if len(e.GetUrl()) == 0 {
log.Warn("Skipping builder preferences entry with no builder url")
failures[i] = "builder url is required"
continue
}
wg.Add(1)
wg.Go(func() {
url := string(e.Url)
c, err := s.clientFor(url)
if err == nil {
req := ðpb.BuilderPreferencesRequest{
Preferences: ðpb.BuilderPreferences{MaxExecutionPayment: e.MaxExecutionPayment},
Auth: e.Auth,
}
err = c.SubmitBuilderPreferences(ctx, bytesutil.ToBytes48(e.ProposerPubkey), req)
}
if err != nil {
tracing.AnnotateError(span, err)
log.WithError(err).WithField("builder", logs.MaskCredentialsLogging(url)).Warn("Could not submit builder preferences")
failures[i] = "could not submit builder preferences: " + logs.MaskCredentialsLogging(err.Error())
}
})
}
wg.Wait()
return failures
}I don't think we need mutex here, as each entry owns its index so there's no concurrency issue. This looks much better to me, although it requires some changes at the caller side.
Also note that i and e can be safely used in goroutine as they are scoped in each iteration.
Contributor
Author
There was a problem hiding this comment.
removed in here but i think the failures still need a map
5504a1e
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
james-prysm
force-pushed
the
builder-rest-endpoints
branch
from
August 27, 2026 14:34
5504a1e to
217c971
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Feature
What does this PR do? Why is it needed?
adds
/eth/v4/validator/blocks/{slot}with aBuilderConfigbody and return the winning builder in theEth-Builder-Urlresponse header, per beacon-APIs #630.POST /eth/v1/validator/builder_preferencesto forward per-builder preference entries to their builders.The core logic is already there in grpc and this simply utilizes it, but needs to update protobuf for ssz.
there's also a few smaller issues on validation fixed
note: this pr does not hook up validator client to beacon node
Which issue(s) does this PR fix?
addresses ethereum/beacon-APIs#630
Other notes for review
Acknowledgements