From ab598021080fe06c96d058521e512dffbbd3bfcb Mon Sep 17 00:00:00 2001 From: malik Date: Sat, 12 Oct 2024 10:04:39 +0100 Subject: [PATCH] chore: reduce clones (#9) just some small tweaks --- bin/odyssey/src/main.rs | 2 +- crates/node/src/node.rs | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/bin/odyssey/src/main.rs b/bin/odyssey/src/main.rs index 77b8af1..9612e5d 100644 --- a/bin/odyssey/src/main.rs +++ b/bin/odyssey/src/main.rs @@ -53,7 +53,7 @@ fn main() { Cli::::parse().run(|builder, rollup_args| async move { let node = builder .with_types_and_provider::>() - .with_components(OdysseyNode::components(rollup_args.clone())) + .with_components(OdysseyNode::components(&rollup_args)) .with_add_ons(OptimismAddOns::new(rollup_args.sequencer_http.clone())) .extend_rpc_modules(move |ctx| { // register sequencer tx forwarder diff --git a/crates/node/src/node.rs b/crates/node/src/node.rs index e50746b..1356a92 100644 --- a/crates/node/src/node.rs +++ b/crates/node/src/node.rs @@ -45,7 +45,7 @@ impl OdysseyNode { /// Returns the components for the given [RollupArgs]. pub fn components( - args: RollupArgs, + args: &RollupArgs, ) -> ComponentsBuilder< Node, OptimismPoolBuilder, @@ -60,7 +60,6 @@ impl OdysseyNode { Types: NodeTypesWithEngine, >, { - let RollupArgs { disable_txpool_gossip, compute_pending_block, discovery_v4, .. } = args; ComponentsBuilder::default() .node_types::() .pool(OptimismPoolBuilder { @@ -72,10 +71,10 @@ impl OdysseyNode { ..Default::default() }, }) - .payload(OdysseyPayloadBuilder::new(compute_pending_block)) + .payload(OdysseyPayloadBuilder::new(args.compute_pending_block)) .network(OdysseyNetworkBuilder::new(OptimismNetworkBuilder { - disable_txpool_gossip, - disable_discovery_v4: !discovery_v4, + disable_txpool_gossip: args.disable_txpool_gossip, + disable_discovery_v4: !args.discovery_v4, })) .executor(OdysseyExecutorBuilder::default()) .consensus(OptimismConsensusBuilder::default()) @@ -113,7 +112,7 @@ where fn components_builder(&self) -> Self::ComponentsBuilder { let Self { args } = self; - Self::components(args.clone()) + Self::components(args) } fn add_ons(&self) -> Self::AddOns {