Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2141976
Squashed 'lightwallet-protocol/' content from commit 23f0768ea
pacu Apr 7, 2026
a0440fe
Merge commit '214197623fb5c8148966be5f7ebe30c784bb12b5' as 'lightwall…
pacu Apr 7, 2026
f79d029
add: gRPC parity test suite (Zainod vs. Lightwalletd)
pacu Apr 8, 2026
17ebb0d
fix: address Copilot review findings in gRPC parity test suite
pacu Apr 10, 2026
91b3dca
fix: rework grpc_comparison chain setup to use submitblock and minera…
pacu Apr 14, 2026
034b52b
Add cached gRPC parity fixture for Zebra-backed comparison
pacu Apr 23, 2026
db0fa82
Refactor grpc comparison test flow for readability
pacu Apr 23, 2026
eebe565
add .claude and .codex to gitignore
pacu Apr 23, 2026
f0b873e
Document how the gRPC comparison test was stabilized
pacu Apr 23, 2026
56f597e
Refine grpc parity test maintenance and cache handling
pacu Apr 23, 2026
67500b5
Address PR review feedback for grpc parity test
pacu Apr 23, 2026
8be519d
Clarify upstream bug follow-up in grpc comparison docs
pacu Apr 23, 2026
d6a7c27
Tighten shielded GetBlockRange parity checks
pacu Apr 24, 2026
89dfa13
Make grpc compact block parity checks fully strict
pacu Apr 24, 2026
aded079
Show unified diffs for grpc compact block mismatches
pacu Apr 26, 2026
45175e9
Use uv consistently in test documentation
pacu Apr 26, 2026
3778014
Avoid running the grpc comparison tests on the per-change run
pacu Apr 26, 2026
b3cdb31
Fail fast on missing persistent wallet caches
pacu Apr 26, 2026
12909dc
Reproduce one-wallet Orchard follow-on spend failure
pacu Apr 27, 2026
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
127 changes: 111 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ on:
- zebra-interop-request
- zaino-interop-request
- zallet-interop-request
- lightwalletd-interop-request

permissions:
contents: read
Expand Down Expand Up @@ -614,6 +615,83 @@ jobs:
requesting-repository: ${{ steps.repo-ids.outputs.requesting-repository }}
job-name: "Build zallet on ${{ matrix.platform }}${{ matrix.required_suffix }}"

build-lightwalletd:
name: Build lightwalletd on ${{ matrix.platform }}${{ matrix.required_suffix }}
needs: setup
runs-on: ${{ matrix.build_os }}
container:
image: ${{ matrix.container }}
env:
HOME: /root
PATH: /root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
continue-on-error: ${{ !matrix.required }}
strategy:
matrix:
include: ${{ fromJson(needs.setup.outputs.build_matrix) }}

steps:
- name: Check out integration-tests to access actions
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: integration-tests
persist-credentials: false

- name: Compute interop repo ids
id: repo-ids
uses: ./integration-tests/.github/actions/interop-repo-ids

- id: start-interop
uses: ./integration-tests/.github/actions/start-interop
with:
status-app-id: ${{ secrets.STATUS_APP_ID }}
status-app-private-key: ${{ secrets.STATUS_APP_PRIVATE_KEY }}
requesting-owner: ${{ steps.repo-ids.outputs.requesting-owner }}
requesting-repository: ${{ steps.repo-ids.outputs.requesting-repository }}
job-name: "Build lightwalletd on ${{ matrix.platform }}${{ matrix.required_suffix }}"

- name: Use specified zcash/lightwalletd commit
if: github.event.action == 'lightwalletd-interop-request'
shell: sh
env:
SHA: ${{ github.event.client_payload.sha }}
run: echo "LIGHTWALLETD_REF=${SHA}" >> $GITHUB_ENV

- name: Use zcash/lightwalletd current master
if: github.event.action != 'lightwalletd-interop-request'
run: echo "LIGHTWALLETD_REF=refs/heads/master" >> $GITHUB_ENV

- name: Check out zcash/lightwalletd
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: zcash/lightwalletd
ref: ${{ env.LIGHTWALLETD_REF }}
path: lightwalletd

- name: Set up Go
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: lightwalletd/go.mod
cache-dependency-path: lightwalletd/go.sum

- name: Build lightwalletd
run: go build -v -o lightwalletd${{ matrix.file_ext }} .
working-directory: ./lightwalletd

- name: Upload lightwalletd
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: lightwalletd-${{ matrix.name }}
path: |
${{ format('./lightwalletd/lightwalletd{0}', matrix.file_ext) }}

- uses: ./integration-tests/.github/actions/finish-interop
if: always()
with:
app-token: ${{ steps.start-interop.outputs.app-token }}
requesting-owner: ${{ steps.repo-ids.outputs.requesting-owner }}
requesting-repository: ${{ steps.repo-ids.outputs.requesting-repository }}
job-name: "Build lightwalletd on ${{ matrix.platform }}${{ matrix.required_suffix }}"

# Not working in Windows
sec-hard:
name: sec-hard ${{ matrix.platform }}${{ matrix.required_suffix }}
Expand All @@ -622,6 +700,7 @@ jobs:
- build-zebra
- build-zaino
- build-zallet
- build-lightwalletd
runs-on: ${{ matrix.test_os }}
container:
image: ${{ matrix.container }}
Expand Down Expand Up @@ -682,12 +761,19 @@ jobs:
name: zallet-${{ matrix.name }}
path: ./src

- name: Download lightwalletd artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: lightwalletd-${{ matrix.name }}
path: ./src

- name: Make artifact executable
if: runner.os != 'Windows'
run: |
chmod +x ${{ format('./src/zebrad{0}', matrix.file_ext) }}
chmod +x ${{ format('./src/zainod{0}', matrix.file_ext) }}
chmod +x ${{ format('./src/zallet{0}', matrix.file_ext) }}
chmod +x ${{ format('./src/lightwalletd{0}', matrix.file_ext) }}

- name: Run sec-hard test
shell: bash
Expand Down Expand Up @@ -719,18 +805,19 @@ jobs:
include: ${{ fromJson(needs.setup.outputs.rpc_test_matrix) }}

steps:
- name: Cache Python dependencies for RPC tests
- name: Cache uv project environment for RPC tests
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
enableCrossOsArchive: true
path: venv
key: test-rpc-venv-${{ matrix.name }}
path: .venv
key: test-rpc-venv-${{ matrix.name }}-${{ hashFiles('pyproject.toml', 'uv.lock') }}

- name: Install uv
run: python3 -m pip install uv

- name: Get Python dependencies for RPC tests
- name: Sync Python dependencies for RPC tests
run: |
python3 -m venv ./venv
. ./venv/bin/activate
pip install zmq asyncio base58 toml
uv sync --frozen

test-rpc:
name: RPC tests ${{ matrix.platform }} ${{ matrix.shard }}${{ matrix.required_suffix }}
Expand All @@ -739,6 +826,7 @@ jobs:
- build-zebra
- build-zaino
- build-zallet
- build-lightwalletd
- rpc-depends
runs-on: ${{ matrix.test_os }}
container:
Expand Down Expand Up @@ -785,18 +873,19 @@ jobs:
requesting-repository: ${{ steps.repo-ids.outputs.requesting-repository }}
job-name: "RPC tests ${{ matrix.platform }} ${{ matrix.shard }}${{ matrix.required_suffix }}"

- name: Cache Python dependencies for RPC tests
- name: Cache uv project environment for RPC tests
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
enableCrossOsArchive: true
path: venv
key: test-rpc-venv-${{ matrix.name }}
path: .venv
key: test-rpc-venv-${{ matrix.name }}-${{ hashFiles('pyproject.toml', 'uv.lock') }}

- name: Get Python dependencies for RPC tests if not cached
- name: Install uv
run: python3 -m pip install uv

- name: Sync Python dependencies for RPC tests
run: |
python3 -m venv ./venv
. ./venv/bin/activate
pip install zmq asyncio base58 toml
uv sync --frozen

- name: Download zebrad artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
Expand All @@ -816,12 +905,19 @@ jobs:
name: zallet-${{ matrix.name }}
path: ./src

- name: Download lightwalletd artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: lightwalletd-${{ matrix.name }}
path: ./src

- name: Make artifact executable
if: runner.os != 'Windows'
run: |
chmod +x ${{ format('./src/zebrad{0}', matrix.file_ext) }}
chmod +x ${{ format('./src/zainod{0}', matrix.file_ext) }}
chmod +x ${{ format('./src/zallet{0}', matrix.file_ext) }}
chmod +x ${{ format('./src/lightwalletd{0}', matrix.file_ext) }}

- name: Get Sprout parameters
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
Expand Down Expand Up @@ -877,8 +973,7 @@ jobs:
if all_passed == False:
sys.exit(1)
EOF
. ./venv/bin/activate
ZEBRAD=$(pwd)/${{ format('src/zebrad{0}', matrix.file_ext) }} ZAINOD=$(pwd)/${{ format('src/zainod{0}', matrix.file_ext) }} ZALLET=$(pwd)/${{ format('src/zallet{0}', matrix.file_ext) }} SRC_DIR=$(pwd) python3 ./subclass.py
ZEBRAD=$(pwd)/${{ format('src/zebrad{0}', matrix.file_ext) }} ZAINOD=$(pwd)/${{ format('src/zainod{0}', matrix.file_ext) }} ZALLET=$(pwd)/${{ format('src/zallet{0}', matrix.file_ext) }} LIGHTWALLETD=$(pwd)/${{ format('src/lightwalletd{0}', matrix.file_ext) }} SRC_DIR=$(pwd) uv run python3 ./subclass.py

- uses: ./.github/actions/finish-interop
if: always()
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
*.orig
*.pyc
.vscode

.claude
.codex
qa/pull-tester/tests_config.py
qa/pull-tester/tests_config.ini
qa/cache/*
qa/rpc-tests/cache/grpc_comparison/
qa/rpc-tests/cache/grpc_comparison_stage1/
src/*

poetry.lock
Expand Down
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Zcash ecosystem. The following tests are provided:

- Functional tests in Python of [`zebrad`], [`zainod`], and [`zallet`], using
regtest mode and primarily their JSON-RPC interfaces.
- gRPC parity tests that run [`zainod`] and [`lightwalletd`] side-by-side
against the same [`zebrad`] node and compare their
[lightwallet-protocol] gRPC responses.

The functional tests and CI workflows were originally part of the [`zcashd`]
codebase, with the Python test framework (and some of the tests) inherited from
Expand All @@ -15,37 +18,35 @@ codebase, with the Python test framework (and some of the tests) inherited from
[`zebrad`]: https://github.com/ZcashFoundation/zebra
[`zainod`]: https://github.com/zingolabs/zaino
[`zallet`]: https://github.com/zcash/wallet
[`lightwalletd`]: https://github.com/zcash/lightwalletd
[lightwallet-protocol]: https://github.com/zcash/lightwallet-protocol
[`zcashd`]: https://github.com/zcash/zcash
[Bitcoin Core]: https://github.com/bitcoin/bitcoin
<!-- ANCHOR_END: summary -->

## Getting Started

### Running the tests locally
Pre-requisite: See the [`uv` installation instructions](https://docs.astral.sh/uv/getting-started/installation/)
if it is not already installed.

- Clone the repository.
- Build `zebrad`, `zainod`, and `zallet` binaries, and place them in a folder
`./src/` under the repository root.

#### With uv (recommended)

- `uv sync`
- `uv run ./qa/zcash/full_test_suite.py`

#### Without uv
See [the README for the functional tests][qa/README.md] for additional usage
information.

On Ubuntu or Debian-based distributions:
- `sudo apt-get install python3-zmq python3-base58 python3-toml`
- `./qa/zcash/full_test_suite.py`
### Running the gRPC parity tests

On macOS or other platforms:
- `python3 -m venv venv`
- `. venv/bin/activate`
- `pip3 install pyzmq base58 toml`
- `./qa/zcash/full_test_suite.py`
The gRPC parity tests additionally require the `lightwalletd` binary in `./src/`
(or set `LIGHTWALLETD=/path/to/lightwalletd`).

See [the README for the functional tests][qa/README.md] for additional usage
information.
```bash
uv run ./qa/zcash/grpc_comparison_tests.py
```

### Writing tests

Expand Down
1 change: 1 addition & 0 deletions doc/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Platform Support](user/platform-support.md)
- [Developer Documentation](dev.md)
- [Regtest Mode](dev/regtest.md)
- [Bringing `grpc_comparison.py` Live](dev/grpc-comparison.md)
- [Platform Policy](dev/platform-policy.md)
- [CI Infrastructure](ci/README.md)
- [Cross-Repository CI](ci/cross-repo.md)
Loading