Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zcash_client_sqlite: Fix invalid attempt to derive Sapling receivers in gap limit handling migration. #1752

Merged
merged 3 commits into from
Mar 27, 2025

Conversation

nuttycom
Copy link
Contributor

No description provided.

…er where there may be none.

This fixes an error in the `transparent_gap_limit_handling` migration,
whereby wallets that received Orchard outputs at diversifier indices for
which no Sapling receivers could exist would incorrectly attempt to
derive UAs containing sapling receivers at those indices.
@@ -480,7 +480,7 @@ impl<P: consensus::Parameters, C: Clock, R: RngCore> RusqliteMigration for Migra
.expect("previously generated an address"),
)
.expect("roundtrip");
let ua = uivk.address(di, UnifiedAddressRequest::AllAvailableKeys)?;
let ua = uivk.address(di, UnifiedAddressRequest::ALLOW_ALL)?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is safe, because the migration will either have succeeded with AllAvailableKeys, or it will have failed in which case the migration will not have been applied and will re-run with the correction the next time the wallet starts up.

Copy link
Contributor

Choose a reason for hiding this comment

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

This change is also safe because it is only used in the context of diversifiers derived from either Sapling or Orchard receivers, ensuring that the resulting UA will contain a shielded receiver.

@nuttycom nuttycom requested review from str4d and daira March 26, 2025 21:37
Copy link

codecov bot commented Mar 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.88%. Comparing base (dd1c7d3) to head (accf78f).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1752   +/-   ##
=======================================
  Coverage   53.88%   53.88%           
=======================================
  Files         179      179           
  Lines       21531    21531           
=======================================
  Hits        11602    11602           
  Misses       9929     9929           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

str4d
str4d previously approved these changes Mar 27, 2025
Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

utACK 4b75b47

@str4d
Copy link
Contributor

str4d commented Mar 27, 2025

Published 7dcdc4c as zcash_client_sqlite 0.16.1.

@nuttycom nuttycom force-pushed the fix/invalid_sapling_receiver_migration branch from 4b75b47 to accf78f Compare March 27, 2025 13:50
@nuttycom nuttycom merged commit 7259c27 into main Mar 27, 2025
32 of 33 checks passed
@nuttycom nuttycom deleted the fix/invalid_sapling_receiver_migration branch March 27, 2025 14:12
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.

None yet

2 participants