cosmos-rust icon indicating copy to clipboard operation
cosmos-rust copied to clipboard

Enable cosmrs support `no_std`

Open DaviRain-Su opened this issue 2 years ago • 7 comments

DaviRain-Su avatar Apr 23 '23 02:04 DaviRain-Su

Do you have an actual use case for cosmrs + no_std?

In particular it currently uses eyre for error handling, which does not support no_std.

It would be nice to wait for the stabilization of the Error trait in core before proceeding. I can't say I'm terribly happy with flex-error in tendermint-rs.

tony-iqlusion avatar Apr 24 '23 13:04 tony-iqlusion

I am implement ics06-solomachain-client, that use cosmrs publickey type. I wish cosmrs can implement no-std.

DaviRain-Su avatar Apr 25 '23 01:04 DaviRain-Su

Adding no_std support is something I don't have time to work on, and ideally it wouldn't require a bunch of compromises on the error types like what happened with tendermint-rs.

What no_std platform are you targeting?

tony-iqlusion avatar Apr 25 '23 01:04 tony-iqlusion

Oh, there is no specific no-std platform support because I need to use types from cosmrs while implementing the ICS06 solomachine client. I don't think it makes sense to redundantly define which type conversions are needed in ibc-rs.

the error types like what happened with tendermint-rs.

Do you like how errors are handled in ibc-rs?

DaviRain-Su avatar Apr 25 '23 01:04 DaviRain-Su

We have CosmWasm on Substrate. Substrate blockchain runtime (big contract) is no_std. We provide precompiles to CW contracts, so they can call our modules(called pallets) as if these are just usual contracts. One of precompiles is IBC Wasm Hook from Osmosis (allows IBC to terminate ICS 20 packets with contracts) calls. It requires generation and verification of sender and receiver using specific bech32 account encoding which needs some cosmos types for handling that.

Btw our no_std CW fork uses error in core feature.

dzmitry-lahoda avatar Jul 19 '23 18:07 dzmitry-lahoda

Note: cosmos-sdk-proto support for no_std was added in #478

tony-iqlusion avatar Aug 14 '24 21:08 tony-iqlusion

Rust 1.81 is out and core::error::Error is now stable, which should unblock this issue

tony-iqlusion avatar Sep 05 '24 18:09 tony-iqlusion