Skip to content

Preflight CCH Fiber payments before creating LND invoices#1555

Open
jjyr wants to merge 2 commits into
nervosnetwork:developfrom
jjyr:codex/sec-0309-cch-sendability
Open

Preflight CCH Fiber payments before creating LND invoices#1555
jjyr wants to merge 2 commits into
nervosnetwork:developfrom
jjyr:codex/sec-0309-cch-sendability

Conversation

@jjyr

@jjyr jjyr commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • run a side-effect-free Fiber payment preflight before creating an LND hold invoice in the CCH receive-BTC flow
  • apply the same fee and TLC expiry limits to the preflight and the eventual outgoing payment
  • support preflight requests through both in-process and RPC-backed Fiber agents
  • add regression coverage for rejecting unroutable Fiber invoices before contacting LND

Motivation

CCH previously created an externally payable LND hold invoice before checking whether the outgoing Fiber invoice was currently routable. When route construction failed, the BTC-side payment could already be accepted even though the order could not complete. The new dry-run check rejects these requests before creating payable LND state and does not create a Fiber payment session or send a TLC.

Validation

  • cargo fmt --all -- --check
  • cargo nextest run -p fnn --features sqlite test_receive_btc_preflights_fiber_sendability_before_lnd
  • cargo clippy --all-targets --features sqlite -p fnn -- -D warnings

@jjyr
jjyr marked this pull request as ready for review July 15, 2026 03:42
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.

1 participant