iotaledger / wasp

Node for IOTA Smart Contracts
Apache License 2.0
289 stars 147 forks source link

`debug_traceTransaction` returns an empty trace #3430

Open vbaranov opened 2 months ago

vbaranov commented 2 months ago

Describe the bug debug_traceTransaction JSON RPC method returns an empty trace

To Reproduce

For instance, multiple transactions at IOTA Shimmer Testnet or IOTA EVM return a trace like this (the example hash is from Shimmer Testnet)

Request:

curl -sL \
  -H "Content-Type:application/json;charset=utf-8" \
  -d "{
      \"jsonrpc\": \"2.0\",
      \"id\": 1,
      \"method\": \"debug_traceTransaction\",
      \"params\": [
          \"0x1d8a4aa40463d317c2b104a3b6b299b0fd4f400d922a976616947f3e18be3196\",
          { \"tracer\": \"callTracer\"}
      ]
  }" \
https://...

Response:
{"jsonrpc":"2.0","id":1,"result":{"type":"","from":"","gas":"","gasUsed":"", "input":""}}

Expected behavior

If a transaction has no nested traces, the response of debug_traceTransaction should contain the data from the original transaction (other EVM JSON RPC clients do that). Thus, instead {"jsonrpc":"2.0","id":1,"result":{"type":"","from":"","gas":"","gasUsed":"", "input":""}}, we expect the data (example with arbitrary data, they're unrelated to tested transaction hash):

{"jsonrpc":"2.0","id":1,"result":{"type":""DELEGATECALL,"from":"0x8250f4af4b972684f7b336503e2d6dfedeb1487a","to": "0x66e9cba5529824a03b5bc9931d9c63637101d0f7","gas":"0xaf7b","gasUsed":"0x2a7d","input":"0xc0fd8bde..."}}

Network and versioning

This issue interferes to properly indexing internal transactions on the mentioned chains in the Blockscout explorer.