For the complete documentation index, see llms.txt. This page is also available as Markdown.

debug_getBadBlocks

Returns the most recent blocks the node received from the network that failed validation, with the reason each one was rejected. Returns an empty array when the node has not seen any bad blocks since it started.

This method will use 80 Compute Units.


Parameters

None.

Returns

array - An array of bad block objects, each containing:

  • hash - string - The hash of the rejected block

  • reason - string - Why the node rejected the block

  • rlp - string - The RLP-encoded block, as a hexadecimal string

  • block - object - The decoded block, with the same fields as eth_getBlockByHash

// Result
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": [
        {
            "hash": "0x355ddc4e7c08ada079e8696bd3bcefe2bbf6b9297d1506e76007478a18652cb1",
            "reason": "block gas used mismatch: got 40908151, expected 40907831; gas spent by each tran...",
            "rlp": "0xf9...",
            "block": {
                "number": "0x188c350",
                "hash": "0x355ddc4e7c08ada079e8696bd3bcefe2bbf6b9297d1506e76007478a18652cb1",
                "parentHash": "0xb40a3a7f0084c3ee28f36474745e7e14f18d35fd3007efd01e3dd5fc5b0d614b",
                "gasUsed": "0x2703437",
                "gasLimit": "0x393868e",
                "timestamp": "0x6a7c9f1b",
                "stateRoot": "0xeac39cf6cd965cc80c77213976df4af4d4967c401c434f99d7a6da6a7c45142b",
                "transactions": [
                    "0x..."
                ]
            }
        }
    ]
}

Last updated

Was this helpful?