-
Notifications
You must be signed in to change notification settings - Fork 791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runBlock gives less gasUsed than runTx #64
Comments
Does |
yeah, the live network uses the same number of gas as |
The difference seems to be 32000 which is the cost of CREATE. There might be something off in block vs. tx regarding deploying a contract. Are you calling CREATE from your code? cc @wanderer |
so to recap I bet this is also the creation cost of a precompiled. @axic added an option to active the precompiles @asinyagin can you give that a try? |
@axic I'm not sure. That's Ballot contract from https://ethereum.github.io/browser-solidity/#version=soljson-latest.js compiled with solc 0.3.0 with constructor parameter |
@wanderer it gives the same gasUsed (the wrong one) with the key. Is the code correct? https://github.com/asinyagin/ethereumjs-test/blob/master/app.js#L37 |
I'm also experiencing out of gas errors, I think it may be related to this. Particularly, I'm getting OOG errors on transactions estimated by The bug is documented on the testrpc github here and includes a test case. |
Even better and more specific reproduction steps in this testrpc issue, #96. |
playing out the repro here with some deeper logging trufflesuite/ganache-cli-archive#96 some how 4683971-3 = 4663968 (off by 20000) but only in runBlock and not in estimateGas wat |
@kumavis so its messing up on the |
ah ok |
lel |
turns out my issue was unrelated -- was an issues in testrpc's provider-engine trufflesuite/ganache-cli-archive#96 |
@asinyagin The problem is here https://github.com/asinyagin/ethereumjs-test/blob/master/app.js#L75 There is a cost difference between homestead and pre-homestead to create an account. By default tx's are homestead, but by setting the block number to 0 you force it to run as pre-homestead. I added a check in 475143f that should fix teh problem if you give the VM the option |
@asinyagin please reopen if this if its still an issue |
@wanderer thanks! it works great |
Reverting NYC to 13.2.0
update keccak to v3
Hi,
As I see,
runBlock()
gives wronggasUsed
whilerunTx()
uses correct number of gas. Here's how to reproduce it: https://github.com/asinyagin/ethereumjs-test/blob/master/app.js . The app prints:The text was updated successfully, but these errors were encountered: