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

Add birthdays to MASP keys #3653

Merged
merged 7 commits into from
Aug 16, 2024
Merged

Add birthdays to MASP keys #3653

merged 7 commits into from
Aug 16, 2024

Conversation

batconjurer
Copy link
Member

Describe your changes

Partially addresses Issue #2900. Viewing and spending keys can no be given birthdays in the form of block heights which are loaded into shielded sync. Shielded sync will not try to decrypt a block before a keys birthday with said key.

Checklist before merging

  • If this PR has some consensus breaking changes, I added the corresponding breaking:: labels
    • This will require 2 reviewers to approve the changes

@batconjurer batconjurer requested review from sug0 and tzemanovic and removed request for sug0 August 15, 2024 12:21
Copy link

codecov bot commented Aug 15, 2024

Codecov Report

Attention: Patch coverage is 71.25984% with 73 lines in your changes missing coverage. Please review.

Project coverage is 61.31%. Comparing base (f08d3f2) to head (00df744).
Report is 64 commits behind head on main.

Files Patch % Lines
crates/sdk/src/wallet/mod.rs 0.00% 32 Missing ⚠️
crates/sdk/src/wallet/store.rs 0.00% 18 Missing ⚠️
crates/sdk/src/wallet/keys.rs 71.15% 15 Missing ⚠️
crates/node/src/bench_utils.rs 0.00% 4 Missing ⚠️
crates/core/src/masp.rs 0.00% 3 Missing ⚠️
crates/sdk/src/masp.rs 99.31% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3653      +/-   ##
==========================================
+ Coverage   61.28%   61.31%   +0.03%     
==========================================
  Files         312      312              
  Lines      101337   101548     +211     
==========================================
+ Hits        62103    62267     +164     
- Misses      39234    39281      +47     

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

Copy link
Contributor

@sug0 sug0 left a comment

Choose a reason for hiding this comment

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

These changes look good against main. When we integrate them with the phase 3 shielded sync code, we should optimize this function accordingly:

fn spawn_trial_decryptions(&self, itx: IndexedTx, txs: &[Transaction]) {
for tx in txs {
for vk in self.ctx.vk_heights.keys() {
let vk = *vk;
if self.cache.trial_decrypted.get(&itx, &vk).is_none() {
let tx = tx.clone();
self.spawn_sync(move |interrupt| {
Message::TrialDecrypt(
itx,
vk,
trial_decrypt(tx, vk, || interrupt.get()),
)
})
}
}
}
}

Right now, it's always attemtpting to scan txs without checking the heights of viewing keys.

@sug0
Copy link
Contributor

sug0 commented Aug 16, 2024

ah benches are broken

@tzemanovic tzemanovic added the merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass label Aug 16, 2024
mergify bot added a commit that referenced this pull request Aug 16, 2024
@mergify mergify bot merged commit 45400e3 into main Aug 16, 2024
21 checks passed
@mergify mergify bot deleted the bat/feat/key-birthdays branch August 16, 2024 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants