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 NetworkConfigBuilder independent of concrete ChainSpec #11176

Merged
merged 4 commits into from
Sep 26, 2024

Conversation

klkvr
Copy link
Collaborator

@klkvr klkvr commented Sep 24, 2024

This PR extends Hardforks trait with helper methods to obtain fork_id used by networking types.

NetworkConfigBuilder is changed to accept chainspec into build method

@klkvr klkvr force-pushed the klkvr/network-chainspec branch from 96860e9 to 3847e43 Compare September 25, 2024 16:05
@klkvr klkvr requested a review from rakita as a code owner September 25, 2024 16:05
@klkvr klkvr force-pushed the klkvr/network-chainspec branch from 10b1da8 to f89cefd Compare September 25, 2024 22:50
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.

cool, pedantic style nit

@@ -75,9 +75,9 @@ impl Status {
///
/// Sets the `chain` and `genesis`, `blockhash`, and `forkid` fields based on the [`ChainSpec`]
/// and head.
pub fn spec_builder(spec: &ChainSpec, head: &Head) -> StatusBuilder {
pub fn spec_builder(spec: impl EthChainSpec + Hardforks, head: &Head) -> StatusBuilder {
Copy link
Collaborator

Choose a reason for hiding this comment

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

style nit, can we convert this to a where clause

#[non_exhaustive]
pub struct NoopBlockReader;
pub struct NoopBlockReader<ChainSpec> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

we need a generic on this anyway so this is okay

@klkvr klkvr enabled auto-merge September 26, 2024 11:25
@klkvr klkvr added this pull request to the merge queue Sep 26, 2024
Merged via the queue into main with commit 65f2664 Sep 26, 2024
35 checks passed
@klkvr klkvr deleted the klkvr/network-chainspec branch September 26, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants