Skip to content
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

Running out of gas #3

Closed
ethernomad opened this issue Oct 5, 2016 · 10 comments
Closed

Running out of gas #3

ethernomad opened this issue Oct 5, 2016 · 10 comments
Labels

Comments

@ethernomad
Copy link

I'm running out of gas when running tests. Error: Contract deployment error: Error: VM Exception while executing transaction: out of gas

I increased the limit in vmtest.js, but now I get Error: Contract deployment error: tx has a higher gas limit than the block

How can I increase the block gas limit?

@ethernomad
Copy link
Author

Here's the test file: https://github.com/link-blockchain/blobstore/blob/master/blobstore_test.sol

If I add any more test methods I hit the gas limit.

@mhhf
Copy link
Collaborator

mhhf commented Oct 7, 2016

can't reproduce with dapple 0.8.3. Which version are you using?
also can you print out the output of dapple status to help me understand your environment

@ethernomad
Copy link
Author

Running Dapple from latest master:

dapple --version
0.8.3

Here is the output from dapple status:

Chain: develop

fork root: undefined
height: +NaN (dev)

default account:
0x0000000000000000000000000000000000000000

faked accounts:
0x0000000000000000000000000000000000000000

Context:



@ethernomad
Copy link
Author

ethernomad commented Oct 7, 2016

Add one more test method to BlobStoreTest and it will run out of gas:

BlobStoreTest
  Error: VM Exception while executing transaction: out of gas
Failing Tests
  BlobStoreTest: Deployment failure

Summary
  Failed 1 out of 1 tests.

@mhhf
Copy link
Collaborator

mhhf commented Oct 8, 2016

Addressing this issue i've added travis based dapple test to your repo which also can't reproduce the out-of-gas error: acuity-network/mix-item-store#2
see here: https://travis-ci.org/nexusdev/blobstore

Maybe there is something wrong with your environment -- try to remove .dapple folder in your project directory and run the tests again...

@ethernomad
Copy link
Author

Thanks for taking a look at this!

I merged your pull request and made a new branch with an extra test that is enough to trigger the problem: https://github.com/link-blockchain/blobstore/tree/testfail

Can you try it again on that branch?

I updated to latest Dapple and removed .dapple, but it didn't make any difference.

@mhhf
Copy link
Collaborator

mhhf commented Oct 12, 2016

Cannot reproduce on my machine (OS X 10.11.6) but reproduce it on Ubuntu! Can you confirm you work on Linux/Ubuntu as well?
Will debug this down and fix this bug asap.

@ethernomad
Copy link
Author

Cool! Yes I am on latest Ubuntu.

@mhhf
Copy link
Collaborator

mhhf commented Oct 12, 2016

Writeup for future work:
it is not a dapple problem but deep deep down in ethereumjs-vm
the problem is how an os stores buffers
if a buffer is 20 byte long, but is prefixed with 00 an internal optimizer or a serealizer and deserializer cuts of this prefix
the problem was that a contract was deployed with an 00 prefixed address: 0x00b68db15676a4024a0b2cfe93c41c10c2323c44
durch
after some vm steps the address got "optimized" to 0xb68db15676a4024a0b2cfe93c41c10c2323c44
and thus, after code lookup in the merkle-trie no code could be found which leads to an error

TODO: update ethereumjs-vm, if bug persists, find precisely where this happens and discuss possible solutions with ethereumjs guys

@mhhf
Copy link
Collaborator

mhhf commented Nov 8, 2016

Fixed in ethereumjs-vm and included in this project

@mhhf mhhf closed this as completed Nov 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants