Skip to content

chainreg: accommodate buried taproot deployment in Bitcoin Core v31 - #10683

Merged
Roasbeef merged 2 commits into
lightningnetwork:masterfrom
pinheadmz:bury-taproot-deployment
Apr 8, 2026
Merged

Roasbeef merged 2 commits into
lightningnetwork:masterfrom
pinheadmz:bury-taproot-deployment

Conversation

@pinheadmz

Copy link
Copy Markdown
Contributor

A PR merged since Bitcoin Core release v30 breaks how lnd detects taproot support:

error creating wallet config: unable to create partial chain control: node backend does not support taproot

This PR removes "taproot" from "deployments" in RPC getdeploymentinfo: bitcoin/bitcoin#26201

Fortunately a second PR adds a new "script_flags" field to RPC getdeploymentinfo: bitcoin/bitcoin#32998

This PR adds a (third) taproot-support check compatible with Bitcoin Core current master and eventually v31.

Note that taproot is active for all blocks since segregated witness is enforced. There is only one exception which is hard-coded into the software.

For your next bitcoin trivia night:

https://github.com/bitcoin/bitcoin/blob/4f8bd396f8ab04f7ea8bde0dce3829c345d6c54b/src/kernel/chainparams.cpp#L87-L88

https://b10c.me/blog/007-spending-p2tr-pre-activation/

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a breaking change in how Bitcoin Core reports taproot support via RPC. By introducing a fallback mechanism that checks for the newly added 'script_flags' field, the system ensures continued compatibility with upcoming Bitcoin Core releases where taproot is no longer listed as a standard BIP9 deployment.

Highlights

  • Compatibility Update: Updated the taproot support check to remain compatible with Bitcoin Core v31 and later versions.
  • New Verification Method: Implemented a check for the new 'script_flags' field in the getdeploymentinfo RPC response to detect taproot support.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the backendSupportsTaproot function to maintain compatibility with Bitcoin Core v31 and later by adding a ScriptFlags field to the deployment info structure and checking for the 'TAPROOT' flag. The review feedback points out an improvement opportunity to remove a redundant nil check before ranging over the ScriptFlags slice, which is idiomatic in Go.

Comment thread chainreg/taproot_check.go Resolved
@pinheadmz
pinheadmz force-pushed the bury-taproot-deployment branch from 3950c6a to d7f5220 Compare March 27, 2026 18:43
@Roasbeef
Roasbeef requested a review from erickcestari March 30, 2026 23:42

@erickcestari erickcestari left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! I tested it locally with and without the fix, and it works! This PR indeed fixes the issue.

By the way, it's amusing to read the b10c blog post about spending from P2TR outputs before activation, knowing that we now have one more hardcoded block hash in bitcoin nodes. 🫠

There's only one small nit, and then it should be good to go!

Comment thread chainreg/taproot_check.go Resolved
@pinheadmz
pinheadmz force-pushed the bury-taproot-deployment branch from d7f5220 to 5e91d4c Compare March 31, 2026 19:55

@erickcestari erickcestari left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

Comment thread chainreg/taproot_check.go Resolved
@pinheadmz
pinheadmz force-pushed the bury-taproot-deployment branch from 5e91d4c to 3867e46 Compare March 31, 2026 23:27
@Roasbeef Roasbeef added this to the v0.21.0 milestone Apr 1, 2026
@Roasbeef

Roasbeef commented Apr 1, 2026

Copy link
Copy Markdown
Member

@pinheadmz can you update the release notes here? That this is the first release that has taproot activation detection compatible with bitcoind v30?

Removes "taproot" from deployments:
bitcoin/bitcoin#26201

Adds "script_flags" field to RPC getdeploymentinfo:
bitcoin/bitcoin#32998
@pinheadmz
pinheadmz force-pushed the bury-taproot-deployment branch from 3867e46 to ca3ccde Compare April 6, 2026 14:18
@pinheadmz

Copy link
Copy Markdown
Contributor Author

update the release notes

Done, thanks.

@saubyk saubyk added taproot backend Related to the node backend software/interface (e.g. btcd, bitcoin-core) bitcoind Bitcoin Core backend and removed no-changelog labels Apr 6, 2026
@saubyk saubyk added this to v0.21 Apr 6, 2026
@saubyk saubyk moved this to In review in v0.21 Apr 6, 2026
@saubyk
saubyk requested a review from yyforyongyu April 7, 2026 16:37

@yyforyongyu yyforyongyu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking good. We will also need to update the tests to use the new version, so will keep this PR on hold until #10689 is fixed.

@gijswijs

gijswijs commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

I think this only comes into play with v32, tho, right? bitcoin/bitcoin#26201 has milestone 32.0 attached to it, not 31.0. So this is a little bit less urgent, right @pinheadmz ?

@pinheadmz
pinheadmz force-pushed the bury-taproot-deployment branch from ca3ccde to 3963905 Compare April 8, 2026 14:42
@pinheadmz

Copy link
Copy Markdown
Contributor Author

milestone 32.0

Good catch, I actually wonder if that had shifted since I noticed it, but you're right I confirmed the commit is not in the 31.x branch, and updated this PR release notes to mention v32 not v31.

I needed this patch for master-to-master branch integration tests between bitcoin core and lnd.

@github-actions github-actions Bot added the severity-medium Focused review required label Apr 8, 2026
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

PR Severity: MEDIUM

Automated classification | 2 files | 17 lines changed

Medium (1 file):

  • chainreg/taproot_check.go - Go file in chainreg package; not in any CRITICAL or HIGH package

Low (1 file):

  • docs/release-notes/release-notes-0.21.0.md - Release notes documentation

Analysis:
This PR modifies chainreg/taproot_check.go (11 additions, 1 deletion) and adds a release note. The chainreg package is not listed under CRITICAL or HIGH packages, so severity is MEDIUM. No bump conditions triggered: only 2 files and 17 lines changed.

To override, add a severity-override-{critical,high,medium,low} label.

@Roasbeef Roasbeef left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 🦍

@Roasbeef
Roasbeef enabled auto-merge April 8, 2026 20:22
@Roasbeef
Roasbeef merged commit cb04748 into lightningnetwork:master Apr 8, 2026
37 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in v0.21 Apr 8, 2026
sedited added a commit to bitcoin/bitcoin that referenced this pull request May 11, 2026
f24a7b5 doc: recommend script_flags instead of deployments.taproot (Sjors Provoost)

Pull request description:

  #26201 removed `taproot` from `getdeploymentinfo` (not yet in a release, slated for v32), which it turns out Lnd relies on: lightningnetwork/lnd#10683

  Expand the release doc note to recommend the same solution they used: check for `TAPROOT` in the `script_flags` array. This was added in v31.

ACKs for top commit:
  maflcko:
    Stakeholder-aligned SLA-compliant production-ready enterprise-grade lgtm ACK f24a7b5
  sedited:
    ACK f24a7b5

Tree-SHA512: 5c21300ce3140eb1dd122e007b2f2cfafa3de83db4fb7c699312d6886d4c8fea56d9602390c1931fc640bf9364b2274dde85b38da4957311ddc07721cbc924a7
Kino1994 pushed a commit to Kino1994/bitcoin-full-history that referenced this pull request Jun 28, 2026
…eployments.taproot

51c2aa8 doc: recommend script_flags instead of deployments.taproot (Sjors Provoost)

Pull request description:

  #26201 removed `taproot` from `getdeploymentinfo` (not yet in a release, slated for v32), which it turns out Lnd relies on: lightningnetwork/lnd#10683

  Expand the release doc note to recommend the same solution they used: check for `TAPROOT` in the `script_flags` array. This was added in v31.

ACKs for top commit:
  maflcko:
    Stakeholder-aligned SLA-compliant production-ready enterprise-grade lgtm ACK 51c2aa8
  sedited:
    ACK 51c2aa8

Tree-SHA512: 5c21300ce3140eb1dd122e007b2f2cfafa3de83db4fb7c699312d6886d4c8fea56d9602390c1931fc640bf9364b2274dde85b38da4957311ddc07721cbc924a7
BigcoinBGC pushed a commit to BigcoinBGC/bigcoin that referenced this pull request Jun 30, 2026
…eployments.taproot

9c38524 doc: recommend script_flags instead of deployments.taproot (Sjors Provoost)

Pull request description:

  #26201 removed `taproot` from `getdeploymentinfo` (not yet in a release, slated for v32), which it turns out Lnd relies on: lightningnetwork/lnd#10683

  Expand the release doc note to recommend the same solution they used: check for `TAPROOT` in the `script_flags` array. This was added in v31.

ACKs for top commit:
  maflcko:
    Stakeholder-aligned SLA-compliant production-ready enterprise-grade lgtm ACK 9c38524
  sedited:
    ACK 9c38524

Tree-SHA512: 5c21300ce3140eb1dd122e007b2f2cfafa3de83db4fb7c699312d6886d4c8fea56d9602390c1931fc640bf9364b2274dde85b38da4957311ddc07721cbc924a7
Kino1994 pushed a commit to Kino1994/bitcoin-full-history that referenced this pull request Aug 19, 2026
…eployments.taproot

f24a7b5f759920f62db1a131a9a9d31408edd0b2 doc: recommend script_flags instead of deployments.taproot (Sjors Provoost)

Pull request description:

  #26201 removed `taproot` from `getdeploymentinfo` (not yet in a release, slated for v32), which it turns out Lnd relies on: lightningnetwork/lnd#10683

  Expand the release doc note to recommend the same solution they used: check for `TAPROOT` in the `script_flags` array. This was added in v31.

ACKs for top commit:
  maflcko:
    Stakeholder-aligned SLA-compliant production-ready enterprise-grade lgtm ACK f24a7b5f759920f62db1a131a9a9d31408edd0b2
  sedited:
    ACK f24a7b5f759920f62db1a131a9a9d31408edd0b2

Tree-SHA512: 5c21300ce3140eb1dd122e007b2f2cfafa3de83db4fb7c699312d6886d4c8fea56d9602390c1931fc640bf9364b2274dde85b38da4957311ddc07721cbc924a7
Ayush4958 pushed a commit to Ayush4958/fedimint that referenced this pull request Nov 11, 2026
### Motivation

The optional Flake self-check on fedimint#9488 rejects the 38-day-old root
`nixpkgs` input under the existing 30-day limit. The October 31 and
November 7, 2026 weekly lock-update runs both failed with `node: command
not found` before updating any inputs.

### Change

The `update-flake-lock` composite action invokes `node` from a shell,
but GitHub's embedded JavaScript action runtime does not put it on the
self-hosted runners' shell path. Build `nixpkgs#nodejs_24` from the
repository's locked input and add the job-local output link's `bin`
directory to `GITHUB_PATH`. This avoids installing Node.js into the
runner's profile.

Refresh only the root `nixpkgs` input from October 2 to November 5,
2026. Keep the 30-day freshness policy, intentionally pinned inputs,
permissions, and token handling unchanged.

The refreshed input also advances Bitcoin Core from 31.1 to 32.1. Its
new HTTP server defaults to 16 connected RPC clients, including idle
persistent connections. Devimint's existing RPC worker and queue
settings do not raise this limit. Set its test-only connection capacity
to 64 to accommodate guardians, gateways, indexers, and test clients in
the larger CI federation. Keep production RPC configuration and
authentication unchanged.

Bitcoin Core documents the new limit in its [32.1 release
notes](https://bitcoincore.org/en/releases/32.1/).

Core 32 also omits `bip125-replaceable` from wallet RPC transaction
responses by default. The current `bitcoincore-rpc-json` decoder and
historical gateway 0.11.2 binaries require that field, so their peg-in
monitors cannot decode transactions or credit deposits. Add
`deprecatedrpc=bip125` to devimint's test-only `bitcoin.conf` to restore
the field. Core 32.1 gates only JSON serialization behind this option;
it does not change consensus or RBF policy. Updating the current
dependency alone would leave historical binaries broken. Remove the
option once all supported backcompat binaries tolerate the missing
field.

Esplora can still exceed that capacity on large hosts. Its separate
`daemon_parallelism=4` pool does not bound the lazy RPC iterator
consumed outside that pool, which uses Rayon's CPU-sized global pool. On
a 96-CPU host, Esplora opened 98 persistent RPC connections, exhausting
Core's 64-connection capacity and causing readiness failures. Set
`RAYON_NUM_THREADS=4` only on the Esplora child process to cap all of
that child's Rayon work for the small regtest workload. Keep Core's
connection limit and timeouts unchanged, and leave the global
development-shell environment, other subprocess environments, and
production settings unchanged.

Core 32 also removes the `taproot` entry from `getdeploymentinfo`'s
`deployments` map. The locked LND checks that entry and refuses to
start, although Core still reports `TAPROOT` in `script_flags`. Backport
the capability-detection change from [upstream LND
#10683](lightningnetwork/lnd#10683) to the LND
package in the shared Nix `nativeBuildInputs`. Limit the source patch to
capability detection: accept the explicit flag while preserving legacy
deployment detection and failure behavior. Add JSON-RPC compatibility
tests covering positive, negative, error, and legacy responses to the
package check.

Use a local build-input override for CI, development shells, and
packages that use the shared build tooling. Keep the override out of the
global overlay and leave LND versions, production runtime configuration,
and other input pins unchanged. Remove the backport once the locked
nixpkgs LND includes the upstream fix.

Requested in
fedimint#9488 (comment);
CI follow-up requested in
fedimint#9491 (comment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Related to the node backend software/interface (e.g. btcd, bitcoin-core) bitcoind Bitcoin Core backend severity-medium Focused review required taproot

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants