Skip to content

Conversation

joostjager
Copy link
Contributor

@joostjager joostjager commented Oct 6, 2025

Store the latest persisted monitor in TestChainMonitor so it no longer needs to be passed into reload. This change also makes the test more realistic. If the monitor wasn't actually persisted, it won't reload properly.

This is a preparation for the larger channel manager refactor project.

@ldk-reviews-bot
Copy link

👋 Hi! I see this is a draft PR.
I'll wait to assign reviewers until you mark it as ready for review.
Just convert it out of draft status when you're ready for review!

@joostjager joostjager changed the title Real persist Simplify node reload logic in tests Oct 6, 2025
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.62%. Comparing base (7439528) to head (6688991).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4142      +/-   ##
==========================================
- Coverage   88.63%   88.62%   -0.02%     
==========================================
  Files         180      180              
  Lines      135230   135216      -14     
  Branches   135230   135216      -14     
==========================================
- Hits       119865   119837      -28     
- Misses      12594    12609      +15     
+ Partials     2771     2770       -1     
Flag Coverage Δ
fuzzing 21.76% <0.00%> (-0.01%) ⬇️
tests 88.46% <100.00%> (-0.02%) ⬇️

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.

Store the latest persisted monitor in TestChainMonitor so it no longer
needs to be passed into reload. This change also makes the test more
realistic. If the monitor wasn't actually persisted, it won't reload
properly.
Copy link
Contributor

@valentinewallace valentinewallace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I think we can land with 1 ack


let mut deserialized_fwd_htlcs = nodes[0].node.forward_htlcs.lock().unwrap();
for scid in [scid_1, scid_2].iter() {
let mut deserialized_fwd_htlcs = nodes[0].node.forward_htlcs.lock().unwrap(); for scid in [scid_1, scid_2].iter() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: needs newline

}

#[cfg(test)]
macro_rules! reload_node_and_monitors {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split into two macros? 😛

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