Skip to content

Conversation

@starius
Copy link
Contributor

@starius starius commented Nov 19, 2025

This PR ports #255 to master


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.
Copy link

@ziggie1984 ziggie1984 left a comment

Choose a reason for hiding this comment

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

I think we should follow a similar strategy than LND, everything goes to master first and is then backported to the necessary release-branches.

@starius starius merged commit a034275 into lightninglabs:master Nov 20, 2025
1 check passed
@starius starius deleted the port-BlockUntilChainNotifier-to-master branch November 20, 2025 14:54
@starius
Copy link
Contributor Author

starius commented Nov 20, 2025

I think we should follow a similar strategy than LND, everything goes to master first and is then backported to the necessary release-branches.

Agree. I merged it originally to lnd-20-0 by mistake.

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