-
Notifications
You must be signed in to change notification settings - Fork 1.6k
make polkadot-runtime optional feature #3820
Conversation
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.
Great, thanks!
If we want to avoid accidentally disabling all of the runtimes, perhaps introducing another feature no-runtimes
and throwing a compilation error in case it's not explicitly enabled is reasonable?
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 code isn't adapted for these feature changes.
could you elaborate? do you mean
|
I mean, if you disable the |
Ahh I see that all usage is hidden behind the Same applied for the client crate. We can just throw a runtime error if someone calls the functions and no runtime is enabled. |
* master: Bump tokio from 1.10.1 to 1.11.0 (#3821) Add words to the dictionnary (#3819) Add vault secrets to puplish-rustdoc job (#3816) Change pipeline to use Vault (#3722) Don't drop UMP queue items if weight exhausted (#3784) Fix flaky availability-recovery test (#3812) participate in disputes only if haven't voted already (#3796)
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.
Shall we add a CI check to make sure the no-default-features
compilation works?
Fine by me. |
It doesn't work for |
pub type PolkadotChainSpec = service::GenericChainSpec<polkadot::GenesisConfig, Extensions>; | ||
|
||
// Dummy chain spec, in case when we don't have the native runtime. | ||
pub type DummyChainSpec = service::GenericChainSpec<(), Extensions>; |
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.
not sure if this is correct
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.
Yeah should be fine.
It would be nice to use |
We could also use |
This PR allows only this approach, but you'd have only one native runtime if you disable polkadot and enable rococo feature. |
pub type PolkadotChainSpec = service::GenericChainSpec<polkadot::GenesisConfig, Extensions>; | ||
|
||
// Dummy chain spec, in case when we don't have the native runtime. | ||
pub type DummyChainSpec = service::GenericChainSpec<(), Extensions>; |
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.
Yeah should be fine.
set -e | ||
|
||
pushd node/service && cargo check --no-default-features && popd | ||
pushd cli && cargo check --no-default-features --features "service" && popd |
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.
Enabling a feature defeats a little bit the name of this file, but fine :P :D
bot merge |
Trying merge. |
* master: Bump tracing from 0.1.26 to 0.1.27 (#3841) Companion for substrate#9711 (#3801) fix complaints in CI (#3838) dockerfiles: upgrade to ubuntu:20.04; some chore (#3828) make polkadot-runtime optional feature (#3820) Companion for #9648 (#3757) Substrate Companion #9737 (#3830) Add logging for worker spawn failures (#3827) Add Canvas (#3823) Allow staking miner to use different election algorithms (#3752)
* master: (21 commits) Add build with docker info to README (#3843) improve approval tracing (#3846) UMP: Support Overweight messages (#3575) Companion for substrate#9115 (#3265) Better error messages. (#3835) Put all authorities of a session into `SessionInfo`. (#3813) Bump tracing from 0.1.26 to 0.1.27 (#3841) Companion for substrate#9711 (#3801) fix complaints in CI (#3838) dockerfiles: upgrade to ubuntu:20.04; some chore (#3828) make polkadot-runtime optional feature (#3820) Companion for #9648 (#3757) Substrate Companion #9737 (#3830) Add logging for worker spawn failures (#3827) Add Canvas (#3823) Allow staking miner to use different election algorithms (#3752) Do not expire HRMP open channel requests (#3543) Bump tokio from 1.10.1 to 1.11.0 (#3821) Add words to the dictionnary (#3819) Add vault secrets to puplish-rustdoc job (#3816) ...
See paritytech/parity-bridges-common#1053 (comment) for the context.