Skip to content
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

tendermint crate uses std features in ed25519-dalek #992

Closed
Tracked by #1158
soareschen opened this issue Sep 28, 2021 · 2 comments
Closed
Tracked by #1158

tendermint crate uses std features in ed25519-dalek #992

soareschen opened this issue Sep 28, 2021 · 2 comments
Labels
no_std no_std compatibility

Comments

@soareschen
Copy link
Contributor

soareschen commented Sep 28, 2021

Part of informalsystems/hermes#1158.

When the Cargo.toml field is set to ed25519-dalek = { version = "1", default-features = false, features = ["serde", "u64_backend"] }, we would get the following compile errors:

error[E0277]: the trait bound `alloc::string::String: DefaultIsZeroes` is not satisfied
   --> tendermint/src/private_key.rs:47:20
    |
47  |     Zeroizing::new(String::from_utf8(Base64::default().encode(&keypair_bytes[..])).unwrap())
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `DefaultIsZeroes` is not implemented for `alloc::string::String`
    |
    = note: required because of the requirements on the impl of `Zeroize` for `alloc::string::String`
note: required by `Zeroizing::<Z>::new`
   --> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/zeroize-1.1.1/src/lib.rs:428:5
    |
428 |     pub fn new(value: Z) -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0599]: no method named `serialize` found for struct `Zeroizing` in the current scope
  --> tendermint/src/private_key.rs:48:10
   |
48 |         .serialize(serializer)
   |          ^^^^^^^^^ method not found in `Zeroizing<alloc::string::String>`
@tony-iqlusion
Copy link
Collaborator

I don't see anything there using std.

It's using alloc, and it looks like you don't have the zeroize/alloc feature enabled.

@soareschen
Copy link
Contributor Author

Interesting, didn't realized that it was indirectly caused by zeroized/alloc not enabled. Fixed in 701f028. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no_std no_std compatibility
Projects
None yet
Development

No branches or pull requests

2 participants