Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

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

Closed
MicaiahReid opened this issue Jan 17, 2023 · 4 comments · Fixed by #4166
Closed

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

MicaiahReid opened this issue Jan 17, 2023 · 4 comments · Fixed by #4166

Comments

@MicaiahReid
Copy link
Contributor

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
Copy link

Does this PR resolve #2509 as well?

@SvenMeyer
Copy link

SvenMeyer commented May 25, 2023

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
Copy link

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

@davidmurdoch
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants