-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: ChainSpec
associated type
#10292
Conversation
@@ -231,7 +232,7 @@ where | |||
+ BlockIdReader | |||
+ CanonChainTracker | |||
+ StageCheckpointReader | |||
+ ChainSpecProvider | |||
+ ChainSpecProvider<ChainSpec = ChainSpec> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, setting the AT to a concrete type makes it possible to impl this in incremental prs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great and allows us to gradually add support for chainspec trait across more components
crates/node/api/src/node.rs
Outdated
/// The type used for configuration of the EVM. | ||
type ChainSpec: ChainSpecTrait; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's your argument for finding it appropriate to put ChainSpec
here? I'd argue it's more appropriate as AT in FullNodeTypes
trait, because looking at the other ATs contained in both traits NodeTypes
and FullNodeTypes
, ChainSpec
semantically fits better into FullNodeTypes
- the chain spec is more about initialisation of the chain, like db and provider, rather than compilation of the reth program for a specific network, like primitives and engine types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have strong opinion here, so would be happy to move it. My understanding was that FullNodeTypes
keeps stateful components which are expected to change their behavior during node operation, while NodeTypes
configures underlying types/configs for those components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the chain spec stateless? what about hardforks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the chain spec stateless? what about hardforks?
It can't change on its own during node operation (thus allowing us to keep it in an Arc
everywhere). Primitive types can also change between hardforks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great!
this is exactly what we're looking for,
I think we can merge this as is, so more incremental work is unlocked.
cc @joshieDo I want to find a way to integrate this together with your generic type work, I think we should actually try to make NodeType the generic that we pass to everything
smol conflict @klkvr
@@ -231,7 +232,7 @@ where | |||
+ BlockIdReader | |||
+ CanonChainTracker | |||
+ StageCheckpointReader | |||
+ ChainSpecProvider | |||
+ ChainSpecProvider<ChainSpec = ChainSpec> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great and allows us to gradually add support for chainspec trait across more components
Co-authored-by: Matthias Seitz <[email protected]>
First step for #10272
Adds
ChainSpec
trait and assoc type toChainSpecProvider
andNodeTypes
, for now most of the logic is hardcoded to use the defaultChainSpec