Skip to content

Releases: bestarch-ae/cacherpc

0.2.3

09 Dec 11:56
e0dc20e
Compare
Choose a tag to compare

Highlights:

  1. The old behavior for handling filtered getProgramAccounts requests, when cache contains data for unfiltered one, has been restored. Now, if cache has an entry for gPA requests, which has been made without filters, it follows that we have all the data for the given program available in cache, and as such we perform filtering in caching service, and serve the request from cache.

What's Changed

  • Fixed cache miss, when cache contains unfiltered gpa response by @bobs4462 in #228
  • chore: version bump to 0.2.3 by @bobs4462 in #229

Full Changelog: 0.2.2...0.2.3

0.2.2

08 Dec 09:58
882f003
Compare
Choose a tag to compare

Highlights

  1. Fix: wrong argument was used to limit the number of waiting gPA requests (--program-request-queue-size parameter)
  2. New metrics were added to gain some insights related to response serialization:
    • serialization_time - compound histogram metric, which uses triple (request type, request encoding, rpc worker thread id) for labeling purposes. It shows the amount of time (in seconds) that caching server spent serializing response after cache hit occurred (not LRU).
    • account_data_len - histogram metric, which uses rpc worker thread id as its labels. It shows the number of bytes in account's data field before this account was serialized, which should provide some information as to how large accounts can be (in binary), and how their size affects the rpc thread load during serialization.

What's Changed

  • Fixed wrong queue size argument passing for program accounts by @bobs4462 in #223
  • Added serialization related metrics by @bobs4462 in #225
  • chore: bumped version to 0.2.2 + updated readme by @bobs4462 in #226

Full Changelog: 0.2.1...0.2.2

0.2.1

02 Dec 13:18
d58a9b6
Compare
Choose a tag to compare
0.2.1 Pre-release
Pre-release

Highlights:

  1. Fix: hot reload of waf-rules now works as expected via cache-rpc waf-reload command
  2. Bounded wait queue was implemented for RPC requests. Now when application starts, it can accept 2 additional parameters:
    • account-request-queue-size - number of client connections that can wait for available permits for getAccountInfo
    • program-request-queue-size - number of connections that can wait for available permits for getProgramAccounts
      Those two parameters complement the other two parameters account-request-limit and program-request-limit respectively. What they do is, they can prevent new client requests, which cannot be served from cache, from trying to acquire available permits for their corresponding request type, and as such indirectly allow to control how many requests can be made to validator in short bursts. It basically works by forcing every request (not serviceable from cache) to get into queue (which has limited size), before even trying to acquire permit to make the actual request, if it doesn't succeed (due to queue being full), the response will be returned immediately to client with message explaining that there are too many requests of this type is being made. If request does succeed, it can go ahead and try to acquire a permit for making the request, and upon success it will move out of wait queue, so that other requests can also attempt to acquire a permit (by getting into queue). These parameters can be hot reloaded from config file, the same way that account-request-limit and program-request-limit can, example config might look like this:
[rpc]
ignore_base58_limit = true

[rpc.request_limits]
account_info = 500
program_accounts = 15

[rpc.request_queue_size]
account_info = 1000 # default is set to value 2 ^ 19, effectively disabling any restrictions 
program_accounts = 75 # default is set to value 2 ^ 18, effectively disabling any restrictions
  1. Completely reworked subscription tracking (biggest change of release), here's the list of most notable updates:
    1. When getAccountInfo triggers subscription, account key starts being tracked in program cache, by means of the public key of account owner, it's done to transfer subscription management responsibility to owner program, when request for its owner will be made in future.
    2. If during subscription attempt for account, it's found that owner program already has cache entry and subscription, then no new account subscription is created, but account key is still added to the list of tracked keys of its owner.
    3. When getProgramAccouns gets cached, it unsubscribes from all tracked child accounts accounts without deleting them from cache.
    4. All accounts, which are being tracked by their owner, get served from cache, as long as parent has an active subscription, and do not create their own subscription, but resetting their ttl nonetheless.
    5. When getAccountInfo hits the cache it creates a purge task for itself, and when timer expires, it removes itself from tracked
      accounts in its owner's cache entry, and tries to remove itself from accounts cache, succeeding only if no other getProgramAccounts request is tracking it.
    6. When getAccountInfo misses the cache, while it's owner still having active subscription, the result is similar to case 5, it fetches account by RPC, puts it into accounts cache, starts tracking it in owner's cache entry, and doesn't create extra subscription for itself, while still making sure that it will be removed from cache when it's ttl ends.
    7. When getProgramAccounts cache entry expires, it will perform cleanup for all of its child accounts, except for those which had recent cache hits, in which case it will resubscribe for those before terminating its own subscription.

What's Changed

  • Fixed waf rules reload by @bobs4462 in #219
  • Implementation of bounded wait queue for rpc requests by @bobs4462 in #187
  • Subsription tracking refactoring by @bobs4462 in #215
  • Wait queue size for rpc requests was made optional by @bobs4462 in #222
  • chore: bump version to 0.2.1 + remove mlua patch by @bobs4462 in #221

Full Changelog: 0.2.0...0.2.1

0.2.0

22 Nov 15:35
854b5a8
Compare
Choose a tag to compare

Highlights:

  1. More even distribution of heavy program accounts subscriptions. Previously all subscriptions with the same pubkey would be served on the same websocket connection, now the choice of connection is additionally determined by commitment level.
  2. New metric for counting requests. backend_requests_count is vector of 3 counters: getAccountInfo, getProgramAccounts, passthrough type of requests.
  3. Control interface now has additional command to reload WAF rules from lua file. File path should be provided on cacher startup, reload will take place from the same file. Usage: cache-rpc waf-reload. As each worker thread of server has it's own copy of filters, it will take N rpc requests for them to reload their copies from disk, where N is the number of logical CPU cores. It happens because reloading of rules takes place right before handling of RPC request.

What's Changed

  • Removed unwrap when starting control interface by @bobs4462 in #211
  • chore: removed patch on actix-tls by @bobs4462 in #210
  • Added commitment to pubsub worker index computation by @bobs4462 in #212
  • Added new metric for counting requests of each type by @bobs4462 in #213
  • fix: index observed filters by key and commitment by @00nktk in #216
  • Added cotrol command to reload waf rules from disk by @bobs4462 in #217
  • chore: version bump to 0.2.0 by @bobs4462 in #218

Full Changelog: 0.1.38...0.2.0

0.1.38

12 Nov 16:33
2f92ab0
Compare
Choose a tag to compare

Highlights:

  1. Fixed command handling for cache-rpc subscriptions status
  2. Reverted subscriptions deduplication feature, which was introduced in last release, until a fix is proved to be logically correct
  3. Added extra header to getProgramAccounts and getAccountInfo requests, that are sent from cacher to balancer. This header has a key: X-Cache-Request-Method and a value: either getProgramAccounts or getAccountInfo.

What's Changed

  • hotfix: fixed handling of subscriptions status command by @bobs4462 in #204
  • Added extra header for load balancer by @bobs4462 in #206
  • Revert "Added logic to deduplicate subscriptions (#185)" by @bobs4462 in #207
  • chore: bump version to 0.1.38 by @bobs4462 in #208

Full Changelog: 0.1.37...0.1.38

0.1.37

11 Nov 10:37
ed7f971
Compare
Choose a tag to compare

Highlights:

  1. WAF rules are now applied to batch requests as well. Every single requests in batch will be subjected to evaluation before further processing can be performed, and in case if one of the requests fail to satisfy checks, entire batch request will be rejected.
  2. Subscriptions deduplication has been improved. Now before creating a new subscription for account, cacher first checks whether there's already exists a subscription for that account's owner (given one is present). Also when creating a subscription for a program, we unsubscribe from all of it's child accounts, if separate subscriptions exist for them.
  3. New metric was added subscriptions_skipped for counting the number of skipped subscriptions, because of improved subscriptions tracking feature.
  4. New metric was added streaming_errors for counting the number of connection drops or other error which occur in the middle of streaming the response from validator to client.
  5. Control interface was implemented in order to make changes to dynamic settings a bit more convenient. Right now control interface supports 4 commands:
    • cacherpc config-reload - forces running instance of cacherpc to reload its configuration file
    • cacherpc subscriptions on - allows running instance of cacherpc to create new websocket subscriptions
    • cacherpc subscriptions off - prevent running instance of cacherpc from creating any new websocket subscriptions
    • cacherpc subscriptions status - get current status of whether subscriptions are on or off
      If command succeeds, it returns exits with code 0, code 1 is returned otherwise, along with description of what has gone wrong

What's Changed

  • Added WAF support for batch requests by @bobs4462 in #199
  • chore: commited Cargo.lock by @bobs4462 in #200
  • Added logic to deduplicate subscriptions by @bobs4462 in #185
  • feat: count streaming errors by @polachok in #201
  • Implemented control interface to issue commands to running instance by @bobs4462 in #198
  • chore(ci): add all-targets/all-features for clippy by @polachok in #203
  • chore: bump version to 0.1.37 by @bobs4462 in #202

Full Changelog: 0.1.36...0.1.37

0.1.36

02 Nov 16:43
fac8c39
Compare
Choose a tag to compare

Highlights:

  1. The project was migrated to Actix-Web version 4 (from 3), and tokio 1 (from 0.2). This migration should solve the thread panicking issue due to bug in DelayQueue implementation of tokio time.
  2. Response parsing for getHealth rpc request was fix, so that the error updating rpc health err=Json deserialize error: invalid type: newtype struct should not happen anymore. Additional logging was added, just in case, if the fix doesn't work

What's Changed

  • Changed the data field for rpc error response by @bobs4462 in #190
  • refactor: update to actix 4.0/tokio 1.0 by @polachok in #192
  • chore: bump version to 0.1.36 by @bobs4462 in #194

Full Changelog: 0.1.35...0.1.36

0.1.35

01 Nov 17:02
bc392b1
Compare
Choose a tag to compare

Highlights:

  1. Added logging and metrics counter (waf_rejections), when WAF rejection takes place.
  2. Moved handling of WAF rule evaluation to higher level, so that every request (single ones, not batch requests) will be subjected to checks.
  3. Added a new signal handler, to intercept USR1 signals, sent to application process. This signal can be used to toggle a new flag, which is responsible for allowing new websocket subscriptions, i.e. when the flag is set to true (default) new subscriptions can be made, if it's switched to false, cacher will refuse to put any new responses to cache and respectively to create a new subscriptions for them. Present subscription and cache entries will continue to exist, until they are removed due to absence of cache hits.

What's Changed

  • Created metric for counting the number of WAF-caused request rejection by @bobs4462 in #183
  • Moved WAF filtering to rpc handler by @bobs4462 in #188
  • Added signal handling to prevent new subscriptions by @bobs4462 in #189
  • chore: bump version to 0.1.35 by @bobs4462 in #191

Full Changelog: 0.1.34...0.1.35

0.1.34

22 Oct 18:00
3cb5341
Compare
Choose a tag to compare

Highlights:

  1. Some minor error result consistency improvements (SOL-33)
  2. Support added for batch requests (with multiple subqueries), but for now those requests aren't handled by cacher and passed on directly to validators, and as a consequence their results are not cached either (SOL-29)
  3. Added new metric to track the number of batch requests called batch_requests which is just a normal integer counter.
  4. Web application firewall was added as an optional feature, in order to use it one has to provide a file containing filtering rules, written in Lua language, via --rules flag. See the example file on how to write rules.
  5. Improved cache hit rate for program related accounts, this is done via sharing the data which was cached by getProgramAccounts with getAccountInfo. But the cache hit is not guaranteed for now, because getProgramAccounts responses don't necessarily contain context with slot, which is required by getAccountInfo requests. So in order for cache hit to occur, one of the related accounts to getProgramAccounts should be sent via websockets (as a notification), and thus updating the owner program's slot. This mechanism should reduce the amount of active subscriptions (but probably not much).

What's Changed

  • Invalid parameters error: consistency with validator by @bobs4462 in #179
  • Added support for batch requests by @bobs4462 in #178
  • WAF by @polachok in #156
  • Added default slot for getProgramAccount requests by @bobs4462 in #180

Full Changelog: 0.1.33...0.1.34

0.1.33

13 Oct 16:39
c0fa6a8
Compare
Choose a tag to compare

Highlights:

  1. Two new metrics were added:
    • counter for websocket reconnect attempts websocket_reconnects
    • counter for rpc request retries request_retries
  2. Number of websocket reconnect attempts has been made infinite, with interval between attempts not exceeding 10 seconds
  3. Random failure of tree_matches_overall proptest has been fixed
  4. In case of invalid request, the error response has been made to match that of validator
  5. jsonParsed encoding support was added to cacher for the already cached values (optional feature, on by default)

What's Changed

  • Made backoff for websocket connection attempts infinite by @bobs4462 in #169
  • AccountUpdateManager mini refactoring + readme update by @bobs4462 in #168
  • Added 2 counters to metrics: rpc request retries, websocket reconnects by @bobs4462 in #167
  • Fixed failing tests due to range error by @bobs4462 in #170
  • Changed the error type in case of invalid request by @bobs4462 in #172
  • chore: bump version by @bobs4462 in #173
  • Added feature to support jsonParsed encoding by @bobs4462 in #174

Full Changelog: 0.1.32...0.1.33