Update everything to btcd v2 modules#10913
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 updates the Highlights
New Features🧠 You can now enable Memory (public preview) 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 the 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 counterproductive. 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 performs a major dependency upgrade across the codebase, transitioning various github.com/btcsuite/btcd sub-modules (such as btcutil, wire, chaincfg, chainhash, txscript, and psbt) to their v2 versions, and introducing address/v2. The review feedback highlights that the go.mod file currently relies on personal forks in its replace block for several critical dependencies, which must be replaced with official tagged releases before merging to prevent security risks and dependency resolution issues for downstream projects.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| replace ( | ||
| github.com/btcsuite/btcwallet => github.com/guggero/btcwallet v0.13.1-0.20260619113612-9ea600d63685 | ||
| github.com/btcsuite/btcwallet/wallet/txauthor => github.com/guggero/btcwallet/wallet/txauthor v1.1.1-0.20260619113612-9ea600d63685 | ||
| github.com/btcsuite/btcwallet/wallet/txrules => github.com/guggero/btcwallet/wallet/txrules v1.1.1-0.20260619113612-9ea600d63685 | ||
| github.com/btcsuite/btcwallet/wallet/txsizes => github.com/guggero/btcwallet/wallet/txsizes v1.1.1-0.20260619113612-9ea600d63685 | ||
| github.com/btcsuite/btcwallet/walletdb => github.com/guggero/btcwallet/walletdb v1.4.1-0.20260619113612-9ea600d63685 | ||
| github.com/btcsuite/btcwallet/wtxmgr => github.com/guggero/btcwallet/wtxmgr v1.3.1-0.20260619113612-9ea600d63685 | ||
| github.com/lightninglabs/neutrino => github.com/guggero/neutrino v0.11.1-0.20260619073835-e49be6c9c0ef | ||
| github.com/lightningnetwork/lightning-onion => github.com/guggero/lightning-onion v1.0.2-0.20260619140053-067e4a7cd61b | ||
| ) |
There was a problem hiding this comment.
The replace block uses personal forks (github.com/guggero/...) for several critical dependencies. Before this pull request is merged, these temporary replacements must be removed and replaced with official tagged releases of the upstream repositories. Relying on personal forks in a merged release of lnd introduces security risks and breaks dependency resolution for downstream projects (such as Loop, Pool, Faraday, etc.) that consume lnd as a module.
|
PR Severity: CRITICAL. This PR (Update everything to btcd v2 modules) touches channeldb/channel.go, channeldb/codec.go, channeldb/db.go (CRITICAL: channeldb/), and 23 channeldb migration files (always CRITICAL per DB migration rule), plus 19 HIGH chainntnfs/ and chanacceptor/* files. 68 non-test files changed exceeds the 20-file bump threshold; 3509 total lines changed exceeds the 500-line bump threshold. Classification was already CRITICAL. <!-- pr-severity-bot --> |
58cb41c to
26c3ce1
Compare
Migrate all btcd dependencies to the new per-package v2 modules (wire/v2, txscript/v2, chaincfg/v2, chainhash/v2, btcutil/v2, psbt/v2, btcec/v2) introduced by btcd v0.26.0, and pin the tagged ecosystem versions: btcwallet v0.17.0, neutrino v0.18.0 and lightning-onion v1.4.0. The bulk of the import rewrite was produced by the scripted diff from btcsuite/btcd#2547 (followed by 'make rpc'). The address symbols that moved out of btcutil into the new address package are imported as btcaddr where a local "address" variable would otherwise shadow them. The go.mod/go.sum updates and the remaining manual compilation fixes are folded into this single commit so it builds on its own (the migration was previously split into a reproducible scripted-diff plus follow-ups, intended to be squashed on merge).
26c3ce1 to
4443a21
Compare
The btcd v2 module migration re-touched several lines that the line-length linter then flagged, and left one error return unchecked. Wrap the over-length lines in input/test_utils.go and zpay32 (the address-decode helpers and test fixtures whose btcutil->address rename lengthened them), and check the LoadTxFilter error return in routing/chainview/btcd.go.
4443a21 to
3912428
Compare
|
/gateway review |
|
❌ gateway review failed: could not fetch PR context: {"level":"info","script":"fetch-pr-context.sh","event":"fetch","outcome":"attempt","step":"pr","path":"repos/lightningnetwork/lnd/pulls/10913"} {"level":"info","script":"fetch-pr-context.sh","event":"fetch","outcome":"attempt","step":"diff","path":"repos/lightningnetwork/lnd/pulls/10913"} {"level":"error","script":"fetch-pr-context.sh","event":"fetch_diff","outcome":"failure","message":"fetch diff failed: gh: Sorry, the diff exceeded the maximum number of files (300). Consider using 'List pull requests files' API or locally cloning the repository instead. (HTTP 406) "} See workflow logs for details. |
ziggie1984
left a comment
There was a problem hiding this comment.
LGTM
Reminder:
A lot of new replacement directives which we need to eventually tag and cleanup.
Depends on:
Change Description
After merging btcsuite/btcd#1825, we'll need to update all
btcddependencies to the newv2modules.With the PRs linked above, we have everything we need to update
lndto consume the new modules.BUT: This will have quite a big impact on the wider ecosystem, as changing
lndwill require all of the following projects to also update in order to ever be able to buildlitdagain:So keep that in mind when merging.
Though eventually this needs to be done, as the following PRs are now directly blocked on this:
SignMessageWithAddrRPC #10798Steps to Test
No functional changes, a green CI should