-
Notifications
You must be signed in to change notification settings - Fork 407
Fix fuzz deadlock #3490
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
Fix fuzz deadlock #3490
Conversation
This marginally expands the test coverage in our persister `do_test_data_migration` test.
bcaba29 introduced a deadlock in the `chanmon_consistency` fuzzer by holding a lock on the route expectations before sending a payment, which ultimately tries to lock the route expectations. Here we fix this deadlock.
bcaba29 started returning pre-built `Route`s from the router in the `chanmon_consistency` fuzzer. In doing so, it didn't properly fill in the `route_parms` field which is expected to match the requested parameters. This causes a debug assertion when sending. Here we fix this by setting the correct `route_params`.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3490 +/- ##
==========================================
- Coverage 88.07% 88.07% -0.01%
==========================================
Files 148 148
Lines 111773 111782 +9
Branches 111773 111782 +9
==========================================
Hits 98447 98447
- Misses 10833 10839 +6
- Partials 2493 2496 +3 ☔ View full report in Codecov by Sentry. |
Prior to bcaba29, the `chanmon_consistency` fuzzer checked that payments sent either succeeded or failed as expected by looking at the `APIError` which we received as a result of calling the send method. bcaba29 removed the legacy send method during fuzzing so attempted to replicate the old logic by checking for events which contained the legacy `APIError` value. While this was plenty thorough, it was somewhat brittle in that it made expectations about the event state of a `ChannelManager` which turned out to not be true. Instead, here, we validate the send correctness by examining the `RecentPaymentDetails` list from a `ChannelManager` immediately after sending.
609428f
to
a91bf02
Compare
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.
Too bad about the bugs in bcaba29, I thought CI ran the fuzzers and would've uncovered the deadlock but I guess not? I was having macOS problems getting the fuzzers working locally so relied on CI too much..
@@ -1226,7 +1226,8 @@ impl OutboundPayments { | |||
|
|||
if route.route_params.as_ref() != Some(route_params) { | |||
debug_assert!(false, | |||
"Routers are expected to return a Route which includes the requested RouteParameters"); | |||
"Routers are expected to return a Route which includes the requested RouteParameters. Got {:?}, expected {:?}", |
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.
Hmm... Should we have made the route params field required in Route
for 0.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.
Maybe? No huge rush, really...
0e6f47e
into
lightningdevkit:main
First commit [54725ce] looks good ! |
and a tiny test improvement from #3481