Skip to content

multi: migrate to btcd v2 modules - #1199

Draft
starius wants to merge 5 commits into
lightninglabs:masterfrom
starius:btcd-v2
Draft

starius wants to merge 5 commits into
lightninglabs:masterfrom
starius:btcd-v2

Conversation

@starius

@starius starius commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator

Migrate Loop to the btcd v2 modules and Go 1.26.8, rebased onto the current master. Exported Bitcoin address, transaction, hash, script, and chain types now use the corresponding v2 packages. Preserve the current swap-fee, withdrawal, and minimum-runtime-lnd behavior while updating the dependency graph.

Use released lndclient v0.21.0-3, the v2-compatible lnd and Aperture revisions, and the matching wallet and chain modules. Keep Taproot Assets on the fixed v0.8.6 code with a v2 compatibility migration rather than switching to main's different API and incomplete v0.8.6 fix set.

Use lnd revision f2963ce1fd19, which contains the released v0.21.4 forwarding-response recovery and replay fixes, rather than the older v2 snapshot. Align the SQL, queue, and result-helper modules with that revision and build with Go 1.26.8.

Module checks honor the configured Go proxy to avoid Git cache fetch races, while retaining all four tidy checks and the failure on a modified working tree.

Companion migrations

  • Taproot Assets #2366, targeting v0.8: preserves the release fixes, migrates the patched TLV module, and recognizes pgx v5 serialization conflicts so PostgreSQL transactions retry correctly. Loop depends on this migration.
  • Pool #524: v2 types, regenerated mocks, Go 1.26.8 build tooling, and the lnd runtime floor required by L402 payments.
  • Faraday #255: v2 types and matching build dependencies.
  • Lightning Terminal #1438: integrates all four upgraded subservers. Loop's compatibility jobs select an immutable revision of this branch and replace Loop plus both RPC modules with the current checkout.

Temporary fork replacements pin immutable source revisions. Before release, replace these with accepted upstream revisions or tags. Review and land Taproot Assets, Pool, and Faraday first; then Loop and its RPC modules; then LiT. Tagged shared dependencies and subservers can be adopted at each stage.

Validation

  • Loop: full SQLite race suite; PostgreSQL race checks for the database, Instant Out, static-address, and sweep-batcher packages; configured lint; all module checks; generated CLI/daemon docs check.
  • LiT: a race-tested database restart regression for pending lnd settle/fail responses and their circuits; full unit race suite with the normal service tags, embedded UI and regtest binary builds, and all eight selected terminal integration cases.
  • Taproot Assets: full unit suite, patched TLV race tests, PostgreSQL conflict regression, and repeated cache-deadline/driver-error checks.
  • Pool and Faraday: unit race suites and their CI checks.

Keep this draft while the coordinated dependency migrations are reviewed and the temporary pins are replaced. The btcd v2 import changes affect Go callers; the runtime lnd minimum remains v0.19.0-beta, based on the actual RPC behavior Loop requires.

Pull Request Checklist

  • Add an entry to docs/release-notes/release-notes-next.md, or apply the no-changelog label.

@levmi levmi assigned levmi and starius and unassigned levmi Aug 13, 2026
@hieblmi
hieblmi self-requested a review August 14, 2026 05:59

@hieblmi hieblmi 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.

Taproot Assets compatibility

Please bump github.com/lightninglabs/taproot-assets to v0.8.1. This PR already handles its updated rfqmath.UnitsToMilliSatoshi signature, and the bump keeps Loop compatible with litd versions using tapd v0.8.1.

Since v0.8.1 still uses the legacy btcd packages, Loop needs the temporary btcd-v2 replacement. Go does not propagate replace directives to downstream modules, so LiT needs the same replacement until a btcd-v2-compatible Taproot Assets release is available. Please re-run the LiT compatibility jobs with that setup.

starius and others added 2 commits October 21, 2026 12:59
Update LND, Aperture, and Taproot Assets to revisions using the
btcd v2 modules, and update lndclient to v0.21.0-3. Migrate Loop
chain, transaction, and address types to their corresponding v2
packages.

The lndclient release includes the migration from:
lightninglabs/lndclient#280

Taproot Assets is temporarily replaced with its btcd v2 revision
because the v0.8 release branch has not adopted the new modules.

This raises the minimum Go version to 1.26 and changes exported
address types.
Use Go's normal module proxy configuration for all four tidy checks.
This avoids concurrent direct VCS fetch failures in CI and removes the
redundant selective prefetch. Keep checksum verification and the final
working-tree consistency check.
@Roasbeef Roasbeef self-assigned this Oct 21, 2026
hieblmi added a commit to hieblmi/loop that referenced this pull request Oct 22, 2026
Port the coordinated source migration from Loop lightninglabs#1199 while keeping
Go 1.27.3 and the existing runtime lnd floor. Pin current lnd master
and matching submodules, tapd v0.8.6's v2 compatibility revision,
and the SDK fixes for proof selection, signing, and activation APIs.

Propagate immutable replacements into LoopRPC and LiT compatibility
builds because dependency replacements are not inherited.

Co-authored-by: Boris Nagaev <bnagaev@gmail.com>
hieblmi added a commit to hieblmi/loop that referenced this pull request Oct 23, 2026
Port the coordinated source migration from Loop lightninglabs#1199 while keeping
Go 1.27.3 and the existing runtime lnd floor. Pin current lnd master
and matching submodules, tapd v0.8.6's v2 compatibility revision,
and the SDK fixes for proof selection, signing, and activation APIs.

Propagate immutable replacements into LoopRPC and LiT compatibility
builds because dependency replacements are not inherited.

Co-authored-by: Boris Nagaev <bnagaev@gmail.com>
hieblmi added a commit to hieblmi/loop that referenced this pull request Oct 23, 2026
Port the coordinated source migration from Loop lightninglabs#1199 while keeping
Go 1.27.3 and the existing runtime lnd floor. Pin current lnd master
and matching submodules, tapd v0.8.6's v2 compatibility revision,
and the SDK fixes for proof selection, signing, and activation APIs.

Propagate immutable replacements into LoopRPC and LiT compatibility
builds because dependency replacements are not inherited.

Co-authored-by: Boris Nagaev <bnagaev@gmail.com>
hieblmi added a commit to hieblmi/loop that referenced this pull request Oct 26, 2026
Port the coordinated source migration from Loop lightninglabs#1199 while keeping
Go 1.27.3 and the existing runtime lnd floor. Pin current lnd master
and matching submodules, tapd v0.8.6's v2 compatibility revision,
and the SDK fixes for proof selection, signing, and activation APIs.

Propagate immutable replacements into LoopRPC and LiT compatibility
builds because dependency replacements are not inherited.

Co-authored-by: Boris Nagaev <bnagaev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants