librustzcash icon indicating copy to clipboard operation
librustzcash copied to clipboard

zcash_client_backend: Make it possible to skip trial-decryption with internal keys.

Open nuttycom opened this issue 1 year ago • 2 comments

Since internal keys should only ever receive funds that are being sent by the wallet, it should be possible to skip trial-decryption using the internal IVK for any block except those where a spend (either of a shielded note or a transparent UTXO) is detected.

nuttycom avatar Sep 08 '23 15:09 nuttycom

This doesn't work reliably now that we are doing non-linear scanning; we don't detect spends for reverse scanning until after we've done trial decryption of the transactions they were spent in. We should still consider doing it where we do detect a spend during forward linear scanning.

str4d avatar Sep 21 '23 13:09 str4d

I guess that we could start by just applying this optimization by checking whether the batch we're working on starts at the block above the fully-scanned height; it would give us a 2x improvement for our current approach to scanning big Historic ranges.

nuttycom avatar Sep 21 '23 13:09 nuttycom