MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
12.03k stars 4.91k forks source link

No gas limit set when creating a new instance of a contract #3519

Closed ghost closed 6 years ago

ghost commented 6 years ago

MetaMask does not set a gas limit when creating a new instance of a deployed contract.

This used to work without issue until yesterday, when it suddenly started setting the gas limit to 0 instead. Gas price is still set accurately and this issue only appears when creating a new instance of a contract, not when calling a function on a deployed contract.

This caught me off guard since it worked perfectly on Saturday and no changes to my code have been made from Saturday to Sunday, so I have no reason to suspect my code as the culprit at the moment.

Additionally I've tested my code on version 3.10.0 of the extension and everything works perfectly.

I'm using Truffle (Version 4.1.3) and Ganache (Version 1.0.2) as my development environment.

surindergiri commented 6 years ago

I'm also facing the same issue since yesterday. Metamask chrome extension is unable to calculate the gas price and set it to 0 and not allow to deploy contract on ethereum Ropsten test network. MetaMark Version: 4.5.5 Test network: Ropsten Browser: Chrome Chrome Version 65.0.3325.181 (Official Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit)

Kaisle commented 6 years ago

Having the same issue in both Firefox and Chrome. So far I have had to tell the user to set the gas limit manually - not ideal.

jennypollack commented 6 years ago

Can you provide an instance of your contract where you see this issue?

bdresser commented 6 years ago

@nhbrown or anyone else here - would love some reproduction steps to help us dig in!

ghost commented 6 years ago

@bdresser @jennypollack I'll be able to put something together to reproduce the issue this upcoming weekend, earliest this Friday - hope that works for you.

bdresser commented 6 years ago

Looks like this happens with any contract deploy, e.g. through remix.ethereum.org.

The old UI still allows gas customization on contract deploy, so I'd recommend using it to deploy new contracts until we're able to get this in.

joejoker77 commented 6 years ago

I confirm. The problem is present in the new UI. I think it's necessary to leave the possibility to set the gas price manually in the new UI. This is critical in my opinion

danfinlay commented 6 years ago

We're adding those manual controls back to new UI very soon.

Are you also experiencing this issue in old UI, or only new UI?

joejoker77 commented 6 years ago

@danfinlay In the old version, too, the price of gas is always 0 for deploy new contract, but there are controls that could be assigned manually. I use Remix as an IDE and a ropsten network

jennypollack commented 6 years ago

thanks @tmashuang for the repro steps:

1) OldUI, Start Ganache Server 2) Connect Metamask ganache 3) Send Tx with Ether Amount: 1 4) Tx Data : some random string. 5) gas Limit will be set to 0

its a combination of issues with Ganache since there is no current block, and we are estimating a default of 0 gas limit

works fine with remix.ethereum.org

The other issue mentioned in this thread is related to adding the ability to edit the gas limit and gas price in the new ui.

danfinlay commented 6 years ago

On a chain with no blocks, I guess we should just assume some baseline high limit?

jennypollack commented 6 years ago

The no current block thing was a red herring, it's an issue with how we handle failures from estimateGas. Another manifestation of the issue is https://github.com/MetaMask/metamask-extension/issues/2898