-
Notifications
You must be signed in to change notification settings - Fork 414
channelmonitor: Persist force-close broadcast preference #3893
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
base: main
Are you sure you want to change the base?
Conversation
I've assigned @joostjager as a reviewer! |
2931b05
to
24c38f5
Compare
Add allow_automated_broadcast flag to ChannelMonitor to prevent automatic commitment transaction broadcasting when channel was previously force-closed with should_broadcast=false. Fixes unsafe broadcast on startup when ChannelManager finds orphaned monitors that were intentionally closed without broadcasting.
24c38f5
to
1eefa37
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3893 +/- ##
==========================================
- Coverage 89.65% 88.77% -0.89%
==========================================
Files 164 164
Lines 134659 117502 -17157
Branches 134659 117502 -17157
==========================================
- Hits 120731 104313 -16418
+ Misses 11248 10846 -402
+ Partials 2680 2343 -337 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
This seems to conflict with the changes in #3881 which entirely removes the 'force close without broadcasting' case.
@TheBlueMatt @martinsaposnic Any thoughts how to resolve this?
It seems Unless there’s a follow up plan to refactor that path as well, the bug addressed in this PR could still occur even after #3881 is merged. I’m still getting familiar with this part of the codebase, so let me know if I’ve misunderstood anything @tnull cc @TheBlueMatt |
#3881 doesn't attempt to "fix" the issue, but rather remove the issue by just calling the API itself a bug and deciding that we don't want have the ability to force-close a channel without broadcasting at all (only setting the skip-broadcasting flag in cases where the channel was never opened, and, indeed, not being perfect about it but its not a major issue at that point, vs today where a user took an action implying they are running with stale state and we broadcasted their state anyway!). Instead, I was hoping that we could transition the "I have stale state and want to reclaim my funds without broadcasting that state" logic to a new flow entirely (what was started in #2943) which is basically just "here's a pile of I was suggesting we go ahead and remove the existing flow because I don't actually think anyone has ever implemented it, though I admit getting a new flow in place might take some time (@adi2011 seems to have slowed down his contribution sadly). I certainly don't have a super strong opinion, though its also probably the case that doing a non-peer-storage-utilizing MVP of the new flow may be quite simple (just a |
🔔 1st Reminder Hey @joostjager! This PR has been waiting for your review. |
fixes #1563
Add allow_automated_broadcast flag to ChannelMonitor to prevent automatic commitment transaction broadcasting when channel was previously force-closed with should_broadcast=false.
Fixes unsafe broadcast on startup when ChannelManager finds orphaned monitors that were intentionally closed without broadcasting.