Skip to content

Zcashd orchard anchor repro on grpc#92

Draft
pacu wants to merge 19 commits intozcash:mainfrom
pacu:zcashd-orchard-anchor-repro-on-grpc
Draft

Zcashd orchard anchor repro on grpc#92
pacu wants to merge 19 commits intozcash:mainfrom
pacu:zcashd-orchard-anchor-repro-on-grpc

Conversation

@pacu
Copy link
Copy Markdown
Contributor

@pacu pacu commented Apr 27, 2026

Add a focused standalone zcashd repro for the wallet behavior encountered while bringing up the gRPC comparison fixture.

The test keeps Sapling funding, Sapling-to-Orchard, and the follow-on Orchard spend in one wallet process. Affected zcashd versions fail the final Orchard spend with an insufficient-funds async operation error because the just-created Orchard note is not available as spendable.

builds atop #84

closes zcash/zcash#7150

pacu and others added 19 commits April 7, 2026 19:54
git-subtree-dir: lightwallet-protocol
git-subtree-split: 23f0768ea4471b63285f3c0e9b6fbb361674aa2b
Closes zcash#83

Runs Zainod and Lightwalletd side-by-side against the same Zebrad node
and compares their CompactTxStreamer gRPC responses. Covers 21 test
cases across 15 RPC methods and integrates with the existing
BitcoinTestFramework and CI pipeline.

- `lightwallet-protocol/` — canonical proto source via `git subtree`
  from `zcash/lightwallet-protocol` v0.4.0
- `qa/rpc-tests/test_framework/proto/` — generated Python gRPC stubs
  committed so CI needs only `grpcio` at runtime
- `scripts/generate_proto.sh` — regenerates stubs after a protocol
  version bump and fixes flat imports to relative
- `util.py` / `test_framework.py` — Lightwalletd process lifecycle
  (`lwd_grpc_port`, `write_lwd_conf`, `start_lightwalletd`,
  `wait_for_lwd_start`, teardown)
- `qa/rpc-tests/grpc_comparison.py` — test file
- `qa/zcash/grpc_comparison_tests.py` — convenience runner
- CI: `lightwalletd-interop-request` dispatch trigger,
  `build-lightwalletd` job, artifact download in `test-rpc`
- Docs: README and book updated with prerequisites and run instructions

1. **`vtx` in compact blocks** — For blocks containing only transparent
   transactions, Zainod returns empty `vtx`; Lightwalletd includes them.
   Block comparison currently covers header fields only.

2. **gRPC error codes on out-of-bounds requests** — Zainod returns
   `OUT_OF_RANGE`; Lightwalletd returns `INVALID_ARGUMENT`. Tests assert
   only that both sides raise an error.

- `GetMempoolTx` / `GetMempoolStream` (need wallet integration)
- Shielded transaction coverage (need Zallet or chain cache)
- Completed subtree roots (need 2^16 outputs per tree)
- `SendTransaction`, darkside mode

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix flat import in service_pb2.pyi (relative import was missing,
  unlike the .py counterpart); extend generate_proto.sh to rewrite
  imports in .pyi files as well
- Add missing height assertion in test_get_taddress_txids_lower
- Add per-element data+height assertions in test_get_taddress_txids_upper
  (previously only checked stream length)
- Add missing script and height assertions in test_get_address_utxos_stream
  to match the coverage in test_get_address_utxos
- Fix gRPC channel leak in _wait_for_indexers: wrap channel lifecycle
  in try/finally and close both channels on exit
- Pad chain to 100 blocks before starting indexers: Zainod requires a
  minimum of 100 blocks; the three mining phases only produce 36

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ddress config

setmineraddress has been removed from this zcashd version, so the mining
address must be set via zcash.conf; zcashd is restarted between phases.
P2P block propagation is replaced by submitblock to sidestep known zcashd↔zebrad
P2P issues (zebra#10329, #10332).

Chain layout changes to match:
  Blocks 1–100  — Orchard coinbase (single zcashd restart with orchard_addr).
  Block 101     — z_sendmany confirmation: transparent + Sapling outputs in one tx.

The Sapling tree is now correctly expected to be empty at Orchard-coinbase height
and non-empty only after block 101.  authproxy.py is fixed to accept both
'application/json' and 'application/json; charset=utf-8' so zcashd RPC calls
no longer raise a content-type error.
Add a focused standalone zcashd repro for the wallet behavior encountered while bringing up the gRPC comparison fixture.

The test keeps Sapling funding, Sapling-to-Orchard, and the follow-on Orchard spend in one wallet process. Affected zcashd versions fail the final Orchard spend with an insufficient-funds async operation error because the just-created Orchard note is not available as spendable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zcashd v6.12.1 crashes with assertion failure in OrchardWallet::GetSpendInfo (walletAnchor.has_value() && walletAnchor.value() == anchor)

1 participant