Skip to content

Commit

Permalink
chore: reduce clones (#9)
Browse files Browse the repository at this point in the history
just some small tweaks
  • Loading branch information
malik672 authored Oct 12, 2024
1 parent 7ad1170 commit ab59802
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bin/odyssey/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn main() {
Cli::<OdysseyChainSpecParser, RollupArgs>::parse().run(|builder, rollup_args| async move {
let node = builder
.with_types_and_provider::<OdysseyNode, BlockchainProvider2<_>>()
.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
Expand Down
11 changes: 5 additions & 6 deletions crates/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl OdysseyNode {

/// Returns the components for the given [RollupArgs].
pub fn components<Node>(
args: RollupArgs,
args: &RollupArgs,
) -> ComponentsBuilder<
Node,
OptimismPoolBuilder,
Expand All @@ -60,7 +60,6 @@ impl OdysseyNode {
Types: NodeTypesWithEngine<Engine = OptimismEngineTypes, ChainSpec = OpChainSpec>,
>,
{
let RollupArgs { disable_txpool_gossip, compute_pending_block, discovery_v4, .. } = args;
ComponentsBuilder::default()
.node_types::<Node>()
.pool(OptimismPoolBuilder {
Expand All @@ -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())
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ab59802

Please sign in to comment.