Skip to content

[v0.20.x-branch] Backport #11200: build: bump Go language to 1.26.8 and toolchain to 1.27.1 - #11209

Merged
ziggie1984 merged 5 commits into
v0.20.x-branchfrom
backport-11200-to-v0.20.x-branch
Sep 21, 2026
Merged

ziggie1984 merged 5 commits into
v0.20.x-branchfrom
backport-11200-to-v0.20.x-branch

Conversation

@ziggie1984

@ziggie1984 ziggie1984 commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Backport of #11200


This updates the Go language/minimum version and build toolchain pins separately:

  • all tracked go.mod files on v0.20 now use Go 1.26.8
  • release/toolchain pins move to Go 1.27.1 across the Makefile, CI,
    Dockerfiles, golangci-lint configuration, protobuf generation, and mobile
    build documentation
  • installation documentation references Go 1.26.8 with the official Linux
    checksums
  • Go 1.27 compatibility changes and branch-native regenerated RPC bindings are
    preserved from the parent PR
  • A standalone compatibility commit adds the master-aligned
    replace github.com/lightningnetwork/lnd/fn/v2 => ./fn directive before the
    parent commits, so per-commit CI validation uses the local module

Backport notes

The v0.20 branch did not contain the earlier golangci-lint v2 configuration
migration that is already present on master. This backport therefore folds the
required v2 schema migration, go tool invocation, and removal of the obsolete
v1 tools/tools.go import into the tooling commit. The existing v0.20 policy of
disabling copyloopvar is retained because its cleanup was not backported.

RPC bindings were regenerated from the v0.20 schemas with the newly pinned Go
1.27.1 generator; no master-only RPC surface was copied into the branch.

Verification

  • git diff --check
  • make check-go-version
  • go test -run '^$' ./...
  • go test ./lnwire
  • go test ./lnrpc/...
  • repeated make rpc with no tracked diff
  • REST annotation validation
  • tools: go mod tidy -diff and go mod verify
  • custom golangci-lint v2.13.2 differential run: 0 issues

@ziggie1984
ziggie1984 force-pushed the backport-11200-to-v0.20.x-branch branch from 1c6a3a0 to b112def Compare September 21, 2026 12:45
@github-actions github-actions Bot added the severity-critical Requires expert review - security/consensus critical label Sep 21, 2026
@github-actions

Copy link
Copy Markdown

🔴 PR Severity: CRITICAL

gh pr view | 65 files | 9646 lines changed (+5073/-4573)

🔴 Critical (3 files)
  • contractcourt/chain_arbitrator.go - contractcourt/* handles on-chain dispute resolution and breach handling
  • sweep/fee_bumper.go - sweep/* handles output sweeping and fee bumping for fund recovery
  • sweep/sweeper.go - sweep/* handles output sweeping and fund recovery
🟠 High (28 files)
  • cert/go.mod - cert/* is auth/security related
  • sqldb/go.mod - sqldb/* is a core storage backend
  • lnrpc/gen_protos_docker.sh - lives under lnrpc/*, the RPC/API surface
  • lnrpc/*.pb.go, lnrpc/*_grpc.pb.go (25 files across autopilotrpc, chainrpc, devrpc, invoicesrpc, routerrpc, signrpc, walletrpc, watchtowerrpc, wtclientrpc, and lnrpc root) - auto-generated RPC/API definitions, regenerated from a protobuf/tooling version bump
🟡 Medium (12 files)
  • .golangci.yml - lint tooling configuration
  • zpay32/decode.go - zpay32/* explicit medium package
  • go.mod (root), clock/go.mod, fn/go.mod, healthcheck/go.mod, kvdb/go.mod, queue/go.mod, ticker/go.mod, tlv/go.mod, tor/go.mod - Go module version bumps (dependency/toolchain updates only)
🟢 Low (22 files)
  • .github/actions/setup-go/action.yml, .github/workflows/main.yml, .github/workflows/release.yaml - CI configuration
  • Dockerfile, dev.Dockerfile, docker/btcd/Dockerfile, lnrpc/Dockerfile, make/builder.Dockerfile, Makefile, make/testing_flags.mk - build tooling
  • docs/INSTALL.md, mobile/README.md - documentation
  • itest/lnd_psbt_test.go, lntest/harness.go, lntest/harness_assertion.go, lntest/node/config.go, lnwire/query_short_chan_ids_test.go - test-only changes
  • tools/.custom-gcl.yml, tools/Dockerfile, tools/go.mod, tools/go.sum, tools/linters/go.mod, tools/tools.go - build tooling under tools/*

Analysis

This is a broad Go toolchain/dependency version-bump PR (updated Go version across all go.mod files, regenerated all lnrpc protobuf/gRPC bindings, refreshed .golangci.yml, and updated build/CI tooling). The individual diffs in contractcourt/chain_arbitrator.go, sweep/fee_bumper.go, and sweep/sweeper.go are tiny (1 line each), but they fall under packages classified CRITICAL (on-chain dispute resolution and fund-sweeping logic), which sets the overall PR severity regardless of the change size. Reviewers should specifically confirm those three one-line edits are purely mechanical (e.g. Go version directives or a shared helper signature) and not a behavioral change, since they sit in security-critical code paths. The bulk of the diff (the regenerated lnrpc/*.pb.go files) is auto-generated and should require no manual review beyond confirming it matches make rpc.


To override, add a severity-override-{critical,high,medium,low} label.

@ziggie1984
ziggie1984 force-pushed the backport-11200-to-v0.20.x-branch branch 3 times, most recently from 5350dce to 55e6ef1 Compare September 21, 2026 15:08
Resolve the fn/v2 dependency to the repository's local ./fn module,
matching master. Without this replacement, the v0.20 and v0.21 branches
download fn/v2@v2.0.9. Its published Go 1.23 module metadata is
incompatible with Go 1.27 when its tests use testing.B.Context.

Keep the replacement local so the existing unit-module job tests the same
source as the root module. This is a backport-specific compatibility change
and does not alter the required fn/v2 version.
Keep lnd compatible with the previous stable Go release by updating the
language version in every tracked go.mod file to Go 1.26.8.

Move build and release tooling to Go 1.27.1, including CI, Docker images,
the Makefile, protobuf generation, the linter configuration, and mobile
build documentation. Update the installation documentation and official
Linux archive checksums for Go 1.26.8 as well.

(cherry picked from commit b1f9ca6)
Upgrade the custom golangci-lint from v2.4.0 to v2.13.2 because the older
version reports false type-checking errors for generic mutex code when it
runs with Go 1.27. Refresh the tools module dependencies, account for the
renamed exhaustruct_v5 linter, and disable the deprecated gomodguard while
leaving gomodguard_v2 active.

Apply Go 1.27's gofmt output to the PSBT test's composite-literal return.

Lower the consecutive-SCID zlib test boundary from 30,794 to 30,792. Go
1.27 changed compress/flate output, making 30,793 SCIDs exceed the
65,535-byte Lightning message limit while 30,792 still fit.

(cherry picked from commit 6b54a38)
The protobuf generator uses Go's formatting packages and is now compiled
inside the Go 1.27.1 Docker image. This changes generated doc-comment
formatting and causes rpc-check to report stale checked-in bindings.

Regenerate the RPC bindings with the newly pinned image. The resulting
changes affect comments only; protobuf schemas and generated API code stay
unchanged.

(cherry picked from commit dd52310)
The linter configuration uses default: all, so upgrading golangci-lint also
enables checks introduced after v2.4. Adopt canonicalheader, clickhouselint,
godoclint, iotamixing, and unqueryvet because they add focused HTTP,
documentation, const-block, and SQL safeguards.

Fix the canonical WebSocket protocol header spelling required by the expanded
canonicalheader implementation. Update twelve existing doc comments to begin
with their declared symbol names as required by godoclint.

Keep modernize disabled for now because its findings require broader code
changes that should be reviewed separately against the Go 1.26 support
baseline.

(cherry picked from commit bada7ea)
@ziggie1984
ziggie1984 force-pushed the backport-11200-to-v0.20.x-branch branch from be25a20 to 305e629 Compare September 21, 2026 20:32
@ziggie1984
ziggie1984 merged commit 3ee4371 into v0.20.x-branch Sep 21, 2026
9 of 34 checks passed

@ziggie1984 ziggie1984 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog severity-critical Requires expert review - security/consensus critical

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant