debug_traceBlockByHash

Retrieves detailed execution information about transactions within a given block hash.

Parameters

  1. Blockhash - the hash of the block to be traced.

  2. Tracer - choose from one of these options:

    • 4byteTracer - Solidity contract functions are addressed using the first four byte of the Keccak-256 hash of their signature. This tracer monitors and analyzes the usage of specific function signatures within smart contracts by capturing their unique first four bytes.

    • callTracer - collects data about all call frames executed within a transaction, creating a hierarchical list of call frames structured mirroring the EVM's operations. This is useful for debugging and analytical purposes.

    • prestateTracer - captures and analyzes the state of the blockchain before the execution of a specific transaction. It helps in understanding the state changes and effects that a transaction will have on the blockchain's data and accounts before the transaction is actually executed.

    • noopTracer - returns empty results. This is used for testing purpose.

    • opcountTracer - count and track the number of operations (or opcodes) executed during a specific transaction.

    • unigramTracer - counts the frequency of occurrence of each opcode.

    • bigramTracer - a bigram refers to a sequence of two bytes or characters. This tracer is designed to observe and provide insights into the patterns and occurrences of these two-byte sequences as they appear within the data of executed transactions.

    • trigramTracer - a trigram refers to a sequence of three bytes or characters. This tracer is designed to observe and provide insights into the patterns and occurrences of these three-byte sequences as they appear within the data of executed transactions.

    • evmdisTracer - generates the bytecode disassembly of executed transactions, providing developers with insights into how smart contracts operate at a low-level bytecode level for debugging, security audits, and performance optimization purposes.

Sample Request

curl https://lb.nodies.app/v1/<INSERT URL> \
   -H "x-api-key: <API-KEY>" \
   -X POST \
   -H "Content-Type: application/json" \
   -d '{ 
  "method": "debug_traceBlockByHash",
  "params": [
    "0xe7b411f474a917139a34428450a1472d7516bc4f156647f5694d4cd376fdac8c",
    {
      "tracer": "prestateTracer"
    }
  ],
  "id": 1,
  "jsonrpc": "2.0"
}'

Sample Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "result": {
        "0x2a65aca4d5fc5b5c859090a6c34d164135398226": {
          "balance": "0x10ba0751b58644a920",
          "nonce": 797
        },
        "0x6fcd2bc280cebdb8b56a36bcf2e91a499eefcacb": {
          "balance": "0x2710",
          "nonce": 1
        },
        "0x790b8a3ce86e707ed0ed32bf89b3269692a23cc1": {
          "balance": "0x16482bba30e7c601b",
          "nonce": 627
        }
      }
    }
  ]
}

Last updated