chainreg: accommodate buried taproot deployment in Bitcoin Core v31#10683
chainreg: accommodate buried taproot deployment in Bitcoin Core v31#10683pinheadmz wants to merge 1 commit intolightningnetwork:masterfrom
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
Removes "taproot" from deployments: bitcoin/bitcoin#26201 Adds "script_flags" field to RPC getdeploymentinfo: bitcoin/bitcoin#32998
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? |
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/