AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 32 Bitcoin

Support deleting legacy forward map persistence in 0.5

Public commit record

What the developer wrote

Authored by Valentine Wallace

73/100 · Adequate
Support deleting legacy forward map persistence in 0.5

In 0.3+, we are taking steps to remove the requirement of regularly persisting
the ChannelManager and instead rebuild the set of HTLC forwards (and the
manager generally) from Channel{Monitor} data.

We previously merged support for reconstructing the
ChannelManager::decode_update_add_htlcs map from channel data, using a new
HTLC onion field that will be present for inbound HTLCs received on 0.3+ only.
The plan is that in upcoming LDK versions, the manager will reconstruct this
map and the other forward/claimable/pending HTLC maps will automatically
repopulate themselves on the next call to process_pending_htlc_forwards.

As such, once we're in a future version that reconstructs the pending HTLC set,
we can stop persisting the legacy ChannelManager maps such as forward_htlcs,
pending_intercepted_htlcs since they will never be used.

For 0.3 to be compatible with this future version, in this commit we detect
that the manager was last written on a version of LDK that doesn't persist the
legacy maps. In that case, we don't try to read the old forwards map and run
the new reconstruction logic only.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit prepares LDK 0.3/0.4 to read ChannelManager data written by a future LDK 0.5. In 0.5, legacy HTLC forwarding maps will no longer be persisted; instead pending forwards are rebuilt from channel monitor data. The change detects the newer serialization version and skips reading the old maps, while in non-test builds it now enables reconstruction from monitors when the stored version is 0.5+. It is a forward-compatibility and data-format change, not a direct fix for an active exploit.

Recommended action

Treat as a planned architectural/data-format change rather than an urgent vulnerability. Review related 0.5 commits and monitor for any edge cases where skipping legacy map reads could lose pending HTLC state if channel monitor reconstruction fails. Ensure downgrade/upgrade paths are tested.

Security signals we found

01

Serialization-version gate added for legacy HTLC map reads

02

Legacy forward_htlcs_legacy map skipped when version >= 5

03

reconstruct_manager_from_monitors enabled in production builds based on stored version

04

Comment notes 0.5+ will fail to read if pending HTLC set cannot be reconstructed

05

Forward-compatibility change between 0.3/0.4 and future 0.5 serialization format

Risk score

Why this scored 32/100

Our methodology →
Potential impact 8/30
Exploitability 3/25
Stealth signal 4/15
Affected reach 6/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.