cleanup(sync): remove obsolete zcashd trailing hash handling#11093
Open
jvff wants to merge 2 commits into
Open
cleanup(sync): remove obsolete zcashd trailing hash handling#11093jvff wants to merge 2 commits into
jvff wants to merge 2 commits into
Conversation
This was specific handling for `zcashd` behavior, and `zcashd` is now deprecated.
Include only the hashes that Zebra will use.
Contributor
There was a problem hiding this comment.
Pull request overview
Removes obsolete zcashd trailing-hash stripping from Zebra’s block synchronization flow.
Changes:
- Retains complete
FindBlocksresponses inobtain_tips()andextend_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. |
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
Closes #11091
Zebra discards the final hash from
FindBlocksresponses 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 completeFindBlocksresponse 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 -- --checkcargo nextest run -p zebrad 'components::sync::tests::vectors'git diff --checkSpecifications & References
Follow-up Work
Handle valid singleton
FindBlocksresponses independently. Removing the trailing-hash workaround alone does not allow the syncer to construct aCheckedTipfrom a single unknown hash.AI Disclosure
PR Checklist
type(scope): description