Correctly track reloaded update_id in chanmon_consistency fuzzer#4145
Merged
TheBlueMatt merged 1 commit intolightningdevkit:mainfrom Oct 7, 2025
Merged
Conversation
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.
|
I've assigned @jkczyz as a reviewer! |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
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:
|
wpaulino
approved these changes
Oct 7, 2025
Collaborator
Author
|
Fuzz-only |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the
chanmon_consistencyfuzzer, when reloading a node, we take a pending monitor update (or the latest persisted one) and put it inpersisted_monitoras it is implicitly the latest persisted monitor on restart. However, we failed to updatepersisted_monitor_id. As a result, we may restart and write the loaded monitor topersisted_monitor(eg at ID 2) but have a laterpersisted_monitor_id(eg ID 3). Then, when we complete the monitor update for thepersisted_monitor_id(here, 3) we will think that its not a new update and neglect to updatepersisted_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_idis always updated in lock-step withpersisted_monitoron reload.