New Update for Bitcoin Lightning Development Kit Addresses Critical Node Crash Issue
The Lightning Development Kit has rolled out a fix for a critical bug affecting Bitcoin Lightning routing nodes, preventing potential fund losses.

Introduction
On November 23, the Lightning Development Kit, a software library designed for facilitating Bitcoin transactions over the Lightning Network, implemented a significant fix aimed at addressing a critical flaw. This issue could potentially lead to routing nodes inadvertently making payouts without having the necessary funds secured.
Details of the Flaw
The problem specifically impacts routing nodes that manage channel recovery data in an asynchronous manner, which is intended to enhance performance by allowing nodes to continue functioning while saving data.
According to a bulletin released by Bitcoin Optech on November 27, there was a specific scenario where an incoming channel was force-closed. If the routing node encountered a crash before it saved its recovery data, it might return online lacking the essential information required to claim the incoming funds.
This situation posed a risk of loss, particularly if the node had executed a payment to the outgoing side and, due to a confirmation failure on the Bitcoin blockchain, the claim could not be processed prior to its expiration.
Fix Implementation
Asynchronous data storage enables the lightning node to keep operating while its channel information is being written to storage. However, under the previous system, the Lightning Development Kit could erroneously record a recovery update as completed while it was still in the process of being saved. The newly implemented fix rectifies this issue by keeping updates in a pending state until the writing is fully completed.
This recovery update is subsequently filed in a channel monitor, which holds vital data that the node can utilize to retrieve funds when a channel is closed.
Additional Recovery Tools
Separately, a recovery tool within the Core Lightning framework aims to handle scenarios where pending payments are affected after the original channel data is lost altogether. The latest code update, identified as pull request #5663, has successfully merged into LDK's primary development branch.
However, as of November 29, it was noted that the repository's release tags and the Rust package history did not contain any confirmed tagged versions that included this critical fix. The latest documentation reflects the existence of version 0.2.8 and package 0.1.14 along with the 0.3.0-rc4 candidate, all of which predate the merge on November 11.
Compatibility and Recommendations
For operators using LDK Node version 0.7.1, compatibility is maintained with certain 0.2-series versions of the lightning library, which ultimately depends on the build being utilized. Developers compiling their own software can review the lockfile associated with their build to ensure that the version or Git revision used includes the crucial fix from pull request #5663.
Those using packaged applications should consult the release notes or build documentation made available by the distributor. If confusion remains, it is advisable to reach out to the software maintainer to confirm whether their specific build incorporates the fix or its backport, as well as whether it properly handles asynchronous channel recovery data.
Custom Storage Solutions
Developers creating custom storage solutions will also need to adjust to the revised LDK contract, which stipulates changes on how and when they should declare that their data has been saved. Under the new guidelines, any custom integrations that mark writes as pending must now indicate when the complete writing to the channel monitor has finished.
Also in other languages: РусскийDeutschFrançaisItalianoEspañol