From c4f23688b93c1376d930a0a09139d644b79fc9c8 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Thu, 31 Oct 2024 15:03:57 +0100 Subject: [PATCH] fix(sidecar): builder proxy not spinning up with delegations --- bolt-sidecar/src/api/builder.rs | 10 ++++------ bolt-sidecar/src/client/constraints_client.rs | 3 ++- bolt-sidecar/src/driver.rs | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/bolt-sidecar/src/api/builder.rs b/bolt-sidecar/src/api/builder.rs index 8a4b9129..ff4d9c03 100644 --- a/bolt-sidecar/src/api/builder.rs +++ b/bolt-sidecar/src/api/builder.rs @@ -16,7 +16,6 @@ use ethereum_consensus::{ Fork, }; use parking_lot::Mutex; -use reqwest::Url; use serde::Deserialize; use thiserror::Error; use tokio::net::TcpListener; @@ -219,8 +218,8 @@ where /// Configuration for the builder proxy. #[derive(Debug, Clone)] pub struct BuilderProxyConfig { - /// The URL of the target constraints client server. - pub constraints_url: Url, + /// The target constraints client server. + pub constraints_client: ConstraintsClient, /// The port on which the builder proxy should listen. pub server_port: u16, } @@ -235,12 +234,11 @@ where { info!( port = config.server_port, - target = config.constraints_url.to_string(), + target = config.constraints_client.url.to_string(), "Starting builder proxy..." ); - let mev_boost = ConstraintsClient::new(config.constraints_url); - let server = Arc::new(BuilderProxyServer::new(mev_boost, payload_fetcher)); + let server = Arc::new(BuilderProxyServer::new(config.constraints_client, payload_fetcher)); let router = Router::new() .route("/", get(index)) diff --git a/bolt-sidecar/src/client/constraints_client.rs b/bolt-sidecar/src/client/constraints_client.rs index fda91fa3..1e8d5af0 100644 --- a/bolt-sidecar/src/client/constraints_client.rs +++ b/bolt-sidecar/src/client/constraints_client.rs @@ -31,7 +31,8 @@ use crate::{ /// A client for interacting with the Constraints client API. #[derive(Debug, Clone)] pub struct ConstraintsClient { - url: Url, + /// The URL of the MEV-Boost target supporting the Constraints API. + pub url: Url, client: reqwest::Client, delegations: Vec, } diff --git a/bolt-sidecar/src/driver.rs b/bolt-sidecar/src/driver.rs index 69ca91b7..64e9f50e 100644 --- a/bolt-sidecar/src/driver.rs +++ b/bolt-sidecar/src/driver.rs @@ -223,7 +223,7 @@ impl SidecarDriver { let (payload_requests_tx, payload_requests_rx) = mpsc::channel(16); let builder_proxy_cfg = BuilderProxyConfig { - constraints_url: opts.constraints_api_url.clone(), + constraints_client: constraints_client.clone(), server_port: opts.constraints_proxy_port, };