Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Error: migrate:ovm - L2 gas limit too low: 0, use at least 100000 #18

Closed
jensendarren opened this issue Sep 13, 2021 · 6 comments
Closed

Comments

@jensendarren
Copy link

Overview

When running the migration to ovm command npm run migrate:ovm --network=optimistic_kovan there is the following error returned: L2 gas limit too low: 0, use at least 100000

Review

I notice in this project README that "to bypass this error, you may need to increase the gas value in the optimistic_kovan network configuration in truffle-config.ovm.js to the value the error indicates. Gas price should be set at the transaction level, like so: { gasPrice: 15000000 }."

I have tried doing this, as well as various combinations thereof, and I've also dug into the reported issue in Truffle here. However, I've so far not been able to deploy the SimpleStorage contract to Kovan Optimism.

Any advice on the settings to use to get around this issue would be appreciated! Many thanks.

@fainashalts
Copy link
Contributor

Hi again @jensendarren. :) Unfortunately I'm aware of this issue and actively working to solve it. You can try to set gas: 0 which will force a gas estimation on the Truffle side, but I believe will result in a block limit error. I'm hoping to have a fix in this week's release and will update this issue when I do!

Does the local docker testnet give you an error as well, or are you able to deploy there to test out your project? I've been working on the Kovan piece but will be checking that part of it as well. Thanks so much for your patience as I figure this issue out!

@jensendarren
Copy link
Author

Hi @fainashalts, Thank you again for your support.

I tried with a gas: 0 setting when deploying to optimistic_kovan but that did not work unfortunately. I'll keep a look out for the fix that you mentioned!

The local Docker testnet works fine, by the way, and I am able to deploy the contract there and interact with it without any issues.

Many thanks!

@jensendarren
Copy link
Author

I notice that Truffle just released version 5.4.11 which I thought might fix this issue. However, after upgrading Truffle to this version, I still experienced the same issue.

After some trial and error, I did manage to get this working and I have deployed the SimpleStore contract to the Optimistic Kovan network.

There were two things I needed to do.

  1. Set gas: 0 in the optimistic_kovan network settings of truffle-config.ovm.js.
  2. Add SimpleStorage.gasMultiplier = 0.9 to the migration file to fix the "exceeded the block limit" error

Perhaps I am mistaken but I had thought the version 5.4.11 release of truffle fixed this issue?

Either way, I hope this solution helps others to deploy onto Optimistic Kovan should they want to!

@fainashalts
Copy link
Contributor

fainashalts commented Sep 20, 2021

HI @jensendarren this is interesting, thank you for bringing it up! The release last week should have ensured that gas estimation occurs, thus obviating the need for gas: 0 in the config. However, the block limit error is still being worked on. Glad you found a temporary workaround! Is there any way you can check whether this works when you remove gas: 0 (but leave step #2 as is)? It does appear to on my end.

I will update the readme for this box to let people know about the gasMultiplier hack. @qbzzt sorry to bother you but I wonder if you know why the gasMultiplier reduction is needed? Does Optimism calculate a different blockLimit somewhere that perhaps we're not properly processing? And will this be different after October's release?

@jensendarren
Copy link
Author

Thank you @fainashalts. So I just tried this out again and I removed both of the modifications that I mentioned previously and I ran the deployment and it works every time. I did not change anything else, and am still using Truffle version 5.4.11. So it would appear that everything is working as expected and no need for the gas or gasMultiplier hacks at all. Many thanks again for your support with this issue!

@its-everdred
Copy link

Closing this since it's a bit stale, glad to hear this issue was resolved!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants