Skip to content

fix injected consignment crash - #191

Merged
zoedberg merged 4 commits into
masterfrom
fix/junk-consignment-vanilla
Nov 8, 2026
Merged

zoedberg merged 4 commits into
masterfrom
fix/junk-consignment-vanilla

Conversation

@zoedberg

@zoedberg zoedberg commented Nov 8, 2026

Copy link
Copy Markdown
Member

Fixes bug shown in #176

orbitalturtle and others added 4 commits November 6, 2026 13:31
A peer can crash a counterparty, then keep it crashing on every
restart, by opening an ordinary, uncolored channel and separately
sending a garbage consignment tagged with that channel's funding txid.

Co-Authored-By: Claude
…red channel

A peer that also opens a colored channel to the victim and never funds it
can send files for the funding txid of its vanilla channel: files name
their own txid, so only ChannelPending learns which channel they are for.
The acceptor's ChannelPending handler loaded `consignment_{funding_txid}`
whenever the file existed, but only `handle_funding` validates it, and that
runs for colored channels only. A peer could open a vanilla channel, send
junk tagged with its funding txid and make the node panic, again on every
restart. Gate the load on the channel being colored, and discard whatever
was staged for a vanilla one.
Any peer with a channel could send files, so one with only vanilla
channels could still have junk buffered and written to disk. Each chunk
now names the temporary ID of the channel it is for, and is accepted only
for an inbound colored channel the sender is still funding, one funding's
worth per channel. Files staged for a channel that is gone without
funding are freed when it closes, or as soon as the peer starts sending
another funding, since LDK drops a channel whose funding_created it
rejects before ChannelClosed is handled. So a retry after a failed open,
or the peer's other colored channel, doesn't wait for the sweep.

This narrows who can stage files but doesn't replace the ChannelPending
check: files name their own funding txid, so a peer with an unfunded
colored channel can still send them for a vanilla funding.

Also count pending fundings per peer, so peers reusing a funding txid no
longer share a single node-wide slot.

Bumps rust-lightning for `ChannelDetails::is_colored`.
@codecov

codecov Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.75931% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.19%. Comparing base (c13d1dd) to head (8635741).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
src/rgb_file_transfer.rs 98.59% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #191      +/-   ##
==========================================
+ Coverage   87.75%   88.19%   +0.44%     
==========================================
  Files          16       16              
  Lines        8476     8838     +362     
==========================================
+ Hits         7438     7795     +357     
- Misses       1038     1043       +5     
Flag Coverage Δ
rust 88.19% <98.75%> (+0.44%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zoedberg
zoedberg merged commit 8635741 into master Nov 8, 2026
20 checks passed

This branch was previously deployed

1 inactive deployment
github-pages — 8635741e Deployed Nov 8, 2026 by zoedberg via deploy #40
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.

2 participants