trufflesuite / ganache

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
2.62k stars 676 forks source link

Sending future nonce transaction in eager mode causes Ganache to hang #4165

Closed MicaiahReid closed 1 year ago

MicaiahReid commented 1 year ago

If a transaction is sent with a future nonce while in eager mining mode, Ganache hangs indefinitely and never returns a response for the transaction.

This happens the blockchain's queueTransaction function. A future nonce transaction will return false for isExecutable, yet the code path still leads to awaiting transaction.once("finalized"), which won't happen until the nonce gap is filled.

itsdevcoffee commented 1 year ago

Does this PR resolve #2509 as well?

SvenMeyer commented 1 year ago

Even worse, Metamask hangs as well and never comes back, just showing the spinner ...

RPC Listening on 127.0.0.1:7545
eth_blockNumber
eth_getCode
eth_getTransactionCount
eth_blockNumber
eth_sendRawTransaction
Transaction "0x829eaabd43c7c53d759ea704cfffeaa020535f84c6e31db584e7561937e8888b" has a too-high nonce; this transaction has been added to the pool, and will be processed when its nonce is reached. See https://github.com/trufflesuite/ganache/issues/4165 for more information.
eth_blockNumber
eth_blockNumber
etsraphael commented 11 months ago

Do we finally have a solution for this? I'm still having it.

davidmurdoch commented 11 months ago

It isn't hanging. When future-nonce transactions that are sent to Ganache running in eager mining mode appear to hang indefinitely, rather than being mined or rejected. This is expected behavior in eager mode, as Ganache does not return the hash until after it is mined. To help alleviate the confusion we now log a message about the status of these kinds of transactions.