Skip to content

Commit

Permalink
chore: add TODOs and remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
dancoombs committed Mar 29, 2024
1 parent dd6efb7 commit 5c4c8f8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
1 change: 1 addition & 0 deletions crates/builder/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ where
Box::new(self)
}

// TODO(danc): Can we DRY these create functions?
async fn create_builders_v0_6<C, E>(
&self,
ep: &EntryPointBuilderSettings,
Expand Down
45 changes: 23 additions & 22 deletions crates/pool/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,15 @@ impl PoolTask {
Box::new(self)
}

fn create_mempool_v0_7<P: Provider + Middleware>(
// TODO(danc): when safe simulation for 0.7 is implemented, DRY these functions
fn create_mempool_v0_6<P: Provider + Middleware>(
chain_spec: ChainSpec,
pool_config: &PoolConfig,
unsafe_mode: bool,
event_sender: broadcast::Sender<WithEntryPoint<OpPoolEvent>>,
provider: Arc<P>,
) -> anyhow::Result<Arc<Box<dyn Mempool>>> {
let ep = EthersEntryPointV0_7::new(pool_config.entry_point, Arc::clone(&provider));
let ep = EthersEntryPointV0_6::new(pool_config.entry_point, Arc::clone(&provider));

if unsafe_mode {
let simulator =
Expand All @@ -205,18 +206,34 @@ impl PoolTask {
simulator,
)
} else {
panic!("V0_7 safe simulation not supported")
let simulate_validation_tracer =
sim_v0_6::SimulateValidationTracerImpl::new(Arc::clone(&provider), ep.clone());
let simulator = sim_v0_6::Simulator::new(
Arc::clone(&provider),
ep.clone(),
simulate_validation_tracer,
pool_config.sim_settings,
pool_config.mempool_channel_configs.clone(),
);
Self::create_mempool(
chain_spec,
pool_config,
event_sender,
provider,
ep,
simulator,
)
}
}

fn create_mempool_v0_6<P: Provider + Middleware>(
fn create_mempool_v0_7<P: Provider + Middleware>(
chain_spec: ChainSpec,
pool_config: &PoolConfig,
unsafe_mode: bool,
event_sender: broadcast::Sender<WithEntryPoint<OpPoolEvent>>,
provider: Arc<P>,
) -> anyhow::Result<Arc<Box<dyn Mempool>>> {
let ep = EthersEntryPointV0_6::new(pool_config.entry_point, Arc::clone(&provider));
let ep = EthersEntryPointV0_7::new(pool_config.entry_point, Arc::clone(&provider));

if unsafe_mode {
let simulator =
Expand All @@ -230,23 +247,7 @@ impl PoolTask {
simulator,
)
} else {
let simulate_validation_tracer =
sim_v0_6::SimulateValidationTracerImpl::new(Arc::clone(&provider), ep.clone());
let simulator = sim_v0_6::Simulator::new(
Arc::clone(&provider),
ep.clone(),
simulate_validation_tracer,
pool_config.sim_settings,
pool_config.mempool_channel_configs.clone(),
);
Self::create_mempool(
chain_spec,
pool_config,
event_sender,
provider,
ep,
simulator,
)
panic!("V0_7 safe simulation not supported")
}
}

Expand Down
1 change: 0 additions & 1 deletion crates/rpc/src/eth/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ impl EntryPointRouterBuilder {
route.version()
);
}
tracing::info!("Adding route for v0.7 entry point {:?}", route.address());

self.entry_points.push(route.address());
self.v0_7 = Some((route.address(), Arc::new(Box::new(route))));
Expand Down

0 comments on commit 5c4c8f8

Please sign in to comment.