Skip to content

Commit

Permalink
typing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ZanCorDX committed Aug 9, 2024
1 parent 743ee62 commit a1d4ba5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
5 changes: 1 addition & 4 deletions crates/rbuilder/src/backtest/backtest_build_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ pub async fn run_backtest_build_block<ConfigType: LiveBuilderConfig>() -> eyre::
print_order_and_timestamp(&block_data.available_orders, &block_data);
}

let provider_factory = config
.base_config()
.provider_factory()?
.provider_factory_unchecked();
let provider_factory = config.base_config().provider_factory()?;
let chain_spec = config.base_config().chain_spec()?;
let sbundle_mergeabe_signers = config.base_config().sbundle_mergeabe_signers();

Expand Down
50 changes: 26 additions & 24 deletions crates/rbuilder/src/live_builder/base_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,15 @@ impl BaseConfig {
}

/// WARN: opens reth db
pub async fn create_builder<Provider>(
pub async fn create_builder(
&self,
cancellation_token: tokio_util::sync::CancellationToken,
) -> eyre::Result<
super::LiveBuilder<Provider, super::building::relay_submit::RelaySubmitSinkFactory>,
>
where
Provider: StateProviderFactory,
{
super::LiveBuilder<
ProviderFactoryReopener<Arc<DatabaseEnv>>,
super::building::relay_submit::RelaySubmitSinkFactory,
>,
> {
let submission_config = self.submission_config()?;
info!(
"Builder mev boost normal relay pubkey: {:?}",
Expand All @@ -216,28 +216,30 @@ impl BaseConfig {
let relays = self.relays()?;
let sink_factory = RelaySubmitSinkFactory::new(self.submission_config()?, relays.clone());

Ok(LiveBuilder::<Arc<DatabaseEnv>, RelaySubmitSinkFactory> {
cls: self.beacon_clients()?,
relays,
watchdog_timeout: self.watchdog_timeout(),
error_storage_path: self.error_storage_path.clone(),
simulation_threads: self.simulation_threads,
order_input_config: OrderInputConfig::from_config(self),
Ok(
LiveBuilder::<ProviderFactoryReopener<Arc<DatabaseEnv>>, RelaySubmitSinkFactory> {
cls: self.beacon_clients()?,
relays,
watchdog_timeout: self.watchdog_timeout(),
error_storage_path: self.error_storage_path.clone(),
simulation_threads: self.simulation_threads,
order_input_config: OrderInputConfig::from_config(self),

chain_chain_spec: self.chain_spec()?,
provider_factory,
chain_chain_spec: self.chain_spec()?,
provider_factory,

coinbase_signer: self.coinbase_signer()?,
extra_data: self.extra_data()?,
blocklist: self.blocklist()?,
coinbase_signer: self.coinbase_signer()?,
extra_data: self.extra_data()?,
blocklist: self.blocklist()?,

global_cancellation: cancellation_token,
global_cancellation: cancellation_token,

bidding_service: Box::new(DummyBiddingService {}),
extra_rpc: RpcModule::new(()),
sink_factory,
builders: Vec::new(),
})
bidding_service: Box::new(DummyBiddingService {}),
extra_rpc: RpcModule::new(()),
sink_factory,
builders: Vec::new(),
},
)
}

pub fn jsonrpc_server_ip(&self) -> Ipv4Addr {
Expand Down
2 changes: 1 addition & 1 deletion crates/rbuilder/src/live_builder/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub trait LiveBuilderConfig: std::fmt::Debug + serde::de::DeserializeOwned {
fn build_backtest_block(
&self,
building_algorithm_name: &str,
input: BacktestSimulateBlockInput<'_, Arc<DatabaseEnv>>,
input: BacktestSimulateBlockInput<'_, ProviderFactoryReopener<Arc<DatabaseEnv>>>,
) -> eyre::Result<(Block, CachedReads)>;
}

Expand Down
5 changes: 3 additions & 2 deletions crates/rbuilder/src/live_builder/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ fn create_builders(
configs: Vec<BuilderConfig>,
root_hash_task_pool: BlockingTaskPool,
sbundle_mergeabe_signers: Vec<Address>,
) -> Vec<Arc<dyn BlockBuildingAlgorithm<Arc<DatabaseEnv>, BestBlockCell>>> {
) -> Vec<Arc<dyn BlockBuildingAlgorithm<ProviderFactoryReopener<Arc<DatabaseEnv>>, BestBlockCell>>>
{
configs
.into_iter()
.map(|cfg| create_builder(cfg, &root_hash_task_pool, &sbundle_mergeabe_signers))
Expand All @@ -209,7 +210,7 @@ fn create_builder(
cfg: BuilderConfig,
root_hash_task_pool: &BlockingTaskPool,
sbundle_mergeabe_signers: &[Address],
) -> Arc<dyn BlockBuildingAlgorithm<Arc<DatabaseEnv>, BestBlockCell>> {
) -> Arc<dyn BlockBuildingAlgorithm<ProviderFactoryReopener<Arc<DatabaseEnv>>, BestBlockCell>> {
match cfg.builder {
SpecificBuilderConfig::OrderingBuilder(order_cfg) => {
Arc::new(OrderingBuildingAlgorithm::new(
Expand Down

0 comments on commit a1d4ba5

Please sign in to comment.