node icon indicating copy to clipboard operation
node copied to clipboard

Logs returned by `eth_getLogs` despite revert in `debug_traceBlockByNumber`

Open fadeev opened this issue 7 months ago • 4 comments

Why does using eth_getLogs to retrieve block 0x16e360 return logs — cast rpc eth_getLogs '{"fromBlock":"0x16e360","toBlock":"0x16e360"}' — but using debug_traceBlockByNumber with withLog shows that the transaction reverted — cast rpc debug_traceBlockByNumber 0x16e360 '{"tracer":"callTracer","tracerConfig":{"withLog":true}}'?

fadeev avatar May 07 '25 09:05 fadeev

Not sure if related, but there are instances where Blockscout shows reverted tx:

https://zetachain-testnet.blockscout.com/tx/0xb4e1526513e0d40092ab1ef849d6cc121a1e9c319bf994839e7a8d8bb7850323?tab=index

And Tenderly shows successful tx:

https://www.tdly.co/tx/0xb4e1526513e0d40092ab1ef849d6cc121a1e9c319bf994839e7a8d8bb7850323

fadeev avatar May 07 '25 09:05 fadeev

cast rpc eth_getLogs '{"fromBlock":"0x16e360","toBlock":"0x16e360"}' -r https://zetachain-evm.blockpi.network/v1/rpc/public       
[{"address":"0x91d18e54daf4f677cb28167158d6dd21f6ab3921","topics":["0x49f492222906ac486c3c1401fa545626df1f0c0e5a77a05597ea2ed66af9850d"],"data":"0x000000000000000000000000000000000000000000000000000000000000003800000000000000000000000000000000000000000000000000000000b2d05e00","blockNumber":"0x16e360","transactionHash":"0xd9220c6906e486812de1fb96cf523782a056d0d4590785a7e9d2c326acaf50f5","transactionIndex":"0x0","blockHash":"0xa7b801206c59da8308e75dd4dff1f2f3aa148f5e35cf46901b2bff749112eec7","logIndex":"0x0","removed":false},{"address":"0x91d18e54daf4f677cb28167158d6dd21f6ab3921","topics":["0x49f492222906ac486c3c1401fa545626df1f0c0e5a77a05597ea2ed66af9850d"],"data":"0x000000000000000000000000000000000000000000000000000000000000003800000000000000000000000000000000000000000000000000000000b2d05e00","blockNumber":"0x16e360","transactionHash":"0x3b8d27e208ea174c5c78fd173fa6decd5d455237d294a73d8c50e642d555e2d1","transactionIndex":"0x0","blockHash":"0xa7b801206c59da8308e75dd4dff1f2f3aa148f5e35cf46901b2bff749112eec7","logIndex":"0x0","removed":false}]

fadeev avatar May 07 '25 16:05 fadeev

cast rpc debug_traceBlockByNumber 0x16e360 '{"tracer":"callTracer","tracerConfig":{"withLog":true}}' --rpc-url={url}
, it shows transactions reverted
[
  {
    "result": {
      "error": "execution reverted",
      "from": "0x735b14bb79463307aacbed86daf3322b1e6226ab",
      "gas": "0x650c",
      "gasUsed": "0x524e",
      "input": "0x",
      "to": "0x91d18e54daf4f677cb28167158d6dd21f6ab3921",
      "type": "CALL",
      "value": "0x0"
    }
  },
  {
    "result": {
      "error": "execution reverted",
      "from": "0x735b14bb79463307aacbed86daf3322b1e6226ab",
      "gas": "0x650c",
      "gasUsed": "0x524e",
      "input": "0x",
      "to": "0x91d18e54daf4f677cb28167158d6dd21f6ab3921",
      "type": "CALL",
      "value": "0x0"
    }
  }
]

fadeev avatar May 07 '25 16:05 fadeev

Also, you can trace 0xFA8D7C381B281C50F8AB72CDC56C7936E8F7CE52E4433C97B5F918E779136464 it shows execution reverted, but it shows successful in zeta explorer.

cast rpc debug_traceTransaction 0xFA8D7C381B281C50F8AB72CDC56C7936E8F7CE52E4433C97B5F918E779136464 '{"tracer":"callTracer"}'  --rpc-url={url}

{
  "error": "execution reverted",
  "from": "0x735b14bb79463307aacbed86daf3322b1e6226ab",
  "gas": "0x7a120",
  "gasUsed": "0x3d090",
  "input": "0x",
  "to": "0x91d18e54daf4f677cb28167158d6dd21f6ab3921",
  "type": "CALL",
  "value": "0x0"
}

fadeev avatar May 07 '25 16:05 fadeev