Stop persisting background shutdown monitor updates#2287
Merged
TheBlueMatt merged 2 commits intolightningdevkit:mainfrom May 10, 2023
Merged
Conversation
In d481008 we added logic to apply `ChannelMonitorUpdate`s which were a part of a channel closure async via a background queue to address some startup issues. When we did that we persisted those updates to ensure we replayed them when starting next time. However, there was no reason to - if we persisted and then restarted even without those monitor updates we'd find a monitor without a channel, which we'd tell to broadcast the latest commitment transaction to force-close. Since adding that logic, we've used the same background queue for several purposes.
This makes much clearer at sites generating such events that they will be lost on restart, to reduce risk of bugs creeping in due to lost monitor updates.
wpaulino
approved these changes
May 9, 2023
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #2287 +/- ##
==========================================
- Coverage 90.94% 90.94% -0.01%
==========================================
Files 104 104
Lines 52760 52750 -10
Branches 52760 52750 -10
==========================================
- Hits 47983 47971 -12
- Misses 4777 4779 +2
☔ View full report in Codecov by Sentry. |
valentinewallace
approved these changes
May 9, 2023
| /// Handle a ChannelMonitorUpdate that closes a channel, broadcasting its current latest holder | ||
| /// commitment transaction. | ||
| ClosingMonitorUpdate((OutPoint, ChannelMonitorUpdate)), | ||
| /// Handle a ChannelMonitorUpdate |
Contributor
There was a problem hiding this comment.
nit:
Suggested change
| /// Handle a ChannelMonitorUpdate | |
| /// Handle a ChannelMonitorUpdate. |
Collaborator
Author
There was a problem hiding this comment.
Twice? I can only fix it once, tho :)
Collaborator
Author
|
Will fix the missing . in #2167. |
This file contains hidden or 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
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 d481008 we added logic to apply
ChannelMonitorUpdates whichwere a part of a channel closure async via a background queue to
address some startup issues. When we did that we persisted those
updates to ensure we replayed them when starting next time.
However, there was no reason to - if we persisted and then
restarted even without those monitor updates we'd find a monitor
without a channel, which we'd tell to broadcast the latest
commitment transaction to force-close.
Since adding that logic, we've used the same background queue for
several purposes.
Pointed out (indirectly) by @wpaulino at #2167 (comment)