-
Notifications
You must be signed in to change notification settings - Fork 34
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
Risczero Fit #97
base: master
Are you sure you want to change the base?
Risczero Fit #97
Conversation
Neat! Unfortunately I don't see any way to accept this. Modifying the upstream Why do you need these serialization impls? |
The compiler(riscv32-unknown-elf-g++) treats them(int, int32_t) as different types in template instantiation. When you compile the bitcoin source code will get the error
This error is caused by the logic in the SignatureHash function within src/script/interpreter.cpp. The function serializes the data to obtain a hash value, but it fails to find a serialization method for the int type.
This behavior is particularly strict in environments like RISC-V, where the ABI (Application Binary Interface) might enforce more rigid type distinctions, leading to errors during compilation. |
Makes sense. I think the correct fix though is to use If this isn't done upstream already, could you also PR there? I'd be willing to carry an extra patch here which did that, since it'd be a clear bugfix and the new code would be clearly correct. Though it would require some extra changes to our vendoring scripts and could be a long while before it got in since this project is in near-maintenance-mode due to the upstream libbitcoinconsensus deprecation. |
Thank you, I will submit a PR to upstream, and your proposed modification makes more sense. However, I have a question: in the current version, when running on 32-bit and 64-bit platforms, why doesn't |
See my reply here: bitcoin/bitcoin#30747 (comment) Specifically, it would be interesting if you compiled |
I suspect that there is an inconsistency but it's just not hit on any target platforms? I think when the 64-bit transition happened almost all C compilers (and presumably C++) kept their But the standard only says that |
Has create a pr to bitcoin repo for the issue: bitcoin/bitcoin#30794. Which will explicitly use int32_t instead of the int type. |
compile:
CXXFLAGS="-DRISCZERO" CXX=/opt/riscv-new/bin/riscv32-unknown-elf-g++ cargo build -p host