Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,7 @@ async-recursion = "1.1.0"
async-stream = "0.3.3"
async-trait = "0.1.79"
asynchronous-codec = "0.7.0"
# TODO(victork): finalise migration to hyper 1.x
axum_08 = { package = "axum", version = "0.8" }
axum = "0.8"
base64 = "0.13.0"
bench_tools.path = "crates/bench_tools"
bitvec = "1.0.1"
Expand Down Expand Up @@ -264,13 +263,11 @@ futures-util = "0.3.21"
glob = "0.3.1"
google-cloud-storage = "0.22.1"
hex = "0.4.3"
http = "0.2.8"
http-body = "0.4.5"
http = "1.1"
http-body-util = "0.1"
http_1 = { package = "http", version = "1.1" }
human_bytes = "0.4.3"
hyper = "1.8"
hyper-util = "0.1.19"
hyper_1 = { package = "hyper", version = "1.8" }
indexmap = "2.1.0"
indoc = "2.0.5"
insta = "1.29.0"
Expand Down Expand Up @@ -375,8 +372,7 @@ tokio-test = "0.4.4"
tokio-util = "0.7.13"
toml = "0.8"
toml_test_utils.path = "toml_test_utils"
tower = { package = "tower", version = "0.4.13" }
tower_05 = { package = "tower", version = "0.5.2" }
tower = "0.5.2"
tracing = "0.1.37"
tracing-subscriber = "0.3.16"
tracing-test = "0.2"
Expand Down
4 changes: 2 additions & 2 deletions crates/apollo_batcher_types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ thiserror.workspace = true
[dev-dependencies]
apollo_infra_utils = { workspace = true, features = ["testing"] }
apollo_storage = { workspace = true, features = ["testing"] }
axum_08.workspace = true
axum.workspace = true
mockall.workspace = true
serde_json.workspace = true
starknet_api = { workspace = true, features = ["testing"] }
tokio = { workspace = true, features = ["full", "test-util"] }
tower_05.workspace = true
tower.workspace = true
2 changes: 1 addition & 1 deletion crates/apollo_http_server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ apollo_infra_utils.workspace = true
apollo_metrics.workspace = true
apollo_proc_macros.workspace = true
async-trait.workspace = true
axum_08.workspace = true
axum.workspace = true
blockifier_reexecution.workspace = true
blockifier_test_utils = { workspace = true, optional = true }
futures.workspace = true
Expand Down
5 changes: 2 additions & 3 deletions crates/apollo_http_server/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ use apollo_gateway_types::deprecated_gateway_error::{
StarknetErrorCode,
};
use apollo_gateway_types::errors::GatewayError;
// TODO(victork): finalise migration to hyper 1.x
use axum_08::http::StatusCode;
use axum_08::response::{IntoResponse, Response};
use axum::http::StatusCode;
use axum::response::{IntoResponse, Response};
use regex::Regex;
use starknet_api::compression_utils::CompressionError;
use thiserror::Error;
Expand Down
9 changes: 4 additions & 5 deletions crates/apollo_http_server/src/http_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ use apollo_infra::component_definitions::ComponentStarter;
use apollo_infra_utils::type_name::short_type_name;
use apollo_proc_macros::sequencer_latency_histogram;
use async_trait::async_trait;
// TODO(victork): finalise migration to hyper 1.x
use axum_08::http::HeaderMap;
use axum_08::routing::{get, post};
use axum_08::{Extension, Json, Router};
use axum::http::HeaderMap;
use axum::routing::{get, post};
use axum::{serve, Extension, Json, Router};
use blockifier_reexecution::serde_utils::deserialize_transaction_json_to_starknet_api_tx;
use serde::de::Error;
use starknet_api::rpc_transaction::RpcTransaction;
Expand Down Expand Up @@ -112,7 +111,7 @@ impl HttpServer {

// Create a server that runs forever.
let listener = TcpListener::bind(&addr).await?;
Ok(axum_08::serve(listener, app).await?)
Ok(serve(listener, app).await?)
}

// TODO(Yael): consider supporting both formats in the same endpoint if possible.
Expand Down
9 changes: 4 additions & 5 deletions crates/apollo_http_server/src/http_server_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ use apollo_gateway_types::gateway_types::{
};
use apollo_infra::component_client::ClientError;
use apollo_proc_macros::unique_u16;
// TODO(victork): finalise migration to hyper 1.x
use axum_08::body::Bytes;
use axum_08::http::StatusCode;
use axum_08::response::{IntoResponse, Response};
use axum_08::Json;
use axum::body::Bytes;
use axum::http::StatusCode;
use axum::response::{IntoResponse, Response};
use axum::Json;
use http_body_util::BodyExt;
use rstest::rstest;
use serde_json::Value;
Expand Down
4 changes: 2 additions & 2 deletions crates/apollo_infra/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ apollo_metrics.workspace = true
async-trait.workspace = true
bytes.workspace = true
derive_more = { workspace = true, features = ["display", "from_str"] }
http.workspace = true
http-body-util.workspace = true
http_1.workspace = true
hyper = { workspace = true, features = ["server"] }
hyper-util = { workspace = true, features = ["client-legacy", "server-auto", "tokio"] }
hyper_1 = { workspace = true, features = ["server"] }
metrics-exporter-prometheus.workspace = true
rand.workspace = true
rstest.workspace = true
Expand Down
3 changes: 1 addition & 2 deletions crates/apollo_infra/src/component_client/definitions.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// TODO(victork): finalise migration to hyper 1.x
use http_1::StatusCode;
use http::StatusCode;
use serde::de::DeserializeOwned;
use serde::Serialize;
use thiserror::Error;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ use std::time::Duration;
use apollo_config::dumping::{ser_param, SerializeConfig};
use apollo_config::{ParamPath, ParamPrivacyInput, SerializedParam};
use async_trait::async_trait;
// TODO(victork): finalise migration to hyper 1.x
use bytes::Bytes;
use http_1::header::CONTENT_TYPE;
use http_1::{StatusCode, Uri};
use http::header::CONTENT_TYPE;
use http::{StatusCode, Uri};
use http_body_util::{BodyExt, Full};
use hyper_1::body::Body;
use hyper_1::{Request as HyperRequest, Response as HyperResponse};
use hyper::body::Body;
use hyper::{Request as HyperRequest, Response as HyperResponse};
use hyper_util::client::legacy::connect::HttpConnector;
use hyper_util::client::legacy::Client;
use hyper_util::rt::TokioExecutor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ use apollo_config::dumping::{ser_param, SerializeConfig};
use apollo_config::{ParamPath, ParamPrivacyInput, SerializedParam};
use apollo_infra_utils::type_name::short_type_name;
use async_trait::async_trait;
// TODO(victork): finalise migration to hyper 1.x
use bytes::Bytes;
use http_1::header::CONTENT_TYPE;
use http_1::StatusCode;
use http::header::CONTENT_TYPE;
use http::StatusCode;
use http_body_util::{BodyExt, Full};
use hyper_1::body::Incoming;
use hyper_1::service::{service_fn, Service};
use hyper_1::{Request as HyperRequest, Response as HyperResponse};
use hyper::body::Incoming;
use hyper::service::{service_fn, Service};
use hyper::{Request as HyperRequest, Response as HyperResponse};
use hyper_util::rt::{TokioExecutor, TokioIo};
use hyper_util::server::conn::auto::Builder as ServerBuilder;
use serde::de::DeserializeOwned;
Expand Down Expand Up @@ -134,7 +133,7 @@ where
request_id: RequestId,
local_client: LocalComponentClient<Request, Response>,
metrics: &'static RemoteServerMetrics,
) -> Result<HyperResponse<Full<Bytes>>, hyper_1::Error> {
) -> Result<HyperResponse<Full<Bytes>>, hyper::Error> {
trace!("Received HTTP request: {http_request:?}");
let body_bytes = http_request.into_body().collect().await?.to_bytes();
trace!("Extracted {} bytes from HTTP request body", body_bytes.len());
Expand Down Expand Up @@ -275,7 +274,7 @@ where
// Error type ambiguity.
let wrapped_response: Result<
HyperResponse<Full<Bytes>>,
hyper_1::Error,
hyper::Error,
> = Ok(response);
wrapped_response
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ use std::sync::Arc;
use apollo_infra_utils::run_until::run_until;
use apollo_proc_macros::unique_u16;
use async_trait::async_trait;
// TODO(victork): finalise migration to hyper 1.x
use bytes::Bytes;
use http_1::header::CONTENT_TYPE;
use http_1::{StatusCode, Uri};
use http::header::CONTENT_TYPE;
use http::{StatusCode, Uri};
use http_body_util::{BodyExt, Full};
use hyper_1::body::Incoming;
use hyper_1::service::service_fn;
use hyper_1::{Request, Response};
use hyper::body::Incoming;
use hyper::service::service_fn;
use hyper::{Request, Response};
use hyper_util::client::legacy::Client;
use hyper_util::rt::{TokioExecutor, TokioIo};
use hyper_util::server::conn::auto::Builder as Http2ServerBuilder;
Expand Down
2 changes: 1 addition & 1 deletion crates/apollo_integration_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ apollo_state_sync_metrics.workspace = true
apollo_storage = { workspace = true, features = ["testing"] }
apollo_test_utils.workspace = true
assert_matches.workspace = true
axum_08.workspace = true
axum.workspace = true
blockifier = { workspace = true, features = ["testing"] }
blockifier_test_utils.workspace = true
cairo-lang-starknet-classes.workspace = true
Expand Down
12 changes: 6 additions & 6 deletions crates/apollo_integration_tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ use apollo_sierra_compilation_config::config::SierraCompilationConfig;
use apollo_state_sync_config::config::StateSyncConfig;
use apollo_storage::db::DbConfig;
use apollo_storage::StorageConfig;
use axum_08::extract::Query;
use axum_08::http::StatusCode;
use axum_08::routing::{get, post};
use axum_08::{Json, Router};
use axum::extract::Query;
use axum::http::StatusCode;
use axum::routing::{get, post};
use axum::{serve, Json, Router};
#[cfg(feature = "cairo_native")]
use blockifier::blockifier::config::CairoNativeRunConfig;
use blockifier::blockifier::config::{ContractClassManagerConfig, WorkerPoolConfig};
Expand Down Expand Up @@ -417,7 +417,7 @@ pub fn spawn_success_recorder(socket_address: SocketAddr) -> JoinHandle<()> {
}),
);
let listener = TcpListener::bind(socket_address).await.unwrap();
axum_08::serve(listener, router).await.unwrap();
serve(listener, router).await.unwrap();
})
}

Expand Down Expand Up @@ -455,7 +455,7 @@ pub fn spawn_eth_to_strk_oracle_server(socket_address: SocketAddr) -> JoinHandle
tokio::spawn(async move {
let router = Router::new().route(ETH_TO_STRK_ORACLE_PATH, get(get_price));
let listener = TcpListener::bind(socket_address).await.unwrap();
axum_08::serve(listener, router).await.unwrap();
serve(listener, router).await.unwrap();
})
}

Expand Down
8 changes: 4 additions & 4 deletions crates/apollo_monitoring_endpoint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license-file.workspace = true
description = "Monitoring and observability endpoints for the Starknet sequencer."

[features]
testing = ["apollo_metrics/testing", "num-traits", "thiserror", "tower_05"]
testing = ["apollo_metrics/testing", "num-traits", "thiserror", "tower"]

[lints]
workspace = true
Expand All @@ -21,14 +21,14 @@ apollo_mempool_types.workspace = true
apollo_metrics.workspace = true
apollo_monitoring_endpoint_config.workspace = true
async-trait.workspace = true
axum_08.workspace = true
axum.workspace = true
http-body-util.workspace = true
hyper-util.workspace = true
metrics-exporter-prometheus.workspace = true
num-traits = { workspace = true, optional = true }
thiserror = { workspace = true, optional = true }
tokio = { workspace = true, features = ["net", "rt"] }
tower_05 = { workspace = true, optional = true }
tower = { workspace = true, optional = true }
tracing.workspace = true

[dev-dependencies]
Expand All @@ -43,4 +43,4 @@ starknet-types-core.workspace = true
starknet_api = { workspace = true, features = ["testing"] }
thiserror.workspace = true
tokio.workspace = true
tower_05.workspace = true
tower.workspace = true
13 changes: 6 additions & 7 deletions crates/apollo_monitoring_endpoint/src/monitoring_endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ use apollo_mempool_types::communication::SharedMempoolClient;
use apollo_mempool_types::mempool_types::MempoolSnapshot;
use apollo_monitoring_endpoint_config::config::MonitoringEndpointConfig;
use async_trait::async_trait;
// TODO(victork): finalise migration to hyper 1.x
use axum_08::extract::Path;
use axum_08::http::StatusCode;
use axum_08::response::{IntoResponse, Response};
use axum_08::routing::{get, post};
use axum_08::{Json, Router};
use axum::extract::Path;
use axum::http::StatusCode;
use axum::response::{IntoResponse, Response};
use axum::routing::{get, post};
use axum::{serve, Json, Router};
use metrics_exporter_prometheus::PrometheusHandle;
use tokio::net::TcpListener;
use tracing::level_filters::LevelFilter;
Expand Down Expand Up @@ -74,7 +73,7 @@ impl MonitoringEndpoint {
info!("MonitoringEndpoint running using socket: {}", endpoint_addr);

let listener = TcpListener::bind(&endpoint_addr).await?;
axum_08::serve(listener, app).await
serve(listener, app).await
}

fn app(&self) -> Router {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ use apollo_monitoring_endpoint_config::config::{
MONITORING_ENDPOINT_DEFAULT_IP,
MONITORING_ENDPOINT_DEFAULT_PORT,
};
// TODO(victork): finalise migration to hyper 1.x
use axum_08::http::StatusCode;
use axum_08::response::Response;
use axum_08::Router;
use axum::http::StatusCode;
use axum::response::Response;
use axum::Router;
use http_body_util::BodyExt;
use hyper_util::client::legacy::Client;
use hyper_util::rt::TokioExecutor;
Expand All @@ -30,7 +29,7 @@ use starknet_api::core::{ContractAddress, Nonce};
use starknet_api::{nonce, tx_hash};
use tokio::spawn;
use tokio::task::yield_now;
use tower_05::util::ServiceExt;
use tower::util::ServiceExt;

use crate::monitoring_endpoint::{
create_monitoring_endpoint,
Expand Down
5 changes: 2 additions & 3 deletions crates/apollo_monitoring_endpoint/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ use anyhow::Result;
use apollo_infra_utils::run_until::run_until;
use apollo_infra_utils::tracing::{CustomLogger, TraceLevel};
use apollo_metrics::test_utils::parse_numeric_metric;
// TODO(victork): finalise migration to hyper 1.x
use axum_08::body::Body;
use axum_08::http::Request;
use axum::body::Body;
use axum::http::Request;
use http_body_util::BodyExt;
use hyper_util::client::legacy::connect::HttpConnector;
use hyper_util::client::legacy::Client;
Expand Down
2 changes: 1 addition & 1 deletion crates/apollo_rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ serde_json = { workspace = true, features = ["arbitrary_precision"] }
starknet-types-core.workspace = true
starknet_api.workspace = true
tokio = { workspace = true, features = ["full", "sync"] }
tower_05 = { workspace = true, features = ["full"] }
tower = { workspace = true, features = ["full"] }
tracing.workspace = true
validator = { workspace = true, features = ["derive"] }

Expand Down
2 changes: 1 addition & 1 deletion crates/apollo_rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use serde::{Deserialize, Serialize};
use starknet_api::block::{BlockHashAndNumber, BlockNumber, BlockStatus};
use starknet_api::core::ChainId;
use tokio::sync::RwLock;
use tower_05::ServiceBuilder;
use tower::ServiceBuilder;
use tracing::{debug, error, info, instrument};
// Aliasing the latest version of the RPC.
use v0_8 as latest;
Expand Down
2 changes: 1 addition & 1 deletion crates/apollo_rpc/src/middleware.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use jsonrpsee::core::http_helpers::read_body;
use jsonrpsee::server::HttpRequest;
use regex::Regex;
use tower_05::BoxError;
use tower::BoxError;
use tracing::debug;

use crate::version_config::{VERSION_0_8, VERSION_PATTERN};
Expand Down
2 changes: 1 addition & 1 deletion crates/apollo_rpc/src/rpc_metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl MetricLogger {
}
}

impl<S> tower_05::Layer<S> for MetricLogger {
impl<S> tower::Layer<S> for MetricLogger {
type Service = MetricLoggerService<S>;

fn layer(&self, service: S) -> Self::Service {
Expand Down
Loading
Loading