Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the typo. For now it backwards compatible. #310

Merged
merged 1 commit into from
Dec 19, 2024
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 config-backtest-example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
2 changes: 1 addition & 1 deletion config-live-example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
2 changes: 1 addition & 1 deletion config-optimism-local.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
2 changes: 1 addition & 1 deletion config-playground.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
2 changes: 1 addition & 1 deletion crates/rbuilder/src/backtest/backtest_build_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?,
)?;

Expand Down
2 changes: 1 addition & 1 deletion crates/rbuilder/src/backtest/backtest_build_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion crates/rbuilder/src/backtest/redistribute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
27 changes: 18 additions & 9 deletions crates/rbuilder/src/live_builder/base_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use std::{
time::Duration,
};
use tokio::sync::mpsc;
use tracing::warn;
use tracing::{error, warn};

use super::SlotSource;

Expand Down Expand Up @@ -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<Vec<Address>>,

/// Backwards compatible typo soon to be removed.
pub sbundle_mergeabe_signers: Option<Vec<Address>>,

/// Number of threads used for incoming order simulation
Expand Down Expand Up @@ -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()),
})
}

Expand All @@ -254,12 +255,19 @@ impl BaseConfig {
chain_value_parser(&self.chain)
}

pub fn sbundle_mergeabe_signers(&self) -> Vec<Address> {
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<Address> {
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.
Expand Down Expand Up @@ -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,
}
}
Expand Down
Loading