← Back to Pull requests

multi: bump lnd to v0.21.3-beta #260

Closed
unknown closed this pull request without merging on Sep 29, 2026 10:38 UTC
View on GitHub
unknown unknown commented on Sep 28, 2026 03:12 UTC
Author

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:

[ERR] CHDB: Refusing to revert from db_version=35 to lower version=33
Error: error opening rescue DB: channel db cannot revert to prior version

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 (CI GO_VERSION updated).

  • lnd/channeldb.go: graph DB is built with graphdb.NewKVStore and graphdb.NewChannelGraph(store).

  • lnd/chanbackup.go, lnd/brontide.go: adapted to changed chanbackup, discovery.Config and peer.Config APIs. The temporary graph DB for triggerforceclose is built from a graphdb.NewKVStore.

  • deletepayments: payments moved to payments/db, now uses paymentsdb.NewKVStore(...).DeletePayments.

  • dropchannelgraph: graph calls take a context and gossip version. Edges are built with models.NewV1Channel (the store rejects edges without GossipVersion1). ChannelGraph.Wipe was removed upstream, so a local wipeGraph deletes graph-node, graph-edge, graph-meta and closed-scid and re-creates them, like the old lnd code did.

  • lndVersion and generated docs say v0.21.3-beta.

  • Test fix: the pointer address regex in root_test.go only matched 10 hex digits, so TestCompactDBAndDumpChannels failed on darwin/arm64 (also on master).

  • zombierecovery_makeoffer.go: strings.Cut instead of strings.Split(...)[0]. This modernize finding also fails go tool golangci-lint run on 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.

  • DB created at schema 35: old binary fails with the error above, new binary runs dropgraphzombies successfully.
  • Tested on a real node DB

  • dropgraphzombies on a channel.db from lnd v0.21.x

  • dropchannelgraph (full wipe, then lnd resyncs the graph)

  • dropchannelgraph --fix_only and --single_channel

  • deletepayments with and without --failedonly

  • chanbackup against the same DB

  • triggerforceclose (uses the lnd/brontide.go peer setup)

  • itest suite
  • Note: cmd/chantools/testdata/channel.db reports schema 20 but already contains the set-id-index bucket 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

    Diff: 359 lines (+269 / -90) across 4 files Reviewer: guggero Review duration: 1886m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.43) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 359 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.352
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #260"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.6% (MEDIUM) · Higher = larger blast radius
    42.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.4% · Safe to merge
    18.4%