Staked Builder API REST Client - #11026
Conversation
0baf796 to
71a3287
Compare
5c4ae8d to
68b3483
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 68b3483. Configure here.
75a1255 to
f07ae53
Compare
921918d to
1f5f5d0
Compare
6ed7989 to
f48c9d8
Compare
|
|
would be good to add the references like OpenApiIntegrationTest does so that we can easily see the api definitions... |
f48c9d8 to
01d69a4
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit b1cde23. Configure here.
|
@tbenr fixed the 5 points, will tackle testing one separately |
They will show eventually anyways when we pipe them through the Beacon API. |
|
just one minor thing: Eth-Consensus-Version presence is not tested in all methods |
bdcdaec to
fa389c9
Compare
Done |
ab1645e to
b5ffe69
Compare
…oas/ePBS Adds a new builder:rest Gradle submodule with an OkHttp-based REST client for the Staked Builder API defined in builder-specs PR Consensys#138. The module is self-contained with no wiring into existing Teku infrastructure yet. Files added: - BuilderClient interface (four Gloas builder endpoints) - BuilderApiMethod enum with {param} URL template substitution - BuilderIdentity record with JSON type definition and data wrapper - BuilderClientException for typed error handling (with HTTP status code) - ResponseHandler with per-status-code deserialization (200/202/204/400/401/500/503) - AbstractBuilderRequest base class (GET, postJson, postEmpty, postOctetStream helpers) - Four handler classes: GetBuilderIdentityRequest, GetExecutionPayloadBidRequest, SendBuilderPreferencesRequest, SendSignedBeaconBlockRequest - OkHttpBuilderClient wrapping handlers with AsyncRunner for SafeFuture responses - Integration tests using MockWebServer for all four handlers
…nt-Type - SendSignedBeaconBlockRequest now takes Spec and sends Eth-Consensus-Version header derived from the block's slot milestone; postOctetStream gains a headers overload to support this - postEmpty no longer sets Content-Type: application/json on a zero-length body; uses null MediaType so no Content-Type is sent (empty body is not valid JSON and would cause builders to return 400)
b5ffe69 to
246a35a
Compare

PR Description
Client for the builder rest api as per ethereum/builder-specs#138 . There is a repetition but I found it difficult to create a generic rest client implementation that both the VC client and builder client can use.
Fixed Issue(s)
related to #10822
Documentation
doc-change-requiredlabel to this PR if updates are required.Changelog
Note
Medium Risk
New client code will carry signed beacon blocks and execution payload bids once wired into proposing; mistakes in encoding, headers, or error handling could affect block production, but this PR is an isolated library with no production wiring yet.
Overview
Adds a new
builder:restGradle module that implements an OkHttp-based client for the Staked Builder API (Gloas).StakedBuilderClientexposes three async operations: fetch execution payload bids (optional signed auth in JSON body vs empty POST), submit builder preferences (JSON), and submit signed beacon blocks (SSZapplication/octet-stream). Shared plumbing includesBuilderApiMethodpath templates,ResponseHandlerstatus mapping toBuilderClientException, andAbstractBuilderRequestfor JSON/empty/octet-stream POSTs withEth-Consensus-Versionheaders.OkHttpStakedBuilderClientdelegates to per-endpoint request classes on anAsyncRunner. MockWebServer integration tests cover success paths, request shape, and 4xx/5xx errors. The parentbuilderproject is included insettings.gradlewith jar packaging disabled for the aggregator.Reviewed by Cursor Bugbot for commit 246a35a. Bugbot is set up for automated code reviews on this repo. Configure here.