Skip to content

fix(zcashd): scope pruned block logs to sidecar peers#302

Merged
ebfull merged 2 commits into
mainfrom
fix/zcashd-pruned-log-peer
Jul 20, 2026
Merged

fix(zcashd): scope pruned block logs to sidecar peers#302
ebfull merged 2 commits into
mainfrom
fix/zcashd-pruned-log-peer

Conversation

@p0mvn

@p0mvn p0mvn commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Motivation

PR #279 enabled an actionable diagnostic when a pruned zcashd-compat node cannot serve a requested block body. The diagnostic was configuration-gated, but the shared inbound service did not identify which connected peer sent the request, so any peer could trigger the message and consume its global rate-limit interval.

Solution

  • attribute block getdata requests from operator-configured protected legacy peers with their connection source
  • independently match that source against the effective zcashd_compat.block_gossip_peer_ips allowlist
  • emit the pruning diagnostic only for configured legacy sidecar requests
  • keep ordinary legacy, unconfigured legacy, and Zakura v2 requests on the existing notfound path without logging

Testing

  • cargo fmt --all -- --check
  • cargo test -p zakura-network protected_connection_attributes_inbound_block_request --lib
  • cargo test -p zakura inbound_pruned_block --lib
  • cargo test -p zakura pruned_block_not_found --lib
  • cargo clippy -p zakura-network -p zakura --lib --tests --no-deps -- -D warnings

The connection test verifies that configured sidecar requests carry their classified source. The inbound integration test verifies that ordinary and unconfigured legacy requests do not log while the configured zcashd-compat peer does, without changing the wire notfound response. Unit coverage verifies rate limiting and IPv4-mapped IPv6 canonicalization.

Specifications & References

Attribute protected-peer block requests so ordinary peers cannot trigger or consume the zcashd-compat pruning diagnostic.
@v12-auditor

v12-auditor Bot commented Jul 20, 2026

Copy link
Copy Markdown

Note

Complete: Audit complete. V12 did not find any issues that need review.

Open the full results here.

Analyzed three files, diff 3669471...dd2d6dc.

Check source-aware legacy requests against the effective sidecar IP allowlist so unrelated legacy sources cannot trigger the pruning diagnostic.
@p0mvn
p0mvn marked this pull request as ready for review July 20, 2026 17:42
@ebfull
ebfull merged commit 361aff7 into main Jul 20, 2026
64 checks passed
@ebfull
ebfull deleted the fix/zcashd-pruned-log-peer branch July 20, 2026 18:08
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.

3 participants