build: bump grpc to v1.83.1 - #11105
Conversation
5ca7ed9 to
053d7c8
Compare
🟡 PR Severity: MEDIUM
🟡 Medium (2 files)
🟡 Medium (2 files, kvdb submodule)
🟢 Low (1 file)
AnalysisThis PR only touches Go module/toolchain files ( To override, add a |
starius
left a comment
There was a problem hiding this comment.
LGTM!
Small optional nit added.
| go.uber.org/zap v1.17.0 // indirect | ||
| go.yaml.in/yaml/v2 v2.4.2 // indirect | ||
| golang.org/x/crypto v0.46.0 // indirect | ||
| golang.org/x/crypto v0.51.0 // indirect |
There was a problem hiding this comment.
Nit: x/crypto v0.51.0 can now return an error from ChaCha initialization under explicit strict FIPS mode, while brontide/noise.go:174 assumes only key length can fail. Since Lightning transport requires ChaCha and strict FIPS mode is inherently unsuitable, the code is still safe, but the comment is stale. We can expand it, to clarify the invariant:
diff --git a/brontide/noise.go b/brontide/noise.go
index a1b7cd4dd..a3b7c205d 100644
--- a/brontide/noise.go
+++ b/brontide/noise.go
@@ -172,7 +172,10 @@ func (c *cipherState) InitializeKey(key [32]byte) {
c.nonce = 0
// Safe to ignore the error here as our key is properly sized
- // (32-bytes).
+ // (32-bytes). Starting with x/crypto v0.51.0, this can also return an
+ // error when Go's strict FIPS 140-only mode is enabled. Brontide requires
+ // ChaCha20-Poly1305, which isn't permitted in that mode, so lnd cannot
+ // operate with strict FIPS enforcement enabled.
c.cipher, _ = chacha20poly1305.New(c.secretKey[:])
}There was a problem hiding this comment.
Good catch, added the comment expansion in c348a58 as a separate commit.
I went with the comment-only route rather than actually catching the error, for two reasons. First, the path is unreachable for lnd: brontide mandates ChaCha20-Poly1305, which strict FIPS 140-only mode forbids, so the two can't coexist. Second, propagating the error would mean adding an error return to InitializeKey -> rotateKey -> Encrypt, but Encrypt returns only []byte and calls rotateKey from a defer, so that's an invasive signature change through hot-path transport code, out of scope for a dependency bump.
🔴 PR Severity: CRITICAL
🔴 Critical (1 file)
🟡 Medium (4 files)
🟢 Low (1 file)
AnalysisThis PR was previously classified as MEDIUM (grpc dependency bump only), but it now also modifies To override, add a |
gijswijs
left a comment
There was a problem hiding this comment.
Commit 1 leaves kvdb/go.mod in an inconsistent intermediate state (grpc v1.82.1) that commit 2 immediately fixes. Squashing would be tidier imho, but each commit still builds, so it's harmless.
The kvdb module is versioned and published independently, so it must also be tested or consumed as a nested module on its own. Run go mod tidy in kvdb so the transitive requirements and checksums match the grpc version selected by the module graph.
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.
c348a58 to
8a23e33
Compare
|
Good catch @gijswijs — fixed in a force-push. That intermediate The commits are rebuilt so the split is clean now:
The final tree is byte-identical to before, and each commit builds on its own. |
Change Description
Routine maintenance bump of
google.golang.org/grpcto the latest release,v1.83.1, keeping our gRPC dependency current with upstream. The latestrelease rolls up a number of upstream fixes and robustness improvements over
the version we currently pin.
The bump pulls the transitive requirements forward to what grpc
v1.83.1declares (
golang.org/x/net,golang.org/x/sys,golang.org/x/text,golang.org/x/crypto,golang.org/x/mod,golang.org/x/tools,golang.org/x/term, and the twogenproto/googleapismodules).google.golang.org/protobufis unchanged atv1.36.11, so the existingprotobuf-go-hex-displayreplace directive is untouched.The pinned-dependency CI matrix entry in
.github/workflows/main.ymlis updatedto match, mirroring the previous grpc bump (#10841).
A second commit runs
go mod tidyin the independently-versionedkvdbmoduleso its transitive requirements and checksums line up with the version selected
by the module graph, matching what was done for the last bump.
Steps to Test
go build ./...make buildgo test ./rpcperms/...make rpcproduces no changes to generated code (the protobuf toolchainversion is pinned separately in
lnrpc/Dockerfileand is unaffected)Pull Request Checklist
Testing
Code Style and Documentation
no-changeloglabel applied.