Bump warp and begin axum migration (#9001)

- Bump `warp` to 0.4. This unifies `warp` and `axum` onto the same `http`, `hyper`, `h2`, `rustls`, etc versions.
- Create `axum_utils` which contain common functions and types
- Begins migration of all HTTP API servers from warp to axum


Co-Authored-By: Mac L <mjladson@pm.me>
This commit is contained in:
Mac L
2026-06-25 18:19:29 +04:00
committed by GitHub
parent a4c4cccf04
commit 8c2a909061
41 changed files with 1333 additions and 543 deletions

View File

@@ -8,7 +8,7 @@ edition = { workspace = true }
[dependencies]
bytes = { workspace = true }
eth2 = { workspace = true }
headers = "0.3.2"
headers = "0.4"
reqwest = { workspace = true }
safe_arith = { workspace = true }
serde = { workspace = true }

View File

@@ -1,9 +1,10 @@
use reqwest::StatusCode;
use warp::Rejection;
/// Convert from a "new" `http::StatusCode` to a `warp` compatible one.
pub fn convert(code: StatusCode) -> Result<warp::http::StatusCode, Rejection> {
code.as_u16().try_into().map_err(|e| {
crate::reject::custom_server_error(format!("bad status code {code:?} - {e:?}"))
})
/// Convert a `reqwest::StatusCode` to a `warp::http::StatusCode`.
///
/// In warp 0.4, both `reqwest` (0.12) and `warp` use the `http` v1 crate,
/// so `reqwest::StatusCode` and `warp::http::StatusCode` are the same type.
/// This function is retained for API compatibility but is now a no-op.
pub fn convert(code: StatusCode) -> Result<warp::http::StatusCode, warp::Rejection> {
Ok(code)
}