Skip to content
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

Merged
merged 11 commits into from
Dec 4, 2023
Merged

added metrics for bad blocks #6270

merged 11 commits into from
Dec 4, 2023

Conversation

Marchhill
Copy link
Contributor

@Marchhill Marchhill commented Nov 14, 2023

Resolves #6245

Changes

  • Add metrics for number of bad blocks, and number of bad blocks with exta data field equal to 'Nethermind'

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Adding metrics

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Documentation

Requires documentation update

  • Yes
  • No

https://github.com/NethermindEth/docs/pull/152/files

Requires explanation in Release Notes

  • Yes
  • No

@@ -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")
Copy link
Contributor

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

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Contributor

@MarekM25 MarekM25 left a 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?

@Marchhill
Copy link
Contributor Author

Added small comment. @Marchhill have you added those metrics to our grafana dashboard?

I'm able to add a panel to my dashboard but I don't think I have the permissions to add for everybody

@MarekM25
Copy link
Contributor

Added small comment. @Marchhill have you added those metrics to our grafana dashboard?

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? :)

@LukaszRozmej LukaszRozmej marked this pull request as ready for review December 4, 2023 13:03
@LukaszRozmej LukaszRozmej merged commit 1740ada into master Dec 4, 2023
62 checks passed
@LukaszRozmej LukaszRozmej deleted the feature/bad_block_metrics branch December 4, 2023 13:04
gr8h pushed a commit to fuseio/nethermind-client that referenced this pull request Dec 12, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add bad blocks metrics
4 participants