Skip to content

Metrics and debug_getBadBlocks for blocks rejected in other stages of validation #6719

@MarekM25

Description

@MarekM25

We currently only gather bad block metrics after processing at https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.Consensus/Processing/BlockchainProcessor.cs#L457.

However, it's important to note that bad blocks can occur at other stages as well. For example:

  1. During hash validation in NewPayloadHandler: https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.Merge.Plugin/Handlers/NewPayloadHandler.cs#L101
  2. During orphaned block header validation: https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.Merge.Plugin/Handlers/NewPayloadHandler.cs#L131
  3. During block validation in NewPayloadHandler: https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.Merge.Plugin/Handlers/NewPayloadHandler.cs#L159

The same limitation applies to the debug_getBadBlocks function; it only captures bad blocks that occur during processing. It might be beneficial to check how other clients handle this issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions