-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resume reading after processing unknown messages #2332
Conversation
If the current chunk of data read from the TCP connection only contains unknown messages (in particular, could be only one isolated unknown message on an otherwise idle connection), we never resumed reading on the connection. This means all subsequent messages, including pings/pongs, won't be read, which is why the most visible effect is disconnecting due to no response to ping. Related to ElementsProject/lightning#5347.
Codecov Report
@@ Coverage Diff @@
## master #2332 +/- ##
==========================================
+ Coverage 84.71% 84.75% +0.03%
==========================================
Files 194 194
Lines 14632 14637 +5
Branches 621 612 -9
==========================================
+ Hits 12395 12405 +10
+ Misses 2237 2232 -5
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! What's surprising is that we use a lightningMessageCodecWithFallback
so the codec should always succeed even for messages we don't understand, unless they're not using the lightning message format at all - which should also be a bug on the sender side as well, shouldn't it (but we need to fix the bug on our side of course)?
As detailed in the linked issue, this is because cln sends us PeerSwap
messages, which are currently not spec-compliant...I'm surprised they would send us such messages since we don't have a feature bit activated for it?
eclair-core/src/main/scala/fr/acinq/eclair/crypto/TransportHandler.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/crypto/TransportHandler.scala
Outdated
Show resolved
Hide resolved
Thanks, I get now why the error I got when reproducing locally ( But there is no "standard lightning message format" though, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does make more sense like this, LGTM
If the current chunk of data read from the TCP connection only contains unknown messages (in particular, could be only one isolated unknown message on an otherwise idle connection), we never resumed reading on the connection. This means all subsequent messages, including pings/pongs, won't be read, which is why the most visible effect is disconnecting due to no response to ping. Related to ElementsProject/lightning#5347. Reported by @wtogami.
If the current chunk of data read from the TCP connection only contains unknown messages (in particular, could be only one isolated unknown message on an otherwise idle connection), we never resumed reading on the connection.
This means all subsequent messages, including pings/pongs, won't be read, which is why the most visible effect is disconnecting due to no response to ping.
Related to ElementsProject/lightning#5347.
Reported by @wtogami.