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

eth_getTransactionCount errors with code:100 message:"State node doesn't exist" #872

Open
DanBurton opened this issue Dec 22, 2020 · 4 comments
Assignees
Labels
KEVM KEVM branch related

Comments

@DanBurton
Copy link

I am using ethers.js to try and send a simple transaction from one account to another on the KEVM testnet. This appears to not be possible due to an error with the implementation of eth_getTransactionCount.

To Reproduce
Steps to reproduce the behavior:

  1. npm install ethers -- (for convenience I chose to do this in the mallet repo)
  2. Create 2 accounts via mallet on the kevm testnet & fund them with the faucet.
  3. Get the secret keys of the 2 accounts. (I used expose recoverPrivateKey mallet#21 to assist with this)
  4. in a node repl (or the mallet repl):
mallet> ethers = require('ethers');
mallet> p = new ethers.providers.JsonRpcProvider('https://david.kevm.dev-mantis.iohkdev.io:8546');
mallet> p.send('net_version').then(console.log);  # make sure it is connected and working
Promise { <pending> }
41390

mallet> w = new ethers.Wallet('<< secret key 1 goes here >>', p);
mallet> w2 = new ethers.Wallet'<< secret key 2 goes here >>', p);
mallet> w.sendTransaction({to: w2.address, value: '1000000000'}).then(console.log);

The following error appears:

mallet> (node:75341) UnhandledPromiseRejectionWarning: Error: processing response error (body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":3,\"message\":\"Execution error\",\"data\":[{\"code\":100,\"message\":\"State node doesn't exist\"}]},\"id\":84}", error={"code":3,"data":[{"code":100,"message":"State node doesn't exist"}]}, requestBody="{\"method\":\"eth_getTransactionCount\",\"params\":[\"0x44a609c5791ab0ce949d04c863760b8a6533dc2d\",\"pending\"],\"id\":84,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="https://david.kevm.dev-mantis.iohkdev.io:8546", code=SERVER_ERROR, version=web/5.0.11)
    at Logger.makeError (/Users/dan/github.com/input-output-hk/mallet/node_modules/@ethersproject/logger/lib/index.js:179:21)
    at Logger.throwError (/Users/dan/github.com/input-output-hk/mallet/node_modules/@ethersproject/logger/lib/index.js:188:20)
    at /Users/dan/github.com/input-output-hk/mallet/node_modules/@ethersproject/web/lib/index.js:265:32
    at step (/Users/dan/github.com/input-output-hk/mallet/node_modules/@ethersproject/web/lib/index.js:33:23)
    at Object.next (/Users/dan/github.com/input-output-hk/mallet/node_modules/@ethersproject/web/lib/index.js:14:53)
    at fulfilled (/Users/dan/github.com/input-output-hk/mallet/node_modules/@ethersproject/web/lib/index.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:75341) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 12)

The same error may sometimes be observed in isolation by sending eth_getTransactionCount manually:

mallet> p.send('eth_getTransactionCount', [w.address, 'pending']).then(console.log);

(HOWEVER, when you call eth_getTransactionCount manually, it appears that after some amount of time has elapsed, eth_getTransactionCount eventually stops erroring and returns 0. The error seems to be reliably reproducible for some period of time after a new account is created.)

Expected behavior
The eth_getTransactionCount method is supported and returns zero for accounts with no transactions.

@jmendiola222 jmendiola222 added the KEVM KEVM branch related label Dec 28, 2020
@matiwinnetou
Copy link

Hi @jmendiola222 @loverdos @rtkaczyk could you provide a rough estimate how hard or easy it is to do and rough ETA? Reach team is very keen to continue working but they are blocked on those issues. We are hoping this is not an architectural problem and a small bug...

@drospa
Copy link
Contributor

drospa commented Mar 5, 2021

Hello @DanBurton ,
we could assume this is caused by the KEVM incompatibility mentioned here #864
could you please try you're using solc 0.5.1, which is not supported by this testnet and let us know?

@DanBurton
Copy link
Author

DanBurton commented Mar 5, 2021

@drospa the instructions for how to reproduce this issue do not involve solc. I'm just trying to use sendTransaction from an ethers.Wallet. Is there an older version of ethers.js with which the KEVM is compatible?

@dzajkowski
Copy link
Contributor

@DanBurton hi there! thanks for the report and for your interest in mantis. As mentioned in #864 this particular test net is lagging heavily behind the current development version of mantis. I understand that this is unfortunate but we are currently unable to support it because we are focusing on the current development version. Judging by your description I assume that it's a bug in mantis that results in this response. Would it be possible for you to test this same code against another test net (eg. https://docs.mantisclient.io/learn/sagano-mantis-testnet)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
KEVM KEVM branch related
Projects
None yet
Development

No branches or pull requests

7 participants