-
Notifications
You must be signed in to change notification settings - Fork 263
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
Add transparent address gap limit handling & general address rotation functionality. #1673
Add transparent address gap limit handling & general address rotation functionality. #1673
Conversation
62c1394
to
bd2df86
Compare
bd2df86
to
4b99663
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1673 +/- ##
==========================================
+ Coverage 54.17% 54.26% +0.08%
==========================================
Files 176 179 +3
Lines 20469 21243 +774
==========================================
+ Hits 11089 11527 +438
- Misses 9380 9716 +336 ☔ View full report in Codecov by Sentry. |
1386dd1
to
49230de
Compare
…handling-prep Preparatory refactoring for #1673
b39c6c3
to
3ac0396
Compare
account_id, | ||
key_scope, | ||
&wdb.gap_limits, | ||
UnifiedAddressRequest::unsafe_custom(Allow, Allow, Require), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue here as for https://github.com/zcash/librustzcash/pull/1673/files#r1978625962
account.internal_id(), | ||
KeyScope::EXTERNAL, | ||
gap_limits, | ||
UnifiedAddressRequest::unsafe_custom(Allow, Allow, Require), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.expect("gap limit fits in usize"), | ||
)?; | ||
|
||
// Find the first index that generates an address conforming to the request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we resolve the issue with there being a significant probability of not finding any Sapling addresses within the gap limit?
account_id, | ||
key_scope, | ||
gap_limits, | ||
UnifiedAddressRequest::unsafe_custom(Allow, Allow, Require), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue here as https://github.com/zcash/librustzcash/pull/1673/files#r1978625962
/// This column exists because the diversifier index is stored as a byte array, meaning that we | ||
/// cannot use SQL integer operations on it for gap limit calculations, and thus need it as an | ||
/// integer as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It occurs to me that we could store the diversifier index as pairs of SQL integers, the high 56 bits and the low 32 bits. That would be normalized, easily sortable in SQL, and easy to check in SQL that the high bits are all 0. Filed #1731.
zcash_client_sqlite/src/wallet/init/migrations/ephemeral_addresses.rs
Outdated
Show resolved
Hide resolved
zcash_client_sqlite/src/wallet/init/migrations/transparent_gap_limit_handling.rs
Outdated
Show resolved
Hide resolved
find_gap_start(&db.conn, account_id, KeyScope::Ephemeral, db.gap_limits.ephemeral()), Ok(addr_index) | ||
if addr_index == Some(NonHardenedChildIndex::ZERO) | ||
); | ||
//assert_matches!(ephemeral::first_unstored_index(&db.conn, account_id), Ok(addr_index) if addr_index == GAP_LIMIT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this assertion correct? Delete it if it isn't correct, otherwise uncomment it. Non-blocking.
a93fb07
to
12e1a10
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
12e1a10
to
635c94b
Compare
Co-authored-by: Jack Grigg <[email protected]> Signed-off-by: Daira-Emma Hopwood <[email protected]>
…uts" feature is not enabled. Signed-off-by: Daira-Emma Hopwood <[email protected]>
Signed-off-by: Daira-Emma Hopwood <[email protected]>
635c94b
to
19e0e39
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-ACK for the last three commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-utACK 19e0e39
No description provided.