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

`notify` `ChainMonitor`'s `EventNotifier` on async write completion

Public commit record

What the developer wrote

Authored by Matt Corallo

85/100 · Strong
`notify` `ChainMonitor`'s `EventNotifier` on async write completion

In c08476753f296319cd74c8394ff8cb6bb5a0e7b5 we a
`ChainMonitor::new_async_beta` and a corresponding
`MonitorUpdatingPersisterAsync` struct. To avoid circular
references, the `ChainMonitor` owns the
`MonitorUpdatingPersisterAsync` which uses a `FutureSpawner` to let
async writes happen in the background after it returns control flow
ownership to the `ChainMonitor`. This is great, except that because
`MonitorUpdatingPersisterAsync` thus doesn't have a reference to
the `ChainMonitor`, we have to poll for completion of the futures.

We do so in the new `Persist::get_and_clear_completed_updates` that
was added in the above-referenced commit. But on async monitor
write completion we're supposed to call `ChainMonitor`'s
`event_notifier.notify()` (ultimately waking up the background
processor which `await`s the corresponding update future). This
didn't happen in the new async flow.

Here we move `ChainMonitor`'s `event_notifier` into an `Arc` and
pass a reference to it through to the
`MonitorUpdatingPersisterAsync` which can then directly `notify()`
it and wake the background processor.
✓ Specific, 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 fixes a bug in rust-lightning's new async channel-monitor persistence code. When a background write finished, the program failed to ring a bell (notify a 'Notifier') that wakes up the background processor. That could leave the node temporarily unaware that a critical disk write completed, potentially delaying channel-state processing or, in edge cases, affecting safety guarantees. The fix moves the Notifier into a shared Arc so the async persister can ring it directly when writes finish.

Recommended action

Treat as a functional/availability bug with possible safety implications. Users running the new async monitor-persistence beta should upgrade. Review whether the missing notification could delay monitor-update completion handling in any deployment. No immediate remote exploit path is evident from the diff alone.

Security signals we found

01

Missing event notification on async I/O completion

02

Background processor may not be woken after monitor persistence completes

03

Async path omitted a notification that the synchronous path presumably performs

04

Fix uses shared ownership (Arc) to avoid circular references while enabling notification

Risk score

Why this scored 57/100

Our methodology →
Potential impact 18/30
Exploitability 8/25
Stealth signal 10/15
Affected reach 10/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.