-
Notifications
You must be signed in to change notification settings - Fork 624
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
Default to no_std
in all crates
#2413
Comments
Why except |
Oh, I got mixed up with no-std and requiring an allocator, you are correct, including bitcoin. |
This may be slightly off-topic, but I'm wondering how close rust-bitcoin is to full support in a no_std environment like Wasm? Is it currently possible to sign a taproot transaction with a local private key in no_std mode? |
I believe the answer is "yes" as far as no-std goes, but we may have WASM-specific problems with rust-secp256k1 because it links to a C library. |
Amazing, thank you. I know that Substrate uses the secp256k1 rust library in a Wasm environment. At least, I saw it on their dependency list. They also use this crate, which they wrote for no_std: I'm not sure of the specifics. I'm just doing research. I'll have to do some testing. Thank you again! |
no_std
in all but bitcoin
crate.no_std
in all crates
FTR you don't actually need |
Amazing! Thank you. |
Do we want to support that, though? WASM+std is some crazy half-working Frankenstein monster where everything compiles but you call the wrong function (mostly SystemTime) and suddenly you panic. It's not really something practical to support IMO without building a custom static checking framework. |
@TheBlueMatt : We're using in Fedimint/Fedi and it works good enough. System time is PITA, but we have semgrep lints; wasm unit, integration and e2e tests; and recently we've figured a way to "grep" the wasm binary and flag banned function call, which should be fast and reliable. ( I'm aware there are some risks w.r.t miscompilation of ABI for rust-secp256k1, which i guess we'll just have to live with for now. |
Certainly not saying its not doable, only asking if we want to officially support that in rust-bitcoin or not. Now that std/no-std is de-tied from this stupid global where you have to set the same one on LDK/rust-bitcoin/etc/etc, there's not a lot of reason users can't use no-std on LDK+rust-bitcoin but std on BDK or whatever. That means we can pick whether we want to support WASM+std or if we just want to tell WASM users to use no-std (which has basically no fewer features in rust-bitcoin). Users can do whatever they want, but its on them if we break it and dont support it :) |
In my case the only reason I use But I'd absolutely love to get rid of it for the peace of mind and potential space optimization. If we can get
I think we can and should at least until |
Explicit trumps implicit any day, we should use the more explicit
#![no_std]
attribute in all cratesexceptas we did inbitcoin
units
.ref: #2408 (comment)
The text was updated successfully, but these errors were encountered: