Skip to content

Wrong response when calling debug_traceBlockByNumber and a transaction from the block doesn't contain any calls #4386

@simzzz

Description

@simzzz

Description

When calling debug_traceBlockByNumber for a block, and some transaction from the block hasn't made any calls, then null would be returned for that transaction. For example:

{
    "method": "debug_traceBlockByNumber",
    "params": [
        "0x5067CB1",
        {
            "tracer":"callTracer"
        }
    ],
    "id": 1,
    "jsonrpc": "2.0"
}

returns
{"result":[{"txHash":"0xa74c140aedec484c5c6cb559aecd75386d15cbafcc3e55c90d5302adbea86337","result":null}],"jsonrpc":"2.0","id":27}

The result be the root transaction object with an empty calls array instead of null, for example:

{"result: 
  [{
    "txHash":"0xa74c140aedec484c5c6cb559aecd75386d15cbafcc3e55c90d5302adbea86337",
    "result":{
        "type": "CALL",
        "from": "0x...",
        "to": "0x...",
        "input": "0x",
        "output": "0x",
        "gas": "0x0",
        "gasUsed": "0x0",
        "value": "0x0",
        "calls": []
    }}],"jsonrpc":"2.0","id":27}

An example response from Quicknode for such a transaction (Geth/Alchemy also adhere):

Image

Steps to reproduce

  1. Try to call debug_traceBlockByNumber for a block containing such a transaction, for example 0x5067CB1
  2. Observe the result

Additional context

No response

Hedera network

No response

Version

0.71.0

Operating system

None

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions