Skip to content

Commit

Permalink
Merge branch 'main' into unused-dups
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 authored Oct 26, 2023
2 parents 375d587 + ce22be3 commit 2c8a128
Show file tree
Hide file tree
Showing 16 changed files with 257 additions and 190 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- name: Rust files
id: changed-files-rust
uses: tj-actions/changed-files@v39.2.3
uses: tj-actions/changed-files@v39.2.4
with:
files: |
**/*.rs
Expand All @@ -49,7 +49,7 @@ jobs:
- name: Workflow files
id: changed-files-workflows
uses: tj-actions/changed-files@v39.2.3
uses: tj-actions/changed-files@v39.2.4
with:
files: |
.github/workflows/*.yml
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=stable --profile=default
- uses: Swatinem/rust-cache@v2.7.0
- uses: Swatinem/rust-cache@v2.7.1
with:
shared-key: "clippy-cargo-lock"

Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
# We don't cache `fmt` outputs because the job is quick,
# and we want to use the limited GitHub actions cache space for slower jobs.
#- uses: Swatinem/rust-cache@v2.7.0
#- uses: Swatinem/rust-cache@v2.7.1

- run: |
cargo fmt --all -- --check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-unit-tests-os.patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, macos-latest]
rust: [stable, beta]
features: [""]
exclude:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/ci-unit-tests-os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ jobs:
fail-fast: false
matrix:
# TODO: Windows was removed for now, see https://github.com/ZcashFoundation/zebra/issues/3801
# TODO: macOS tests were removed for now, see https://github.com/ZcashFoundation/zebra/issues/6824
os: [ubuntu-latest]
os: [ubuntu-latest, macos-latest]
rust: [stable, beta]
# TODO: When vars.EXPERIMENTAL_FEATURES has features in it, add it here.
# Or work out a way to trim the space from the variable: GitHub doesn't allow empty variables.
Expand Down Expand Up @@ -109,7 +108,7 @@ jobs:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=${{ matrix.rust }} --profile=minimal
- uses: Swatinem/rust-cache@v2.7.0
- uses: Swatinem/rust-cache@v2.7.1
# TODO: change Rust cache target directory on Windows,
# or remove this workaround once the build is more efficient (#3005).
#with:
Expand Down Expand Up @@ -218,7 +217,7 @@ jobs:
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=stable --profile=minimal
- uses: Swatinem/rust-cache@v2.7.0
- uses: Swatinem/rust-cache@v2.7.1
with:
shared-key: "clippy-cargo-lock"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs-deploy-firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=beta --profile=default
- uses: Swatinem/rust-cache@v2.7.0
- uses: Swatinem/rust-cache@v2.7.1

- name: Build external docs
run: |
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=beta --profile=default
- uses: Swatinem/rust-cache@v2.7.0
- uses: Swatinem/rust-cache@v2.7.1

- name: Build internal docs
run: |
Expand Down
45 changes: 0 additions & 45 deletions .github/workflows/sub-build-zcash-params.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/sub-test-zebra-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:
jobs:
test-docker-config:
name: Test ${{ inputs.test_id }} in Docker
timeout-minutes: 15
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
Expand Down
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org).

## [Zebra 1.4.0](https://github.com/ZcashFoundation/zebra/releases/tag/v1.4.0) - TODO: DATE

Zebra's mining RPCs are now available in release builds. TODO: rest of intro
Zebra's mining RPCs are now available in release builds. Our Docker images are significantly smaller,
because the smaller Zcash verification parameters are now built into the `zebrad` binary.
TODO: rest of intro

This release contains the following changes:

Expand All @@ -21,10 +23,12 @@ read our [mining blog post](https://zfnd.org/experimental-mining-support-in-zebr
Please [let us know](https://github.com/ZcashFoundation/zebra/issues/new?assignees=&labels=C-enhancement%2CS-needs-triage&projects=&template=feature_request.yml&title=feature%3A+)
if your mining pool needs extra RPC methods or fields.

### Parameters in Binary
### Zcash Parameters in `zebrad` Binary

`zebrad` now bundles zk-SNARK parameters directly into its binary. This increases the binary size
by a few megabytes, but these parameters do not need to be downloaded or stored separately.
by a few megabytes, but reduces the size of the Docker image by around 600 MB because
the parameters don't contain the Sprout proving key anymore. The `zebrad download`
command does nothing, so it has been removed.

Previously, parameters were stored by default in these locations:

Expand Down
1 change: 1 addition & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- [Continuous Delivery](dev/continuous-delivery.md)
- [Generating Zebra Checkpoints](dev/zebra-checkpoints.md)
- [Doing Mass Renames](dev/mass-renames.md)
- [Updating the ECC dependencies](dev/ecc-updates.md)
- [Zebra RFCs](dev/rfcs.md)
- [Pipelinable Block Lookup](dev/rfcs/0001-pipelinable-block-lookup.md)
- [Parallel Verification](dev/rfcs/0002-parallel-verification.md)
Expand Down
70 changes: 70 additions & 0 deletions book/src/dev/ecc-updates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Updating the ECC dependencies

Zebra relies on numerous Electric Coin Company ([ECC](https://electriccoin.co/)) dependencies, and updating them can be a complex task. This guide will help you navigate the process.


The main dependency that influences that is [zcash](https://github.com/zcash/zcash) itself. This is because [zebra_script](https://github.com/ZcashFoundation/zcash_script) links to specific files from it (zcash_script.cpp and all on which it depends). Due to the architecture of zcash, this requires linking to a lot of seemingly unrelated dependencies like orchard, halo2, etc (which are all Rust crates).

## Steps for upgrading

Let's dive into the details of each step required to perform an upgrade:

### Before starting

- Zebra developers often dismiss ECC dependency upgrade suggestions from dependabot. For instance, see [this closed PR](https://github.com/ZcashFoundation/zebra/pull/7745) in favor of the [5.7.0 zcashd upgrade PR](https://github.com/ZcashFoundation/zebra/pull/7784), which followed this guide.

- Determine the version of `zcashd` to use. This version will determine which versions of other crates to use. Typically, this should be a [tag](https://github.com/zcash/zcash/tags), but in some cases, it might be a reference to a branch (e.g., nu5-consensus) for testing unreleased developments.

- Upgrading the `zcash_script` crate can be challenging, depending on changes in the latest `zcashd` release. Follow the instructions in the project's [README](https://github.com/ZcashFoundation/zcash_script/blob/master/README.md) for guidance.

- Upgrade and release `zcash_script` before upgrading other ECC dependencies in Zebra.

### Upgrade versions

- Use the `cargo upgrade` command to upgrade all the ECC dependency versions in Zebra. For example, in [this PR](https://github.com/ZcashFoundation/zebra/pull/7784), the following command was used:

```
cargo upgrade --incompatible -p bridgetree -p incrementalmerkletree -p orchard -p zcash_primitives -p zcash_proofs -p zcash_address -p zcash_encoding -p zcash_note_encryption -p zcash_script
```

Notes:

- Insert all the crate names to be updated to the command.

- Use `crate-name@version` to upgrade to a specific version of that crate, instead of just the highest version.

- You need to have [cargo upgrade](https://crates.io/crates/cargo-upgrades) and [cargo edit](https://crates.io/crates/cargo-edit) installed for this command to work.

### Version consistency check

- Ensure that the crate versions in the `Cargo.toml` of the zcashd release, `Cargo.toml` of `zcash_script`, and the `Cargo.toml` files of Zebra crates are all the same. Version consistency is crucial.

### Build/Test zebra & fix issues

- Build zebra and make sure it compiles.

```
cargo build
```

- Test Zebra and make sure all test code compiles and all tests pass:

```
cargo test
```

- When upgrading, it's common for things to break, such as deprecated or removed functionality. Address these issues by referring to the broken dependency's changelog, which often provides explanations and workarounds.

- If you encounter issues that you can't resolve, consider reaching out to ECC team members who worked on the upgrade, as they may have more context.

### Check `deny.toml`

- Review Zebra's `deny.toml` file for potential duplicates that can be removed due to the upgrade. You may also need to add new entries to `deny.toml`.
- You can identify issues with the dependencies using `cargo deny check bans` command, need to have [cargo deny](https://crates.io/crates/cargo-deny) installed.
- Push your changes and let the CI identify any additional problems.

### Push the Pull Request (PR)

- Push the pull request with all the changes and ensure that the full CI process passes.
- Seek approval for the PR.
- Merge to `main` branch.
Loading

0 comments on commit 2c8a128

Please sign in to comment.