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

Change HashMaps in ScanningKeys to hold concrete ScanningKey #1540

Closed
wants to merge 1 commit into from

Conversation

ec2
Copy link

@ec2 ec2 commented Sep 13, 2024

Removing the use of dynamic dispatch from the ScanningKeys struct. As per @nuttycom and @str4d, the original reason for this was to support both IVKs and FVKs for trial decryption.

I'm of the opinion that allowing the mixing of the two makes things un-ergonomic. IVKs can be derived from FVKs anyways, so I don't really see the point in allowing mixing.

@nuttycom
Copy link
Contributor

The problem that I see for this is that it then requires two calls to scan_block_with_runners for every block in a wallet that has both FVKs and IVKs. Instead of simply being able to query for the keys that are relevant to the wallet, and scan with them (taking advantage of batching) you have to do everything twice.

Something I'm not understanding with this change is: what use case is the Box<dyn ScanningKeyOps> interfering with? I can't see how this is a performance bottleneck; in general the number of keys will be small, and the cost of dynamic dispatch here should be negligible on a per-block basis. So what's the motivation for this change?

@ec2
Copy link
Author

ec2 commented Oct 10, 2024

I had a misunderstanding of requirements! Closing.

@ec2 ec2 closed this Oct 10, 2024
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.

2 participants