fix(zcashd): scope pruned block logs to sidecar peers#302
Merged
Conversation
Attribute protected-peer block requests so ordinary peers cannot trigger or consume the zcashd-compat pruning diagnostic.
|
Note Complete: Audit complete. V12 did not find any issues that need review. Open the full results here. Analyzed three files, diff |
Check source-aware legacy requests against the effective sidecar IP allowlist so unrelated legacy sources cannot trigger the pruning diagnostic.
czarcas7ic
approved these changes
Jul 20, 2026
p0mvn
marked this pull request as ready for review
July 20, 2026 17:42
ebfull
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
getdatarequests from operator-configured protected legacy peers with their connection sourcezcashd_compat.block_gossip_peer_ipsallowlistnotfoundpath without loggingTesting
cargo fmt --all -- --checkcargo test -p zakura-network protected_connection_attributes_inbound_block_request --libcargo test -p zakura inbound_pruned_block --libcargo test -p zakura pruned_block_not_found --libcargo clippy -p zakura-network -p zakura --lib --tests --no-deps -- -D warningsThe 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
notfoundresponse. Unit coverage verifies rate limiting and IPv4-mapped IPv6 canonicalization.Specifications & References