-
Notifications
You must be signed in to change notification settings - Fork 414
Only mark all mon updates complete if there are no blocked updates #3907
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?
Only mark all mon updates complete if there are no blocked updates #3907
Conversation
I've assigned @wpaulino as a reviewer! |
6bfe0bd
to
49ad15c
Compare
lightning/src/ln/quiescence_tests.rs
Outdated
let (_, latest_update) = | ||
chain_monitor.latest_monitor_update_id.lock().unwrap().get(&chan_id).unwrap().clone(); |
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.
There appears to be a syntax error in this line - the object reference before .chain_monitor
is missing. The correct statement should be:
let (_, latest_update) = nodes[0].chain_monitor.latest_monitor_update_id.lock().unwrap().get(&chan_id).unwrap().clone();
This ensures proper access to the chain monitor from the nodes[0]
object.
let (_, latest_update) = | |
chain_monitor.latest_monitor_update_id.lock().unwrap().get(&chan_id).unwrap().clone(); | |
let (_, latest_update) = | |
nodes[0].chain_monitor.latest_monitor_update_id.lock().unwrap().get(&chan_id).unwrap().clone(); |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
7759b4d
to
95c0696
Compare
In `handle_new_monitor_update!`, we correctly check that the channel doesn't have any blocked monitor updates pending before calling `handle_monitor_update_completion!` (which calls `Channel::monitor_updating_restored`, which in turn assumes that all generated `ChannelMonitorUpdate`s, including blocked ones, have completed). We, however, did not do the same check at several other places where we called `handle_monitor_update_completion!`. Specifically, after a monitor update completes during reload (processed via a `BackgroundEvent` or when monitor update completes async, we didn't check if there were any blocked monitor updates before completing). Here we add the missing check, as well as an assertion in `Channel::monitor_updating_restored`.
let chain_monitor = &nodes[0].chain_monitor; | ||
let (_, new_latest_update) = | ||
chain_monitor.latest_monitor_update_id.lock().unwrap().get(&chan_id).unwrap().clone(); | ||
assert_eq!(new_latest_update, latest_update + 1); |
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.
There appears to be a typo in the variable name: lastest_update
should be latest_update
to match the variable defined earlier in the code.
assert_eq!(new_latest_update, latest_update + 1); | |
assert_eq!(new_latest_update, latest_update + 1); |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
95c0696
to
ab0dda7
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3907 +/- ##
==========================================
- Coverage 88.82% 88.80% -0.02%
==========================================
Files 165 165
Lines 119075 119123 +48
Branches 119075 119123 +48
==========================================
+ Hits 105769 105790 +21
- Misses 10986 11003 +17
- Partials 2320 2330 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
In
handle_new_monitor_update!
, we correctly check that the channel doesn't have any blocked monitor updates pending before callinghandle_monitor_update_completion!
(which callsChannel::monitor_updating_restored
, which in turn assumes that all generatedChannelMonitorUpdate
s, including blocked ones, have completed).We, however, did not do the same check at several other places where we called
handle_monitor_update_completion!
. Specifically, after a monitor update completes during reload (processed via aBackgroundEvent
or when monitor update completes async, we didn't check if there were any blocked monitor updates before completing).Here we add the missing check, as well as an assertion in
Channel::monitor_updating_restored
.