Repository navigation
chainreg: accommodate buried taproot deployment in Bitcoin Core v31 - #10683
Conversation
Summary of ChangesHello, 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
🧠 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 AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
3950c6a to
d7f5220
Compare
erickcestari
left a comment
There was a problem hiding this comment.
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!
d7f5220 to
5e91d4c
Compare
5e91d4c to
3867e46
Compare
|
@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
3867e46 to
ca3ccde
Compare
Done, thanks. |
yyforyongyu
left a comment
There was a problem hiding this comment.
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.
|
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 ? |
ca3ccde to
3963905
Compare
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 I needed this patch for master-to-master branch integration tests between bitcoin core and lnd. |
|
PR Severity: MEDIUM Automated classification | 2 files | 17 lines changed Medium (1 file):
Low (1 file):
Analysis: To override, add a severity-override-{critical,high,medium,low} label. |
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
…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
…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
…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
### 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).
A PR merged since Bitcoin Core release v30 breaks how lnd detects taproot support:
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/