Continued from #32061.
This is a major component of removing libevent as a dependency of the project, by replacing the HTTP server used for RPC and REST with one implemented entirely within the Bitcoin Core codebase. The new HTTPServer class runs its own I/O thread, handling socket connections with code based on #30988, but tailored specifically for HTTP.
Commit strategy:
- Isolate the existing libevent-based HTTP server in a namespace
http_libevent - Implement HTTP in a new namespace
http_bitcoin(classes likeHTTPRequest,HTTPClient, etc...) - Switch bitcoind from the libevent server to the new server
- Clean up (delete
http_libevent)
Fuzz testing
libfuzzer
- 24 hours x8 cores at b75223bfb3
- generated corpus: https://github.com/pinheadmz/qa-assets/tree/httprequest-PR32061-b75223bfb3
- coverage report: https://thebitcoinblockclock.com/demo/libfuzzer_PR32061_b75223bfb3/
fuzzamoto
- 24 hours x8 cores at b75223bfb3 using an HTTP dictionary
- coverage report: https://thebitcoinblockclock.com/demo/fuzzamoto_PR32061_b75223b/
Integration testing:
I am testing the new HTTP server by forking projects that integrate with bitcoin via HTTP and running their integration tests with bitcoind built from this branch (on Github actions). I will continue adding integrations over time, and re-running these CI tests as this branch gets rebased: