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

Pass a new `Notifier` through to `UtxoFuture`s

Public commit record

What the developer wrote

Authored by Matt Corallo

80/100 · Strong
Pass a new `Notifier` through to `UtxoFuture`s

`P2PGossipSync` is a rather poor design. It currently basically
requires two circular `Arc` references, leaving `NetworkGraph`s to
leak if LDK is un-loaded:
* `P2PGossipSync` owns/holds a reference to the
`GossipVerifier` and `GossipVerifier` holds an `Arc` to the
`P2PGossipSync` and
* `PeerManager` holds a reference to the `P2PGossipSync` (as the
gossip message handler) which owns/holds a reference to the
`GossipVerifier`, which has a `Deref` (likely an `Arc` in
practice) to the `PeerManager`.

Instead, we should move towards the same design we have elsewhere -
hold a `Notifier` and expose waiting on it to the background
processor then poll for completion from there (in this case, as in
others by checking for completion when handling
`get_and_clear_pending_msg_events` calls).

Here we take the first step towards this, adding a shared
`Notifier` to `PendingChecks` and piping it through to
`UtxoFuture`s so that they can be simply resolved and wake the
background processor (once it waits on the new `Notifier`).
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit is a small internal cleanup in the Lightning Dev Kit Rust library. It changes how background tasks are notified when an asynchronous UTXO (unspent transaction output) lookup finishes, so that circular references between gossip-sync objects can eventually be removed. There is no direct security vulnerability being fixed here; it is a design refactor that may help prevent memory leaks in the future.

Recommended action

No immediate security action required. Downstream users implementing `UtxoLookup` will need to update their `get_utxo` signature to accept the new `Arc<Notifier>` parameter and, if returning `UtxoResult::Async`, call `notify` on it when the future resolves. Monitor follow-up commits that actually remove the circular references and wire the background processor to wait on the Notifier.

Security signals we found

01

Memory-leak mitigation: refactor aims to remove circular Arc references between P2PGossipSync, GossipVerifier, and PeerManager.

02

No vulnerability class introduced: no new unsafe code, no cryptographic changes, no network parsing changes.

03

API change to UtxoLookup::get_utxo adds an async_completion_notifier parameter, requiring downstream implementors to update.

Risk score

Why this scored 19/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 2/15
Confidence 9/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.