This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rpc: Use the blocks pinning API for chainHead methods (#13233)
* rpc/chain_head: Add backend to subscription management Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_head: Pin blocks internally and adjust testing Signed-off-by: Alexandru Vasile <[email protected]> * client/in_mem: Reference for the number of pinned blocks Signed-off-by: Alexandru Vasile <[email protected]> * rpc/tests: Check in-memory references to pinned blocks Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_head: Fix clippy Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_head: Remove unused comment Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_head: Place subscription handle under `Arc` and unpin blocks on drop Signed-off-by: Alexandru Vasile <[email protected]> * rpc/tests: Check all pinned blocks are unpinned on drop Signed-off-by: Alexandru Vasile <[email protected]> * Apply suggestions from code review Co-authored-by: Bastian Köcher <[email protected]> * Update client/rpc-spec-v2/src/chain_head/subscription.rs Co-authored-by: Bastian Köcher <[email protected]> * rpc/tests: Retry fetching the pinned references for CI correctness Signed-off-by: Alexandru Vasile <[email protected]> * client/service: Use 512 as maximum number of pinned blocks Signed-off-by: Alexandru Vasile <[email protected]> * chain_head: Fix merging conflicts Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_head: Adjust subscriptions to use pinning API Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_head/tests: Test subscription management Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_head: Adjust chain_head follow to the new API Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_head: Adjust chain_head.rs to the new API Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_head/tests: Adjust test.rs to the new API Signed-off-by: Alexandru Vasile <[email protected]> * client/builder: Use new chainHead API Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_head: Fix documentation Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_head: Fix clippy Signed-off-by: Alexandru Vasile <[email protected]> * client/in_mem: ChainHead no longer uses `in_mem::children` Signed-off-by: Alexandru Vasile <[email protected]> * Update client/rpc-spec-v2/src/chain_head/subscription.rs Co-authored-by: Sebastian Kunert <[email protected]> * Update client/rpc-spec-v2/src/chain_head/subscription.rs Co-authored-by: Sebastian Kunert <[email protected]> * Update client/rpc-spec-v2/src/chain_head/subscription.rs Co-authored-by: Sebastian Kunert <[email protected]> * Update client/rpc-spec-v2/src/chain_head/subscription.rs Co-authored-by: Sebastian Kunert <[email protected]> * chain_head: Add block state machine Signed-off-by: Alexandru Vasile <[email protected]> * Address feedback Signed-off-by: Alexandru Vasile <[email protected]> * Use new_native_or_wasm_executor Signed-off-by: Alexandru Vasile <[email protected]> * chain_head: Remove 'static on Backend Signed-off-by: Alexandru Vasile <[email protected]> * chain_head: Add documentation Signed-off-by: Alexandru Vasile <[email protected]> * chain_head: Lock blocks before async blocks Signed-off-by: Alexandru Vasile <[email protected]> * chain_head_follower: Remove static on backend Signed-off-by: Alexandru Vasile <[email protected]> * Update client/service/src/builder.rs Co-authored-by: Davide Galassi <[email protected]> * Update client/service/src/builder.rs Co-authored-by: Davide Galassi <[email protected]> * chain_head: Add BlockHeaderAbsent to the PartialEq impl Signed-off-by: Alexandru Vasile <[email protected]> * client: Add better documentation around pinning constants Signed-off-by: Alexandru Vasile <[email protected]> * chain_head: Move subscription to dedicated module Signed-off-by: Alexandru Vasile <[email protected]> * subscription: Rename global pin / unpin functions Signed-off-by: Alexandru Vasile <[email protected]> --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: parity-processbot <> Co-authored-by: Sebastian Kunert <[email protected]> Co-authored-by: Davide Galassi <[email protected]>
- Loading branch information