20 releases
0.2.0 | Jun 10, 2024 |
---|---|
0.1.14 | Oct 18, 2023 |
0.1.13 | Jul 5, 2023 |
0.1.11 | Feb 24, 2023 |
0.1.4 | Nov 17, 2020 |
#33 in #bindgen
2,671 downloads per month
Used in 5 crates
(via zebra-script)
4.5MB
39K
SLoC
Contains (obscure autoconf code, 19KB) depend/zcash/src/secp256k1/configure.ac
zcash_script
Rust bindings to the ECC's zcash_script
C++ library.
Developing
This crate works by manually including the zcash_script
.h and .cpp files,
using bindgen
to generate Rust bindings, and compiling everything together
into a single library.
Updating this crate
- Create a new branch batch so all the release commits can be made into a PR
- Update
depend/zcash
with the latest tagged version ofzcashd
, using the instructions below - Test if everything works by running
cargo test
. If you get any compiling errors, see the troubleshooting section below. - Check all open PRs to see if they can be merged before the release
- Do the release, following the instructions below
- Check the release tag was pushed to https://github.com/ZcashFoundation/zcash_script/tags
Updating depend/zcash
We keep a copy of the zcash source in depend/zcash
, but it has diverged
in 0.2.0 release (based on zcashd 5.9.0) with the following changes:
- The root
Cargo.toml
was be deleted, since otherwise cargo will ignore the entire folder when publishing the crate (see https://github.com/rust-lang/cargo/issues/8597). - New classes were introduced in interpreter.h/.cpp to support the callback API.
- Some #if guards were added to remove code that is not needed for script verification.
The simplified API now mostly require files that are truly required for script verification. These are unlikely to change so this crate no longers need to keep the zcashd source in sync, unless there was some bug fix in script verification.
If updating zcashd source is required, you will need to manually update the
depend/zcash
source tree and reapply changes that have been made to it. If
you do that, please document the process in detail in this file.
Publishing New Releases
Releases for zcash-script
are made with the help of cargo release.
- Update
CHANGELOG.md
to document any major changes since the last release - Run
cargo release <level>
to commit the release version bump (but not actually publish),<level>
can bepatch
,minor
ormajor
- Open a
zcash_script
PR with the changes, get it reviewed, and wait for CI to pass - Publish a new release using
cargo release --execute <level>
NOTE: It's important to specify the level when using cargo release because of the way it implements the substitutions. We specify a number of automatic substitutions in Cargo.toml
but they will only be applied if cargo release
also handles incrementing the version itself, do not increment the version by hand and then run cargo release
or cargo release -- release
, or it will not correctly update all version references in the codebase.
Troubleshooting
"undefined reference to name
"
This likely means that a .c
file is not being included in build.rs
.
Search for name
in the zcashd source tree to find which file contains it,
and add it to a file()
call inside build.rs
.
"fatal error: file
: No such file or directory"
This likely means that a .h
file is not being found.
Seach for a file with the given name and add its folder to a .include()
call in build.rs
. If the file does not exist there it's likely from
a 3rd-party dependency that is downloaded at build time. Search for
the file name on some search engine to attempt to find what project
it belongs to, cross-referencing the depends/packages
folder
in zcashd
. Then you may need to copy those files to a folder
inside zcash_script
like we did in depend/expected
.