-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: rate limit with rln configuration #1262
Conversation
Jenkins BuildsClick to see older builds (4)
|
@kaichaosun i am guessing this is for some sort of testing and analysis because RLN already the logic to accept/reject msgs based on rate limit, if so better not to merge it. Would it be required for both lightclient and relay? Would be helpful if you can give more context as to what this change is meant to be used for. Also iiuc RLN integration is supposed to be done for 1:1 chats first right. if so, wondering if we should introduce this limiter at such lower layer or a higher layer in status-go where we can distinguish 1:1 chats and community chats. |
@chaitanyaprem this PR/branch is used for 1:1 chat with RLN, updated the description to reflect its purpose. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rate limiter logic looks good to me, but i am surprised golang's default rate-limiter doesn't support any other interval other than rate/sec.
Using a config in status-go seems better, and pass the rate limiter as needed. |
Interesting implementation of a rate limiter! |
cc @richard-ramos for another review. |
76309b2
to
1bcb412
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
wondering if default rate-limit is fine for community owner node or will it run into any issues?
The default rate limit is 5 messages per second and burst into 10, which was added previously and already used by status-go. Actually the old default config is 2 messages per second before #1267, and deployed via status-im/status-go#5523. |
Description
Support RLN contract's configuration like: allow 100 messages per 1 minute.
[DO NOT MERGE] Use this PR to test 1:1 with RLNThe default rate limiter is used when not configured, so this PR is safe to be merged.
Changes