Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Rate Limit RPC/Events for specified messages from Peers #3664

Closed
mitsuaki-u opened this issue May 17, 2019 · 0 comments
Closed

Rate Limit RPC/Events for specified messages from Peers #3664

mitsuaki-u opened this issue May 17, 2019 · 0 comments
Assignees

Comments

@mitsuaki-u
Copy link
Contributor

Expected behavior

P2P layer should limit the number of incoming calls from peers for specified message types (e.g. getTransactions, getBlocks) within a 10 second window to avoid spamming a node as per LIP 0004 .

Actual behavior

P2P layer should not have knowledge of module specific event types.

However it should be responsible for keep track of the 10-second interval for each peer and count the number of calls in order to limit and apply penalty as necessary.

Proposed options

  1. Set a generalized limit for all incoming messages regardless of message type, with a higher threshold within the P2P layer, and apply a 10 point penalty in case of breach.

  2. For modules which require penalties for specific message types, they can implement their own rate-limiting functionality from outside the P2P layer. For example this can be handled between the chain and network module.

  3. Pass a map of event types and relevant penalty scores to P2P constructor. However this may not work depending on the order in which the modules are loaded.

Which version(s) does this affect? (Environment, OS, etc...)

2.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants