-
Notifications
You must be signed in to change notification settings - Fork 683
Simulating transactions on Ganache v7 fork throws insufficient funds error #2162
Comments
Hi @haseebrabbani, thanks for opening this issue. We're investigating this now. Is there any chance you could send a repo to help us reproduce this? |
@MicaiahReid for sure, here is a repo to reproduce: https://github.com/haseebrabbani/ganache-v7-forking-issue-repro i'm simulating the transaction on a fork over a fixed range of 10 blocks. it seems that the error is thrown on the same blocks everytime. when i initially encountered this issue i was running it on increasing block numbers which made it appear non-deterministic |
@haseebrabbani This is perfect, thank you! We're looking into this now. |
Hi @haseebrabbani, we did some looking into this and think there's a combination of factors contributing to the issue. If you change your const tx = await tetherContract.transfer(
USER2_ADDRESS,
userTetherBalance,
{ maxFeePerGas: 90417983619 }
); all of the transfers work. Whenever you fork from a block, the new "latest" block is used to set the We plan to improve upon this in a number of ways:
@haseebrabbani Let me know if the above fix doesn't work for you and we can investigate further. If it does work, feel free to close this issue! |
Appreciate the explanation! However, since this code will be client-facing I wouldn't want to use this workaround (and possibly link to this issue in a comment to explain why I'm setting |
If you want the revert to ganache-core's gas behavior and you don't care about type 2 transactions (eip-1559) you can set the hardfork option to |
We're closing since it's working as intended. Please subscribe to the linked issues above to track progress. |
hey there, appreciate your work on this amazing tool! when trying to integrate the latest version (ganache 7.0.0) into my previously working code (which used ganache-core 2.13.2) I am seeing some non-deterministic behaviour. Sometimes when simulating a transaction on a fork it will throw an
insufficient funds for intrinsic transaction cost
error. But other times, running the exact same code will work as expected. Here is what I am doing:The text was updated successfully, but these errors were encountered: