-
Notifications
You must be signed in to change notification settings - Fork 59
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
alloc
feature added, to gate unicode normalization
#57
alloc
feature added, to gate unicode normalization
#57
Conversation
Maybe I should introduce |
unicode_normalization
enabled in no-stdalloc
feature added, to gate unicode normalization
Otherwise, looks good! Thanks. |
Thanks for fixing it up! Can you squash the fixes into the patches that they fix please. We don't squash when merging so each patch should be correct on its own. Sorry for taking so long to get back to this. |
I'd squash all the commits to the single one, and force push. @tcharding would that work for you? |
Yep, that is fine for me. |
e63f0b2
to
1372108
Compare
@tcharding I've squashed all the patches into single one. |
Thanks for the effort @michalkucharczyk. I started on the same before seeing this 🙈 here is the issue that should be referenced: #55 Please see #59 too which re-enables some unit tests that accidentally never ran - could be relevant. |
Description updated.
I've check the tests (with |
1372108
to
c62f91b
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.
ACK c62f91b
Thanks man! |
c62f91b
to
9180d56
Compare
@stevenroose thanks for review - all addressed. would appreciate your feedback again. |
9180d56
to
eb35a97
Compare
what is wrong with enabling it? if we are in std it shall be propagated
there, right?
…On Sat, 3 Feb 2024 at 00:05, Tobin C. Harding ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Cargo.toml
<#57 (comment)>
:
> @@ -13,8 +13,9 @@ edition = "2018"
[features]
default = [ "std" ]
-std = [ "unicode-normalization", "serde/std" ]
+std = [ "alloc", "serde/std", "unicode-normalization/std" ]
Yes but we do not need the unicode-normalization "std" feature so why
enable it? Also "unicode-normalization" is enabled already in "alloc".
—
Reply to this email directly, view it on GitHub
<#57 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANF4TUBGDBRCP4AP3GGFGLYRVWNBAVCNFSM6AAAAAA62PCI2KVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQNRQGYYDCMBUGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Parity Technologies is a limited company registered in England and Wales
with registered number 09760015 and registered office at c/o Ignition Law,
1 Sans Walk, London, England, EC1R 0LT. This message is intended solely for
the addressee(s) and may contain confidential information. If you have
received this message in error, please notify us, and immediately and
permanently delete it. Do not use, copy or disclose the information
contained in this message or in any attachment. For information about how
we process data and monitor communications please see our Privacy policy
(https://www.parity.io/privacy/ <https://www.parity.io/privacy/>)and for
terms of use please see our Terms of Use policy
(https://www.parity.io/terms/ <https://www.parity.io/terms/>).
|
@@ -49,7 +50,7 @@ zeroize = { version = "1.5", features = ["zeroize_derive"], optional = true } | |||
|
|||
# Unexported dependnecies | |||
bitcoin_hashes = { version = ">=0.12, <=0.13", default-features = false } | |||
unicode-normalization = { version = "=0.1.22", optional = true } | |||
unicode-normalization = { version = "=0.1.22", default-features = false, optional = true } |
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.
Oh I did not notice before but I don't think this should be a fixed version? Should be version = "0.1.22"
.
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.
No then it will upgrade and this crate has repeatedly broken MSRV for some of my projects. It's an internal dep so the version used shouldn't matter. Luckily 0.1.22 now is over a year old and seems like he saturated the project too. Which is ok :)
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.
It makes it a bit hard to package on distributions though if dependencies get out of sync, one would have to patch the Cargo.toml
file to allow other versions.
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 I rekon we should handle MSRV breakage with pinning not in the manifest like this.
I think we are talking about "unicode-normalization" from "std", right? If its an optional dependency then it should be optional, if its enabled in "std" its not really optional. |
I wanted it to be optional in no-std.
Originally it was always enabled in std, so I kept it enabled (with default
features on, which is std) to be backward compatible.
…On Sat, 3 Feb 2024 at 00:20, Tobin C. Harding ***@***.***> wrote:
what is wrong with enabling it? if we are in std it shall be propagated
there, right?
I think we are talking about "unicode-normalization" from "std", right? If
its an optional dependency then it should be optional, if its enabled in
"std" its not really optional.
—
Reply to this email directly, view it on GitHub
<#57 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANF4TVZI5QA45C3J4TXSRTYRVYETAVCNFSM6AAAAAA62PCI2KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRUHA4TKMZVHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Parity Technologies is a limited company registered in England and Wales
with registered number 09760015 and registered office at c/o Ignition Law,
1 Sans Walk, London, England, EC1R 0LT. This message is intended solely for
the addressee(s) and may contain confidential information. If you have
received this message in error, please notify us, and immediately and
permanently delete it. Do not use, copy or disclose the information
contained in this message or in any attachment. For information about how
we process data and monitor communications please see our Privacy policy
(https://www.parity.io/privacy/ <https://www.parity.io/privacy/>)and for
terms of use please see our Terms of Use policy
(https://www.parity.io/terms/ <https://www.parity.io/terms/>).
|
Oh I see. I'll ack this as is then and we can look at the features more closely later. Thanks for explaining. |
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.
ACK eb35a97
Is this failure: |
Can you rebase on master so that the MSRV build works? Thanks. |
This commit introduces the `alloc` feature. The alloc feature is intended to use in no-std environments which are allowed to use alloc. New feature enables: - the unicode-normalization, and all related methods (parse_in,normalize_utf8_cow,parse,to_seed) - to_entropy() method as Vec is available in alloc,
eb35a97
to
86353a5
Compare
Done (force pushed). |
@stevenroose can you kick CI please. On #64 as well. |
any updates here? |
This functionality is required for #1984. This PR enables [`sp-keyring`](https://github.com/paritytech/polkadot-sdk/blob/21d36b7b4229c4d5225944f197918cde23fda4ea/substrate/primitives/keyring/src/sr25519.rs#L31-L40) in `no-std` environments, allowing to generate the public key (e.g. `AccountKeyring::Alice.public().to_ss58check()`), which can be later used in the any of built-in [_runtime-genesis-config_ variant](https://github.com/paritytech/polkadot-sdk/blob/21d36b7b4229c4d5225944f197918cde23fda4ea/polkadot/node/service/src/chain_spec.rs#L1066-L1073). The proposal is as follows: - expose [`core::Pair` trait](https://github.com/paritytech/polkadot-sdk/blob/d6f15306282e3de848a09c9aa9cba6f95a7811f0/substrate/primitives/core/src/crypto.rs#L832) in `no-std`, - `full_crypto` feature enables `sign` method, - `std` feature enables `generate_with_phrase` and `generate` methods (randomness is required), - All other functionality, currently gated by `full_crypto` will be available unconditionally (`no-std`): -- `from_string` -- `from_string_with_seed` -- `from seed` -- `from_seed_slice` -- `from_phrase` -- `derive` -- `verify` --- Depends on rust-bitcoin/rust-bip39#57 --------- Co-authored-by: command-bot <> Co-authored-by: Davide Galassi <[email protected]>
This functionality is required for #1984. This PR enables [`sp-keyring`](https://github.com/paritytech/polkadot-sdk/blob/21d36b7b4229c4d5225944f197918cde23fda4ea/substrate/primitives/keyring/src/sr25519.rs#L31-L40) in `no-std` environments, allowing to generate the public key (e.g. `AccountKeyring::Alice.public().to_ss58check()`), which can be later used in the any of built-in [_runtime-genesis-config_ variant](https://github.com/paritytech/polkadot-sdk/blob/21d36b7b4229c4d5225944f197918cde23fda4ea/polkadot/node/service/src/chain_spec.rs#L1066-L1073). The proposal is as follows: - expose [`core::Pair` trait](https://github.com/paritytech/polkadot-sdk/blob/d6f15306282e3de848a09c9aa9cba6f95a7811f0/substrate/primitives/core/src/crypto.rs#L832) in `no-std`, - `full_crypto` feature enables `sign` method, - `std` feature enables `generate_with_phrase` and `generate` methods (randomness is required), - All other functionality, currently gated by `full_crypto` will be available unconditionally (`no-std`): -- `from_string` -- `from_string_with_seed` -- `from seed` -- `from_seed_slice` -- `from_phrase` -- `derive` -- `verify` --- Depends on rust-bitcoin/rust-bip39#57 --------- Co-authored-by: command-bot <> Co-authored-by: Davide Galassi <[email protected]>
This functionality is required for paritytech#1984. This PR enables [`sp-keyring`](https://github.com/paritytech/polkadot-sdk/blob/21d36b7b4229c4d5225944f197918cde23fda4ea/substrate/primitives/keyring/src/sr25519.rs#L31-L40) in `no-std` environments, allowing to generate the public key (e.g. `AccountKeyring::Alice.public().to_ss58check()`), which can be later used in the any of built-in [_runtime-genesis-config_ variant](https://github.com/paritytech/polkadot-sdk/blob/21d36b7b4229c4d5225944f197918cde23fda4ea/polkadot/node/service/src/chain_spec.rs#L1066-L1073). The proposal is as follows: - expose [`core::Pair` trait](https://github.com/paritytech/polkadot-sdk/blob/d6f15306282e3de848a09c9aa9cba6f95a7811f0/substrate/primitives/core/src/crypto.rs#L832) in `no-std`, - `full_crypto` feature enables `sign` method, - `std` feature enables `generate_with_phrase` and `generate` methods (randomness is required), - All other functionality, currently gated by `full_crypto` will be available unconditionally (`no-std`): -- `from_string` -- `from_string_with_seed` -- `from seed` -- `from_seed_slice` -- `from_phrase` -- `derive` -- `verify` --- Depends on rust-bitcoin/rust-bip39#57 --------- Co-authored-by: command-bot <> Co-authored-by: Davide Galassi <[email protected]>
This functionality is required for paritytech#1984. This PR enables [`sp-keyring`](https://github.com/paritytech/polkadot-sdk/blob/21d36b7b4229c4d5225944f197918cde23fda4ea/substrate/primitives/keyring/src/sr25519.rs#L31-L40) in `no-std` environments, allowing to generate the public key (e.g. `AccountKeyring::Alice.public().to_ss58check()`), which can be later used in the any of built-in [_runtime-genesis-config_ variant](https://github.com/paritytech/polkadot-sdk/blob/21d36b7b4229c4d5225944f197918cde23fda4ea/polkadot/node/service/src/chain_spec.rs#L1066-L1073). The proposal is as follows: - expose [`core::Pair` trait](https://github.com/paritytech/polkadot-sdk/blob/d6f15306282e3de848a09c9aa9cba6f95a7811f0/substrate/primitives/core/src/crypto.rs#L832) in `no-std`, - `full_crypto` feature enables `sign` method, - `std` feature enables `generate_with_phrase` and `generate` methods (randomness is required), - All other functionality, currently gated by `full_crypto` will be available unconditionally (`no-std`): -- `from_string` -- `from_string_with_seed` -- `from seed` -- `from_seed_slice` -- `from_phrase` -- `derive` -- `verify` --- Depends on rust-bitcoin/rust-bip39#57 --------- Co-authored-by: command-bot <> Co-authored-by: Davide Galassi <[email protected]>
This PR introduces the
alloc
feature.The
alloc
is intended to use in no-std environments which are allowed to usealloc
. New feature enables:unicode-normalization
, and all related methods (parse_in
,normalize_utf8_cow
,parse
,to_seed
)fn to_entropy()
method asVec
is available inalloc
,Some formatting sneaked in, too.
Fix for #55.