Skip to content

Follow BOLT1 handling for "no reply" pings: ignore, don't warn.#3278

Merged
t-bast merged 2 commits intoACINQ:masterfrom
rustyrussell:noreply-ping-fix
Apr 2, 2026
Merged

Follow BOLT1 handling for "no reply" pings: ignore, don't warn.#3278
t-bast merged 2 commits intoACINQ:masterfrom
rustyrussell:noreply-ping-fix

Conversation

@rustyrussell
Copy link
Copy Markdown
Contributor

These "oversize ping replies" are how we ask for no replies, such as when we're sending dummy traffic. From the rationale:

This allows a convenient cutoff for `num_pong_bytes` to indicate that no reply should be sent.

These "oversize ping replies" are how we ask for no replies, such as when
we're sending dummy traffic.  From the rationale:

    This allows a convenient cutoff for `num_pong_bytes` to indicate that no reply should be sent.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
t-bast
t-bast previously approved these changes Apr 2, 2026
Copy link
Copy Markdown
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never noticed that the spec had this hook for pongless pings, thanks!

We previously tested that we were sending a `warning` back.
We also add a comment to explain why we ignore those pings.
@t-bast t-bast merged commit 6336d80 into ACINQ:master Apr 2, 2026
1 check passed
t-bast added a commit that referenced this pull request Apr 7, 2026
BOLT1 says:

```
A node receiving a ping message:
- if num_pong_bytes is less than 65532:
  - MUST respond by sending a pong message, with byteslen equal to num_pong_bytes.
- otherwise (num_pong_bytes is not less than 65532):
  - MUST ignore the ping.
```

These reply-less pings are used to insert cover traffic to thwart
network-level traffic analysis. We wanted to allow them in #3278
but we missed this ping flood protection that needed to be updated.
@t-bast t-bast mentioned this pull request Apr 7, 2026
t-bast added a commit that referenced this pull request Apr 7, 2026
BOLT1 says:

```
A node receiving a ping message:
- if num_pong_bytes is less than 65532:
  - MUST respond by sending a pong message, with byteslen equal to num_pong_bytes.
- otherwise (num_pong_bytes is not less than 65532):
  - MUST ignore the ping.
```

These reply-less pings are used to insert cover traffic to thwart
network-level traffic analysis. We wanted to allow them in #3278
but we missed this ping flood protection that needed to be updated.

We also had an off-by-one in the maximum pong length that
is now fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants