-
Notifications
You must be signed in to change notification settings - Fork 11
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
Update libzcash_script
to include support for V5 transactions
#22
Update libzcash_script
to include support for V5 transactions
#22
Conversation
|
`git subtree` wasn't working because it was missing commit `d94fe7678'. Looking at the history, it seems like that commit became `fa1a57867`.
Keep track of the remote with the changes and allow the directory to be handled more easily as a separate repository.
03eaba8
to
99ce36b
Compare
New FFI modules required for `libzcash_script`.
Including the transaction FFI code requires this helper function to be linked in.
d55578e
to
1787b5a
Compare
This specific issue was fixed by #23. |
I ran into a weird issue. It seems that there's a file in the Zcash source code that uses a C++20 feature: Aggregate initialization. https://github.com/zcash/zcash/blob/master/src/primitives/transaction.cpp#L440-L442 What's even weirder is that compiling this on Linux using C++17 works, but on Windows it doesn't. I've disabled Windows CI builds for now, but this should be fixed in the future. For the error itself, see: https://github.com/ZcashFoundation/zcash_script/runs/3799118607#step:5:1095 |
I assume we're using different compilers or compiler versions in the Windows and Linux tests.
This seems like a blocker for a Zebra release, because we'd have to disable Windows Zebra builds as well.
Given our tight timeframes here, I've committed the suggested fix to this PR, and re-enabled Windows builds. |
We're using MSVC on Windows, and I tried a few different C++ standards version flags, for all platforms, and specifically for Windows. But none of them worked. I've just applied a change that always sets the compiler to If this PR passes CI, let's merge, update Zebra's dependencies, and go ahead with the release. |
That didn't work, because the Maybe we should edit the problematic C++ file, and submit a patch to the |
bfafb67
to
1787b5a
Compare
Fix the compilation of the C++ files.
1787b5a
to
92d9c36
Compare
90ee747
to
4ed7a62
Compare
IIRC the problem could not be fixed without rolling back the |
405ce1f
to
cdf748a
Compare
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.
Using Foundation repositories isn't urgent, but it is a release blocker.
(It's caused us a bunch of problems in the past when users have deleted branches or forks.)
5119a7d
to
55bda6e
Compare
Don't compile the `CurrentTxVersionInfo` function, because it requires including some other code that won't be used by `zcash_script`.
55bda6e
to
2e4cd75
Compare
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.
This is good to merge, once we're sure it works for Zebra.
Update `depend/zcash` so that the `orchard_ffi` module has a root `mod.rs` module file to fix an issue where Cargo can't find any sub-modules.
Did you do this? We're not intentionally using C++20 in The logs at https://github.com/ZcashFoundation/zcash_script/runs/3799118607 have been deleted so I can't see which code this affected from there. |
No, we split Here's our commit with the subtree fix, but it's hard to see the diff, because we needed to change to our fork as well:
|
The upstream repository added support for ZIP-225 and ZIP-244, resulting in support for V5 transactions. This PR is an attempt to close #21 by updating the upstream dependency. When I tried to update it, I ran into some issues. I'll leave this as a draft PR until these issues are solved.
The update procedure was the following:
depend/zcash
subtree with a submodule (see more info in the "Outstanding issues" section)transaction_ffi
,orchard_ffi
andstreams_ffi
)zcash/src/support/cleanse.cpp
andzcash/src/support/cleanse.h
in the build and packagehalo2
,orchard
,rand_core
,tracing
andzcash_primitives
)Outstanding issues
git subtree pull -P depend/zcash <zcash-upstream> <commit>
, it failed with an error saying that a commit could not be found. I couldn't find the commit anywhere, but later @str4d found it and pointed out the commit was out-of-tree. I also found the likely rebased commit. I wasn't sure how to fix this usinggit subtree
, so I ended up replacing the subtree with a submodule, so that the remote is properly reference to avoid similar issues in the future. It also simplified the experimentation process because I could jump to different upstream commits more easily. Long-term, this should reference an in-tree commit inzcash/zcash
, independently if a subtree or a submodule is used. The submodule is currently referencing a fork because of some fixes discussed in the next item, but a reference to the fork should NOT be in the final PR to be merged.master
branch commit in the final PR.libzcash_script
. These fixes can be seen here. I'm not sure if they are correct and should be upstreamed, or if they are the consequence of a mismatched compiler version. I'm still trying to figure that out, but when discussing with @str4d, one possibility is because Zcash is compiling it asC99
andzcash_script
is compiling asC++17
.secp256k1
C files separately #23).[patch.crates-io]
inCargo.toml
. That section with the patched dependencies must also be included in this repository and in any crate that useszcash_script
. Ideally, these should be proper dependencies to avoid having to downstream the patches.Wait until the patches are removed or they are more stable.Included as is for now. Downstream dependencies will have to apply the same patches to use this library.