Honour the configured timeout when submitting validator registrations. - #432
Open
ThomasDalla wants to merge 1 commit into
Open
Honour the configured timeout when submitting validator registrations.#432ThomasDalla wants to merge 1 commit into
ThomasDalla wants to merge 1 commit into
Conversation
Validator registrations are submitted with a per-call timeout of one second per registration. The intent, per the comment, is to wait longer than usual for large batches, but the per-call timeout cannot do this: go-builder-client sets http.Client.Timeout from the configured timeout, which is a hard ceiling on the request regardless of any context deadline, so the effective budget is min(configured, 1s x count). The formula can only ever shorten the deadline. As a result builderclient.submitvalidatorregistrations.timeout, optionally overridden per relay, is honoured for every other builder call and ignored for this one. Submissions of fewer registrations than the configured timeout in seconds are capped below it: a single registration is given one second. This is most visible to operators who share a relay setup through the validator registrations endpoint, where registrations are forwarded a handful at a time and relays that are slow to respond routinely miss the deadline. Leave the per-call timeout unset so that the configured timeout applies. Batches large enough for the formula to exceed the configured timeout are unaffected, as the client's own timeout already clamped them.
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.
Validator registrations are submitted with a per-call timeout of one second per registration:
The comment above it says the intent is to wait longer than usual, because some relays process
registrations sequentially. The per-call timeout cannot do that.
go-builder-clientbuilds eachrelay's
http.ClientwithTimeout: parameters.timeout— the value resolved frombuilderclient.submitvalidatorregistrations, optionally overridden per relay — andhttp.Client.Timeoutis an absolute ceiling on the whole request, independent of any contextdeadline. The per-call value is applied on top of that as a context deadline, so the effective
budget is
min(configured, 1s × count). The formula can only ever shorten the deadline.Two consequences:
builderclient.submitvalidatorregistrations.timeoutis honoured for every other builder calland ignored for this one.
registration gets one second.
Measured against a
httptestserver that sleeps 4s, to confirm the direction of the clamp:Common.TimeoutThe case where this actually bites is the shared MEV-boost passthrough: registrations arriving at
/eth/v1/builder/validatorsare forwarded a handful at a time, so each submission gets 1–4seconds. On a mainnet node forwarding for an SSV cluster I see a steady ~1% of submissions fail
with
context deadline exceededacross five relays, concentrated on the slower ones — with theconfigured timeout at 10s, which is never reached. The failures are invisible to the caller
(
ValidatorRegistrationsreturnsnil, nilregardless), so the only symptom is the log line.This change leaves the per-call timeout unset so the configured timeout applies. Batches large
enough for the formula to exceed the configured value are unaffected — the client's own timeout
already clamped them — so the crossover is
count == configured timeout in seconds, and theperiodic full-registration sweep keeps exactly the budget it has today.
The options construction is extracted into
registrationOptsso the absence of a per-calltimeout can be asserted in a test; a future reinstatement of the formula then fails CI rather than
silently restoring a one-second deadline.