Skip to content

Commit 5928407

Browse files
authored
fix(rate_limiter): add missing prune calls for light client protocols (#8058)
Co-Authored-By: Jimmy Chen <[email protected]> Co-Authored-By: gitToki <[email protected]>
1 parent b7d78a9 commit 5928407

File tree

2 files changed

+39
-10
lines changed

2 files changed

+39
-10
lines changed

.github/mergify.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ queue_rules:
105105
106106
107107
{{ body | get_section("## Proposed Changes", "") }}
108+
109+
{% for commit in commits | unique(attribute='email_author') %}
110+
Co-Authored-By: {{ commit.author }} <{{ commit.email_author }}>
111+
{% endfor %}
108112
queue_conditions:
109113
- "#approved-reviews-by >= 1"
110114
- "check-success=license/cla"

beacon_node/lighthouse_network/src/rpc/rate_limiter.rs

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -382,16 +382,41 @@ impl RPCRateLimiter {
382382

383383
pub fn prune(&mut self) {
384384
let time_since_start = self.init_time.elapsed();
385-
self.ping_rl.prune(time_since_start);
386-
self.status_rl.prune(time_since_start);
387-
self.metadata_rl.prune(time_since_start);
388-
self.goodbye_rl.prune(time_since_start);
389-
self.bbrange_rl.prune(time_since_start);
390-
self.bbroots_rl.prune(time_since_start);
391-
self.blbrange_rl.prune(time_since_start);
392-
self.blbroot_rl.prune(time_since_start);
393-
self.dcbrange_rl.prune(time_since_start);
394-
self.dcbroot_rl.prune(time_since_start);
385+
386+
let Self {
387+
prune_interval: _,
388+
init_time: _,
389+
goodbye_rl,
390+
ping_rl,
391+
metadata_rl,
392+
status_rl,
393+
bbrange_rl,
394+
bbroots_rl,
395+
blbrange_rl,
396+
blbroot_rl,
397+
dcbroot_rl,
398+
dcbrange_rl,
399+
lc_bootstrap_rl,
400+
lc_optimistic_update_rl,
401+
lc_finality_update_rl,
402+
lc_updates_by_range_rl,
403+
fork_context: _,
404+
} = self;
405+
406+
goodbye_rl.prune(time_since_start);
407+
ping_rl.prune(time_since_start);
408+
metadata_rl.prune(time_since_start);
409+
status_rl.prune(time_since_start);
410+
bbrange_rl.prune(time_since_start);
411+
bbroots_rl.prune(time_since_start);
412+
blbrange_rl.prune(time_since_start);
413+
blbroot_rl.prune(time_since_start);
414+
dcbrange_rl.prune(time_since_start);
415+
dcbroot_rl.prune(time_since_start);
416+
lc_bootstrap_rl.prune(time_since_start);
417+
lc_optimistic_update_rl.prune(time_since_start);
418+
lc_finality_update_rl.prune(time_since_start);
419+
lc_updates_by_range_rl.prune(time_since_start);
395420
}
396421
}
397422

0 commit comments

Comments
 (0)