contractcourt: recover settled AMP HTLCs on-chain #11492
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 192 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
Diff Size
diff_size
0.315
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #11492"
general
weight: 0.35
Roasbeef
Change Description
This change makes settled AMP child preimages available to the on-chain resolution path through a side-effect-free invoice-registry lookup.
The lookup is scoped by AMP set ID and child hash and returns a preimage only for a settled invoice HTLC. The channel arbitrator and incoming contest resolver use it when processing final-hop AMP HTLCs. Recorded spontaneous AMP and keysend replays are also routed through persisted invoice state before preprocessing intended for new HTLCs.
To keep the normal block-processing path lightweight, invoice lookups are deferred until an incoming HTLC is within its broadcast window. Lookup failures do not block unrelated HTLC actions and are retried on the next block.
Steps to Test
Both focused suites pass locally, including the PostgreSQL-backed invoice tests.
Pull Request Checklist
Testing
Code Style and Documentation
lnclicommands are introduced.# Bug Fixes.