From b151d6ea8d79cf3a0bb511ec00d0d375a7d3882c Mon Sep 17 00:00:00 2001 From: Dan Cline <6798349+Rjected@users.noreply.github.com> Date: Sat, 9 Sep 2023 06:27:22 -0400 Subject: [PATCH] fix: wake future after buffering pong (#4536) --- crates/net/eth-wire/src/p2pstream.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/net/eth-wire/src/p2pstream.rs b/crates/net/eth-wire/src/p2pstream.rs index 025f0b347e..081662db09 100644 --- a/crates/net/eth-wire/src/p2pstream.rs +++ b/crates/net/eth-wire/src/p2pstream.rs @@ -401,6 +401,9 @@ where _ if id == P2PMessageID::Ping as u8 => { tracing::trace!("Received Ping, Sending Pong"); this.send_pong(); + // This is required because the `Sink` may not be polled externally, and if + // that happens, the pong will never be sent. + cx.waker().wake_by_ref(); } _ if id == P2PMessageID::Disconnect as u8 => { let reason = DisconnectReason::decode(&mut &decompress_buf[1..]).map_err(|err| {