Skip to content

RPC backend fails against servers that send chunked responses #392

In review
libbitcoin/libbitcoin.github.io
#22

Description

@eynhaender

Describe the bug
With --client-type rpc, every request fails when the server sends its JSON-RPC responses with Transfer-Encoding: chunked:

The server replied with a chunked response which is not supported

bitcoincore_rpc::Client::new always uses jsonrpc's simple_http transport, which only reads Content-Length responses. Bitcoin Core is not affected, but servers that send chunked responses, such as libbitcoin-server's bitcoind-compatible endpoint, cannot be used.

To Reproduce

  1. Run an RPC server that sends chunked responses (e.g. libbitcoin-server with its [bitcoind] endpoint enabled).
  2. Configure a wallet with --client-type rpc --url http://127.0.0.1:<port> --basic-auth <user>:<pass>.
  3. Run wallet full_scan; it fails with the error above.

Expected behavior
The scan completes, as it does against Bitcoin Core. jsonrpc's minreq_http transport reads chunked responses, and bitcoincore-rpc 0.19 already enables it.

Build environment

  • BDK-CLI tag/commit: v4.0.0 and master 1c8026e
  • OS+version: Debian bookworm (rust:1-bookworm container)
  • Rust/Cargo version: 1.100.0
  • Rust/Cargo target: x86_64-unknown-linux-gnu

Additional context
The error comes from jsonrpc's simple_http transport, which bitcoincore-rpc's Client::new always uses. Its documentation describes it as "a minimal and non standard conforming HTTP 1.0 round-tripper"; it reads only Content-Length bodies. Chunked transfer encoding is HTTP/1.1, so it is not supported by design:

  • apoelstra/rust-jsonrpc#105 (2023): reported that simple_http doesn't support chunked encoding and named minreq as the workaround. The reporter closed it after finding the HTTP 1.0 note in the docs.
  • apoelstra/rust-jsonrpc#112 (2024): a chunked response surfaced as a confusing JSON decode error. The maintainers agreed it should stay unsupported ("not supported and different backend should be used") and asked for a clear error instead. That request is the source of the current message: "The server replied with a chunked response which is not supported".

Both repositories are now archived (rust-jsonrpc, rust-bitcoincore-rpc; development continues in rust-bitcoin/corepc), so a fix there is not expected. The supported path is the other transport jsonrpc already ships: minreq_http reads chunked and Content-Length responses, and bitcoincore-rpc 0.19 already enables it (jsonrpc = { features = ["minreq_http"] }). Using it only requires bdk-cli to construct the client with Client::from_jsonrpc over that transport instead of Client::new.

Activity

  1. added
    bug
    on Nov 23, 2026
  2. moved this from Todo to In Progress in BDK-CLIon Nov 23, 2026
  3. added
    enhancement
    and removed
    bug
    on Nov 23, 2026
  4. added theissue type on Nov 23, 2026
  5. added this to the CLI 4.1.0 milestone on Nov 23, 2026
  6. moved this from In Progress to Done in BDK-CLIon Nov 23, 2026
  7. moved this from Done to Ready to Review in BDK-CLIon Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Projects

  • Status
    Ready to Review

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions