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": [
    "0xf75853a120b34ffba9d40ad83b01f5f73a62797a9906cd9afd53509a525ae081",
    {
      "tracer": "unigramTracer"
    }
  ],
  "id": 1,
  "jsonrpc": "2.0"
}'

Sample Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "result": {
        "PUSH1": 667,
        "MSTORE": 282,
        "CALLDATASIZE": 24,
        "PUSH2": 453,
        "JUMPI": 199,
        "JUMPDEST": 403,
        "JUMP": 221,
        "PUSH32": 21,
        "SLOAD": 8,
        "SHL": 7,
        "SUB": 18,
        "AND": 7,
        "SWAP2": 135,
        "SWAP1": 253,
        "POP": 284,
        "CALLER": 1,
        "DUP1": 220,
        "CALLDATACOPY": 21,
        "DUP5": 87,
        "GAS": 5,
        "DELEGATECALL": 1,
        "CALLVALUE": 1,
        "ISZERO": 100,
        "LT": 105,
        "CALLDATALOAD": 3,
        "SHR": 1,
        "PUSH4": 4,
        "GT": 54,
        "EQ": 4,
        "DUP4": 190,
        "DUP6": 58,
        "SLT": 9,
        "DUP3": 215,
        "PUSH8": 7,
        "DUP2": 325,
        "ADD": 437,
        "DUP7": 31,
        "SWAP3": 67,
        "SWAP7": 5,
        "SWAP6": 10,
        "SWAP4": 26,
        "DIV": 8,
        "MUL": 98,
        "MLOAD": 295,
        "DUP9": 11,
        "DUP8": 19,
        "OR": 10,
        "SWAP5": 8,
        "DUP10": 11,
        "DUP11": 9,
        "DUP13": 3,
        "SWAP8": 5,
        "DUP12": 6,
        "SWAP9": 3,
        "DUP14": 1,
        "SWAP11": 2,
        "DUP15": 3,
        "SWAP13": 5,
        "SWAP10": 3,
        "SHA3": 7,
        "MOD": 2,
        "NOT": 30,
        "PUSH31": 1,
        "CODECOPY": 10,
        "STATICCALL": 4,
        "SWAP14": 1,
        "SSTORE": 3,
        "LOG3": 1,
        "STOP": 1,
        "RETURNDATASIZE": 2,
        "RETURNDATACOPY": 1,
        "RETURN": 1
      }
    }
  ]
}

Last updated