Skip to content

cleanup(sync): remove obsolete zcashd trailing hash handling#11093

Open
jvff wants to merge 2 commits into
mainfrom
jvff/remove-special-handling-of-zcashd-block-hashes
Open

cleanup(sync): remove obsolete zcashd trailing hash handling#11093
jvff wants to merge 2 commits into
mainfrom
jvff/remove-special-handling-of-zcashd-block-hashes

Conversation

@jvff

@jvff jvff commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Motivation

Closes #11091

Zebra discards the final hash from FindBlocks responses on Mainnet and Testnet as a workaround for a deprecated zcashd behavior that could append an unrelated hash.

The workaround was originally added in #991 for a zcashd bug that combined responses. Since zcashd has been deprecated, Zebra no longer needs to discard otherwise valid trailing hashes.

Solution

Remove trailing-hash stripping from both sync stages:

  • obtain_tips() now considers the complete FindBlocks response on every network.
  • extend_tips() retains the final new hash after removing the expected overlap hash.

The general overlap handling in extend_tips() remains unchanged.

Update the existing sync test vectors to omit their artificial sacrificial trailing hashes. The existing download assertions now verify that the final valid hash is retained and downloaded.

Tests

  • cargo fmt --all -- --check
  • cargo nextest run -p zebrad 'components::sync::tests::vectors'
    • 10 tests passed
  • git diff --check

Specifications & References

Follow-up Work

Handle valid singleton FindBlocks responses independently. Removing the trailing-hash workaround alone does not allow the syncer to construct a CheckedTip from a single unknown hash.

AI Disclosure

  • No AI tools were used in this PR
  • AI tools were used: OpenAI Codex was used to investigate the sync behavior and history, implement the change, update tests, run validation, and draft the PR description.

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.

jvff added 2 commits July 24, 2026 21:04
This was specific handling for `zcashd` behavior, and `zcashd` is now
deprecated.
Include only the hashes that Zebra will use.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes obsolete zcashd trailing-hash stripping from Zebra’s block synchronization flow.

Changes:

  • Retains complete FindBlocks responses in obtain_tips() and extend_tips().
  • Updates sync vectors to verify final valid hashes are downloaded.
  • No consensus or serialization behavior changes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
zebrad/src/components/sync.rs Removes trailing-hash filtering from both sync stages.
zebrad/src/components/sync/tests/vectors.rs Removes sacrificial hashes and validates retained trailing hashes.

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.

Remove special handling of zcashd BlockHashes response

2 participants