Skip to content

Commit 8ffe1a7

Browse files
committed
add rate limit for new rpcs
1 parent 5e50100 commit 8ffe1a7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

beacon_node/lighthouse_network/src/rpc/self_limiter.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ impl<Id: ReqId, TSpec: EthSpec> SelfRateLimiter<Id, TSpec> {
7373
// inbound and outbound requests, and the LightClientBootstrap is an only inbound
7474
// protocol.
7575
.one_every(Protocol::LightClientBootstrap, Duration::from_secs(10))
76+
.one_every(Protocol::LightClientOptimisticUpdate, Duration::from_secs(10))
77+
.one_every(Protocol::LightClientFinalityUpdate, Duration::from_secs(10))
7678
.build()?;
7779

7880
Ok(SelfRateLimiter {

beacon_node/lighthouse_network/tests/rpc_tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ use std::sync::Arc;
99
use std::time::Duration;
1010
use tokio::runtime::Runtime;
1111
use tokio::time::sleep;
12-
use types::light_client_bootstrap::LightClientBootstrap;
1312
use types::light_client_update::CURRENT_SYNC_COMMITTEE_PROOF_LEN;
1413
use types::{
1514
BeaconBlock, BeaconBlockAltair, BeaconBlockBase, BeaconBlockHeader, BeaconBlockMerge,
1615
EmptyBlock, Epoch, EthSpec, ForkContext, ForkName, Hash256, MinimalEthSpec, Signature,
17-
SignedBeaconBlock, Slot, SyncCommittee, LightClientOptimisticUpdate, SyncAggregate,
16+
SignedBeaconBlock, Slot, SyncCommittee, LightClientOptimisticUpdate, SyncAggregate, LightClientBootstrap,
1817
};
1918

2019
mod common;

0 commit comments

Comments
 (0)