-
Notifications
You must be signed in to change notification settings - Fork 16
refactor(cch): refactor lnd trackers #948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
refactor(cch): refactor lnd trackers #948
Conversation
|
This PR can simplify the task in #944 that uses store change event to monitor invoices and payments changes. |
2fb5370 to
b551c25
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors LND payment and invoice tracking by extracting the functionality into a dedicated actor module and introducing a unified event-based architecture for handling payment status changes.
Key Changes:
- Introduced
CchIncomingEventenum to represent payment and invoice status changes for both Fiber and LND - Extracted LND tracking logic from
CchActorinto a dedicatedLndTrackerActorwith concurrency control (max 5 concurrent invoice trackers) - Implemented timeout-based re-queuing for invoice trackers (5-minute timeout)
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
crates/fiber-lib/src/cch/trackers/mod.rs |
New module definition for LND trackers |
crates/fiber-lib/src/cch/trackers/lnd_trackers.rs |
Core implementation of LndTrackerActor with queue management and timeout logic |
crates/fiber-lib/src/cch/tests/lnd_trackers_tests.rs |
Unit tests for tracker queue and timeout behavior |
crates/fiber-lib/src/cch/events.rs |
Defines event types and status enums for payment/invoice tracking |
crates/fiber-lib/src/cch/actor.rs |
Refactored to use LndTrackerActor and event-based handling |
crates/fiber-lib/src/cch/order.rs |
Removed direct LND status conversions (moved to events module) |
crates/fiber-lib/src/cch/error.rs |
Updated error message for clarity |
crates/fiber-lib/src/cch/mod.rs |
Updated exports for new modules |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2fc0bb1 to
60fcff8
Compare
60fcff8 to
2b4f39e
Compare
79f39b4 to
7ae0df4
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #948 +/- ##
========================================
Coverage 0.00% 0.00%
========================================
Files 61 63 +2
Lines 38210 38314 +104
========================================
- Misses 38210 38314 +104
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:
|
8e078d0 to
e2b7c82
Compare
34e526d to
07ebe6a
Compare
edbd824 to
60d02aa
Compare
60d02aa to
0a03d7f
Compare
- Define payment and invoice events to be sent to CCH for both fiber and lnd. - These events can be emitted from fiber store changes in a later PR. - Extract lnd trackers into its own module. - Limit concurrent lnd invoice trackers to 5, scheduling them at 5-minute intervals using a round-robin strategy.
Add gauges to monitor the LND tracker's internal state for better observability. - Track invoice queue length to monitor backlog size - Monitor count of active invoice trackers for capacity awareness - Conditionally compile metrics behind "metrics" feature flag
0a03d7f to
11de423
Compare
Important
This is a stacked PR:
lnd.
5-minute intervals using a round-robin strategy.
Actions:
Failed to spawn test actor: ActorAlreadyRegistered("test_lnd_tracker")