Skip to content

test(rpc): cover lightwalletd block RPCs - #11248

Draft
cleanerzkp wants to merge 16 commits into
ZcashFoundation:mainfrom
cleanerzkp:test/lightwalletd-grpc-slice
Draft

test(rpc): cover lightwalletd block RPCs#11248
cleanerzkp wants to merge 16 commits into
ZcashFoundation:mainfrom
cleanerzkp:test/lightwalletd-grpc-slice

Conversation

@cleanerzkp

Copy link
Copy Markdown

Motivation

Add the low-cost lightwalletd gRPC coverage requested in #11224 and scoped by the Zebra team response.

This draft is stacked on #10953 because the in-process server harness is currently on lightwalletd-grpc.

Solution

Add test-only coverage through the existing in-process gRPC server for:

  • GetLatestBlock returning the mocked best tip height and hash;
  • inclusive ascending and descending GetBlockRange order;
  • a range crossing the available state, which returns prior blocks and then NotFound;
  • an unspecified BlockID, which returns InvalidArgument without a state read.

Stream reads use bounded waits so a failed server response cannot hang the tests.

Tests

Passed locally:

  • cargo test -p zebra-rpc lightwalletd::tests::vectors -- --nocapture — 7 passed;
  • cargo fmt --all -- --check;
  • cargo clippy --workspace --all-targets -- -D warnings.

The full cargo test --workspace run reached zebra-network, then stopped on five unrelated macOS environment failures: three tests could not bind 127.0.0.2, and two peer-cache tests could not use the default cache path. The modified zebra-rpc suite passed. Local validation used installed stable Rust 1.95 because repeated downloads of the pinned Rust 1.91 toolchain reset at static.rust-lang.org; CI should provide the authoritative pinned-toolchain result.

Specifications & References

Follow-up Work

After #10953 merges, rebase this branch onto main, retarget the PR, and rerun the required gates.

AI Disclosure

  • No AI tools were used in this PR
  • AI tools were used: OpenAI Codex helped inspect repository guidance, implement the focused test coverage, run validation, and review the diff.

PR Checklist

  • The PR title follows conventional commits format: type(scope): description
  • The PR follows the contribution guidelines.
  • This change was discussed in an issue or with the team beforehand.
  • The solution is tested.
  • The documentation and changelogs are up to date.

arya2 and others added 16 commits July 14, 2026 17:52
# Conflicts:
#	CHANGELOG.md
#	zebra-rpc/CHANGELOG.md
@cleanerzkp
cleanerzkp force-pushed the test/lightwalletd-grpc-slice branch from fee2a59 to e65ae85 Compare August 12, 2026 13:25
@mergify
mergify Bot deleted the branch ZcashFoundation:main August 18, 2026 22:40
@mergify mergify Bot closed this Aug 18, 2026
@oxarbitrage oxarbitrage reopened this Aug 19, 2026
@oxarbitrage
oxarbitrage changed the base branch from lightwalletd-grpc to main August 19, 2026 12:43
@oxarbitrage

Copy link
Copy Markdown
Contributor

Reopened — this was auto-closed when its base branch (#10953's lightwalletd-grpc) merged, not a review outcome. #10953 is now on main (78acfd5) and this PR is retargeted to main, so it needs a rebase; the coverage is still wanted (tracked in #11224). @cleanerzkp, can you rebase — or let us know if you'd rather we pick it up?

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.

4 participants