librustzcash icon indicating copy to clipboard operation
librustzcash copied to clipboard

zcash_client_backend: Add cache insertion and deletion APIs to `BlockSource` trait or a new trait

Open str4d opened this issue 1 year ago • 0 comments

Currently the BlockSource trait only exposes a generic way to access cached blocks. However, if we want to provide a generic state machine (#1169), we will need a generic way to perform the following operations:

  • Insert downloaded CompactBlocks into the cache.
  • Mark previously-cached blocks as scanned (to trigger cache removal at some point).
  • Remove all cached blocks above some height (for rollbacks).

We might want to do this as part of BlockSource, but more likely we will have a new BlockCache: BlockSource trait providing these capabilities.

str4d avatar Feb 07 '24 19:02 str4d