-
Notifications
You must be signed in to change notification settings - Fork 378
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
Track message type for messages we are expecting to receive #3573
Track message type for messages we are expecting to receive #3573
Conversation
This was previously not considered because we only ever expected to receive a specific message at a time. This will change with quiescence, as we may be waiting for the counterparty's `stfu` in response to ours, while at the same time waiting for a counterparty's `revoke_and_ack` to irrevocably commit any pending updates. If this were unchanged, we could potentially overwrite our expectation to receive `stfu` with the `revoke_and_ack` and the channel would become stuck (until a disconnect) if the counterparty chooses to never send the `stfu`.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3573 +/- ##
==========================================
- Coverage 88.54% 88.50% -0.04%
==========================================
Files 149 149
Lines 114459 114491 +32
Branches 114459 114491 +32
==========================================
- Hits 101345 101331 -14
- Misses 10618 10651 +33
- Partials 2496 2509 +13 ☔ View full report in Codecov by Sentry. |
Wait, I'm confused, how does the protocol work? So we send a |
This is only a shortcoming because of the current implementation of expecting messages, not because of the protocol. We're only allowed to send stfu once our outgoing updates have been irrevocably committed on both sides. When we send stfu, we want to make sure we receive theirs as well to enter quiescence in a timely manner, otherwise we can't propose any new updates without reestablishing the channel. While we're waiting to receive theirs, we may also be waiting on a revoke_and_ack due to an update they've made, such that they can send stfu eventually. If we're waiting on a stfu, then the revoke_and_ack (which overwrites waiting for the stfu), AND the counterparty chooses to ignore our stfu for whatever reason without sending theirs, LDK wouldn't enforce the disconnect without these changes.
|
I mean this is still introducing a major change to the protocol, no? Up until now there's been no requirement that we track whether we're expecting a message at all, let alone what type. Now the protocol requires that we do so.
So I'm still confused by this - if we send
That just sounds like a bug on the counterparty's end? Can we just time out a |
This was previously not considered because we only ever expected to receive a specific message at a time.
This will change with quiescence, as we may be waiting for the counterparty's
stfu
in response to ours, while at the same time waiting for a counterparty'srevoke_and_ack
to irrevocably commit any pending updates. If this were unchanged, we could potentially overwrite our expectation to receivestfu
with therevoke_and_ack
and the channel would become stuck (until a disconnect) if the counterparty chooses to never send thestfu
.