Skip to content

Conversation

TheBlueMatt
Copy link
Collaborator

In the chanmon_consistency fuzzer, when reloading a node, we take a pending monitor update (or the latest persisted one) and put it in persisted_monitor as it is implicitly the latest persisted monitor on restart. However, we failed to update
persisted_monitor_id. As a result, we may restart and write the loaded monitor to persisted_monitor (eg at ID 2) but have a later persisted_monitor_id (eg ID 3). Then, when we complete the monitor update for the persisted_monitor_id (here, 3) we will think that its not a new update and neglect to update persisted_monitor/persisted_monitor_id. As a result, later updates (e.g. ID 4) will fail as we're trying to apply them to the original persisted monitor (at ID 2).

The fix is simply to ensure persisted_monitor_id is always updated in lock-step with persisted_monitor on reload.

In the `chanmon_consistency` fuzzer, when reloading a node, we
take a pending monitor update (or the latest persisted one) and put
it in `persisted_monitor` as it is implicitly the latest persisted
monitor on restart. However, we failed to update
`persisted_monitor_id`. As a result, we may restart and write the
loaded monitor to `persisted_monitor` (eg at ID 2) but have a
later `persisted_monitor_id` (eg ID 3). Then, when we complete
the monitor update for the `persisted_monitor_id` (here, 3) we will
think that its not a new update and neglect to update
`persisted_monitor`/`persisted_monitor_id`. As a result, later
updates (e.g. ID 4) will fail as we're trying to apply them to the
original persisted monitor (at ID 2).

The fix is simply to ensure `persisted_monitor_id` is always
updated in lock-step with `persisted_monitor` on reload.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Oct 7, 2025

I've assigned @jkczyz as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@ldk-reviews-bot ldk-reviews-bot requested a review from jkczyz October 7, 2025 16:03
Copy link

codecov bot commented Oct 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.64%. Comparing base (2efb009) to head (f59557f).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4145   +/-   ##
=======================================
  Coverage   88.63%   88.64%           
=======================================
  Files         180      180           
  Lines      135241   135241           
  Branches   135241   135241           
=======================================
+ Hits       119869   119881   +12     
+ Misses      12607    12592   -15     
- Partials     2765     2768    +3     
Flag Coverage Δ
fuzzing 21.76% <ø> (ø)
tests 88.48% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TheBlueMatt
Copy link
Collaborator Author

Fuzz-only

@TheBlueMatt TheBlueMatt merged commit faf7b8a into lightningdevkit:main Oct 7, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants