Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Illegal transaction failed_reason show only partial information #281

Open
gpBlockchain opened this issue Apr 12, 2022 · 0 comments
Open
Assignees
Labels

Comments

@gpBlockchain
Copy link

env: https://godwoken-testnet-web3-v1-rpc.ckbapp.dev/
query illegal transaction's Receipt ,failed reason not fully displayed

step

  1. send illegal transaction
  2. query response by send eth_getTransactionReceipt
  3. query eth_call response
  4. query eth_estimateGas

transaction code

function testERCTransferFailed() public {
        require(false, "ERC20: transfer amount exceeds balance");
    }

response

eth_getTransactionReceipt

jsonRpcRequest: {
  jsonrpc: '2.0',
  method: 'eth_getTransactionReceipt',
  params: [
    '0x6a5fe6b03b0b866ed7887f629433dacf35ab7b88557d89a60b6edd25396b2344'
  ],
  id: 22
}
jsonRpcResponse: {
  jsonrpc: '2.0',
  id: 22,
  result: {
    transactionHash: '0x6a5fe6b03b0b866ed7887f629433dacf35ab7b88557d89a60b6edd25396b2344',
    blockHash: '0xd8f8fe9d79c9b04e75a41f0606198b797356466cdaef42325791af45407f0d56',
    blockNumber: '0x13dcf',
    transactionIndex: '0x0',
    gasUsed: '0xf26',
    cumulativeGasUsed: '0xf26',
    logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
    logs: [],
    contractAddress: null,
    status: '0x0',
    from: '0x0000000000000000000000000000000000000000',
    to: null,
    failed_reason: {
      status_code: '0x2',
      status_type: 'REVERT',
      message: 'ERC20: transfer amount exceeds b'
    }
  }
}

eth_estimateGas

jsonRpcRequest: {
  jsonrpc: '2.0',
  method: 'eth_estimateGas',
  params: [
    {
      to: '0xdf02807eEBE70CeC5c3F81358702937024CFf9F8',
      data: '0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000041945df7b00000000000000000000000000000000000000000000000000000000',
      from: '0x0c1efcca2bcb65a532274f3ef24c044ef4ab6d73'
    },
    'latest'
  ],
  id: 17
}
jsonRpcResponse: { jsonrpc: '2.0', id: 17, result: '0xf26' }

eth_call

jsonRpcRequest: {
  jsonrpc: '2.0',
  method: 'eth_call',
  params: [
    {
      to: '0xd93A07eE498b45501C8079FEa8e774942787112A',
      data: '0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000041945df7b00000000000000000000000000000000000000000000000000000000',
      from: '0x0c1efcca2bcb65a532274f3ef24c044ef4ab6d73'
    },
    'latest'
  ],
  id: 17
}
jsonRpcResponse: {
  jsonrpc: '2.0',
  id: 17,
  error: {
    code: -32099,
    message: 'revert: ERC20: transfer amount exceeds balance',
    data: {"failed_reason":{"status_code":"0x2","status_type":"REVERT","message":"ERC20: transfer amount exceeds balance"}
  }
}

expected

  1. eth_getTransactionReceipt's response :ERC20: transfer amount exceeds balance
  2. eth_estimateGas's response:ERC20: transfer amount exceeds balance (May be Fixed, but for sync to v1)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants