-
Notifications
You must be signed in to change notification settings - Fork 695
estimateGas bug - minimal example #96
Comments
explicitly setting a high
|
estimateGas vm trace initially looks healthy |
so to make things weirder: publishing the same contract to morden + estimating gas via geth offers a different number: publish:
produces: http://testnet.etherscan.io/address/0x272c19a069cdfea31e913524501494c26830a3f1 estimating gas of a transfer tx against this MetaCoin contract
gives us a new number what the math?? actually executing the tx |
I've replicated this failing example with the testrpc test suite on this branch. Interestingly, the gas estimation was correct when I used the testrpc internal sample contract, but did occur when using @kumavis's example transaction. |
I'm probably going crazy here, but the ratio of wrongness is approximately the square root of 2. actual / estimated = 48844 / 34524 = 1.4147839184335536 |
@tcoulter Could you please take a look at this, and at least figure out if this is a problem with testrpc or ethereumjs-vm? This has broken the interaction between MetaMask and testrpc, and I was hoping to show that off at our presentation tomorrow. |
@FlySwatter looks like your test "should return the same value from estimateGas as eth_sendTransaction actually uses for another contract" is setup incorrectly it falls through all entry points ( seems like the tx is pointing at a contract with an incompatible abi
|
so for my original setup, the stack traces for estimateGas and processing the tx are 100% the same which means the issue is 100% related to ethereumjs/ethereumjs-monorepo#64 |
continuing the thread on ethereumjs/ethereumjs-monorepo#64 |
despite how many times I wrote 100% up there, it turns out it was unrelated to ethereumjs/ethereumjs-monorepo#64 ! |
fixed in 7.7.3 |
0. initialize
I reccomend
npm i -g jsonogram
for pretty printing json1. publish contract
2. estimate tx gas
-> "0x82b5" 33461
3. send tx and check gas used
-> "0x47e7c4" 4712388
4. compare gas
"0x82b5" 33461 !== "0x47e7c4" 4712388
ZOMG
The text was updated successfully, but these errors were encountered: