Repository navigation
fix(server): delegate CometLoggerWrapper.Warn, bump grpc and x/net - #98
Open
marcello33 wants to merge 3 commits into
Open
marcello33 wants to merge 3 commits into
marcello33 wants to merge 3 commits into
Conversation
Collaborator
Author
|
@claude review |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix is correct and adequately covered by a regression test.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes infinite recursion in CometLoggerWrapper.Warn by delegating to the embedded SDK logger.
Changes:
- Delegates warning messages and key/value fields correctly.
- Adds regression coverage for contextual warning output.
| File | Description |
|---|---|
server/log/cmt_logger.go |
Corrects warning delegation. |
server/log/cmt_logger_test.go |
Verifies warning level, message, and fields. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
marcello33
marked this pull request as ready for review
October 6, 2026 09:03
0xrukimedo
self-requested a review
October 6, 2026 10:33
0xrukimedo
approved these changes
Oct 6, 2026
0xrukimedo
approved these changes
Oct 6, 2026
cffls
approved these changes
Oct 6, 2026
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.
Summary
CometLoggerWrapper.Warncalled itself without bound:With(keyvals)returns anotherCometLoggerWrapper.Warnthen repeats the sameWith(...).Warn(...).So the first Warn on a CometBFT logger in a heimdall process would overflow the goroutine stack and crash the node. It also passed
keyvalsun-spread as a singleWithargument. Upstream v0.50 has noWarnon this wrapper. It came in with our CometBFT fork'sLoggerinterface (initially a no-op, then this body in11853a396d).Warnnow delegates to the embeddedcosmossdk.io/loglogger, the same wayWithalready does.Today this is latent. The cometbft fork at
v0.3.8-polygonhas no live.Warn(call (only two commented-out ones inp2p/pex), and neither do heimdall or this fork outsidelog/. Any future Warn in CometBFT code would hit it.Also in this PR: govulncheck on
develwas red for reasons unrelated to the fix above.Changes:
google.golang.org/grpcv1.83.2 andgolang.org/x/netv0.58.0, matching heimdall-v2develop(It'd be nice to print the PubKey as well cosmos/cosmos-sdk#647).go getalso pulled transitive bumps: x/crypto, x/sys, x/term, x/text, x/sync, otel, genproto, protobuf v1.36.11.Executed tests
TestCometLoggerWrapperWarn: aWith("module", ...).Warn(msg, kv...)chain emits one warn line that carries the message, theWithcontext and the call keyvals.Warnthe test binary dies withruntime: goroutine stack exceeds 1000000000-byte limit. With the fix it passes, including under-race.Your code is affected by 0 vulnerabilities.go build ./...is clean, andgo testpasses forserver/...,baseapp/...,x/auth/...,x/bank/...,x/gov/...,codec/...,types/...andclient/....golangci-lint(v1, the repo config) andgo vetare clean onserver/log. diffguard with mutation: exit 0, 100% kill.Rollout notes
develop; CItest-unitcovers the rest of the module.github.com/0xPolygon/cosmos-sdkreplace) to take effect there. It's independent of heimdall-v2#657.