-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
discovery: use token bucket based rate limiting to throttle gossip #5006
discovery: use token bucket based rate limiting to throttle gossip #5006
Conversation
The recently added gossip throttling was shown to be too aggressive, especially with our auto channel enable/disable signaling. We switch to a token bucket based system instead as it's based on time, rather than a block height which isn't constantly updated at a given rate.
30ed562
to
83a0d03
Compare
// DefaultMaxChannelUpdateBurst is the default maximum number of updates | ||
// for a specific channel and direction that we'll accept over an | ||
// interval. | ||
DefaultMaxChannelUpdateBurst = 10 | ||
|
||
// DefaultChannelUpdateInterval is the default interval we'll use to | ||
// determine how often we should allow a new update for a specific | ||
// channel and direction. | ||
DefaultChannelUpdateInterval = time.Minute |
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.
These values were somewhat arbitrarily chosen in case reviewers have any thoughts/suggestions.
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 🥃
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 🎉 default parameters seem reasonable, we can tune further if anything pops up during the rc phase.
The recently added gossip throttling was shown to be too aggressive, especially with our auto channel enable/disable signaling. We switch to a token bucket based system instead as it's based on time, rather than a block height which isn't constantly updated at a given rate.
Along the way, we also revert the commits that exposed a config flag that was only necessary for our integration tests with the previous gossip throttling logic.