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
1,179 changes: 253 additions & 926 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ opentelemetry_sdk = "0.31"
tracing = "0.1"
tracing-opentelemetry = "0.32"
tracing-subscriber = "0.3"
url = "2.5.7"
url = { version = "2.5.7", features = ["serde"] }

# lighthouse
ethereum_serde_utils = "0.8.0"
Expand All @@ -84,13 +84,12 @@ reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth", tag =
stateless = { git = "https://github.com/paradigmxyz/stateless", rev = "ed189a51931e8589102f3139d48fdbb3bbe4c1f7", default-features = false }

# ere
ere-server = { git = "https://github.com/eth-act/ere", tag = "v0.7.0" }
ere-zkvm-interface = { git = "https://github.com/eth-act/ere", tag = "v0.7.0" }
ere-server-client = { git = "https://github.com/eth-act/ere", tag = "v0.8.1" }

# ere-guests
stateless-validator-common = { git = "https://github.com/eth-act/ere-guests", tag = "v0.7.0" }
stateless-validator-ethrex = { git = "https://github.com/eth-act/ere-guests", tag = "v0.7.0", features = ["host"] }
stateless-validator-reth = { git = "https://github.com/eth-act/ere-guests", tag = "v0.7.0", features = ["host"] }
ere-guests-stateless-validator-common = { git = "https://github.com/eth-act/ere-guests", tag = "v0.9.0", package = "stateless-validator-common" }
ere-guests-stateless-validator-ethrex = { git = "https://github.com/eth-act/ere-guests", tag = "v0.9.0", features = ["host"], package = "stateless-validator-ethrex" }
ere-guests-stateless-validator-reth = { git = "https://github.com/eth-act/ere-guests", tag = "v0.9.0", features = ["host"], package = "stateless-validator-reth" }

# local
zkboost-client = { path = "crates/client" }
Expand Down
16 changes: 7 additions & 9 deletions crates/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ otel = [
"dep:opentelemetry-otlp",
"dep:opentelemetry_sdk",
"dep:tracing-opentelemetry",
"ere-server/otel",
"ere-server-client/otel",
]

[dependencies]
anyhow.workspace = true
axum = { workspace = true, features = ["macros"] }
bincode.workspace = true
bytes.workspace = true
clap = { workspace = true, features = ["derive"] }
futures.workspace = true
Expand All @@ -43,7 +42,8 @@ tokio = { workspace = true, features = ["full"] }
tokio-stream = { workspace = true, features = ["sync"] }
tokio-util.workspace = true
toml_edit = { workspace = true, features = ["serde"] }
tower-http = { workspace = true, features = ["trace", "limit"] }
tower.workspace = true
tower-http = { workspace = true, features = ["catch-panic", "trace", "limit"] }
opentelemetry = { workspace = true, optional = true }
opentelemetry-otlp = { workspace = true, features = ["grpc-tonic"], optional = true }
opentelemetry_sdk = { workspace = true, features = ["rt-tokio"], optional = true }
Expand All @@ -64,20 +64,18 @@ reth-ethereum-primitives.workspace = true
stateless.workspace = true

# ere
ere-server.workspace = true
ere-zkvm-interface.workspace = true
ere-server-client.workspace = true

# ere-guests
stateless-validator-common.workspace = true
stateless-validator-ethrex.workspace = true
stateless-validator-reth.workspace = true
ere-guests-stateless-validator-common.workspace = true
ere-guests-stateless-validator-ethrex.workspace = true
ere-guests-stateless-validator-reth.workspace = true

# local
zkboost-types.workspace = true

[dev-dependencies]
futures.workspace = true
tower = { workspace = true, features = ["util"] }

# local
zkboost-client.workspace = true
17 changes: 11 additions & 6 deletions crates/server/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ use bytes::Bytes;
use lru::LruCache;
use metrics_exporter_prometheus::PrometheusHandle;
use tokio::sync::{RwLock, broadcast, mpsc};
use tower_http::trace::TraceLayer;
use tower::ServiceBuilder;
use tower_http::{catch_panic::CatchPanicLayer, trace::TraceLayer};
use zkboost_types::{Hash256, ProofEvent, ProofType};

use crate::{
Expand Down Expand Up @@ -63,6 +64,12 @@ impl AppState {

/// Builds the Axum router with all endpoints and middleware.
pub(crate) fn router(state: Arc<AppState>) -> Router {
let api_middleware = ServiceBuilder::new()
.layer(middleware::from_fn(http_metrics_middleware))
.layer(TraceLayer::new_for_http())
.layer(CatchPanicLayer::new())
.layer(DefaultBodyLimit::max(1 << 30));

let api = Router::new()
.route(
"/v1/execution_proof_requests",
Expand All @@ -77,22 +84,20 @@ pub(crate) fn router(state: Arc<AppState>) -> Router {
post(v1::post_execution_proof_verifications),
)
.fallback(fallback_handler)
.with_state(state.clone())
.layer(middleware::from_fn(http_metrics_middleware))
.layer(TraceLayer::new_for_http())
.layer(DefaultBodyLimit::max(1 << 30));
.layer(api_middleware);

let mut infra = Router::new()
.route("/health", get(StatusCode::OK))
.route("/metrics", get(get_metrics));

if state.dashboard.is_some() {
infra = infra
.route("/dashboard", get(dashboard::get_dashboard))
.route("/dashboard/state", get(dashboard::get_dashboard_state))
.route("/dashboard/events", get(dashboard::get_dashboard_events));
}

api.merge(infra.with_state(state))
api.merge(infra).with_state(state)
}

async fn fallback_handler() -> v1::ErrorResponse {
Expand Down
Loading
Loading