fuzz: cover deferred writing in chanmon_consistency#4465
Conversation
|
👋 I see @wpaulino was un-assigned. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4465 +/- ##
==========================================
- Coverage 86.12% 86.12% -0.01%
==========================================
Files 157 157
Lines 108824 108944 +120
Branches 108824 108944 +120
==========================================
+ Hits 93727 93826 +99
- Misses 12480 12499 +19
- Partials 2617 2619 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
51afc25 to
0aebb10
Compare
|
Rebased |
0aebb10 to
6274ba0
Compare
|
Prerequisites are in, rebased. |
|
This LGTM, why is it draft? |
|
I first wanted to do a serious local run, but then it turned out there are so many pre-existing fuzz failures that it is hard to see what's new. I've bisected the failures to the various PRs that introduced them. |
|
Although for this PR I could just see if anything pops up that doesnt repro on main. Will do that. |
|
Several newly introduced fuzz failures to address: |
|
Zoomed in on one of those sequences, and it seems it is reproducible with another string without deferred mode too. |
c6da16e to
d4bf3e0
Compare
|
Dependency: #4520 |
d4bf3e0 to
a798d74
Compare
|
Interestingly the non-deferred mode reproducer It seems the increased headroom made the bug unobservable to the fuzzer? I ran the fuzzer on this branch overnight, and no failures were found. |
|
I'll try to add a new invariant to the fuzzer so it catches the problem in a more robust way. |
|
Invariant addition: #4601 |
|
Will rebase this after #4571 |
|
I've carefully re-reviewed the entire PR diff, cross-referencing with the All four previously flagged issues remain unaddressed in the current code. No code changes have occurred since the prior review pass. No new issues found beyond the prior review. SummaryPreviously flagged issues (still open):
Cross-cutting observations:
|
a798d74 to
20275f6
Compare
af7e8ee to
53cd7c9
Compare
53cd7c9 to
e72ec58
Compare
Replace the chanmon consistency harness' Watch wrapper with a Persist implementation backed by HarnessPersister. Monitor writes now flow through the real ChainMonitor persistence hooks. Track restart candidates separately from monitor completion callbacks. A monitor can stop being a valid reload candidate once a newer baseline is durable, while its callback may still be needed to unblock the live ChainMonitor. On reload, choose the durable baseline, first pending snapshot, or last pending snapshot. Startup monitor registration completes immediately before the configured persistence style is restored.
e72ec58 to
5eb96ab
Compare
|
I reworked this PR and based it on a preparatory commit that makes the fuzzer's persistence model much more understandable, in my opinion. The prep work was taken from the force-close fuzzing PR #4381 that is still WIP, so it should be useful there as well. |
|
Fuzzed this overnight, no failures other than what is pre-existing in main. |
5eb96ab to
eb061da
Compare
Treat HTLC-forward processing and monitor completion as real progress in the chanmon harness. This keeps the settle loop running after passes that only unblock follow-up work instead of stopping before the next event or message batch.
Build the replacement persister with the configured monitor update status during reload. This keeps non-deferred restart behavior aligned with the active persistence-style matrix.
Track deferred monitor writes in the harness and checkpoint the ChannelManager state before flushing them to the persister. This extends setup, reload, and settle paths to model deferred ChainMonitor persistence ordering.
eb061da to
e0c5818
Compare
Adds fuzz coverage for #4351