mirror of
https://github.com/0glabs/0g-storage-node.git
synced 2024-11-20 15:05:19 +00:00
Add discv5 config and enlarge the default rate limiter (#86)
This commit is contained in:
parent
dea518a0aa
commit
d8d8c28c64
@ -145,9 +145,9 @@ impl Default for Config {
|
||||
// Discv5 Unsolicited Packet Rate Limiter
|
||||
let filter_rate_limiter = Some(
|
||||
discv5::RateLimiterBuilder::new()
|
||||
.total_n_every(10, Duration::from_secs(1)) // Allow bursts, average 10 per second
|
||||
.ip_n_every(9, Duration::from_secs(1)) // Allow bursts, average 9 per second
|
||||
.node_n_every(8, Duration::from_secs(1)) // Allow bursts, average 8 per second
|
||||
.total_n_every(300, Duration::from_secs(1)) // Allow bursts, average 300 per second
|
||||
.ip_n_every(300, Duration::from_secs(1)) // Allow bursts, average 300 per second
|
||||
.node_n_every(300, Duration::from_secs(1)) // Allow bursts, average 300 per second
|
||||
.build()
|
||||
.expect("The total rate limit has been specified"),
|
||||
);
|
||||
|
@ -53,6 +53,8 @@ impl ZgsConfig {
|
||||
network_config.discv5_config.request_retries = self.discv5_request_retries;
|
||||
network_config.discv5_config.query_parallelism = self.discv5_query_parallelism;
|
||||
network_config.discv5_config.report_discovered_peers = self.discv5_report_discovered_peers;
|
||||
network_config.discv5_config.enable_packet_filter = !self.discv5_disable_packet_filter;
|
||||
network_config.discv5_config.ip_limit = !self.discv5_disable_ip_limit;
|
||||
|
||||
network_config.target_peers = self.network_target_peers;
|
||||
network_config.private = self.network_private;
|
||||
|
@ -26,6 +26,8 @@ build_config! {
|
||||
(discv5_request_retries, (u8), 1)
|
||||
(discv5_query_parallelism, (usize), 5)
|
||||
(discv5_report_discovered_peers, (bool), false)
|
||||
(discv5_disable_packet_filter, (bool), false)
|
||||
(discv5_disable_ip_limit, (bool), false)
|
||||
|
||||
// log sync
|
||||
(blockchain_rpc_endpoint, (String), "http://127.0.0.1:8545".to_string())
|
||||
|
@ -65,6 +65,13 @@ network_boot_nodes = ["/ip4/54.219.26.22/udp/1234/p2p/16Uiu2HAmPxGNWu9eVAQPJww79
|
||||
# Reports all discovered ENR's when traversing the DHT to the event stream.
|
||||
# discv5_report_discovered_peers = false
|
||||
|
||||
# Disables the incoming packet filter.
|
||||
# discv5_disable_packet_filter = false
|
||||
|
||||
# Disable to limit the number of IP addresses from the same
|
||||
# /24 subnet in the kbuckets table. This is to mitigate eclipse attacks.
|
||||
# discv5_disable_ip_limit = false
|
||||
|
||||
#######################################################################
|
||||
### Log Sync Config Options ###
|
||||
#######################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user