tendermint-rs icon indicating copy to clipboard operation
tendermint-rs copied to clipboard

no_std compatibility

Open romac opened this issue 3 years ago • 3 comments

This issue tracks the current status of no_std compatibility for the tendermint and ibc crates.

Dependency on std

Code-level dependencies on std items, like Box, collections, Error, file systems operations, etc.

These dependencies should be categorized depending on whether they are provided by the alloc crate or not. Only items provided by alloc can be used in no_std context, given that a global allocator is available.

TODO: Look more closely into no-std-compat.

tendermint

Pervasive, to be detailed further.

ibc

Pervasive, to be detailed further.

Dependencies

no_std compatibility of our dependencies, via manual inspection (could not get cargo-nono to work.

tendermint + ibc

no_std by default

no_std via feature

incompatible

  • thiserror (need to use https://github.com/dtolnay/thiserror/pull/64#issuecomment-735805334)
  • toml (only used for parsing Tendermint config, could be feature-guarded for std)

ibc

no_std by default

no_std via feature

std-only

romac avatar Mar 03 '21 10:03 romac

the ibc-rs dependency on bech32 will be removed when some refactoring happens as part of ibc-rs issue informalsystems/ibc-rs-tmp#88

andynog avatar Mar 04 '21 14:03 andynog

We have alloc only bech32 implementation that can be used in subtle-encoding

https://crates.io/crates/subtle-encoding

zmanian avatar Mar 31 '21 14:03 zmanian

when I move std to no_std, I replace anomaly to anyhow, thiserror to displaydoc, and use sp-std. but re-code after I meet time mod error, time mod is not support no_std. This Link: https://github.com/informalsystems/tendermint-rs/issues/884

DaviRain-Su avatar May 19 '21 03:05 DaviRain-Su