Repository navigation
multi: bump lnd to v0.21.3-beta - #260
Merged
Merged
Conversation
lnd v0.21.0 added channel DB schema version 35. chantools built against
lnd v0.19.0-beta only knows versions up to 33 and refuses to open a DB
that was last used by lnd v0.21.x in read-write mode ("channel db cannot
revert to prior version").
This bumps lnd to v0.21.3-beta, loop to v0.35.0-beta (for a compatible
lndclient) and pool to v0.7.1-beta. lnd v0.21.3-beta requires Go 1.25.13.
API changes adapted to:
- graphdb: the channel graph is created from a KVStore, StoreOptions
replaces KVStoreOptions and ChannelGraph.Wipe was removed, so
dropchannelgraph now deletes the graph buckets itself.
- graph edges and policies need a gossip version, edges are built with
models.NewV1Channel.
- payments moved to the payments/db package.
- chanbackup, discovery and peer config signature changes.
The address pattern only matched 10 hex digits, which is what Go uses on linux/amd64. On darwin/arm64 heap addresses have 11 digits, so TestCompactDBAndDumpChannels failed there because the dumps differed in pointer values only.
Fixes a modernize lint error that also shows up on master when linting with go tool golangci-lint.
This makes sure topology notifications are processed, which prevents the dropchannelgraph command from hanging indefinitely otherwise.
Add itest coverage for deletepayments, dropchannelgraph, dropgraphzombies and removechannel sub commands.
guggero
approved these changes
Sep 29, 2026
guggero
left a comment
Collaborator
There was a problem hiding this comment.
Thanks a lot for the update!
I've added some integration test coverage that actually found a small bug (see pushed commits). But now everything should be great, so LGTM 🌮
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
chantools v0.14.x is built against lnd v0.19.0-beta, which knows channel DB schema versions up to 33. lnd v0.21.0 added version 35, so every read-write command fails on a DB last used by lnd v0.21.x:
Changes
go.mod: lnd v0.21.3-beta, loop v0.35.0-beta (brings lndclient v0.21.0-2), pool v0.7.1-beta. Go 1.25.13 is now required (CIGO_VERSIONupdated).lnd/channeldb.go: graph DB is built withgraphdb.NewKVStoreandgraphdb.NewChannelGraph(store).lnd/chanbackup.go,lnd/brontide.go: adapted to changedchanbackup,discovery.Configandpeer.ConfigAPIs. The temporary graph DB fortriggerforcecloseis built from agraphdb.NewKVStore.deletepayments: payments moved topayments/db, now usespaymentsdb.NewKVStore(...).DeletePayments.dropchannelgraph: graph calls take a context and gossip version. Edges are built withmodels.NewV1Channel(the store rejects edges withoutGossipVersion1).ChannelGraph.Wipewas removed upstream, so a localwipeGraphdeletesgraph-node,graph-edge,graph-metaandclosed-scidand re-creates them, like the old lnd code did.lndVersionand generated docs say v0.21.3-beta.root_test.goonly matched 10 hex digits, soTestCompactDBAndDumpChannelsfailed on darwin/arm64 (also on master).zombierecovery_makeoffer.go:strings.Cutinstead ofstrings.Split(...)[0]. Thismodernizefinding also failsgo tool golangci-lint runon master.Behavior change
Read-write commands (
migratedb,dropgraphzombies,dropchannelgraph,removechannel,deletepayments) now migrate older DBs to schema 35. After that the DB can't be opened by lnd older than v0.21.Tested
go vet ./...clean, unit tests pass (itest not run).go tool golangci-lint run(v2.6.2) and the v2.6.2 release binary used by CI (built with Go 1.25.3): 0 issues.dropgraphzombiessuccessfully.Tested on a real node DB
dropgraphzombieson a channel.db from lnd v0.21.xdropchannelgraph(full wipe, then lnd resyncs the graph)dropchannelgraph --fix_onlyand--single_channeldeletepaymentswith and without--failedonlychanbackupagainst the same DBtriggerforceclose(uses thelnd/brontide.gopeer setup)Note:
cmd/chantools/testdata/channel.dbreports schema 20 but already contains theset-id-indexbucket that migration 22 creates, so it can't be migrated read-write by either the old or the new binary. Not changed here.Disclosure: built with assistance from Claude Opus 5.5