-
Notifications
You must be signed in to change notification settings - Fork 87
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
no_std support for fuel-tx
and fuel-vm
#582
Conversation
Co-authored-by: Green Baneling <[email protected]>
Co-authored-by: Green Baneling <[email protected]>
fuel-storage/src/error.rs
Outdated
} | ||
|
||
#[cfg(feature = "std")] | ||
impl From<StorageError> for std::io::Error { |
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.
Are there still instances where we use std::io::Error
? Or can we get rid of this conversion now?
Migrating to a single concrete I've reversed the direction on this, and instead parametrized Let me know your opinions on the new approach. |
#[cfg(feature = "std")] | ||
use thiserror::Error; |
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.
I would prefer to remove usage of thiserror
and replace it with similar Display
implementation. Maybe we can use another macro(no_std
compatible) to derive exact the same implementation of the Display
trait.
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.
LGTM. Personally, I like the approach to parameterize the InterpreterError
because it allows us to maintain separation between discrete levels of logic.
re: thiserror
- If we want to remove thiserror
in favour of writing custom Display
traits, I think that we can do that in a separate PR.
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 would be nice to have it in this PR because it can remove some std
features from some crates, but I'm also okay with doing that in a separate PR=)
@@ -95,7 +97,7 @@ jobs: | |||
- uses: dtolnay/rust-toolchain@master | |||
with: | |||
toolchain: ${{ env.RUST_VERSION }} | |||
targets: "thumbv6m-none-eabi,wasm32-unknown-unknown" | |||
targets: "thumbv6m-none-eabi,riscv32imac-unknown-none-elf,wasm32-unknown-unknown" |
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.
Just curious - did you chose the IMAC extensions for any particular reason, or is that just a safe default?
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.
That's closes to the internal target used by risc-zero
I'm leaving the thiserror -> display impl change for a follow-up PR, as I feel like it's nicer to review separately. |
Addresses breaking fuel-vm changes from FuelLabs/fuel-vm#582, FuelLabs/fuel-vm#578, FuelLabs/fuel-vm#588 and FuelLabs/fuel-vm#587. Waiting for a new fuel-vm release. --------- Co-authored-by: Green Baneling <[email protected]>
Addresses breaking fuel-vm changes from FuelLabs/fuel-vm#582, FuelLabs/fuel-vm#578, FuelLabs/fuel-vm#588 and FuelLabs/fuel-vm#587. Waiting for a new fuel-vm release. --------- Co-authored-by: Green Baneling <[email protected]>
Makes fuel-vm crate compile without stdlib, but still requireing alloc. This is a breaking change, and the corresponding updates to fuel-core are done in FuelLabs/fuel-core#1367. Most of the breakage comes from removing
std::io::Error
, especially from storage traits which now use concrete error types instead and only allowstd::io::Error
on some variants available withstd
feature enabled.Currently passes with the following command for RiscV:
and check passes for freestanding x86-64, but building doesn't, since it requires soft-float configuration:
Closes #230 #536