Skip to content
Commit 744b783a authored by Alexandru Vasile's avatar Alexandru Vasile Committed by GitHub
Browse files

chainHead: Limit ongoing operations (#14699)



* chainHead/api: Make storage/body/call pure RPC methods

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead: Add mpsc channel between RPC methods

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead/subscriptions: Extract mpsc::Sender via BlockGuard

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead/subscriptions: Generate and provide the method operation ID

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead: Generate `chainHead_body` response

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead: Generate `chainHead_call` response

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead: Generate `chainHead_storage` responses

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead: Propagate responses of methods to chainHead_follow

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead/tests: Adjust `chainHead_body` responses

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead/tests: Adjust `chainHead_call` responses

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead/tests: Adjust `chainHead_call` responses

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead/tests: Ensure unique operation IDs across methods

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead/events: Remove old method events

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead/subscriptions: Add limit helper

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead/subscription: Expose limits to `BlockGuard`

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead/tests: Adjust testing to ongoing operations

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead: Make limits configurable via `ChainHeadConfig`

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead/tests: Adjust testing to `ChainHeadConfig`

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead/tests: Ensure operation limits discards items

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead: Improve documentation

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead: Rename `OngoingOperations` -> `LimitOperations`

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead: Rename reserve -> reserve_at_most

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead: Use duration const instead of u64

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* chainHead/subscription: Use tokio::sync::Semaphore for limits

Signed-off-by: default avatarAlexandru Vasile <[email protected]>

* Update client/rpc-spec-v2/src/chain_head/subscription/inner.rs

Co-authored-by: default avatarSebastian Kunert <[email protected]>

---------

Signed-off-by: default avatarAlexandru Vasile <[email protected]>
Co-authored-by: parity-processbot <>
Co-authored-by: default avatarSebastian Kunert <[email protected]>
parent 0146cb2f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment