ZcashFoundation / zebra

Zcash - Financial Privacy in Rust 🦓
https://zfnd.org/zebra/
Apache License 2.0
408 stars 100 forks source link

Tracking: Support indexer/caching service in Zebra #8610

Open arya2 opened 4 months ago

arya2 commented 4 months ago

Motivation

The indexer needs to notify clients when there are changes to the mempool or best chain with affected transactions.

This is more efficient than polling to check for changes, especially from the indexer's perspective, and has better usability for clients.

Design

Add a method to ChainTipChange in zebra-state for getting changes to the nullifier set, and a tonic IndexerRpcServer server for streaming responses to clients with server-sent events.

Implementation Plan

Preperation:

Indexing:

RPC methods:

Index Server / Cacher:

Optional:

conradoplg commented 3 months ago

I think this might be missing some of the notifications we need, namely when transactions are available and blocks are validated. See https://github.com/zcash/librustzcash/issues/1395#issuecomment-2211134913