Closed MatthieuScarset closed 1 year ago
Thanks @MatthieuScarset for raising this issue. I suspect this is caused by a future-nonce. Can you please check the transaction count of the account you are using with the following:
curl -s http://localhost:8545 -X POST -H "Content-Type:application/json;" -d '{"id":1,"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0x11d749256d326d3b316C2dcDF2b7d8cE20CF2cFd"]}'
Assuming the transaction count is 0, then you'll need to set the nonce to '00'.
AFAICT this is a problem with Ganache, as it shouldn't fail to return. I feel like there was some work in progress somewhere to address this. I'll have a look tomorrow and see if I can find it.
In v7.7.6 we added a log to warn users of the future nonce: https://github.com/trufflesuite/ganache/pull/4166
If you are running >= v7.7.6 and don't get that warning, then it's likely it's another issue. As to holding the connection open, I'll have to chat with the team to understand the reasoning behind this.
I forgot to state the version I'm using, sorry. I'm using Ganache 8.19.3
- the latest version as of today.
Thank you for linking the issue #4166. The bug/behavior described in this issue is exactly what I am experiencing.
So either the issue with future nonce is not fixed or it's something else from my transaction's values?
@MatthieuScarset can you please double check the version - the latest is v7.7.7
Oups sorry. I run a wrong cmd and it gave me the version of npm
itself I think... :face_exhaling:
I am using Ganache ^7.7.5
indeed.
Let me try with the latest version to see if I can reproduce the issue or if I have an error returned before timeout.
It fails! :tada: with an error message.
{"id":null,"jsonrpc":"2.0","error":{"message":"insufficient funds for gas * price + value","stack":"Error: insufficient funds for gas * price + value\n at TransactionPool.prepareTransaction (\/app\/node_modules\/ganache\/dist\/node\/1.js:2:121958)","code":-32003}}
So I now at least know what I need to work on to fix my transaction.
Thank you for your help!
Excellent - let us know if you have any more challenges with Ganache.
Cheers!
@MatthieuScarset, we've got a feature branch that, upon start up, logs a message to the console that ganache is out of date and you should update. It would look similar to this message:
The message is only logged once for each new version we release.
If ganache had this (optional, opt-out) feature do you think you would have updated?
I would certainly have updated, yes. It's a side project i'm working on so I don't fear to break things... I would try to keep all dependencies the most up to date possible.
Running ganache in verbose mode
ganache -v --logging.debug
and sending a transaction (see below) ends up in aConnection timeout
error but there is no information about what's wrong.The transaction values are correct because I can send it successfully via another provider (e.g. tested successfully through Alchemy and Metamask).
The POST is as follow:
Ganache receives the transaction as I can see it in my terminal but then it timeout after 30001 milliseconds without explanations.![image](https://user-images.githubusercontent.com/7369593/229311990-ed1b1b37-3d27-40a6-b7c3-19936b5bf591.png)
Any help will be much appreciated :wave: