← Back to Pull requests

loopin: Route invoices over asset channels #1212

Open
unknown opened this pull request with 257 lines diff across 3 files
View on GitHub
unknown unknown commented on Aug 26, 2026 12:54 UTC
Author

Summary

  • Receive Loop In over an asset channel using either an asset ID or a

  • compressed group key, an explicit edge, and a minimum asset-unit output.
  • Return provisional asset rate and expected output from GetLoopInQuote,

  • and display those terms before CLI confirmation. Execution obtains a fresh
    RFQ and rejects output below the user-approved minimum before funding.
  • Use the same RFQ route hint for the swap and canceled probe. Execution

  • requires a quote covering the full 30-day invoice lifetime.
  • Persist execution terms and expose them through SwapInfo, ListSwaps and

  • Monitor, including asset-only filtering and restart recovery.
  • Use a hold invoice to check actual accepted multipart HTLC asset units

  • before releasing the preimage. Cancel payments below the minimum after
    per-HTLC rounding; on-chain funds then follow the normal timeout recovery
    path, which can delay recovery and incur an on-chain fee.
  • Validate CLI selectors, regenerate RPC/CLI documentation, and document

  • the quote and settlement behavior.

    Invoices remain BTC/msat-denominated BOLT 11 invoices. The selected edge's
    RFQ converts the amount into asset units. A quote-only request creates and
    immediately cancels a temporary hold invoice because tapd has no quote-only
    RPC for this BTC-denominated receive flow. The built-in one-hour mock oracle
    is insufficient for execution.

    Testing

  • Full Loop suite: GOWORK=off go test ./...

  • make lint workers=4, make rpc, and generated CLI documentation checks

  • Selector validation, quote output/display, exact and short MPP settlement,

  • persisted asset terms, shared status marshalling and asset-only filtering
  • Focused race checks for asset quoting, invoice setup and status tests

  • Paired server integration coverage in lightninglabs/nautilus#1697:

  • asset-ID/group-key selection, exact-minimum forced MPP, physical channel
    balance deltas, pre-funding quote rejection, and client restart recovery

    Pull Request Checklist

  • Added an entry to docs/release-notes/release-notes-next.md
  • Diff: 257 lines (+192 / -65) across 3 files Reviewer: sputn1ck Review duration: 116150m
    All Vouch review confidence checks passed
    Residual risk 0.26 = Change Risk (0.46) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.46 · 257 lines diff across 3 files
    0.46
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.332
    Real PR Conversation Timeline
    1 comments
    "Review active on #1212"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 46.1% (MEDIUM) · Higher = larger blast radius
    46.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 25.5% · Safe to merge
    25.5%