Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Every transaction failing with JsonRPCSigner #365

Closed
tlxnithin opened this issue Dec 5, 2018 · 11 comments
Closed

Every transaction failing with JsonRPCSigner #365

tlxnithin opened this issue Dec 5, 2018 · 11 comments
Assignees

Comments

@tlxnithin
Copy link

After the last night change for bulk transactions,
every transaction using JsonRpcSigner is failing with below error.


{
        "reason": "transaction failed",
        "code": "CALL_EXCEPTION",
        "transactionHash": "0x067d3526d73917ff037722ab70910748af20812ddc55d7c4666a0356dceaf733",
        "transaction": {
            "hash": "0x067d3526d73917ff037722ab70910748af20812ddc55d7c4666a0356dceaf733",
            "blockHash": "0x79471e3c171f2f7d7289e7177c462394de7a148d58d841d588e5546530dda5b0",
            "blockNumber": 4200,
            "transactionIndex": 0,
            "confirmations": 1,
            "from": "0x898dB302944455Dbc6Ad7F58452C74E26400eb67",
            "gasPrice": {
                "_hex": "0x2540be400"
            },
            "gasLimit": {
                "_hex": "0x15f90"
            },
            "to": "0x0dc5f8a12C0af9ddA2fD7f76823e4b3bA6F8bC1E",
            "value": {
                "_hex": "0x0"
            },
            "nonce": 2088,
            "data": "0x93767f3200000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000898db302944455dbc6ad7f58452c74e26400eb67000000000000000000000000f4d5edec750a6736817a548742a1a8db36de4f0000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000152d02c7e14af6800000000000000000000000000000000000000000000000000000000000000133f021000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000b746f6b6930303132333131000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002430623966366161332d633463372d346636342d626632642d3039326330343936653935350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035553440000000000000000000000000000000000000000000000000000000000",
            "r": "0x4287ce5263b226c990d22296838bb4a823077b1f5c7a699e31d14463e3d17f92",
            "s": "0x744f3ad044ca2897d8d1a5162df372971718399a4f8bd659678ff8afeb8d5cb9",
            "v": 2503,
            "creates": null,
            "raw": "0xf9024f8208288502540be40083015f90940dc5f8a12c0af9dda2fd7f76823e4b3ba6f8bc1e80b901e493767f3200000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000898db302944455dbc6ad7f58452c74e26400eb67000000000000000000000000f4d5edec750a6736817a548742a1a8db36de4f0000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000152d02c7e14af6800000000000000000000000000000000000000000000000000000000000000133f021000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000b746f6b6930303132333131000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002430623966366161332d633463372d346636342d626632642d30393263303439366539353500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000355534400000000000000000000000000000000000000000000000000000000008209c7a04287ce5263b226c990d22296838bb4a823077b1f5c7a699e31d14463e3d17f92a0744f3ad044ca2897d8d1a5162df372971718399a4f8bd659678ff8afeb8d5cb9",
            "networkId": 1234
        }

@ricmoo
Copy link
Member

ricmoo commented Dec 5, 2018

Can you provide the contract method? It looks like a require() statement is failing.

@ricmoo
Copy link
Member

ricmoo commented Dec 5, 2018

It also looks like it is using 90k gas... is that sufficient?

Can you run:

let tx = {
    to: "0x0dc5f8a12c0af9dda2fd7f76823e4b3ba6f8bc1e",
    data: "0x93767f3200000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000898db302944455dbc6ad7f58452c74e26400eb67000000000000000000000000f4d5edec750a6736817a548742a1a8db36de4f0000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000152d02c7e14af6800000000000000000000000000000000000000000000000000000000000000133f021000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000b746f6b6930303132333131000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002430623966366161332d633463372d346636342d626632642d3039326330343936653935350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035553440000000000000000000000000000000000000000000000000000000000"
};
provider.estimateGas(tx).then((gasLimit) => {
    console.log(gasLimit);
});

The only thing that should have changed is I let the node compute its expected gas, rather than perform the estimate separately.

Also, what node is this? Parity, Ganache, Geth?

@ricmoo ricmoo added the investigate Under investigation and may be a bug. label Dec 5, 2018
@ricmoo ricmoo self-assigned this Dec 5, 2018
@tlxnithin
Copy link
Author

createToki method in this contract. And it is a geth node.

@ricmoo
Copy link
Member

ricmoo commented Dec 5, 2018

Can you also look up older transactions, which worked, and see what gasLimit was set?

@ricmoo
Copy link
Member

ricmoo commented Dec 5, 2018

Looks like 90k is the default: https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendtransaction

My guess is that when it was using estimateGas directly, it was determining a much higher gas limit. I can go back to automatically filling in the gas limit. I need to think for a few minutes what the "right" (least wrong?) thing is to do...

@tlxnithin
Copy link
Author

Looks like 90k is the default: https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendtransaction

My guess is that when it was using estimateGas directly, it was determining a much higher gas limit. I can go back to automatically filling in the gas limit. I need to think for a few minutes what the "right" (least wrong?) thing is to do...

I think that what is happening. The successful transaction gas used was 2113100 wei. And the gas limit on the network is 8000000.

@tlxnithin
Copy link
Author

I was able to make successful transactions after passing the options for transaction with higher gas limit.

@ricmoo
Copy link
Member

ricmoo commented Dec 5, 2018

Ok... I will add gas estimation back in. I think it is easier for people to hard-code 90k if that is what they want, but it is far more useful of a default to pick a sane gas limit. :)

@tlxnithin
Copy link
Author

Sounds good. :)

@ricmoo
Copy link
Member

ricmoo commented Dec 5, 2018

This should be fixed now. Give it a go? 4.0.17 :)

@tlxnithin
Copy link
Author

That worked. Thanks @ricmoo . :)

This should be fixed now. Give it a go? 4.0.17 :)

👍

@ricmoo ricmoo removed the investigate Under investigation and may be a bug. label Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants