Skip to content

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

Merged
luisschwab merged 6 commits intobitcoindevkit:masterfrom
oleonardolima:feat/add-new-minireq-client
Apr 30, 2026
Merged

refactor(client)!: use bitreq for both BlockingClient and AsyncClient#137
luisschwab merged 6 commits intobitcoindevkit:masterfrom
oleonardolima:feat/add-new-minireq-client

Conversation

@oleonardolima
Copy link
Copy Markdown
Collaborator

@oleonardolima oleonardolima commented Oct 21, 2025

Closes #136
Closes #183
Closes #184
Closes #185

Description

The PR remove the usage of both minreq and reqwest, relying on only in bitreq as the HTTP client for both BlockingClient and AsyncClient.

It also does some minimal refactor in BlockingClient to remove some of the duplicated code, more refactoring and organization could be done in a follow-up.

Notes to the reviewers

Let me know in the comments if you see any improvements feature-wise, or on the usage of bitreq API.

Changelog notice

TBD

Checklists

All Submissions:

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

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

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 6 times, most recently 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
Copy Markdown
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.

Comment thread src/blocking.rs Outdated
@oleonardolima oleonardolima force-pushed the feat/add-new-minireq-client branch 4 times, most recently from 4c79f38 to 1d81b39 Compare April 30, 2026 00:32
- update the `BlockingClient` to use `bitreq` instead of `minreq`
@oleonardolima oleonardolima force-pushed the feat/add-new-minireq-client branch 3 times, most recently from d984950 to 86aeb2e Compare April 30, 2026 01:27
- update the `AsyncClient` to use `bitreq` instead of `reqwest`
- refactors the blocking client http get/post methods, remove duplicated
  error handling and bitreq calls.
- add new `build_request` to build raw `Requests` with all required
  data, such as: timeout, proxy, headers.
- introduce new `build_request` to build raw `Request`s with all
  required fields, such as: timeout, proxy and headers.
- rename the `post_request_bytes` to simple `post_request`.
@oleonardolima oleonardolima force-pushed the feat/add-new-minireq-client branch from 86aeb2e to 2ec119b Compare April 30, 2026 01:40
@oleonardolima oleonardolima moved this from In Progress to Needs Review in BDK Chain Apr 30, 2026
@oleonardolima oleonardolima requested a review from tnull April 30, 2026 13:15
@oleonardolima oleonardolima marked this pull request as ready for review April 30, 2026 13:15
Copy link
Copy Markdown
Member

@luisschwab luisschwab left a comment

Choose a reason for hiding this comment

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

tACK 2ec119b

@luisschwab luisschwab merged commit 629cce5 into bitcoindevkit:master Apr 30, 2026
26 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in BDK Chain Apr 30, 2026
@oleonardolima oleonardolima deleted the feat/add-new-minireq-client branch April 30, 2026 19:21
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: Done

5 participants