feat: add esplora client timeout option - #1119
Open
Arowolokehinde wants to merge 1 commit into
Open
Arowolokehinde wants to merge 1 commit into
Arowolokehinde wants to merge 1 commit into
Conversation
EsploraClient::new had no way to set a request timeout: it only forwarded proxy to esplora_client::Builder, leaving the builder's timeout at None. A server that accepts a connection then stops responding could block the calling thread indefinitely. Add an optional timeout, as Option<u8> seconds to match ElectrumClient::new. It defaults to None so callers opt in and existing behavior is unchanged, and the docs note that a request can block indefinitely when it is unset.
j-kon
approved these changes
Sep 21, 2026
This branch has not been deployed
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.
Description
Closes #1109
EsploraClient::newhad no way to set a request timeout: proxy was theonly setting it applied to
esplora_client::Builder, leaving thebuilder's timeout at
None. A server that accepts a connection then stopsresponding could block the calling thread indefinitely.
This adds an optional
timeout(seconds), mirroringElectrumClient::new. Itdefaults to
None, so callers opt in.Notes to the reviewers
Noneas suggested, so nothing changes for existing callers.Added a docstring note for the hang risk when it's unset.
Option<u8>seconds matchesElectrumClient.replies. With
timeoutunset the call never returned; withtimeout = 3itraised
Minreq("the timeout of the request was reached")after 3.01s —catchable rather than a hang.
changelog: added?Documentation
esplora_client::Builder::timeoutChecklists
All Submissions:
cargo fmtandcargo clippybefore committingchangelog:*labelNew Features: