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 |
…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)
bdcdaec to
fa389c9
Compare
Done |

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 outbound client for execution payload bids and block submission on the proposing path; additive and isolated in this PR but correctness will matter once wired into the validator client.
Overview
Adds a new
builder:restGradle module with an OkHttp-based Staked Builder API client aligned with builder-specs#138.StakedBuilderClientexposes three async operations: fetch execution payload bids (optionalSignedRequestAuthJSON body vs empty POST), submit builder preferences (JSON), and submit signed beacon blocks (SSZapplication/octet-stream). Shared plumbing includesBuilderApiMethodpath templates,AbstractBuilderRequestfor JSON/empty/octet-stream POSTs,ResponseHandlerfor status codes (200/202/204 vs 4xx/5xx →BuilderClientException), andEth-Consensus-Versionheaders from the spec milestone.OkHttpStakedBuilderClientwraps the per-endpoint handlers on anAsyncRunner. Gloas-milestone MockWebServer integration tests cover success paths, request shape, and error handling. The parentbuildermodule is included insettings.gradlewith jar packaging disabled.Reviewed by Cursor Bugbot for commit 26c5540. Bugbot is set up for automated code reviews on this repo. Configure here.