0

POA Network (Ethereum Like) blockchain has eth_estimateGas to estimate gas limit but this method does not work in POA Network Sokol (Testnet) blockchain. When i call this method it gives response:

{
    "jsonrpc": "2.0",
    "error": {
        "code": -32016,
        "message": "The execution failed due to an exception."
    },
    "id": 42
}

because of this i hardcoded gas limit to 21786 . It works for few transactions but fails for later transactions. So how can i estimate gas limit without eth_estimateGas. I have read many post in http://ethereum.stackexchange.com none of them worked for me.

EDIT:

I am making eth_estimateGas method call like this:

URL:https://sokol.poa.network

BODY:

{
    "method": "eth_estimateGas",
    "params": [
        {
            "gasPrice": "0x3b9aca00",
            "from": "0x29D02699195632360D743Eb568fa71B8c8f744dc",
            "gas":"0x21000",
            "to": "0xa6Dc5E5B21D32929b4545126ec95670032c0c178",
            "data": "0x7b97008d000000000000000000000000000000000000000000000000016345785d8a0000"
        }
    ],
    "id": 42,
    "jsonrpc": "2.0"
}

Response:

{
    "jsonrpc": "2.0",
    "error": {
        "code": -32016,
        "message": "The execution failed due to an exception."
    },
    "id": 42
}
  • Has nothing to do with POA. You simply getting a revert opcode which can't give you an estimate. It will be the same behavior on any eth chain – rstormsf Jan 23 at 9:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.