Add X-timeout-ms header #817
Open
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.
📝 Summary
X-timeout-ms
HTTP header included in theget_header
request to specify the timeout set to the request. Used by the relay in order to determine if and how much delay it can add to the block production.⛱ Motivation and Context
We have encountered issues where a lower
get_header
request timeout resulted in only failures by the relays. This was caused as it's not uncommon for relays to delay the block creation in order to maximise the rewards. Relays on their end assume a default timeout in the range of 950-1000ms, so they adjust block production to that. However, reducing the HTTP request timeout does not reduce the delay they are using, resulting in failures to provide block header on time.On Obol's side we have talked about that with multiple relay providers and most of them agreed to include
X-timeout-ms
HTTP header in theget_header
HTTP request. Using this HTTP header and theDate-Milliseconds
HTTP header, relays can calculate the timeout - the latency and adjust their block production delay accordingly.✅ I have run these commands
make lint
make test-race
go mod tidy