Skip to content

Commit 0208da8

Browse files
committed
Reduce AwaitReply timeout from 5 minutes to 90 seconds
90s is ~4.5x the expected mainnet block interval (20s average), providing sufficient margin while detecting dead connections faster.
1 parent bfdfb23 commit 0208da8

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

crates/torsten-network/src/pipelined.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,17 +250,18 @@ impl PipelinedPeerClient {
250250
// After AwaitReply, the server enters MustReply state and
251251
// will send RollForward/RollBackward when a block arrives.
252252
// We wait for that response with a timeout — if no block
253-
// arrives within 5 minutes, the connection is likely dead
254-
// (e.g., after machine sleep/hibernate).
255-
const AWAIT_REPLY_TIMEOUT: Duration = Duration::from_secs(300);
253+
// arrives within 90 seconds, the connection is likely dead
254+
// (e.g., after machine sleep/hibernate). 90s is ~4.5x the
255+
// expected mainnet block interval (20s average).
256+
const AWAIT_REPLY_TIMEOUT: Duration = Duration::from_secs(90);
256257
let wait_response: Message<HeaderContent> = tokio::time::timeout(
257258
AWAIT_REPLY_TIMEOUT,
258259
self.cs_buf.recv_full_msg(),
259260
)
260261
.await
261262
.map_err(|_| {
262263
ClientError::ChainSync(
263-
"AwaitReply timeout: no block received in 5 minutes, \
264+
"AwaitReply timeout: no block received in 90 seconds, \
264265
connection may be stale"
265266
.into(),
266267
)

0 commit comments

Comments
 (0)