-
Notifications
You must be signed in to change notification settings - Fork 380
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added metrics for bad blocks #6270
Conversation
@@ -454,6 +455,11 @@ private void TraceFailingBranch(in ProcessingBranch processingBranch, Processing | |||
catch (InvalidBlockException ex) | |||
{ | |||
BlockTraceDumper.LogDiagnosticTrace(blockTracer, ex.InvalidBlock.Hash!, _logger); | |||
Metrics.BadBlocks++; | |||
if (Encoding.ASCII.GetString(ex.InvalidBlock.ExtraData) == "Nethermind") |
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.
Instead of hardcoding Nethermind
we might want to get the default value from Nethermind.Config.BlocksConfig
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 would go with both. Also would use Contains and InvariantCultureIgnoreCase comparision.
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.
@LukaszRozmej I changed to contains and ignoring case. Are you saying I should hardcode Nethermind
as well as getting it from the config - why would that be better than just using the 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.
Added small comment. @Marchhill have you added those metrics to our grafana dashboard?
src/Nethermind/Nethermind.Consensus/Processing/BlockchainProcessor.cs
Outdated
Show resolved
Hide resolved
I'm able to add a panel to my dashboard but I don't think I have the permissions to add for everybody |
Could you ask Angkor for permissions? :) |
src/Nethermind/Nethermind.Consensus/Processing/BlockchainProcessor.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Consensus/Processing/BlockExtensions.cs
Outdated
Show resolved
Hide resolved
* added metrics for bad blocks * increment metrics when bad blocks observed * use config rather than hardcoding block extra data * check for extra data containing (instead of being equal to) Nethermind and ignore case * use defualt block extra data field * handle exception if block extra data is null * refactor and add test * fix whitespace * fix whitespace (again) * merge lines * avoid making internal class public --------- Co-authored-by: Marc Harvey-Hill <marc@Marcs-MacBook-Pro.local>
Resolves #6245
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Documentation
Requires documentation update
https://github.com/NethermindEth/docs/pull/152/files
Requires explanation in Release Notes