Skip to content

fuzz: add chanmon stuck HTLC invariant#4601

Open
joostjager wants to merge 1 commit intolightningdevkit:mainfrom
joostjager:fuzz-htlc-invariant
Open

fuzz: add chanmon stuck HTLC invariant#4601
joostjager wants to merge 1 commit intolightningdevkit:mainfrom
joostjager:fuzz-htlc-invariant

Conversation

@joostjager
Copy link
Copy Markdown
Contributor

This adds a chanmon consistency fuzz invariant that checks for stuck channel HTLCs after the harness has settled all state. The previous corpus signal was indirect, usually showing up as a later capacity assertion failure, so the new invariant makes the oracle point at the actual leftover HTLC state.

The invariant reproduced the stuck-HTLC issue on upstream/main with this corpus entry:

  • 0270801109191109191f1f10b6ff

Verified that #4520 fixes the issue.

Assert that channel HTLC sets are empty after harness quiescence.
@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented May 7, 2026

👋 Thanks for assigning @TheBlueMatt as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@ldk-claude-review-bot
Copy link
Copy Markdown
Collaborator

The diff is small and focused. I've reviewed the full surrounding context — the 0xff settlement branch reconnects all peers, enables all signer ops, runs process_all_events!() (which loops until quiescent), does timer ticks for MPP failure, runs settlement again, then checks for stuck payments and claimed-vs-sent consistency before reaching the new HTLC check.

The new invariant is well-placed and logically correct. The format string arguments match (6 placeholders, 6 args), and the assertion condition properly checks both inbound and outbound HTLCs are empty.

No issues found.

@joostjager
Copy link
Copy Markdown
Contributor Author

Merge order: #4571 first if no new changes needed there.

@joostjager joostjager self-assigned this May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants