Skip to content

Slow stream subscribers should receive a timeout #2234

@Mirko-von-Leipzig

Description

@Mirko-von-Leipzig

#2196 adds the dropping of slow sync clients. However these can simply reconnect.

Once a client has been disconnected, we should also give them a temporary ban from subscribing. Clients on this list would be rejected from subscriptions only. The error message should also indicate the reason, and the timeout left.

There are alternatives here, but I feel like giving the slow client a e.g. 10 minute ban should suffice. Number here is arbitrary and should be larger, but it also depends on how quickly #2196 disconnects them.

My suggested approach would be to keep a basic ban: VecDequeue<(ClientIp, Instant)>. The capacity must be limited to prevent overflow. Under normal circumstances this doesn't matter, but just to be safe. We also don't need to prune the list until it reaches capacity - we just need to check the first matching Instant to see if its expired or not. This limits the complexity imo. You'll be tempted to use some sort of map instead but I don't think its worth it. ymmv, just a suggestion.

Metadata

Metadata

Assignees

Labels

block-producerRelated to the block producer componentnodeRelated to the node component
No fields configured for Feature.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions