-
Notifications
You must be signed in to change notification settings - Fork 16
feat: multi-hop fiber payments for cch #942
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
Conversation
810eb33 to
d616965
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 the cross-chain hub (CCH) implementation to support bidirectional BTC-CKB swaps using a unified order structure. The changes consolidate the separate SendBTC and ReceiveBTC order types into a single CchOrder type, introduce hold invoice support, and improve the payment flow.
Key Changes
- Unified order management: Merged
SendBTCOrderandReceiveBTCOrderinto a singleCchOrderstruct with aCchInvoiceenum to handle both Lightning and Fiber invoices - Added hold invoice support: Introduced
settle_invoiceRPC method and related error handling to manually settle hold invoices - Simplified payment flow: Refactored RPC methods (renamed
get_receive_btc_ordertoget_cch_order) and updated test files to reflect new API
Reviewed Changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
crates/fiber-lib/src/cch/order.rs |
Unified order types into CchOrder and added CchInvoice enum for handling both network types |
crates/fiber-lib/src/cch/actor.rs |
Major refactor of CCH actor implementation with unified order processing and network actor integration |
crates/fiber-lib/src/cch/orders_db.rs |
Simplified database methods to work with unified CchOrder type |
crates/fiber-lib/src/rpc/invoice.rs |
Added settle_invoice RPC method and modified new_invoice to support optional preimage/hash parameters |
crates/fiber-lib/src/rpc/cch.rs |
Updated RPC interfaces to use CchOrderResponse and simplified parameter structures |
crates/fiber-lib/src/fiber/network.rs |
Added AddInvoice and SettleInvoice commands to network actor |
crates/fiber-lib/src/fiber/channel.rs |
Added hold TLC support for invoices without preimages |
tests/bruno/e2e/cross-chain-hub/*.bru |
Updated e2e test suite to reflect new API and workflow |
docs/biscuit-auth.md |
Updated authorization rules for renamed RPC methods |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4a3306d to
35e4a4e
Compare
9fd56b0 to
e5772aa
Compare
CCH is added before multi-hop payments so it manipulates TLC directly for fiber payments. This PR adds multi-hop payments support to CCH.
e5772aa to
800dc26
Compare
Important
Stack PR based on #945
CCH is added before multi-hop payments so it manipulates TLC directly
for fiber payments.
This PR adds multi-hop payments support to CCH.
Differences with #615 :
HoldTlcinstead of a new database typeInvoiceChannelInfoto store incoming payments to hold invoices.SendBTCOrderandReceiveBTCOrderintoCchOrder.