From 728cad9a73740b1f43a9052557d476eb37eb2490 Mon Sep 17 00:00:00 2001 From: dylan Date: Wed, 8 Oct 2025 17:13:27 -0600 Subject: [PATCH 1/3] removes bin-base flashbots dependency --- Cargo.lock | 1 - Cargo.toml | 2 +- src/config.rs | 58 +++++++++++++++++++++++++---------------------- src/test_utils.rs | 6 ++--- 4 files changed, 34 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8169b75..16ad714 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3309,7 +3309,6 @@ dependencies = [ "reqwest", "rustls 0.23.32", "serde", - "serde_json", "signet-constants", "signet-tx-cache", "thiserror 2.0.17", diff --git a/Cargo.toml b/Cargo.toml index 20fdc99..d472d97 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ name = "zenith-builder-example" path = "bin/builder.rs" [dependencies] -init4-bin-base = { version = "0.13.1", features = ["perms", "aws", "flashbots"] } +init4-bin-base = { version = "0.13.1", features = ["perms", "aws" ] } signet-constants = { version = "0.11.2" } signet-sim = { version = "0.11.2" } diff --git a/src/config.rs b/src/config.rs index badf5fb..d5fb3b5 100644 --- a/src/config.rs +++ b/src/config.rs @@ -21,7 +21,6 @@ use init4_bin_base::{ perms::{Authenticator, OAuthConfig, SharedToken}, utils::{ calc::SlotCalculator, - flashbots::Flashbots, from_env::FromEnv, provider::{ProviderConfig, PubSubConfig}, signer::{LocalOrAws, SignerError}, @@ -66,6 +65,18 @@ pub type FlashbotsProvider = FillProvider< providers::RootProvider, >; +/// +pub type FlashbotsProviderV2 = FillProvider< + JoinFill< + JoinFill< + Identity, + JoinFill>>, + >, + WalletFiller, + >, + providers::RootProvider, +>; + /// The default concurrency limit for the builder if the system call /// fails and no user-specified value is set. pub const DEFAULT_CONCURRENCY_LIMIT: usize = 8; @@ -110,8 +121,17 @@ pub struct BuilderConfig { )] pub tx_broadcast_urls: Vec>, - /// Flashbots configuration for privately submitting rollup blocks. - pub flashbots: init4_bin_base::utils::flashbots::FlashbotsConfig, + /// Configuration for the Flashbots provider. + /// * If set, the builder will submit blocks as MEV bundles to Flashbots instead of + /// submitting them directly to the Host chain. + /// * If not set, the builder defaults to submitting blocks directly to the Host chain + /// using the Builder Helper contract. + #[from_env( + var = "FLASHBOTS_ENDPOINT", + desc = "Flashbots endpoint for privately submitting rollup blocks", + optional + )] + pub flashbots_endpoint: Option, /// Address of the Zenith contract on Host. #[from_env(var = "ZENITH_ADDRESS", desc = "address of the Zenith contract on Host")] @@ -239,25 +259,9 @@ impl BuilderConfig { pub async fn connect_flashbots( &self, config: &BuilderConfig, - ) -> Result< - FillProvider< - JoinFill< - JoinFill< - Identity, - JoinFill< - GasFiller, - JoinFill>, - >, - >, - WalletFiller, - >, - providers::RootProvider, - >, - eyre::Error, - > { + ) -> Result { let endpoint = config .clone() - .flashbots .flashbots_endpoint .expect("flashbots endpoint must be configured"); let signer = config.connect_builder_signer().await?; @@ -332,12 +336,12 @@ impl BuilderConfig { }) } - /// Connect to a Flashbots provider. - pub async fn flashbots_provider(&self) -> eyre::Result { - self.flashbots - .build(self.connect_builder_signer().await?) - .ok_or_else(|| eyre::eyre!("Flashbots is not configured")) - } + // /// Connect to a Flashbots provider. + // pub async fn flashbots_provider(&self) -> eyre::Result { + // self.flashbots + // .build(self.connect_builder_signer().await?) + // .ok_or_else(|| eyre::eyre!("Flashbots is not configured")) + // } /// Spawn a submit task, either Flashbots or BuilderHelper depending on /// configuration. @@ -346,7 +350,7 @@ impl BuilderConfig { tx_channel: UnboundedSender, ) -> eyre::Result<(UnboundedSender, JoinHandle<()>)> { // If we have a flashbots endpoint, use that - if self.flashbots.flashbots_endpoint.is_some() { + if self.flashbots_endpoint.is_some() { debug!("spawning flashbots submit task"); // Make a Flashbots submission task let submit = FlashbotsTask::new(self.clone(), tx_channel).await?; diff --git a/src/test_utils.rs b/src/test_utils.rs index ca3d7cc..c9684d9 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -12,7 +12,7 @@ use init4_bin_base::{ EnvFilter, Layer, fmt, layer::SubscriberExt, registry, util::SubscriberInitExt, }, perms::OAuthConfig, - utils::{calc::SlotCalculator, flashbots::FlashbotsConfig, provider::ProviderConfig}, + utils::{calc::SlotCalculator, provider::ProviderConfig}, }; use signet_constants::SignetSystemConstants; use std::env; @@ -35,9 +35,7 @@ pub fn setup_test_config() -> Result { .try_into() .unwrap(), tx_broadcast_urls: vec!["http://localhost:9000".into()], - flashbots: FlashbotsConfig { - flashbots_endpoint: Some("https://relay-sepolia.flashbots.net:443".parse().unwrap()), - }, // NB: Flashbots API default + flashbots_endpoint: Some("https://relay-sepolia.flashbots.net:443".parse().unwrap()), zenith_address: Address::default(), quincey_url: "http://localhost:8080".into(), sequencer_key: None, From e5bd2378d8e8a30e12ef237d46f6cb6b452901b4 Mon Sep 17 00:00:00 2001 From: dylan Date: Wed, 8 Oct 2025 17:22:03 -0600 Subject: [PATCH 2/3] moar cleanup --- src/config.rs | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/config.rs b/src/config.rs index d5fb3b5..6d6e337 100644 --- a/src/config.rs +++ b/src/config.rs @@ -65,18 +65,6 @@ pub type FlashbotsProvider = FillProvider< providers::RootProvider, >; -/// -pub type FlashbotsProviderV2 = FillProvider< - JoinFill< - JoinFill< - Identity, - JoinFill>>, - >, - WalletFiller, - >, - providers::RootProvider, ->; - /// The default concurrency limit for the builder if the system call /// fails and no user-specified value is set. pub const DEFAULT_CONCURRENCY_LIMIT: usize = 8; @@ -255,15 +243,13 @@ impl BuilderConfig { .connect_provider(provider?)) } - /// Connect to a Flashbots bundle provider + /// Connect to a Flashbots bundle provider. pub async fn connect_flashbots( &self, config: &BuilderConfig, ) -> Result { - let endpoint = config - .clone() - .flashbots_endpoint - .expect("flashbots endpoint must be configured"); + let endpoint = + config.clone().flashbots_endpoint.expect("flashbots endpoint must be configured"); let signer = config.connect_builder_signer().await?; let flashbots: FlashbotsProvider = ProviderBuilder::new().wallet(signer).connect_http(endpoint); From 817fed97dc1b437dc726c0cf7a734ba8a8f45489 Mon Sep 17 00:00:00 2001 From: dylan Date: Wed, 8 Oct 2025 17:24:16 -0600 Subject: [PATCH 3/3] cleanup --- src/config.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/config.rs b/src/config.rs index 6d6e337..5f5b51e 100644 --- a/src/config.rs +++ b/src/config.rs @@ -322,13 +322,6 @@ impl BuilderConfig { }) } - // /// Connect to a Flashbots provider. - // pub async fn flashbots_provider(&self) -> eyre::Result { - // self.flashbots - // .build(self.connect_builder_signer().await?) - // .ok_or_else(|| eyre::eyre!("Flashbots is not configured")) - // } - /// Spawn a submit task, either Flashbots or BuilderHelper depending on /// configuration. pub async fn spawn_submit_task(