Skip to content

Conversation

@joostjager
Copy link
Contributor

Add a new AChainMonitor trait following the same pattern as AChannelManager. This trait provides associated types for all generic parameters of ChainMonitor and a get_cm() method to access the underlying ChainMonitor.

Update the background processor to use AChainMonitor trait bounds instead of spelling out the full ChainMonitor generic parameters. This simplifies the function signatures by removing 5-6 explicit generic parameters (CF, T, F, P, ES) per function.

This is preparation for adding a flush method to the AChainMonitor trait.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Feb 2, 2026

👋 Thanks for assigning @TheBlueMatt 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.

@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 75.92593% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.01%. Comparing base (35ab03f) to head (4800a47).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
lightning-background-processor/src/lib.rs 74.50% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4371      +/-   ##
==========================================
+ Coverage   85.99%   86.01%   +0.01%     
==========================================
  Files         156      156              
  Lines      102766   102781      +15     
  Branches   102766   102781      +15     
==========================================
+ Hits        88378    88409      +31     
+ Misses      11879    11864      -15     
+ Partials     2509     2508       -1     
Flag Coverage Δ
tests 86.01% <75.92%> (+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.

@joostjager joostjager force-pushed the achainmonitor branch 2 times, most recently from b99f6ee to 0a38e48 Compare February 3, 2026 10:35
Add a new `AChainMonitor` trait following the same pattern as
`AChannelManager`. This trait provides associated types for all
generic parameters of `ChainMonitor` and a `get_cm()` method to
access the underlying `ChainMonitor`.

Update the background processor to use `AChainMonitor` trait bounds
instead of spelling out the full `ChainMonitor` generic parameters.
This simplifies the function signatures by removing 5-6 explicit
generic parameters (CF, T, F, P, ES) per function.

This is preparation for adding a flush method to the AChainMonitor
trait.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@joostjager
Copy link
Contributor Author

Verified that this is indeed going to work with deferred writes (#4317) and ldk-node integration (lightningdevkit/ldk-node#782)

@joostjager joostjager marked this pull request as ready for review February 3, 2026 12:24
Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

Cool thanks!

@ldk-reviews-bot
Copy link

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

@TheBlueMatt
Copy link
Collaborator

Eh, just gonna merge this even though it "broke" semver. but semver is already broken cause BP depends on lightning which are different types...

@TheBlueMatt TheBlueMatt merged commit 57ff0c7 into lightningdevkit:main Feb 3, 2026
20 of 21 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