Skip to content

Commit

Permalink
chore: increase discv5 request_timeout from 1 to 3 seconds (#1027)
Browse files Browse the repository at this point in the history
  • Loading branch information
KolbyML authored Nov 7, 2023
1 parent 99686df commit d258efd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion portalnet/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::hash::{Hash, Hasher};
use std::net::Ipv4Addr;
use std::path::PathBuf;
use std::str::FromStr;
use std::time::Duration;
use std::{convert::TryFrom, fmt, fs, io, net::SocketAddr, sync::Arc};

use anyhow::anyhow;
Expand Down Expand Up @@ -144,7 +145,9 @@ impl Discovery {
port: portal_config.listen_port,
};

let discv5_config = ConfigBuilder::new(listen_config).build();
let discv5_config = ConfigBuilder::new(listen_config)
.request_timeout(Duration::from_secs(3))
.build();
let discv5 = Discv5::new(enr, enr_key, discv5_config)
.map_err(|e| format!("Failed to create discv5 instance: {e}"))?;

Expand Down

0 comments on commit d258efd

Please sign in to comment.