Skip to content
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

chainreg: shutdown if backend node doesn't support taproot #6798

Merged
merged 1 commit into from Aug 8, 2022

Conversation

Roasbeef
Copy link
Member

@Roasbeef Roasbeef commented Aug 5, 2022

In this commit, we add a check during normal node construction to see if
the backend node supports Taproot. If it doesn't, then we want to
shutdown and force the user to take note.

To check if the node supports Taproot, we'll first try the normal
getblockchaininfo call. If this works, cool, then we can rely on the
value. If it doesn't, then we'll fall back to the getdeploymentinfo call
which was added in a recent version of bitcoind 1. Newer versions of
bitcoind might also have this call, and the getblockchaininfo call, but
not actually populate the softforks field 2. In this case, we'll fall
back, and we also account for the case when the getblockchaininfo RPC is
removed all together.

Fixes #6773

@Roasbeef Roasbeef added safety General label for issues/PRs related to the safety of using the software taproot labels Aug 5, 2022
@Roasbeef Roasbeef added this to the v0.15.1 milestone Aug 5, 2022
Copy link
Collaborator

@bhandras bhandras left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Copy link
Collaborator

@yyforyongyu yyforyongyu left a comment

Choose a reason for hiding this comment

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

hmmm looks like the itest cannot be started.

chainreg/chainregistry.go Show resolved Hide resolved
chainreg/taproot_check.go Outdated Show resolved Hide resolved
chainreg/taproot_check.go Show resolved Hide resolved
In this commit, we add a check during normal node construction to see if
the backend node supports Taproot. If it doesn't, then we want to
shutdown and force the user to take note.

To check if the node supports Taproot, we'll first try the normal
getblockchaininfo call. If this works, cool, then we can rely on the
value. If it doesn't, then we'll fall back to the getdeploymentinfo call
which was added in a recent version of bitcoind [1]. Newer versions of
bitcoind might also have this call, and the getblockchaininfo call, but
not actually populate the softforks field [2]. In this case, we'll fall
back, and we also account for the case when the getblockchaininfo RPC is
removed all together.

[1]: bitcoin/bitcoin#23508
[2]: bitcoin/bitcoin#25114

Fixes lightningnetwork#6773
Copy link
Collaborator

@yyforyongyu yyforyongyu left a comment

Choose a reason for hiding this comment

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

Cool LGTM👍

@Roasbeef Roasbeef merged commit ec7be96 into lightningnetwork:master Aug 8, 2022
bhandras added a commit to bhandras/loop that referenced this pull request Oct 7, 2022
In this commit we bump the minimum LND version required to run loopd to
v0.15.1-beta in order to ensure that the underlying chain backend
supports taproot (lightningnetwork/lnd#6798)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safety General label for issues/PRs related to the safety of using the software taproot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

multi: refuse to dispatch need schnorr/taproot/musig2 features if the target backend isn't upgraded
3 participants