Merged
Conversation
…d streamline unsigned transaction building
… to use zap logger
7b2ab86 to
ad5930b
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the logging infrastructure to use zap for structured output, cleans up gRPC logger setup, and makes minor adjustments in various modules to integrate the new logtrace API.
- Replace slog-based logger with zap in
pkg/logtrace, introduceLOG_LEVEL/LOG_TRACINGenv vars, and remove deprecated functions. - Update all
SetGRPCLoggercalls to the new signature, remove context parameter, and adjust gRPC logger implementation. - Add file-overwrite logic in the download task and refactor transaction simulation to simplify gas estimation.
Reviewed Changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/system/go.mod | Add direct btcutil and zap dependencies; remove duplicate indirect entry |
| supernode/node/supernode/server/server.go | Update SetGRPCLogger call to new no-arg signature |
| supernode/cmd/start.go | Adjust logtrace.Setup call to match new one-arg signature |
| sdk/task/download.go | Add pre-download file removal logic |
| pkg/net/grpc/server/server.go | Update SetGRPCLogger call to new signature |
| pkg/net/grpc/client/client.go | Update SetGRPCLogger call to new signature |
| pkg/lumera/modules/tx/impl.go | Refactor SimulateTransaction and related methods for simplified gas estimation |
| pkg/logtrace/log.go | Replace slog logger with zap, add env-driven level/tracing controls |
| pkg/logtrace/grpc_logger.go | Change gRPC logger implementation to use zap and no-arg setup |
| p2p/kademlia/network.go | Downgrade certain errors to warnings for handshake/read failures |
| p2p/kademlia/bootstrap.go | Replace fmt.Println with structured logtrace.Debug |
| go.mod | Add go.uber.org/zap dependency |
| example_env | Introduce LOG_LEVEL and LOG_TRACING environment variables |
Comments suppressed due to low confidence (5)
sdk/task/download.go:127
- Consider adding unit or integration tests to cover the new file-removal branch, ensuring behavior when the file exists, doesn’t exist, or removal fails.
// Remove existing file if it exists to allow overwrite
pkg/logtrace/log.go:92
- The commented-out correlation ID enrichment means logs no longer include the correlation ID. Restore logic to append
extractCorrelationID(ctx)as a zap field so each log entry carries its correlation ID.
// Always enrich logs with the correlation ID.
supernode/node/supernode/server/server.go:50
- Dropping the context here means the gRPC logger won’t capture the correlation ID. Either restore a context overload or pass the current context into
SetGRPCLoggerso internal gRPC logs use the correct correlation ID.
logtrace.SetGRPCLogger()
pkg/net/grpc/server/server.go:220
- Calling
SetGRPCLoggerwithout context causes loss of correlation IDs in server-side gRPC logs. Consider updating the API to accept or capture the current context.
logtrace.SetGRPCLogger()
pkg/net/grpc/client/client.go:320
- The gRPC client’s internal logs no longer include the correlation ID because context isn’t passed. Update
SetGRPCLogger(or add a variant) to use the provided context.
logtrace.SetGRPCLogger()
j-rafique
approved these changes
Jul 14, 2025
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.
No description provided.