chainHead: Limit ongoing operations (#14699)
* chainHead/api: Make storage/body/call pure RPC methods Signed-off-by: Alexandru Vasile <[email protected]> * chainHead: Add mpsc channel between RPC methods Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/subscriptions: Extract mpsc::Sender via BlockGuard Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/subscriptions: Generate and provide the method operation ID Signed-off-by: Alexandru Vasile <[email protected]> * chainHead: Generate `chainHead_body` response Signed-off-by: Alexandru Vasile <[email protected]> * chainHead: Generate `chainHead_call` response Signed-off-by: Alexandru Vasile <[email protected]> * chainHead: Generate `chainHead_storage` responses Signed-off-by: Alexandru Vasile <[email protected]> * chainHead: Propagate responses of methods to chainHead_follow Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/tests: Adjust `chainHead_body` responses Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/tests: Adjust `chainHead_call` responses Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/tests: Adjust `chainHead_call` responses Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/tests: Ensure unique operation IDs across methods Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/events: Remove old method events Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/subscriptions: Add limit helper Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/subscription: Expose limits to `BlockGuard` Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/tests: Adjust testing to ongoing operations Signed-off-by: Alexandru Vasile <[email protected]> * chainHead: Make limits configurable via `ChainHeadConfig` Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/tests: Adjust testing to `ChainHeadConfig` Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/tests: Ensure operation limits discards items Signed-off-by: Alexandru Vasile <[email protected]> * chainHead: Improve documentation Signed-off-by: Alexandru Vasile <[email protected]> * chainHead: Rename `OngoingOperations` -> `LimitOperations` Signed-off-by: Alexandru Vasile <[email protected]> * chainHead: Rename reserve -> reserve_at_most Signed-off-by: Alexandru Vasile <[email protected]> * chainHead: Use duration const instead of u64 Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/subscription: Use tokio::sync::Semaphore for limits Signed-off-by: Alexandru Vasile <[email protected]> * Update client/rpc-spec-v2/src/chain_head/subscription/inner.rs Co-authored-by: Sebastian Kunert <[email protected]> --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: parity-processbot <> Co-authored-by: Sebastian Kunert <[email protected]>
parent
0146cb2f
Please register or sign in to comment