Correct docs on `ChannelSigner::get_per_commitment_point`
What changed, and why it matters
This commit only updates documentation comments for a Rust function called get_per_commitment_point. It removes an outdated warning that the method was non-asynchronous and that returning an error could cause a crash, and replaces it with guidance that errors can signal a temporarily unavailable signer and how to retry. No actual code logic was changed, so there is no direct security vulnerability introduced or fixed by this patch itself.
No security action required. Treat as normal documentation update. If auditing, verify that the implementation of get_per_commitment_point and ChannelManager::signer_unblocked actually behaves as newly documented.
Security signals we found
Documentation-only change
Removes outdated panic warning
Adds retry/unblock guidance for signer errors
Evidence from the diff
The diff modifies only doc comments in lightning/src/sign/mod.rs for the ChannelSigner::get_per_commitment_point trait method. The old docs stated the method was not asynchronous and that returning Err could lead to immediate panic. The new docs state Err can signal an unavailable signer and that ChannelManager::signer_unblocked must be called once the signer is ready again. No implementation, signature, or behavior changes are present in the diff.
Changed components
lightning/src/sign/mod.rs documentationInspect captured patch +6 / −3
diff --git a/lightning/src/sign/mod.rs b/lightning/src/sign/mod.rs
index 70bd9e6..b81d382 100644
--- a/lightning/src/sign/mod.rs
+++ b/lightning/src/sign/mod.rs
@@ -746,9 +746,12 @@ pub trait ChannelSigner {
///
/// Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
///
- /// This method is *not* asynchronous. This method is expected to always return `Ok`
- /// immediately after we reconnect to peers, and returning an `Err` may lead to an immediate
- /// `panic`. This method will be made asynchronous in a future release.
+ /// An `Err` can be returned to signal that the signer is unavailable/cannot produce a new
+ /// commitment point and should be retried later. Once the signer is ready to provide a new
+ /// commitment point after previously returning an `Err`, [`ChannelManager::signer_unblocked`]
+ /// must be called.
+ ///
+ /// [`ChannelManager::signer_unblocked`]: crate::ln::channelmanager::ChannelManager::signer_unblocked
fn get_per_commitment_point(
&self, idx: u64, secp_ctx: &Secp256k1<secp256k1::All>,
) -> Result<PublicKey, ()>;
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.