-
Notifications
You must be signed in to change notification settings - Fork 329
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
Use core
and alloc
crates for no_std
compatibility
#1156
Conversation
What's the advantage of doing this rather than use something like |
|
Very good points, thanks @soareschen! Let's go with that then! Some follow-up questions: a) Can also add a workflow to the CI to build the |
The current change do not support no-std just yet. There are still use of constructs from
I think it is good to be consistent with the convention so that we do not need to switch between the conventions when developing on different crates. The use of
That's a good point! I have reverted the changes and created #1164 to address the issue separately. |
core
and alloc
crates for no_std
compatibility
@soareschen What do you think about defining our own prelude which re-exports commonly used types such as |
I can see that having such prelude would make it more convenient to use common constructs. However I would advise against building our own prelude library, as it can be tedious to keep the exports in sync with a proper "subset" of What we could do instead is to create a minimal prelude that re-exports everything from Note that the |
Sounds good to me! |
What is the status of this PR? I think we should move forward with it. Are there any implications of using BTreeMap and BTreeSet, performance, or correctness, that we should be aware of? |
I don't see any implications on correctness as I don't believe we every relied on the iteration order of elements of a As for performance, most operations on I don't believe that's an issue at the moment, as we do not maintain any data structure large enough for it to matter (especially as most operations in Hermes are IO-bound anyway).
|
I have made a few more changes to this PR after merging with master:
|
Thanks for the update @soareschen! This all sounds good to me.
This seems to be the main remaining issue. If there is no support for this directly in prost/tonic, do you see a way of working around that? |
It seems like We will have to fix |
@romac shall we merge this? |
Let's go, we just need an entry in the |
Done. |
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.
Awesome work @soareschen, thanks a lot!
* Use tendermint-rs master * Re-introduce PartialEq and Eq trait bounds on error types * Enable support for Secp256k1 signatures in tendermint-rs via its `secp256k1` feature * Update Cargo.lock * Ensure we do not introduce conflicts with #1156 * Add .changelog entry
…tems#1156) * Use core and alloc crates for no_std compatibility * Revert use of core:: back to std:: in ibc-proto crate * Refactor some new uses of std * Refactor more use of std. * Fix formatting * Fix more use of `std` * Remove stale changes * Remove some more use of std * Use #![no_std] in ibc crate, with extern crate std and custom prelude * Add changelog
* Use tendermint-rs master * Re-introduce PartialEq and Eq trait bounds on error types * Enable support for Secp256k1 signatures in tendermint-rs via its `secp256k1` feature * Update Cargo.lock * Ensure we do not introduce conflicts with informalsystems#1156 * Add .changelog entry
Partially Closes: #1158
Description
In this PR I search for the use of
std::
imports and change them to usecore
oralloc
. The unsupported constructs are left to be imported fromstd
and be fixed through other PRs for #1158.A notable change in this PR is that we are now using BTreeMap instead of HashMap, and BTreeSet instead of HashSet. The reason is that the formers are not supported in the
alloc
crate, as they depends on random sources which are not available in no-std. I'm not sure if this change would break anything, so we might want to investigate further on this.For contributor use:
docs/
) and code comments.Files changed
in the Github PR explorer.