-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add serde
feature flag to primitives
#13027
Add serde
feature flag to primitives
#13027
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.
Something like that for the rest should do it.
serde_full
feature flag to primitivesserde
feature flag to primitives
serde
feature flag to primitivesno_std
availability of primitives and add serde
feature flag
@bkchr Any news on this? I'll happily split the PR, keep it up to date.. if there's a chance, this can go through. |
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
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.
Sorry for the long delay, but there are also still things that need to be improved!
no_std
availability of primitives and add serde
feature flagserde
feature flag to primitives
LGTM. @haerdib Would you be willing to continue work on this (rebase)? I already did some work here: michalkucharczyk@17a7981, michalkucharczyk@218f1e8. But I am not sure how I can share it. |
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.
@haerdib Would you be willing to continue work on this (rebase)? I already did some work here: michalkucharczyk@17a7981, michalkucharczyk@218f1e8. But I am not sure how I can share it.
So does this PR still have a chance of being merged eventually? If so, I can do the rebase, that's not a problem. Thanks for the commits. I'll happily take a look at them 👍
@bkchr thanks a lot for the tip! Honestly, didn't expect that 🥳 |
/tip medium |
@bkchr A medium tip was successfully submitted for haerdib (FsnxqJnqWVNMZZgxaQdhaCk9c5sL3WSggRCRqp1qEzk1L2i on kusama). https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.polkadot.io#/referenda |
bot merge |
This is followup of #13027. `Aura` need to enable `serde` feature in dependent crates, otherwise test-substrate-runtime compilation fails with the following error if `serde` is enabled: ``` error: cannot find macro `format` in this scope --> /home/miszka/parity/10-genesis-config/substrate-master/primitives/consensus/aura/src/lib.rs:50:3 | 50 | app_crypto!(ed25519, AURA); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider importing one of these items: scale_info::prelude::format sp_application_crypto::format = note: this error originates in the macro `$crate::app_crypto_public_common_if_serde` which comes from the expansion of the macro `app_crypto` (in Nightly builds, run with -Z macro-backtrace for more info) ```
This pull request has been mentioned on Polkadot Forum. There might be relevant details there: |
This is followup of #13027. `Aura` need to enable `serde` feature in dependent crates, otherwise test-substrate-runtime compilation fails with the following error if `serde` is enabled: ``` error: cannot find macro `format` in this scope --> /home/miszka/parity/10-genesis-config/substrate-master/primitives/consensus/aura/src/lib.rs:50:3 | 50 | app_crypto!(ed25519, AURA); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider importing one of these items: scale_info::prelude::format sp_application_crypto::format = note: this error originates in the macro `$crate::app_crypto_public_common_if_serde` which comes from the expansion of the macro `app_crypto` (in Nightly builds, run with -Z macro-backtrace for more info) ```
Re-submitting this tip, as the original one (https://kusama.polkassembly.io/referenda/196) was wasted due to |
/tip medium |
@mordamax A medium tip was successfully submitted for @haerdib (FsnxqJnqWVNMZZgxaQdhaCk9c5sL3WSggRCRqp1qEzk1L2i on kusama). https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.polkadot.io#/referenda |
* add serde_full feature flag add serde_full to sp_runtime add space to toml add serde_full to application-crypto add serde_full to arithmetic fix arithmetic add serde full to beefy add serde full to consensus add serde_full to core add serdefull to finality grandpa add serde_full to several primitives crates make rpc no_std compatible add scale info to runtime make serializer no_std compatible add serde full to storage add full serde to version add serde full to weights add all serde_full features add . to comment add missing impl-serde fix no-std build fix build add full_crypto to serde_full serde_full also implements crypto full_serde does not work with full_crytpo. needs std no no_std serde impl possible also for crypto std is necessary no serde full for application crypto fix arithmetic fix tomls fix some things impl fmt for Signature add serialize to Public add impl_maybe_marker_serde_full fix sp-application-crypto toml add serde feature flag fix clippy fix toml grandpa fix grandpa rename if_std to if_serde keystore is not no_std compatible make keystore vrf no_std compatible fix nopos-elections fix rpc fix serializer fix test-primitives fix version add comment add serde full only import for format string remove all(serde_full and full_crypot) as serde_full enforces full_crypto make comment better readable even better comment clean up rpc toml clean up toml clean up serializer toml clean up storage toml fix std build update .lock fix sp-version move sp_std import test extern crate alloc replace sp_std with core add missing core sp_core: serde feature do not enforce full crypto application-crypto: serde feature do not enforce full crypto rename serde_full to serde add dep:serde and alloc to default feature add full_crypto and remove unnecessary debu/fmt impls for serde update comment remove obolsete change in display AccountId32 remove extra changes minimize diff revert keystore changes remove std from keystore remove full-crypto feature fix serde import fix comment fix feature = serde * rename serde_full to serde * move #[doc(hidden)] back * remove feature = full crypto require frm MultiSigner * reorder serde and scale_info import * fix bs58 missing alloc import in serde feature * add `from_string` to serde feature and add unimplemented * remove serde feature from fixed_point display * Remove serde/alloc Co-authored-by: Davide Galassi <davxy@datawok.net> * Update primitives/consensus/babe/Cargo.toml Co-authored-by: Bastian Köcher <git@kchr.de> * Update primitives/arithmetic/src/fixed_point.rs Co-authored-by: Bastian Köcher <git@kchr.de> * revert `from_string`fixed impl back to std only * remove duplicate runtime string impl * use sp_std::alloc * remove no_std compatible rpc * remove no_std compatibility from serializer * rename mpl_maybe_marker_serde to std_or_serde * update .lock * add sp-std to executor * fix sp-std import * fix sp_std::format import * use crate import * add serde feature * Update primitives/core/src/lib.rs --------- Co-authored-by: Davide Galassi <davxy@datawok.net> Co-authored-by: Bastian Köcher <git@kchr.de>
This is followup of #13027. `Aura` need to enable `serde` feature in dependent crates, otherwise test-substrate-runtime compilation fails with the following error if `serde` is enabled: ``` error: cannot find macro `format` in this scope --> /home/miszka/parity/10-genesis-config/substrate-master/primitives/consensus/aura/src/lib.rs:50:3 | 50 | app_crypto!(ed25519, AURA); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider importing one of these items: scale_info::prelude::format sp_application_crypto::format = note: this error originates in the macro `$crate::app_crypto_public_common_if_serde` which comes from the expansion of the macro `app_crypto` (in Nightly builds, run with -Z macro-backtrace for more info) ```
Re-submitting this tip, as the second one was wasted due to insufficient permissions to run Related: #14260 |
/tip medium |
The tip has actually went through - it appears that we have incorrectly (?) treated an |
* add serde_full feature flag add serde_full to sp_runtime add space to toml add serde_full to application-crypto add serde_full to arithmetic fix arithmetic add serde full to beefy add serde full to consensus add serde_full to core add serdefull to finality grandpa add serde_full to several primitives crates make rpc no_std compatible add scale info to runtime make serializer no_std compatible add serde full to storage add full serde to version add serde full to weights add all serde_full features add . to comment add missing impl-serde fix no-std build fix build add full_crypto to serde_full serde_full also implements crypto full_serde does not work with full_crytpo. needs std no no_std serde impl possible also for crypto std is necessary no serde full for application crypto fix arithmetic fix tomls fix some things impl fmt for Signature add serialize to Public add impl_maybe_marker_serde_full fix sp-application-crypto toml add serde feature flag fix clippy fix toml grandpa fix grandpa rename if_std to if_serde keystore is not no_std compatible make keystore vrf no_std compatible fix nopos-elections fix rpc fix serializer fix test-primitives fix version add comment add serde full only import for format string remove all(serde_full and full_crypot) as serde_full enforces full_crypto make comment better readable even better comment clean up rpc toml clean up toml clean up serializer toml clean up storage toml fix std build update .lock fix sp-version move sp_std import test extern crate alloc replace sp_std with core add missing core sp_core: serde feature do not enforce full crypto application-crypto: serde feature do not enforce full crypto rename serde_full to serde add dep:serde and alloc to default feature add full_crypto and remove unnecessary debu/fmt impls for serde update comment remove obolsete change in display AccountId32 remove extra changes minimize diff revert keystore changes remove std from keystore remove full-crypto feature fix serde import fix comment fix feature = serde * rename serde_full to serde * move #[doc(hidden)] back * remove feature = full crypto require frm MultiSigner * reorder serde and scale_info import * fix bs58 missing alloc import in serde feature * add `from_string` to serde feature and add unimplemented * remove serde feature from fixed_point display * Remove serde/alloc Co-authored-by: Davide Galassi <davxy@datawok.net> * Update primitives/consensus/babe/Cargo.toml Co-authored-by: Bastian Köcher <git@kchr.de> * Update primitives/arithmetic/src/fixed_point.rs Co-authored-by: Bastian Köcher <git@kchr.de> * revert `from_string`fixed impl back to std only * remove duplicate runtime string impl * use sp_std::alloc * remove no_std compatible rpc * remove no_std compatibility from serializer * rename mpl_maybe_marker_serde to std_or_serde * update .lock * add sp-std to executor * fix sp-std import * fix sp_std::format import * use crate import * add serde feature * Update primitives/core/src/lib.rs --------- Co-authored-by: Davide Galassi <davxy@datawok.net> Co-authored-by: Bastian Köcher <git@kchr.de>
This is followup of paritytech#13027. `Aura` need to enable `serde` feature in dependent crates, otherwise test-substrate-runtime compilation fails with the following error if `serde` is enabled: ``` error: cannot find macro `format` in this scope --> /home/miszka/parity/10-genesis-config/substrate-master/primitives/consensus/aura/src/lib.rs:50:3 | 50 | app_crypto!(ed25519, AURA); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider importing one of these items: scale_info::prelude::format sp_application_crypto::format = note: this error originates in the macro `$crate::app_crypto_public_common_if_serde` which comes from the expansion of the macro `app_crypto` (in Nightly builds, run with -Z macro-backtrace for more info) ```
Adds
serde
feature flag to the primitives. This way, serde (de)serialization can also be used inno_std
environments.The following crates now implement the
serde
flag:sp-application-crypto
sp-arithmetic
sp-consensus-babe
sp-consensus-beefy
sp-consensus-grandpa
sp-consensus-slots
sp-core
sp-mmr-primitives
sp-npos-elections
sp-runtime
sp-storage
sp-test-primitives
sp-version
sp-weights
closes #12994
Kusama address: FsnxqJnqWVNMZZgxaQdhaCk9c5sL3WSggRCRqp1qEzk1L2i