Skip to content

Conversation

@starius
Copy link
Contributor

@starius starius commented Nov 10, 2025

LND commit lightningnetwork/lnd@c6f458e (v0.20.0-rc3) moved ChainNotifier startup later in the lifecycle, so RegisterBlockEpochNtfn callers now see "chain notifier RPC is still in the process of starting" coming from Recv().

The new BlockUntilChainNotifier config option repeatedly calls RegisterBlockEpochNtfn during startup and only proceeds once the stream yields its first block height, retrying solely when we detect the ErrChainNotifierServerNotActive condition introduced by the LND commit above.

The wait is guarded by a "chainrpc" build-tag check, so deployments without the ChainNotifier service fail fast when the option is requested.

Pull Request Checklist

  • PR is opened against correct version branch.
  • Version compatibility matrix in the README and minimal required version
    in lnd_services.go are updated.
  • Update macaroon_recipes.go if your PR adds a new method that is called
    differently than the RPC method it invokes.

LND commit c6f458e478f9 (v0.20.0-rc3) moved ChainNotifier startup later in
the lifecycle, so RegisterBlockEpochNtfn callers now see "chain notifier RPC
is still in the process of starting" coming from Recv().

The new BlockUntilChainNotifier config option repeatedly calls
RegisterBlockEpochNtfn during startup and only proceeds once the stream yields
its first block height, retrying solely when we detect the
ErrChainNotifierServerNotActive condition introduced by the LND commit above.

The wait is guarded by a "chainrpc" build-tag check, so deployments without
the ChainNotifier service fail fast when the option is requested.
@starius starius force-pushed the block-until-chain-notifier-is-ready branch from e581dc3 to be4fd2c Compare November 10, 2025 20:43
starius added a commit to starius/loop that referenced this pull request Nov 10, 2025
starius added a commit to starius/loop that referenced this pull request Nov 10, 2025
starius added a commit to starius/loop that referenced this pull request Nov 10, 2025
starius added a commit to starius/loop that referenced this pull request Nov 10, 2025
Copy link

@mohamedawnallah mohamedawnallah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

LND commit lightningnetwork/lnd@c6f458e (v0.20.0-rc3) moved ChainNotifier startup later in the lifecycle

By the way, this commit (lightningnetwork/lnd@c6f458e) in LND v0.20.0-rc3 moved ChainNotifier startup back to its original location from LND v0.18.5. This location was changed in the first release candidate for LND v0.19.0, and this commit reverts it back to the v0.18.5 proper behavior


// If requested, wait until the chain notifier RPC is ready before we
// return. This ensures sub-servers relying on the notifier don't fail
// during startup.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

starius added a commit to starius/loop that referenced this pull request Nov 10, 2025
starius added a commit to starius/loop that referenced this pull request Nov 10, 2025
starius added a commit to starius/lightning-terminal that referenced this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants