-
Notifications
You must be signed in to change notification settings - Fork 266
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
Rework channel reestablish #2036
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In an "outdated commitment" scenario where we are on the up-to-date side, we always react by force-closing the channel immediately, not giving our peer a chance to fix their data and restart. On top of that, we consider this a commitment sync error, instead of clearly logging that our counterparty is using outdated data. Addressing this turned out to be rabbit-holey: our sync code is quite complicated and is a bit redundant because we separate between: - checking whether we are late - deciding what messages we need to retransmit Also, discovered a missing corner case when syncing in SHUTDOWN state.
Codecov Report
@@ Coverage Diff @@
## master #2036 +/- ##
==========================================
- Coverage 87.64% 87.58% -0.07%
==========================================
Files 161 161
Lines 12590 12589 -1
Branches 566 515 -51
==========================================
- Hits 11035 11026 -9
- Misses 1555 1563 +8
|
t-bast
reviewed
Oct 27, 2021
eclair-core/src/main/scala/fr/acinq/eclair/channel/Channel.scala
Outdated
Show resolved
Hide resolved
t-bast
approved these changes
Oct 27, 2021
pm47
added a commit
to ACINQ/lightning-kmp
that referenced
this pull request
Apr 16, 2024
This is inspired from eclair, but changes are kept minimal. We don't support the `RemoteLate` case. Eclair had a full rework in ACINQ/eclair#2036, that separated concerns better and got completely rid of exceptions.
pm47
added a commit
to ACINQ/lightning-kmp
that referenced
this pull request
Apr 16, 2024
This is the equivalent of ACINQ/eclair#2036. Notably we remove the `RevocationSyncError` exception, and in case the peer has an outdated commitment we stay in stand by, waiting for their `error` before force-closing.
pm47
added a commit
to ACINQ/lightning-kmp
that referenced
this pull request
Apr 17, 2024
- properly handle `channel_reestablish` in state `Syncing(Shutdown)` - implement the equivalent of ACINQ/eclair#2036, a major rework/cleanup of the reestablish logic, with separation of concerns, strong typing, etc.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In an "outdated commitment" scenario where we are on the up-to-date side, we always react by force-closing the channel immediately, not giving our peer a chance to fix their data and restart. On top of that, we consider this a commitment sync error, instead of clearly logging that our counterparty is using outdated data.
Addressing this turned out to be rabbit-holey: our sync code is quite complicated and is a bit redundant because we separate between:
Also, discovered a missing corner case when syncing in SHUTDOWN state.
This has been extracted from #1838.