Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor the JSON-RPC cache and handling of legacy API subscriptions (#…
…854) * Move cache populating task to separate module * Move main loop to separate function * Pass individual components to the task rather than the Background * Move `chain_subscribeAllHeads` to new task * Move chain_subscribeNewHeads to new task * Add a `Message` enum for messages * Notify when subscription is destroyed * Make runtime_access ask the cache through a message * Query block number from cache * Ask block header from cache through a message * Ask for the block state root and number by sending a message * Move `state_get_keys_paged` as a separate field * The `Cache` is now scoped to `legacy_state_sub` * Remove background abort registration system * Simplify `Frontend::queue_rpc_request` * Remove TODOs and update CHANGELOG * Perform the re-subscription within the task * Inline the fields of `Cache` within `Task` * Move recent pinned blocks to Subscription::Active as it makes sense there * Simplify `start_task` * Wrap recent blocks in a struct * Add `runtime_version` field to `RecentBlock` * Fix pinning strategy * Handle finalized subscriptions in new task * Fix runtime_version todo!() * Remove obsolete TODO * Keep current best and finalized and report them immediately * Fix unused imports and variables * Ask the best block from the new task instead of using sub_utils * Move runtime subscription to new task * Remove unused function * Move `state_subscribeStorage` to new task * Update CHANGELOG * Small tweaks and restore logging incoming requests * Remove obsolete code * Add TODO * Change creation API to return a sender * Use a Config struct and pass proper seeds * Add lots of comments and tweaks * Report finalized block separately * Simplify notifying best block update * Split the blocks more for readability * Fix all warnings * Small tweak * PR link * Docfix and error moved
- Loading branch information