From f131f2fcbcece048ecfba96940a5c836fcee1ad6 Mon Sep 17 00:00:00 2001 From: ZanCorDX <126988525+ZanCorDX@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:41:49 -0300 Subject: [PATCH] Fixed the typo. For now it backwards compatible. (#310) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 📝 Summary It was supposed to be sbundle_mergeable_signers but was sbundle_mergeabe_signers. ## 💡 Motivation and Context - My eyes start to bleed everytime I see that typo. ## ✅ I have completed the following steps: * [X] Run `make lint` * [X] Run `make test` * [ ] Added tests (if applicable) --- config-backtest-example.toml | 2 +- config-live-example.toml | 2 +- config-optimism-local.toml | 2 +- config-playground.toml | 2 +- .../src/backtest/backtest_build_block.rs | 2 +- .../src/backtest/backtest_build_range.rs | 2 +- .../rbuilder/src/backtest/redistribute/mod.rs | 2 +- .../rbuilder/src/live_builder/base_config.rs | 27 ++++++++++++------- 8 files changed, 25 insertions(+), 16 deletions(-) diff --git a/config-backtest-example.toml b/config-backtest-example.toml index 987abf7d..be4a22c4 100644 --- a/config-backtest-example.toml +++ b/config-backtest-example.toml @@ -8,7 +8,7 @@ backtest_fetch_eth_rpc_parallel = 400 backtest_fetch_output_file = "~/.rbuilder/backtest/main.sqlite" backtest_fetch_mempool_data_dir = "~/.rbuilder/mempool-data" -sbundle_mergeabe_signers = [] +sbundle_mergeable_signers = [] backtest_builders = ["mp-ordering", "mgp-ordering"] diff --git a/config-live-example.toml b/config-live-example.toml index c295f71c..c0a5adba 100644 --- a/config-live-example.toml +++ b/config-live-example.toml @@ -31,7 +31,7 @@ max_concurrent_seals = 4 # genesis_fork_version = "0x00112233" -sbundle_mergeabe_signers = [] +sbundle_mergeable_signers = [] live_builders = ["mp-ordering", "mgp-ordering", "merging"] [[relays]] diff --git a/config-optimism-local.toml b/config-optimism-local.toml index b62491d1..9a374e4b 100644 --- a/config-optimism-local.toml +++ b/config-optimism-local.toml @@ -21,7 +21,7 @@ dry_run_validation_url = "http://localhost:8545" ignore_cancellable_orders = true -sbundle_mergeabe_signers = [] +sbundle_mergeable_signers = [] live_builders = ["mp-ordering"] [[relays]] diff --git a/config-playground.toml b/config-playground.toml index 3ea4da6c..114ecc22 100644 --- a/config-playground.toml +++ b/config-playground.toml @@ -24,7 +24,7 @@ dry_run_validation_url = "http://localhost:8545" ignore_cancellable_orders = true -sbundle_mergeabe_signers = [] +sbundle_mergeable_signers = [] live_builders = ["mp-ordering", "mgp-ordering", "parallel"] [[relays]] diff --git a/crates/rbuilder/src/backtest/backtest_build_block.rs b/crates/rbuilder/src/backtest/backtest_build_block.rs index 337025b5..3e6ad1e0 100644 --- a/crates/rbuilder/src/backtest/backtest_build_block.rs +++ b/crates/rbuilder/src/backtest/backtest_build_block.rs @@ -108,7 +108,7 @@ where chain_spec.clone(), cli.block_building_time_ms, config.base_config().blocklist()?, - &config.base_config().sbundle_mergeabe_signers(), + &config.base_config().sbundle_mergeable_signers(), config.base_config().coinbase_signer()?, )?; diff --git a/crates/rbuilder/src/backtest/backtest_build_range.rs b/crates/rbuilder/src/backtest/backtest_build_range.rs index 552d5b11..da96d7f3 100644 --- a/crates/rbuilder/src/backtest/backtest_build_range.rs +++ b/crates/rbuilder/src/backtest/backtest_build_range.rs @@ -178,7 +178,7 @@ where builders_names, &config, blocklist, - &config.base_config().sbundle_mergeabe_signers(), + &config.base_config().sbundle_mergeable_signers(), ) { Ok(ok) => Some(ok), Err(err) => { diff --git a/crates/rbuilder/src/backtest/redistribute/mod.rs b/crates/rbuilder/src/backtest/redistribute/mod.rs index f613b091..1d26a940 100644 --- a/crates/rbuilder/src/backtest/redistribute/mod.rs +++ b/crates/rbuilder/src/backtest/redistribute/mod.rs @@ -1010,7 +1010,7 @@ where base_config.backtest_builders.clone(), config, base_config.blocklist()?, - &base_config.sbundle_mergeabe_signers(), + &base_config.sbundle_mergeable_signers(), )? .builder_outputs .into_iter() diff --git a/crates/rbuilder/src/live_builder/base_config.rs b/crates/rbuilder/src/live_builder/base_config.rs index 75ac6325..21a3b8e8 100644 --- a/crates/rbuilder/src/live_builder/base_config.rs +++ b/crates/rbuilder/src/live_builder/base_config.rs @@ -34,7 +34,7 @@ use std::{ time::Duration, }; use tokio::sync::mpsc; -use tracing::warn; +use tracing::{error, warn}; use super::SlotSource; @@ -80,6 +80,9 @@ pub struct BaseConfig { pub extra_data: String, /// mev-share bundles coming from this address are treated in a special way(see [`ShareBundleMerger`]) + pub sbundle_mergeable_signers: Option>, + + /// Backwards compatible typo soon to be removed. pub sbundle_mergeabe_signers: Option>, /// Number of threads used for incoming order simulation @@ -232,9 +235,7 @@ impl BaseConfig { orderpool_sender, orderpool_receiver, - sbundle_merger_selected_signers: Arc::new( - self.sbundle_mergeabe_signers.clone().unwrap_or_default(), - ), + sbundle_merger_selected_signers: Arc::new(self.sbundle_mergeable_signers()), }) } @@ -254,12 +255,19 @@ impl BaseConfig { chain_value_parser(&self.chain) } - pub fn sbundle_mergeabe_signers(&self) -> Vec
{ - if self.sbundle_mergeabe_signers.is_none() { - warn!("Defaulting sbundle_mergeabe_signers to empty. We may not comply with order flow rules."); + pub fn sbundle_mergeable_signers(&self) -> Vec
{ + if let Some(sbundle_mergeable_signers) = &self.sbundle_mergeable_signers { + if self.sbundle_mergeabe_signers.is_some() { + error!("sbundle_mergeable_signers and sbundle_mergeabe_signers found. Will use bundle_mergeable_signers"); + } + sbundle_mergeable_signers.clone() + } else if let Some(sbundle_mergeable_signers) = &self.sbundle_mergeabe_signers { + warn!("sbundle_mergeable_signers missing but found sbundle_mergeabe_signers. sbundle_mergeabe_signers will be used but this will be deprecated soon"); + sbundle_mergeable_signers.clone() + } else { + warn!("Defaulting sbundle_mergeable_signers to empty. We may not comply with order flow rules."); + Vec::default() } - - self.sbundle_mergeabe_signers.clone().unwrap_or_default() } /// Open reth db and DB should be opened once per process but it can be cloned and moved to different threads. @@ -455,6 +463,7 @@ impl Default for BaseConfig { backtest_builders: Vec::new(), live_builders: vec!["mgp-ordering".to_string(), "mp-ordering".to_string()], simulation_threads: 1, + sbundle_mergeable_signers: None, sbundle_mergeabe_signers: None, } }