-
Notifications
You must be signed in to change notification settings - Fork 47
lndclient: block until chain notifier is ready #255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: lnd-20-0
Are you sure you want to change the base?
lndclient: block until chain notifier is ready #255
Conversation
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.
e581dc3 to
be4fd2c
Compare
Include lightninglabs/lndclient#255 TODO: remove replace
Include lightninglabs/lndclient#255 TODO: remove replace
mohamedawnallah
left a comment
There was a problem hiding this 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Include lightninglabs/lndclient#255 TODO: remove replace
Include lightninglabs/lndclient#255 Include lightninglabs/loop#1039 wait for chain notifier
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
in
lnd_services.goare updated.macaroon_recipes.goif your PR adds a new method that is calleddifferently than the RPC method it invokes.