ganache
ganache copied to clipboard
VM exception in cETH mint on compound, only in ganache fork
Fails on ganache fork (with archival infura node), but does not fail when calling to an infura node directly cEthContract.methods.mint().call({from:"0x5f2462bD60724ED34E3a88FE666EF860D299ff95", value: "1000000000000000"}))
Expected Behavior
The code here should return Result {}
, when running with ganache cli command: npx ganache-cli -f https://mainnet.infura.io/v3/XXX.
Current Behavior
The call reverts. When commenting this line, and running without ganache, it returns the expected result.
Context
Initially I encountered this issue while doing tests over truffle, and it seem the reason for failure is a re-entry mutex that is from some reason set to true in ganache fork (while in reality it is false).
I provide here a simpler setup that does not involve truffle test.
Here is an even simpler setup,
where the return value with infura is 32130655324245331613864
, but with ganache fork it again reverts.
Your Environment
- Version used: Ganache CLI v6.12.1 (ganache-core: 2.13.1)
digging further into the issue, it seems there is a performance issue in getEstimateGas with ganache fork. And if i do one voodo operation (an arbitrary contract write), then getEstimateGas works well. I imagine because things get cached, and performance is improved.