From 9520a390edb8720eeac4b2f95d16ef42a542c918 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Thu, 6 Nov 2025 20:28:22 -0300 Subject: [PATCH 1/2] chainrpc: return Unavailable while notifier starts From v0.20.0-rc3 (commit c6f458e478f9ef2cf1d394972bfbc512862c6707) onward the ChainNotifier sub-server may still be initialising when clients attempt to subscribe, currently resulting in a gRPC Unknown error with a plain-text message. Change the notifier RPC endpoints to return codes.Unavailable instead so clients can reliably interpret the condition as "retry later" and handle the startup lag without unstable string matching. --- lnrpc/chainrpc/chain_server.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lnrpc/chainrpc/chain_server.go b/lnrpc/chainrpc/chain_server.go index da68e034b74..e42a6843c01 100644 --- a/lnrpc/chainrpc/chain_server.go +++ b/lnrpc/chainrpc/chain_server.go @@ -18,6 +18,8 @@ import ( "github.com/lightningnetwork/lnd/lnrpc" "github.com/lightningnetwork/lnd/macaroons" "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "gopkg.in/macaroon-bakery.v2/bakery" ) @@ -84,8 +86,8 @@ var ( // ErrChainNotifierServerNotActive indicates that the chain notifier hasn't // finished the startup process. - ErrChainNotifierServerNotActive = errors.New("chain notifier RPC is " + - "still in the process of starting") + ErrChainNotifierServerNotActive = status.Error(codes.Unavailable, + "chain notifier RPC is still in the process of starting") ) // ServerShell is a shell struct holding a reference to the actual sub-server. From e4313eba85f0c8c9c673631ffb273ddb9c6c7a31 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Thu, 6 Nov 2025 20:35:59 -0300 Subject: [PATCH 2/2] docs: add release notes entry Also fixed a typo in release notes. --- docs/release-notes/release-notes-0.20.0.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/release-notes-0.20.0.md b/docs/release-notes/release-notes-0.20.0.md index e01f6cfb0e9..03b2c2720b2 100644 --- a/docs/release-notes/release-notes-0.20.0.md +++ b/docs/release-notes/release-notes-0.20.0.md @@ -59,6 +59,11 @@ - [Fixed a bug](https://github.com/lightningnetwork/lnd/pull/10330) to ensure that goroutine resources are properly freed in the case of a disconnection or other failure event. +- Chain notifier RPCs now [return the gRPC `Unavailable` + status](https://github.com/lightningnetwork/lnd/pull/10352) while the + sub-server is still starting. This allows clients to reliably detect the + transient condition and retry without brittle string matching. + # New Features * Use persisted [nodeannouncement](https://github.com/lightningnetwork/lnd/pull/8825) @@ -283,7 +288,7 @@ reader of a payment request. * [Require invoices to include a payment address or blinded paths](https://github.com/lightningnetwork/lnd/pull/9752) to comply with updated BOLT 11 specifications before sending payments. -* [LND can now recgonize DNS address type in node +* [LND can now recognize DNS address type in node announcement msg](https://github.com/lightningnetwork/lnd/pull/9455). This allows users to forward node announcement with valid DNS address types. The validity aligns with Bolt 07 DNS constraints.