Skip to content

[v0.20.x-branch] Backport #11105: build: bump grpc to v1.83.1 - #11110

Merged
yyforyongyu merged 4 commits into
lightningnetwork:v0.20.x-branchfrom
ziggie1984:backport-11105-to-v0.20.x-branch
Aug 21, 2026
Merged

[v0.20.x-branch] Backport #11105: build: bump grpc to v1.83.1#11110
yyforyongyu merged 4 commits into
lightningnetwork:v0.20.x-branchfrom
ziggie1984:backport-11105-to-v0.20.x-branch

Conversation

@ziggie1984

@ziggie1984 ziggie1984 commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Backport of #11105 to v0.20.x-branch. Companion to #11109 (v0.21.x).

Opened manually rather than via the backport bot, which failed to push both
release branches for #11105 ("Git push to origin failed for v0.20.x-branch with
exitcode 1") — the change touches .github/ files.

How this backport differs from #11105

This is not a verbatim replay. Mapping the source commits onto this branch:

#11105 on master here why
ad7ccc004 build: bump grpc to v1.83.1 029045649 (cherry-pick -x) go.mod/go.sum regenerated, not replayed — see below. CI pin resolved by hand (v1.59.0 → v1.83.1)
81c3fb26b kvdb: bump grpc module floor omitted no-op on this branch — see below
8a23e33c2 brontide: clarify InitializeKey invariant b32c7d18f (cherry-pick -x) applies unchanged; patch is byte-identical to the original
4b2602c73 + 30b08925e added: protobuf prerequisite this branch needs and master did not — see below

1. go.mod/go.sum were regenerated, not replayed

v0.20.x is far enough behind master that the dependency commit conflicts. The
bump was reproduced on the branch with
go get google.golang.org/grpc@v1.83.1 && go mod tidy rather than importing
master's files, which would have pulled in bumps belonging to unrelated master
PRs.

2. The kvdb commit is omitted as a no-op

master carries replace github.com/lightningnetwork/lnd/kvdb => ./kvdb, so the
root bump flows into the local module there. v0.20.x has no local sub-module
replaces and consumes published kvdb, so go mod tidy in kvdb/ produces no
change at all.

This is safe beyond just being a no-op: kvdb exposes no gRPC server. It has no
grpc.NewServer and no service registration — grpc reaches it only as an etcd
client (kvdb/etcdetcd/api/v3/etcdserverpb → grpc), behind the
kvdb_etcd build tag, so it is not exposed to the server-side transport
advisories above. The shipped binary resolves grpc from the root module
regardless, and the dep-pin CI job greps the root go.mod only.

3. Two added commits: the protobuf prerequisite

master did not need this because it was already on protobuf v1.36.11. This
branch sits at v1.33.0, self-consistent across require, the hex-display replace
and the generated stubs.

grpc v1.83.1 requires google.golang.org/protobuf v1.36.11, which is above the
v1.33.0 pin, so MVS raises it. Because lnrpc/gen_protos_docker.sh derives
PROTOBUF_VERSION from the selected protobuf version, that also drags
protoc-gen-go from v1.33.0 to v1.36.11, and make rpc-check fails until the
stubs are regenerated. The version cannot be held down — MVS takes the maximum
of all requirements.

Rather than leave that churn tangled into the grpc commit, it is done up front
as its own prerequisite, in the order master landed it (3f3718caa, #10887).
These two commits are authored fresh rather than cherry-picked: master's
equivalent moved v1.36.10 → v1.36.11, so replaying it here would be wrong.

Commit structure

# Commit Diff Purpose
1 mod: bump protobuf hex display fork 2 files, 3 (+) / 3 (−) repoint the replace at v1.36.11-hex-display
2 lnrpc: bump protobuf to v1.36.11 and regenerate stubs 18 files, 6824 (+) / 16382 (−) raise the required version; regenerate
3 build: bump grpc to v1.83.1 3 files, 76 (+) / 76 (−) the actual security fix
4 brontide: clarify InitializeKey error-discard invariant 1 file, 4 (+) / 1 (−) comment, follows the x/crypto bump

The ordering is deliberate, and reviewing commit 3 in isolation is the point:
because protobuf has already reached v1.36.11 by then, the security fix touches
only go.mod, go.sum and the CI pin, with no generated code at all. All
the noise is quarantined in commit 2, under a title that says what it is.

Splitting the fork bump (1) from the require bump (2) also keeps the skew
pointing the right way. Commit 1 moves only the runtime, so protobuf is ahead
of the generated code — the supported direction — and since the generator
version comes from the required version, it stays at v1.33.0 and the stubs do
not move. Commit 2 then brings require and stubs up together.

The result is that every commit is internally consistent, so make rpc-check is
clean at each one rather than only at the tip:

commit grpc required protobuf fork stubs rpc-check
1 4b2602c73 v1.59.0 v1.33.0 v1.36.11 v1.33.0 clean
2 30b08925e v1.59.0 v1.36.11 v1.36.11 v1.36.11 clean
3 029045649 v1.83.1 v1.36.11 v1.36.11 v1.36.11 clean
4 b32c7d18f v1.83.1 v1.36.11 v1.36.11 v1.36.11 clean

Every commit also builds independently.

On the size of commit 2

The diff is large but mechanical: the v1.36 generator emits each file descriptor
as a string constant instead of a []byte literal, which accounts for nearly
all of it — hence ~6.8k insertions against ~16.4k deletions. No .proto file is
touched and no RPC definition changes. The output matches the generator form
master already carries, and make rpc is idempotent against the committed
stubs.

Steps to Test

  • go build ./...
  • go vet ./brontide/... ./lnrpc/...
  • go test ./lnrpc/... ./brontide/...
  • make rpc leaves the tree clean, so make rpc-check passes
  • go mod tidy produces no drift in go.mod/go.sum

Pull Request Checklist

Testing

  • Your PR passes all CI checks.

Code Style and Documentation

  • The change obeys the code style guidelines.
  • Commits follow the ideal Git commit structure.
  • This is a dependency bump; no-changelog label applied.

@ziggie1984 ziggie1984 added no-changelog severity-critical Requires expert review - security/consensus critical labels Aug 20, 2026
Point the google.golang.org/protobuf replace at the
lightninglabs/protobuf-go-hex-display v1.36.11-hex-display tag, matching
what master carries since 3f3718c (lightningnetwork#10887).

This moves only the runtime backing the replace; the required protobuf
version is untouched, so the protoc-gen-go version derived from go.mod
is unchanged and the generated stubs stay as they are. The
UseHexForBytes option used by the lncli JSON marshal and unmarshal paths
is preserved.
Raise the required google.golang.org/protobuf version to v1.36.11, the
version the hex display fork now tracks. grpc v1.83.1 requires this
version too, so doing it here keeps the grpc bump that follows free of
generated-code churn.

lnrpc/gen_protos_docker.sh derives PROTOBUF_VERSION from the protobuf
version selected in go.mod, so protoc-gen-go moves from v1.33.0 to
v1.36.11 and the stubs have to be regenerated for 'make rpc-check' to
stay clean.

The diff is large but mechanical: the v1.36 generator emits each file
descriptor as a string constant instead of a []byte literal, which
accounts for nearly all of it. No RPC definitions change, and the output
matches what master already carries.
(cherry picked from commit ad7ccc0)
x/crypto v0.51.0 adds a second failure mode to chacha20poly1305.New:
it now returns an error under Go's strict FIPS 140-only mode, in
addition to the existing bad-key-length case. The key here is a fixed
[32]byte, and lnd cannot run under strict FIPS mode because brontide
mandates ChaCha20-Poly1305, so the discarded error remains unreachable.
Expand the comment to record that widened invariant.

(cherry picked from commit 8a23e33)
@ziggie1984
ziggie1984 force-pushed the backport-11105-to-v0.20.x-branch branch from 12be235 to b32c7d1 Compare August 21, 2026 02:09
@github-actions

Copy link
Copy Markdown

🔴 PR Severity: CRITICAL

gh pr view | 21 files | 23,369 lines changed

🔴 Critical (1 file)
  • brontide/noise.go - Noise protocol code for encrypted peer connections (brontide/*)
🟠 High (17 files)
  • lnrpc/autopilotrpc/autopilot.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/chainrpc/chainkit.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/chainrpc/chainnotifier.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/devrpc/dev.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/invoicesrpc/invoices.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/lightning.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/lnclipb/lncli.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/neutrinorpc/neutrino.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/peersrpc/peers.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/routerrpc/router.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/signrpc/signer.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/stateservice.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/verrpc/verrpc.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/walletrpc/walletkit.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/walletunlocker.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/watchtowerrpc/watchtower.pb.go - lnrpc/* generated RPC definitions
  • lnrpc/wtclientrpc/wtclient.pb.go - lnrpc/* generated RPC definitions
🟡 Medium (2 files)
  • go.mod - dependency version bump (grpc)
  • go.sum - dependency checksum updates
🟢 Low (1 file)
  • .github/workflows/main.yml - CI/CD configuration

Analysis

This is a backport of a grpc dependency bump (v1.83.1). The bulk of the diff (~23k lines) is auto-regenerated protobuf stubs under lnrpc/* (High tier) plus go.mod/go.sum updates, which is expected fallout from a gRPC/protoc toolchain bump and not itself risky.

However, the PR also touches brontide/noise.go (5 lines changed), which falls under the brontide/* Noise-protocol/encrypted-peer-connection category. Per classification rules, any touch to this package is automatically CRITICAL regardless of diff size, so this PR is flagged for expert review. Reviewers should focus specifically on the small brontide/noise.go change to confirm it's a benign adaptation to the new grpc/protobuf APIs and doesn't affect the Noise handshake or encryption logic.


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

@ziggie1984

Copy link
Copy Markdown
Collaborator Author

Verifying the regenerated stubs against master

Commit 2 is the one part of this PR that can't be reviewed by reading it, so
here is a check that pins it down rather than asking for trust.

Wherever a .proto file is byte-identical between this branch and master, the
generated .pb.go must also come out byte-identical — provided both sides ran
the same generator. Any drift in the toolchain or in the output form would show
up immediately as a diff. That makes it a direct test of "did this branch land
on the same protobuf toolchain master already uses".

Result:

branch .proto files identical to master generated .pb.go byte-identical
this PR (v0.20.x) 13 13 / 13
#11109 (v0.21.x) 15 15 / 15

No differences on either branch.

Four files here have protos that genuinely diverge from master, since master has
added RPCs to lightning, router, signer and walletkit since the branch
was cut. Byte equality isn't meaningful for those, so I compared the generator
fingerprint instead — all four match master exactly:

FILE                       gen-ver    protoc     rawDesc  hex-lines  enforce
lightning.pb.go  [here]    v1.36.11   v3.21.12   1        0          2
lightning.pb.go  [master]  v1.36.11   v3.21.12   1        0          2
router.pb.go     [here]    v1.36.11   v3.21.12   1        0          2
router.pb.go     [master]  v1.36.11   v3.21.12   1        0          2
signer.pb.go     [here]    v1.36.11   v3.21.12   1        0          2
signer.pb.go     [master]  v1.36.11   v3.21.12   1        0          2
walletkit.pb.go  [here]    v1.36.11   v3.21.12   1        0          2
walletkit.pb.go  [master]  v1.36.11   v3.21.12   1        0          2

Same string-constant rawDesc, no leftover []byte hex literals, same
EnforceVersion pair. Their remaining differences trace to the proto
definitions, not to the regeneration.

Together with make rpc being idempotent against the committed stubs, that
closes the loop:

committed stubs == this branch's toolchain output == master's toolchain
output, for identical input.

So the ~16k deleted lines in commit 2 are the []byte descriptor literal being
replaced by the string constant that master already carries, and nothing else.

@yyforyongyu yyforyongyu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@yyforyongyu
yyforyongyu merged commit c0e4751 into lightningnetwork:v0.20.x-branch Aug 21, 2026
35 of 36 checks passed
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.

3 participants