librustzcash
librustzcash copied to clipboard
Ignore subtree roots in the unstable chain region on the Rust side
The gRPC method to get subtree roots from lightwalletd
takes a start index and returns every subtree root from there on. However, if we know that we won't use the most recent subtree root because there is a chance we rewind across a subtree boundary, then we may instead choose to ignore the subtree root update and rely on leaf insertions. This would reduce the number of subtree roots we need to insert into the cap tree, reducing overhead. We just need to ensure that we always end up at the same subtree root as we would have if we inserted the ignored root.