-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix: build spec experience #331
Conversation
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #331 +/- ##
==========================================
+ Coverage 72.59% 74.29% +1.69%
==========================================
Files 56 56
Lines 10700 11233 +533
Branches 10700 11233 +533
==========================================
+ Hits 7768 8345 +577
+ Misses 1844 1746 -98
- Partials 1088 1142 +54
|
Looking good. Some notes:
I think
For some reason this does not work, not sure if it is a pop-cli issue or a pop-node issue, also something to keep in mind, |
You are right about the About this: |
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.
Looks good, would just appreciate some context in terms of the deprecation of release option. Why not leave the flexibility?
Would also want @al3mart to look this PR over before being merged.
My apologies for not mentioning it in the PR description. The deprecation of the The changes were made in a single commit 37bb25d. so will be easy to revert if we decide to keep it. What are your thoughts, @al3mart? A better approach suggested? |
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.
build spec might trigger a compilation. I feel that having the option of declaring if we want the profile to be release
or debug
can be convenient .
If we didn't have the flag anywhere else I think removing it might make more sense.
The flag was added mainly so the options for builds were consistent across sub commands
Maybe we can improve the doc as a way to clarify why that flag is present..
You are right, It makes sense to keep it consistent across the comment. I removed the deprecation message and added more information in the docs to clarify that this command builds the node if it hasn't been built yet. |
What is the difference in the outputted chain spec artifacts when using debug vs release? Can the runtime wasm be different? |
Yes you are right. Since there are quite a few options for this command that are needed, it would be nice to have an error if for example |
Yes, makes sense. Logs of the command |
Regarding the resulting wasm I'd say that the only possible difference is that if it is not built in release it may contain some extra debug information that can be logged. Release also tries to compile with optimization. This comes to mind - https://paritytech.github.io/polkadot-sdk/master/frame_support/derive.RuntimeDebugNoBound.html |
a27cb19
to
a1abb01
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 think the change on default value for --default-bootnode
makes sense. I can see how that was confusing.
Love the addition of --chain
. Was definitely something needed.
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 think the multi/spinner can be improved a little quite easily.
As mentioned separately, there is no consideration for builds using the production profile, which is potentially an important use case. Whilst this may have no effect on the resulting wasm, it did mean a rebuild of the node despite me already having a production build at target/production. This obviously is a waste of time and local storage and also might be frustrating to an end user. This might be an edge case, but I think the tooling should ideally cater to both novice and professional devs. |
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.
All good, thanks!
Related to this, the same happens if you have a binary built already using the default debug profile and then run the build spec command - it rebuilds it all with the release profile as that is defaulted to true. Purely based on UX, might it be best to allow the user to either specify via --debug (-d), --release (-r), --profile name (-p) and if not specified, simply add a prompt with these same options? |
6ba8d0f
to
f0bc925
Compare
f0bc925
to
204296a
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.
LGTM.
Looking forward to merging this one!
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.
The new commits after my last approval seem to make sense. Thanks for addressing those!
* fix: add chain to specify the chain specification * fix: default_bootnode by default to true * chore: fmt * chore: deprecate flag --release in build specs * fix: clean output (#334) * fix: undo deprecation of --release flag * refactor: small fix * style: remove extra space * fix(spec): better handling of spinner * style: use spinner instead of multispinner * docs: help message to include build * feat: reuse existing chain spec * refactor: remove clone * refactor: opt in to edit provided chain spec * docs: improve * refactor: flow flag input * fix: prepare_output_path * refactor: resolve small improvements * fix: protocol id prompt * fix: spinner * fix: docs * test: test cli * chore: refactor * chore: amend test * feat: production profile * refactor: improve profile experience * chore: feedback and rebase * chore: add profile tests * fix(test): parachain_lifecycle * style: fmt * fix: clippy * fix: cli required changes introduced by PR * fix: test * fix: clippy * docs: deprecation message --------- Co-authored-by: Alejandro Martinez Andres <[email protected]> Co-authored-by: Daanvdplas <[email protected]>
Fixes #305
Changes
Add the flag
--chain
to specify the chain specification. Is to add this flag: https://github.com/paritytech/polkadot-sdk/blob/master/substrate/client/cli/src/params/shared_params.rs#L32 when running thebuild-spec
command of the binary.To generate
pop-node
chain_spec mainnet for example can be done with:pop build spec --release --id 4024 --type live --relay paseo --chain mainnet
(https://github.com/r0gue-io/pop-node/blob/main/node/src/command.rs#L73)
As pointed in the issue the
--default-bootnode
was a bit confusing because by default was set to true and to don't include localhost as the default bootnode has to be specified with--default-bootnode false
.Set by default to false and included if specified
--default-bootnode
.The other approach is to change the name to
--disable-default-bootnode
and set it by default to false unless the flag is included.