-
Notifications
You must be signed in to change notification settings - Fork 437
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
ChainSpecEmbeddedResource #4450
Conversation
7f16ac0
to
0450dfc
Compare
Can we make it smart somehow? Ideas to brainstorm:
|
After a discussion with @smartprogrammer93, I see the solution as follows. To stay backward-compatible as much as possible, we keep the This should work for most of the users without breaking anything:
I don't think we need to make the process any smarter for now. Later, based on user feedback, we can consider a better solution. |
I'm a bit hesitant that we will override the default paths to built in chainspec. I don't like to be smarter than user. But not saying it's good or bad idea. Would like to have more input from others. |
Is the field "ReadChainspecFromFile" necessary in the "InitConfig" class? |
We are removing the flag. The latest suggestion is to look for the file in embedded resource, if it is not there, we will read the file. |
Will this method include this suggestion? |
We can include a warning that we are not using the chainspec from file if the file exists, but i dont think we should mention it being outdated or not. |
Wouldn't it be better if the user got notified that the client isn't using the chainspec file they provided with the reason why as a feedback? |
7a70954
to
ee16d6e
Compare
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'd also suggest always using file scope namespaces. It eliminates redundant nesting. Simply put ;
after the namespace and Visual Studio will do the rest.
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoaderExtensions.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoaderExtensions.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoaderExtensions.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoaderExtensions.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoaderExtensions.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoaderExtensions.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoaderExtensions.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoaderExtensions.cs
Outdated
Show resolved
Hide resolved
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.
Some smaller comments about readability and code organisation
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoaderExtensions.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoaderExtensions.cs
Outdated
Show resolved
Hide resolved
@MarekM25 I tested this per your request as follows:
It works as expected. |
Checked:
|
Co-authored-by: Falco <1364936+FalcoXYZ@users.noreply.github.com>
Resolves #4266
Changes:
Chainspec to be in embedded resources and read from there without requiring users to make any changes after updating. The only users who will have to make changes after an update are the ones running private networks.
Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that applyTesting
Requires testing
In case you checked yes, did you write tests??