Skip to content

Commit d258efd

Browse files
authored
chore: increase discv5 request_timeout from 1 to 3 seconds (#1027)
1 parent 99686df commit d258efd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

portalnet/src/discovery.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::hash::{Hash, Hasher};
22
use std::net::Ipv4Addr;
33
use std::path::PathBuf;
44
use std::str::FromStr;
5+
use std::time::Duration;
56
use std::{convert::TryFrom, fmt, fs, io, net::SocketAddr, sync::Arc};
67

78
use anyhow::anyhow;
@@ -144,7 +145,9 @@ impl Discovery {
144145
port: portal_config.listen_port,
145146
};
146147

147-
let discv5_config = ConfigBuilder::new(listen_config).build();
148+
let discv5_config = ConfigBuilder::new(listen_config)
149+
.request_timeout(Duration::from_secs(3))
150+
.build();
148151
let discv5 = Discv5::new(enr, enr_key, discv5_config)
149152
.map_err(|e| format!("Failed to create discv5 instance: {e}"))?;
150153

0 commit comments

Comments
 (0)