Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make NodeConfig generic over ChainSpec #11039

Merged
merged 1 commit into from
Sep 19, 2024
Merged

Conversation

klkvr
Copy link
Collaborator

@klkvr klkvr commented Sep 19, 2024

Depends on #10978

Towards #10909

Makes NodeConfig generic over chainspec, allowing us to forward custom chainspecs parsed from CLI into NodeBuilder.

For now still requires concrete ChainSpec in several places including RPC and networking configuration

Base automatically changed from klkvr/chainspec-generic to main September 19, 2024 14:36
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice, more progress!

/// All settings for how the node should be configured.
config: NodeConfig,
config: NodeConfig<ChainSpec>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes sense and unblocks separation of Opchainspec and regular eth chainspec further, right?

/// All settings for how the node should be configured.
config: NodeConfig,
config: NodeConfig<ChainSpec>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's perhaps an argument to make the entire config generic,so the builder can be used with custom config, but we should investigate this separately

Comment on lines +73 to +74
#[derive(Debug)]
pub struct NodeConfig<ChainSpec> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a bit unpleasant, but can we impls Clone here manually, auto derive doesn't work for arc.

nvm saw it below

maybe we could also remove the Arc and require chainspec clone and expect that chainspec internally wraps the arc, but different discussion

@mattsse mattsse added the A-sdk Related to reth's use as a library label Sep 19, 2024
@klkvr klkvr force-pushed the klkvr/generic-config branch from 9ad110a to 57b7ab5 Compare September 19, 2024 14:50
@klkvr klkvr added this pull request to the merge queue Sep 19, 2024
Merged via the queue into main with commit c3d090a Sep 19, 2024
36 checks passed
@klkvr klkvr deleted the klkvr/generic-config branch September 19, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sdk Related to reth's use as a library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants