duality-labs / hapi-indexer

A Node.js based indexer for the Duality Cosmos chain
1 stars 0 forks source link

fix: ensure queryable state for all block height ranges #34

Closed dib542 closed 1 year ago

dib542 commented 1 year ago

This PR adds the saving of tick state for all block heights, allowing queries for block height range extents anywhere between 0-lastBlockHeight to have a deterministic result set. This in turn allows better (less awkward/hacky) cache usage: as all cache keys now generate unchanging result sets that can be cached indefinitely.

This also solves the related issue of pagination requests being able to be shared by multiple indexer instances: now that the state can be queried for any range an offset pagination request for a previously uncached result is not an issue.