Unverified Commit 01577daf authored by Alexandru Vasile's avatar Alexandru Vasile Committed by GitHub
Browse files

Add resource limiting for `Subscriptions` (#786)



* ws-server: Fix copyright for tests
Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* rpc_module: Return a resource builder when subscribing

Registering a subscription returns the subscription'
callback wrapped into a `MethodResourcesBuilder` for resource
limiting purposes.
Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* tests: Fix `register_subscription` tests
Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* server: Drop `ResourceGuard` with `SubscriptionSink` for resource limit
Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* tests: Check resource limits for subscription
Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* proc-macros: Render resource limits for subscription macro
Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* tests: Extend subscription limiting test via macro generation
Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* core: Check if the `unsubscribe` method was already inserted
Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* tests: Fix unsupported fields for subscriptions
Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* server: Verify subscription methods before registering them
Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* Update test comment for subscription limiting
Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>

* Modify tests comments
Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>
parent 21189759
Pipeline #198583 passed with stages
in 5 minutes and 34 seconds