Is there an existing issue for this?
- I have searched the existing issues
Current behaviour
The new HTTP server (#35182) ignores Expect: 100-continue. curl/libcurl sends this header for POST bodies over 1 MiB and waits up to 1s for 100 Continue before sending the body anyway, so every such request is delayed by ~1 s.
RFC 9110 §10.1.1 requires an origin server receiving Expect: 100-continue to either send 100 Continue or an immediate final status. The previous libevent-based server sent 100 Continue.
Affected RPCs include submitblock (full blocks in hex exceed 1 MiB), large sendrawtransaction/submitpackage, big PSBTs and JSON-RPC batches. bitcoin-cli and most JSON-RPC libraries don't send Expect, and requests still succeed, just ~1 s later.
Expected behaviour
Follow RFC 9110 §10.1.1 and reply with 100 Continue or an immediate final status.
Steps to reproduce
python3 -c 'print("{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"echo\",\"params\":[\"" + "a"*2_000_000 + "\"]}")' > big.json
curl -v -u "$(cat ~/.bitcoin/regtest/.cookie)" --data-binary [@big](/bitcoin-bitcoin/contributor/big/).json http://127.0.0.1:18443/ -o /dev/null -w '%{time_total}\n'
v32.0rc3 output:
> Expect: 100-continue
>
* Done waiting for 100-continue
...
1.029281
v31.0 output:
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
...
0.052923
Relevant log output
No response
How did you obtain Bitcoin Core
Compiled from source
What version of Bitcoin Core are you using?
v32.0rc3
Operating system and version
Arch Linux, kernel 7.1.8-arch1-3
Machine specifications
No response