Skip to content

0.2.11

Choose a tag to compare

@bmuddha bmuddha released this 11 Feb 15:34
· 9 commits to master since this release
6dbb658

Highlights

  1. Main and the biggest change of this release is the way that getProgramAccounts are handled. The following logic has been implemented
    • If the getProgramAccount request is made with filter, and no cache entry is found for the given filter, then search for existence of this filter's superset, i.e. a different filter which when applied to all accounts of the program, will produce a subset of it which will include the accounts for the original filter (which was present in request). Such a filter is a less restrictive one. If found, then the list of accounts is filtered in-place by cacherpc itself before being served to client.
    • If superset filter cannot be found in cache, then try to search for valid intersections of the requested filter with others present in cache, i.e. new filter which will be a superset of the original filter in request.
    • In case such an intersection can be found, a separate asynchronous gPA request is made to cluster/validator, which is identical to the one made by client, except for the filter.
    • The original request is also made, as cacherpc cannot wait for second request to finish and should start streaming data to client as soon as possible
    • The result of second request (with superset filter) is saved to cache, and should prevent future cache misses
    • When an entry for the given filter is not found in cache, but the request still can be served from superset, then the ttl for the superset filter will be reset, and not for the originally requested filter, so that hot supersets will linger for long time in cache.
  2. Refactored pubsub module, splitting it into several files, for better maintainability

What's Changed

  • Refactored pubsub module by @bobs4462 in #244
  • Implemented optimized filter based caching for gPA by @bobs4462 in #243

Full Changelog: 0.2.10...0.2.11