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
2 changes: 1 addition & 1 deletion tap_aggregator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tap_graph.workspace = true
thegraph-core = { workspace = true, features = ["alloy-eip712"] }
tokio.workspace = true
tonic.workspace = true
tower.workspace = true
tower = { workspace = true, features = ["util", "steer", "limit"] }
tracing-subscriber.workspace = true

[build-dependencies]
Expand Down
8 changes: 7 additions & 1 deletion tap_aggregator/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,14 @@ pub async fn run_server(

let grpc_service = create_grpc_service(rpc_impl)?;

let grpc_router = Router::new()
.layer(tower::limit::ConcurrencyLimitLayer::new(
max_concurrent_connections as usize,
))
.merge(grpc_service.into_axum_router());

let service = tower::steer::Steer::new(
[json_rpc_router, grpc_service.into_axum_router()],
[json_rpc_router, grpc_router],
|req: &hyper::Request<_>, _services: &[_]| {
if req
.headers()
Expand Down