-
Notifications
You must be signed in to change notification settings - Fork 695
EVM behavior does not match Geth/Parity. #412
Comments
Hi Micah, It seems you tracked this down to an out of gas issue, which I commented on over in #411. As I said over there, our goal isn't to behave identically to geth or parity, but rather to somewhat pedantically implement the JSON RPC spec. That said, since testing the byzantium changes, I've been finding that some cases which used to produce a very helpful The problem is, I think the |
@MicahZoltu I believe this behaviour will get much better once ethereum/solidity#1686 is completed. Closing this for now, as I suspect the Solidity team will provide better messages on revert once that enhancement is ready. |
@benjamincburns This is not an OOG issue as I am working around #411 by setting the gas provided to Strongly recommend re-opening and investigating as I believe this is a consensus issue with TestRPC's EVM. |
I hereby heed your strong recommendation, and offer a sincere thanks for your persistence. Also your repro steps kick ass. Thanks for making it easy. |
Note to self - is #367 related? |
I think i am stuck to the same issue but i am not running out of gas... my code was working fine previews week now i am stuck for 14 hours figuring out how to fix this.... |
Pinging this issue again as it is preventing us from developing against TestRPC and it would be great to be able to do so. Thanks! |
I looked into this issue a little bit, and it appears the first I implemented the fix in trufflesuite/ganache#25 for It's late so I'll continue this tomorrow, but I wanted to report my findings thusfar. Side note: As part of a bounty for Augur, I'm developing a Solidity Debugger runtime and accompanying VS Code extension built around the ganache-core/ethereumjs-vm libraries. Augur's test suite/contracts are the forefront in terms of practical testing. Side-side note: Great work on TestRPC/Ganache-cli/core! It was fairly easy and straight forward to integrate with! |
Hi @seesemichaelj I decided to look into this again today as well, and it seems we're on the same track, though there is already a fix in place which causes
Edit: I misinterpreted what I was seeing and spoke too soon: this just causes things to fail earlier. Edit2: I don't think this is a gas estimation issue, either. If I force the transaction to use the block gas limit it still reverts. |
Yanno, @seesemichaelj I really should've clicked that PR link before replying - I was thinking that you submitted a new one. Had I clicked it, I would've seen that it was already merged! 😊 |
Forget edit 2 in my comment above. If I set an absurdly high block gas limit, and if I change As @seesemichaelj pointed out, As for why Universe.initialize fails, I have a suspicion that it's to do with a couple of things...
Edit: this theory is likely somewhat incorrect, namely because of #367. I've just confirmed that this issue is still present in the EVM. More edit: Per comments on ethereumjs/ethereumjs-monorepo#255, the gas accounting is implemented in the ethereumjs-vm, it's just not reported to the vm itself correctly, so this theory seems plausible. |
Also a heads up as well that there appears to be a race condition around nonce calculation. That is, if I comment out the |
After some more testing (including the fix in trufflesuite/ganache@2421f4a), I've concluded that only Changing Still investigating root cause |
@seesemichaelj thanks so much for taking the time to look into this! I'm sorry to say that I've been juggling too many things to follow this thread as deeply as you have. Given the behavior you describe, my strong suspicion at this point is that the underlying cause is a bug in ethereumjs-vm. There's really very little If you feel like you'd rather pass this off to someone else, it might be worth capturing a minimal test example and submitting it as an issue over there, or even better, as a test in the ethereum/tests project. |
No problem! I've been getting pretty familiar with the I agree with you that this seems to be pointing at an |
Feel free! |
Given the fix you put in at trufflesuite/ganache@2421f4a, the next I noticed one thing that in that transaction, we were receiving a 15,000 gas refund for a SSTORE; from the yellow paper:
It makes sense, but it's a little confusing because you need that gas to run the transaction. I feel that two changes should be proposed to mitigate this issue:
After implementing these, the test passes. Thoughts? |
Ha! I'm reading your chat now in Gitter on |
@seesemichaelj sorry it took me so long to get back to you - I was traveling last week. Writing up the relevant issues/PRs is encouraged, thanks! |
No worries; I've been moving forward! I will go ahead and take charge on this one. Thanks for the help! |
After trufflesuite/ganache@2421f4a, this issue can be closed in favor of trufflesuite/ganache#26 as trufflesuite/ganache#26 is the root cause to the last |
Closing 'cause Mike is on the team now, and Mike knows best :-D |
Expected Behavior
EVM execution behavior to match Geth/Parity.
Current Behavior
Possible Solution
Unfortunately I don' tknow what is causing this, though I do have a repro case.
Steps to Reproduce (for bugs)
git clone git@github.com:AugurProject/augur-core.git
git checkout 69e6e1acc4f99ba3abaf1b0d05a25f50a4821462
npm install
node --inspect-brk=19867 node_modules\mocha\bin\_mocha output/tests-integration/**/*.js --no-timeouts
docker-compose up --build --force-recreate parity-integration-tests geth-integration-tests
Context
It appears the problem is with
source/contracts/libraries/Delegator.sol
which does a bit of fancy footwork. Even when I comment outUniverse.initialize
body so it just returnstrue
, the call still fails which means it must be failing on the delegate call to that function. If I call a non-delegated method on the same contract it behaves as expected and returns the correct result.Your Environment
The text was updated successfully, but these errors were encountered: