Skip to content

Commit

Permalink
added comments about how we use the reference to FullNodeTypes to bui…
Browse files Browse the repository at this point in the history
…ld the components
  • Loading branch information
fgimenez committed Jun 21, 2024
1 parent c78e283 commit 7940040
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/node/builder/src/launch/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ where
blockchain_db,
tree_config,
canon_state_notification_sender,
// we store here a reference to T.
phantom_data: PhantomData,
};

Expand Down Expand Up @@ -822,6 +823,8 @@ pub struct WithMeteredProviders<DB, T> {
blockchain_db: BlockchainProvider<DB>,
canon_state_notification_sender: CanonStateNotificationSender,
tree_config: BlockchainTreeConfig,
// this field is used to store a reference to the FullNodeTypes so that we
// can build the components in `with_components` method.
phantom_data: PhantomData<T>,
}

Expand Down
2 changes: 2 additions & 0 deletions crates/node/builder/src/launch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ where
info!(target: "reth::cli", "\n{}", this.chain_spec().display_hardforks());
})
.with_metrics()
// passing FullNodeTypes as type parameter here so that we can build
// later the components.
.with_blockchain_db::<T>().await?
.with_components(components_builder, on_component_initialized).await?;

Expand Down

0 comments on commit 7940040

Please sign in to comment.