Skip to content
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

v0.1.14 release #102

Merged
merged 8 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,24 @@ blake2b_simd = "1"
bls12_381 = "0.8"
byteorder = "1"
crossbeam-channel = "0.5"
cxx = { version = "=1.0.95", features = ["c++17"] }
cxx = { version = "=1.0.107", features = ["c++17"] }
group = "0.13"
incrementalmerkletree = "0.4"
incrementalmerkletree = "0.5"
jubjub = "0.10"
libc = "0.2"
memuse = "0.2"
metrics = "0.21"
orchard = "0.5"
orchard = "0.6"
rand_core = "0.6"
rayon = "1.5"
subtle = "2.2"
tracing = "0.1"
zcash_address = "0.3"
zcash_encoding = "0.2"
zcash_note_encryption = "0.4"
zcash_primitives = { version = "0.12", features = ["temporary-zcashd", "transparent-inputs"] }
zcash_proofs = "0.12"
bridgetree = "0.3"
zcash_primitives = { version = "=0.13.0-rc.1", features = ["temporary-zcashd", "transparent-inputs"] }
zcash_proofs = { version = "=0.13.0-rc.1", features = ["directories"] }
bridgetree = "0.4"
rand = "0.8"

[build-dependencies]
Expand All @@ -86,9 +86,9 @@ bindgen = ">= 0.64.0"
# These dependencies are shared with a lot of other Zebra dependencies,
# so they are configured to automatically upgrade to match Zebra.
# But we try to use the latest versions here, to catch any bugs in `zcash_script`'s CI.
cc = { version = "1.0.79", features = ["parallel"] }
cc = { version = "1.0.83", features = ["parallel"] }
# Treat minor versions with a zero major version as compatible (cargo doesn't by default).
cxx-gen = ">= 0.7.93"
cxx-gen = ">= 0.7.107"
syn = { version = "1.0.109", features = ["full", "printing"] }

[dev-dependencies]
Expand All @@ -98,8 +98,8 @@ syn = { version = "1.0.109", features = ["full", "printing"] }
# Treat minor versions with a zero major version as compatible (cargo doesn't by default).
hex = ">= 0.4.3"
lazy_static = "1.4.0"
incrementalmerkletree = { version = "0.4", features = ["test-dependencies"] }
zcash_primitives = { version = "0.12", features = ["temporary-zcashd", "transparent-inputs", "test-dependencies"] }
incrementalmerkletree = { version = "0.5", features = ["test-dependencies"] }
zcash_primitives = { version = "=0.13.0-rc.1", features = ["temporary-zcashd", "transparent-inputs", "test-dependencies"] }

[[package.metadata.release.pre-release-replacements]]
file = "CHANGELOG.md"
Expand Down
45 changes: 39 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,34 @@ fn gen_cxxbridge() -> Result<()> {
let out_path = PathBuf::from(out_path).join("gen");
let src_out_path = PathBuf::from(&out_path).join("src");
let header_out_path = PathBuf::from(&out_path).join("include").join("rust");
let header_out_path_sapling = header_out_path.join("sapling");

// Copy the files we need to generate the bindings
fs::copy(
"depend/zcash/src/rust/src/sapling/spec.rs",
"depend/zcash/src/rust/src/spec.rs",
)
.unwrap();
fs::copy(
"depend/zcash/src/rust/src/sapling/zip32.rs",
"depend/zcash/src/rust/src/zip32.rs",
)
.unwrap();
oxarbitrage marked this conversation as resolved.
Show resolved Hide resolved

// Replace blake2s with blake2b
let spec = fs::read_to_string("depend/zcash/src/rust/src/spec.rs").unwrap();
let new_spec = spec.replace("blake2s_simd", "blake2b_simd");
oxarbitrage marked this conversation as resolved.
Show resolved Hide resolved
fs::write("depend/zcash/src/rust/src/spec.rs", new_spec.as_bytes()).unwrap();

// These must match `CXXBRIDGE_RS` in depend/zcash/src/Makefile.am
let filenames = ["blake2b", "ed25519", "equihash", "streams", "bridge"];
let filenames = [
"blake2b", "ed25519", "equihash", "streams", "bridge", "spec", "zip32",
];

// The output folder must exist
fs::create_dir_all(&src_out_path).unwrap();
fs::create_dir_all(&header_out_path).unwrap();
fs::create_dir_all(&header_out_path_sapling).unwrap();

// Generate the generic header file
fs::write(header_out_path.join("cxx.h"), cxx_gen::HEADER).unwrap();
Expand Down Expand Up @@ -103,11 +124,22 @@ fn gen_cxxbridge() -> Result<()> {
)
});

fs::write(
header_out_path.join(format!("{}.h", filename)),
output.header,
)
.unwrap();
// Write the generated header files for the sapling module to a subfolder
if filename == "spec" || filename == "zip32" {
fs::write(
header_out_path.join(format!("sapling/{}.h", filename)),
output.header,
)
.unwrap();
} else {
// Write the generated header files for the other modules to the root folder
fs::write(
header_out_path.join(format!("{}.h", filename)),
output.header,
)
.unwrap();
}
// Write the generated source files all to the same location
fs::write(
src_out_path.join(format!("{}.c", filename)),
output.implementation,
Expand Down Expand Up @@ -135,6 +167,7 @@ fn main() -> Result<()> {
.include("depend/zcash/src/secp256k1/include/")
.include("depend/expected/include/")
.include(&gen_path.join("include"))
.include(&gen_path.join("include/sapling/"))
.flag_if_supported("-Wno-implicit-fallthrough")
.flag_if_supported("-Wno-catch-value")
.flag_if_supported("-Wno-reorder")
Expand Down
11 changes: 10 additions & 1 deletion depend/zcash/.github/workflows/audits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,14 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
id: toolchain
- run: rustup override set ${{steps.toolchain.outputs.name}}
- run: cargo install cargo-vet --version ~0.6
- run: cargo install cargo-vet --version ~0.8
- run: cargo vet --locked

cargo-deny:
name: Check licenses
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check licenses
15 changes: 10 additions & 5 deletions depend/zcash/.github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:

- name: Install cross-compilation build dependencies
if: matrix.cross_deps != ''
run: sudo apt install ${{ matrix.cross_deps }}
run: sudo apt update && sudo apt install ${{ matrix.cross_deps }}

- name: Configure MinGW to use POSIX variant
if: matrix.name == 'mingw32'
Expand Down Expand Up @@ -85,33 +85,38 @@ jobs:
restore-keys: |
${{ matrix.name }}-ccache-

- name: Get the number of available processing cores
id: nproc
shell: bash
run: echo "count=$(nproc 2> /dev/null || sysctl -n hw.logicalcpu)" >> "$GITHUB_OUTPUT"

- name: Build zcashd
id: build
run: >
${{ matrix.host }}
./zcutil/build.sh
-j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
-j"${{ steps.nproc.outputs.count }}"

- name: Build zcashd with libraries enabled
if: ${{ always() && steps.build.outcome == 'success' }}
run: >
CONFIGURE_FLAGS="--with-libs"
${{ matrix.host }}
./zcutil/build.sh
-j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
-j"${{ steps.nproc.outputs.count }}"

- name: Build zcashd with wallet disabled
if: ${{ always() && steps.build.outcome == 'success' }}
run: >
CONFIGURE_FLAGS="--disable-wallet"
${{ matrix.host }}
./zcutil/build.sh
-j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
-j"${{ steps.nproc.outputs.count }}"

- name: Build zcashd with mining disabled
if: ${{ always() && steps.build.outcome == 'success' }}
run: >
CONFIGURE_FLAGS="--disable-mining"
${{ matrix.host }}
./zcutil/build.sh
-j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)"
-j"${{ steps.nproc.outputs.count }}"
4 changes: 4 additions & 0 deletions depend/zcash/.github/workflows/lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
if: always()
continue-on-error: true # Temporary until we get this passing

- name: make dist
run: ./test/lint/lint-make-dist.sh
if: always()

- name: Shebang
run: ./test/lint/lint-shebang.sh
if: always()
Expand Down
Loading
Loading