-
Notifications
You must be signed in to change notification settings - Fork 16
feat: monitor fiber store changes for cch #950
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
feat: monitor fiber store changes for cch #950
Conversation
ddc60c0 to
c589196
Compare
c589196 to
abf7623
Compare
1e9163b to
77713af
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #950 +/- ##
========================================
Coverage 0.00% 0.00%
========================================
Files 61 64 +3
Lines 38210 38322 +112
========================================
- Misses 38210 38322 +112
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:
|
| pub fn is_incoming_invoice_fiber(&self) -> bool { | ||
| matches!(self.incoming_invoice, CchInvoice::Fiber(_)) | ||
| } | ||
| pub fn is_incoming_invoice_lnd(&self) -> bool { | ||
| matches!(self.incoming_invoice, CchInvoice::Lightning(_)) | ||
| } | ||
| pub fn is_outgoing_payment_fiber(&self) -> bool { | ||
| self.is_incoming_invoice_lnd() | ||
| } | ||
| pub fn is_outgoing_payment_lnd(&self) -> bool { | ||
| self.is_incoming_invoice_fiber() | ||
| } | ||
|
|
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.
the later 2 functions are just alias of the first 2 functions,
proper function naming to keep only 2 function seems more maintainable.
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.
The extra 2 functions make code easy to reason. In the place I want to ensure the order is sending outgoing payment to fiber, I can use is_outgoing_payment_fiber. It's more straightforward than is_incoming_invoice_lnd since I have to reason that when incoming invoice is from lnd, the outgoing payment is to fiber.
92c0931 to
58f7f76
Compare
|
Convert to Draft. Wait on #934 |
58f7f76 to
e75a7da
Compare
a7b2dad to
327aed0
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
- When an invoice state changes in Fiber (settled, failed, expired), the CCH order tracking system automatically detects and synchronizes the state without manual polling or intervention. - When an outgoing payment state changes in Fiber (succeeded, failed, pending), the CCH order tracking system automatically detects and synchronizes the state without requiring manual status checks. - CCH monitors invoice for the incoming payment. When CCH has received the incoming payment, it will send the outgoing payment to get the preimage. - CCH monitors outgoing payment to get the preimage and use the obtained preimage the settle the incoming payment.
327aed0 to
f196421
Compare
Important
This is a stacked PR:
This PR will deprecate #615, which has been refactored and split into
Actions: