lightningdevkit / rust-lightning

A highly modular Bitcoin Lightning library written in Rust. It's rust-lightning, not Rusty's Lightning!
Other
1.11k stars 342 forks source link

Fuzz reloading with a stale monitor in chanmon_consistency #3113

Closed TheBlueMatt closed 2 weeks ago

TheBlueMatt commented 3 weeks ago

Now that we are gearing up to support fully async monitor storage, we really need to fuzz monitor updates not completing before a reload, which we do here in the chanmon_consistency fuzzer.

While there are more parts to async monitor updating that we need to fuzz, this at least gets us started by having basic async restart cases handled. In the future, we should extend this to make sure some basic properties (eg claim/balance consistency) remain true through chanmon_consistency runs.

codecov-commenter commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 97.50000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 90.65%. Comparing base (1d0c6c6) to head (2a0c900). Report is 15 commits behind head on main.

Files Patch % Lines
lightning/src/ln/chanmon_update_fail_tests.rs 97.46% 2 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3113 +/- ## ========================================== + Coverage 89.84% 90.65% +0.80% ========================================== Files 119 119 Lines 97811 102825 +5014 Branches 97811 102825 +5014 ========================================== + Hits 87883 93217 +5334 + Misses 7364 7108 -256 + Partials 2564 2500 -64 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

TheBlueMatt commented 3 weeks ago

Addressed feedback.

tnull commented 3 weeks ago

Addressed feedback.

Unfortunately the new test now reliably fails:

thread 'ln::chanmon_update_fail_tests::test_sync_async_persist_doesnt_hang' panicked at 'explicit panic', lightning/src/ln/chanmon_update_fail_tests.rs:3410:14
TheBlueMatt commented 3 weeks ago

Ugh, sorry, pushed right before bed last night and didn't test enough :/

valentinewallace commented 2 weeks ago

LGTM, feel free to squash IMO.

TheBlueMatt commented 2 weeks ago

Squashed without further changes.