New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Beacon cleanups #5148
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #5148 +/- ##
=======================================
Coverage 77.5% 77.5%
=======================================
Files 258 258
Lines 30391 30342 -49
=======================================
- Hits 23566 23533 -33
+ Misses 5320 5313 -7
+ Partials 1505 1496 -9
|
@@ -237,7 +225,7 @@ func (pd *ProtocolDriver) Start(ctx context.Context) { | |||
pd.logger.Info("beacon protocol disabled") | |||
return | |||
} | |||
pd.logger.With().Info("starting beacon protocol", log.String("config", fmt.Sprintf("%+v", pd.config))) | |||
pd.logger.With().Info("starting beacon protocol", log.Any("config", pd.config)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using log.Any
is expensive, because zap needs to go over the object with reflection to generate a string from it. I'd prefer if pd.config
would implement zapcore.ObjectMarshaler
by adding a MarshalLogObject
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally yes, but this is a Start()
method that is executed once per application life, so IMHO it doesn't make sense to bloat code with special implementation just for this use-case.
Bors merge |
Some clean-ups in beacon code: - removed redundant: - nodeID (can be derived from edSigner) - and metricsRegistry (unused - use `codec.MustEncode` where an error lead to shutdown anyway - avoid costly eager marshaling for log purposes :bulb: It's recommended to review commit-by-commit as changes are separated.
Pull request successfully merged into develop. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Some clean-ups in beacon code: - removed redundant: - nodeID (can be derived from edSigner) - and metricsRegistry (unused - use `codec.MustEncode` where an error lead to shutdown anyway - avoid costly eager marshaling for log purposes :bulb: It's recommended to review commit-by-commit as changes are separated.
Some clean-ups in beacon code:
codec.MustEncode
where an error lead to shutdown anyway馃挕 It's recommended to review commit-by-commit as changes are separated.