-
Notifications
You must be signed in to change notification settings - Fork 47
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
chore: cleanup chainspecs #643
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ntn-x2
force-pushed
the
aa/chainspec-cleanup
branch
from
May 22, 2024 10:01
373ae86
to
ae685d1
Compare
Ad96el
reviewed
May 28, 2024
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 changes. We got rid of a lot of dead code. I tried running the node, but it results in an error.
Ad96el
previously approved these changes
May 28, 2024
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.
LGTM. The commands are running
Ad96el
pushed a commit
that referenced
this pull request
May 31, 2024
Fixes KILTprotocol/ticket#3404. Cleaning up the different chainspecs required also the modules to be restructured a bit. To note is the following: * Removal of the `--runtime` flag. Now any possible runtime is parsed solely from the provided `--chain` (or `--dev`) parameter (relevant for starting up the node going forward) * Removal of the unused chainspecs and renaming of the folder (relevant for starting up the node going forward) * Removal of all maintain scripts, which can be re-added if needed * Removal of the clone runtime Of interest is the change from this ```rust match (id, runtime) { ("clone-dev", _) => Ok(Box::new(chain_spec::clone::get_chain_spec_dev()?)), ("clone-new", _) => Ok(Box::new(chain_spec::clone::new_chain_spec()?)), ("dev", _) => Ok(Box::new(chain_spec::peregrine::get_chain_spec_dev()?)), ("spiritnet-dev", _) => Ok(Box::new(chain_spec::spiritnet::get_chain_spec_dev()?)), ("peregrine-new", _) => Ok(Box::new(chain_spec::peregrine::make_new_spec()?)), ("rilt-new", _) => Ok(Box::new(chain_spec::peregrine::get_chain_spec_rilt()?)), ("rilt", _) => Ok(Box::new(chain_spec::peregrine::load_rilt_spec()?)), ("spiritnet", _) => Ok(Box::new(chain_spec::spiritnet::load_spiritnet_spec()?)), ("", "spiritnet") => Ok(Box::new(chain_spec::spiritnet::get_chain_spec_dev()?)), ("", "peregrine") => Ok(Box::new(chain_spec::peregrine::get_chain_spec_dev()?)), (path, "spiritnet") => Ok(Box::new(chain_spec::spiritnet::ChainSpec::from_json_file(path.into())?)), (path, "peregrine") => Ok(Box::new(chain_spec::peregrine::ChainSpec::from_json_file(path.into())?)), (path, "clone") => Ok(Box::new(chain_spec::clone::ChainSpec::from_json_file(path.into())?)), _ => Err("Unknown KILT parachain spec".to_owned()), } ``` to this ```rust match s { // Peregrine development "dev" => Ok(Self::Peregrine(PeregrineRuntime::Dev)), // New blank Peregrine chainspec "peregrine-new" => Ok(Self::Peregrine(PeregrineRuntime::New)), // Peregrine chainspec "peregrine" => Ok(Self::Peregrine(PeregrineRuntime::Peregrine)), // Peregrine staging chainspec "peregrine-stg" => Ok(Self::Peregrine(PeregrineRuntime::PeregrineStg)), // RILT chainspec "rilt" => Ok(Self::Peregrine(PeregrineRuntime::Rilt)), // Any other Peregrine-based chainspec s if s.contains("peregrine") => Ok(Self::Peregrine(PeregrineRuntime::Other(s.to_string()))), // Spiritnet development "spiritnet-dev" => Ok(Self::Spiritnet(SpiritnetRuntime::Dev)), // New blank Spiritnet chainspec "spiritnet-new" => Ok(Self::Spiritnet(SpiritnetRuntime::New)), // Spiritnet chainspec "spiritnet" => Ok(Self::Spiritnet(SpiritnetRuntime::Spiritnet)), // Any other Spiritnet-based chainspec s if s.contains("spiritnet") => Ok(Self::Spiritnet(SpiritnetRuntime::Other(s.to_string()))), _ => Err(format!("Unknown chainspec id provided: {s}")), } ```
5 tasks
Ad96el
pushed a commit
that referenced
this pull request
Aug 20, 2024
Fixes KILTprotocol/ticket#3404. Cleaning up the different chainspecs required also the modules to be restructured a bit. To note is the following: * Removal of the `--runtime` flag. Now any possible runtime is parsed solely from the provided `--chain` (or `--dev`) parameter (relevant for starting up the node going forward) * Removal of the unused chainspecs and renaming of the folder (relevant for starting up the node going forward) * Removal of all maintain scripts, which can be re-added if needed * Removal of the clone runtime Of interest is the change from this ```rust match (id, runtime) { ("clone-dev", _) => Ok(Box::new(chain_spec::clone::get_chain_spec_dev()?)), ("clone-new", _) => Ok(Box::new(chain_spec::clone::new_chain_spec()?)), ("dev", _) => Ok(Box::new(chain_spec::peregrine::get_chain_spec_dev()?)), ("spiritnet-dev", _) => Ok(Box::new(chain_spec::spiritnet::get_chain_spec_dev()?)), ("peregrine-new", _) => Ok(Box::new(chain_spec::peregrine::make_new_spec()?)), ("rilt-new", _) => Ok(Box::new(chain_spec::peregrine::get_chain_spec_rilt()?)), ("rilt", _) => Ok(Box::new(chain_spec::peregrine::load_rilt_spec()?)), ("spiritnet", _) => Ok(Box::new(chain_spec::spiritnet::load_spiritnet_spec()?)), ("", "spiritnet") => Ok(Box::new(chain_spec::spiritnet::get_chain_spec_dev()?)), ("", "peregrine") => Ok(Box::new(chain_spec::peregrine::get_chain_spec_dev()?)), (path, "spiritnet") => Ok(Box::new(chain_spec::spiritnet::ChainSpec::from_json_file(path.into())?)), (path, "peregrine") => Ok(Box::new(chain_spec::peregrine::ChainSpec::from_json_file(path.into())?)), (path, "clone") => Ok(Box::new(chain_spec::clone::ChainSpec::from_json_file(path.into())?)), _ => Err("Unknown KILT parachain spec".to_owned()), } ``` to this ```rust match s { // Peregrine development "dev" => Ok(Self::Peregrine(PeregrineRuntime::Dev)), // New blank Peregrine chainspec "peregrine-new" => Ok(Self::Peregrine(PeregrineRuntime::New)), // Peregrine chainspec "peregrine" => Ok(Self::Peregrine(PeregrineRuntime::Peregrine)), // Peregrine staging chainspec "peregrine-stg" => Ok(Self::Peregrine(PeregrineRuntime::PeregrineStg)), // RILT chainspec "rilt" => Ok(Self::Peregrine(PeregrineRuntime::Rilt)), // Any other Peregrine-based chainspec s if s.contains("peregrine") => Ok(Self::Peregrine(PeregrineRuntime::Other(s.to_string()))), // Spiritnet development "spiritnet-dev" => Ok(Self::Spiritnet(SpiritnetRuntime::Dev)), // New blank Spiritnet chainspec "spiritnet-new" => Ok(Self::Spiritnet(SpiritnetRuntime::New)), // Spiritnet chainspec "spiritnet" => Ok(Self::Spiritnet(SpiritnetRuntime::Spiritnet)), // Any other Spiritnet-based chainspec s if s.contains("spiritnet") => Ok(Self::Spiritnet(SpiritnetRuntime::Other(s.to_string()))), _ => Err(format!("Unknown chainspec id provided: {s}")), } ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes https://github.com/KILTprotocol/ticket/issues/3404.
Cleaning up the different chainspecs required also the modules to be restructured a bit. To note is the following:
--runtime
flag. Now any possible runtime is parsed solely from the provided--chain
(or--dev
) parameter (relevant for starting up the node going forward)Of interest is the change from this
to this