Skip to content

refactor(client)!: use bitreq for both BlockingClient and AsyncClient#137

Draft
oleonardolima wants to merge 2 commits intobitcoindevkit:masterfrom
oleonardolima:feat/add-new-minireq-client
Draft

refactor(client)!: use bitreq for both BlockingClient and AsyncClient#137
oleonardolima wants to merge 2 commits intobitcoindevkit:masterfrom
oleonardolima:feat/add-new-minireq-client

Conversation

@oleonardolima
Copy link
Collaborator

No description provided.

@oleonardolima oleonardolima force-pushed the feat/add-new-minireq-client branch from 293c886 to 7d21272 Compare October 21, 2025 21:43
@coveralls
Copy link

coveralls commented Oct 21, 2025

Pull Request Test Coverage Report for Build 18927210446

Details

  • 8 of 9 (88.89%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 87.216%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/blocking.rs 7 8 87.5%
Totals Coverage Status
Change from base Build 18851490484: 0.0%
Covered Lines: 1037
Relevant Lines: 1189

💛 - Coveralls

@oleonardolima oleonardolima force-pushed the feat/add-new-minireq-client branch 3 times, most recently from c03e04f to fd63f37 Compare October 21, 2025 21:59
@oleonardolima oleonardolima self-assigned this Oct 21, 2025
@oleonardolima oleonardolima force-pushed the feat/add-new-minireq-client branch from fd63f37 to 4b0dbd0 Compare October 21, 2025 22:04
@oleonardolima oleonardolima force-pushed the feat/add-new-minireq-client branch 2 times, most recently from 6ba4aad to 5b989db Compare October 30, 2025 01:42
@oleonardolima oleonardolima changed the title wip(feat(minireq)): add minireq/bitreq HTTP client blocking support wip(feat(bitreq)): switch from minreq/reqwest to bitreq HTTP client Nov 19, 2025
@oleonardolima oleonardolima added enhancement New feature or request summit labels Nov 19, 2025
@oleonardolima oleonardolima moved this to In Progress in BDK Chain Nov 19, 2025
@tnull
Copy link
Contributor

tnull commented Feb 10, 2026

@oleonardolima Any update here? The rust-esplora-client might be the last thing that keeps reqwest (and sub-dependencies) in our tree. If you don't have time to finish this, should I take this one over?

@oleonardolima
Copy link
Collaborator Author

@oleonardolima Any update here? The rust-esplora-client might be the last thing that keeps reqwest (and sub-dependencies) in our tree. If you don't have time to finish this, should I take this one over?

@tnull I didn't follow the recent changes for the latest bitreq release, do you deem it production-ready and with the feature-parity that we need from reqwest here ?

@tnull
Copy link
Contributor

tnull commented Feb 11, 2026

@oleonardolima Any update here? The rust-esplora-client might be the last thing that keeps reqwest (and sub-dependencies) in our tree. If you don't have time to finish this, should I take this one over?

@tnull I didn't follow the recent changes for the latest bitreq release, do you deem it production-ready and with the feature-parity that we need from reqwest here ?

Yes, we made good progress there (full/fixed async support, added a Url type for parsing, superseding url::Url, etc). Also replaced other HTTP clients in a bunch of places (LDK Node, LDK, alpenlabs/bitcoind-async-client etc). So would be great to move forward with this here, too!

@oleonardolima oleonardolima force-pushed the feat/add-new-minireq-client branch 5 times, most recently from 26dfb35 to e9d41e0 Compare February 24, 2026 13:58
- update the `BlockingClient` to use `bitreq` instead of `minreq`
- update the `AsyncClient` to use `bitreq` instead of `reqwest`
@oleonardolima oleonardolima force-pushed the feat/add-new-minireq-client branch from e9d41e0 to 1337d8e Compare February 24, 2026 14:03
@oleonardolima oleonardolima changed the title wip(feat(bitreq)): switch from minreq/reqwest to bitreq HTTP client refactor(client)!: use bitreq for both BlockingClient and AsyncClient Feb 24, 2026
@oleonardolima
Copy link
Collaborator Author

oleonardolima commented Feb 24, 2026

@tnull I did an initial shot on this one, it's pretty straight-forward so far. However, there's still some API changes I'd like to do, mainly trying to unify it into a single client. Also, I didn't throughly tested it yet, specially in wasm environments.

Also, I'm wondering if it'd be best to wait for the ClientBuilder on bitreq, it's not a blocker though.

/// Perform a raw HTTP GET request with the given URI `path`.
pub fn get_request(&self, path: &str) -> Result<Request, Error> {
let mut request = minreq::get(format!("{}{}", self.url, path));
let mut request = bitreq::get(format!("{}{}", self.url, path));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, it's kind of unfortunate we don't have a Client for the blocking variant, as this means we'll establish a new connection for each request. Maybe we might first need to add it? I can give it a shot in some time this week, so this would be unblocked?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that'd be a good improvement.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants