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

@joostjager joostjager commented May 7, 2026

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.

@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

ldk-claude-review-bot commented May 7, 2026

The diff is a single, well-placed assertion block. My prior review covered all the substantive analysis. There are no new issues to flag.

No issues found.

This is a clean, well-placed invariant check in settle_all() that asserts no HTLCs remain pending after the harness has fully settled state. The prior review already confirmed correctness of the Debug formatting, channel iteration scope, placement within the settlement sequence, and diagnostic info in the assertion message. No new issues identified on re-review.

@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
@joostjager joostjager force-pushed the fuzz-htlc-invariant branch 2 times, most recently from b015492 to 0d735df Compare May 8, 2026 08:36
@joostjager
Copy link
Copy Markdown
Contributor Author

Rebased after merge of #4571

Assert that channel HTLC sets are empty after harness quiescence.
@joostjager joostjager force-pushed the fuzz-htlc-invariant branch from 0d735df to f0edabb Compare May 8, 2026 08:40
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