Giter Club home page Giter Club logo

Comments (3)

bitcoinwarrior1 avatar bitcoinwarrior1 commented on August 19, 2024

The failed tx:
https://etherscan.io/tx/0x7d9860f50f3a0ebc32f3fb72d693da74472adb1723583d2edac698c791a2a4bf

The estimated gas:
imagen

@colourful-land your rejected transaction was for withdrawal and I get a higher gas limit set when I click on the withdraw prompt, are you referencing the wrong screenshot?

from cofix-web-user-interface-v2.0.

foxgem avatar foxgem commented on August 19, 2024

Currently, gas limit calculation is done the following way:

gasLmit = contract.estimateGas * 1.2

  • contract.estimateGas is a web3 method which will estimate gas needed for execution.
  • if this estimation could not be gotten, 700000 will be used. Then gas limit = 700000 * 1.2 = 840000.

Also, this value is dynamic not a fixed value. Sometimes, the gas estimation returned may not be enough for method execution, that's why 1.2 times of it here.

I will keep my eyes on this issue, but I don't think it is very often and it should be rare.

To fix this, this simplest way is to use a bigger value than 1.2, such as 1.5.

from cofix-web-user-interface-v2.0.

foxgem avatar foxgem commented on August 19, 2024

When developing v1.1.0 , I met a similar issue. After digging code, I find there is no gas estimation for staking. Most of time, this is ok, but sometime staking will fail because of "out of gas".

So, I add gas estimation for staking (and other methods without gas estimation) and give it 200000 as a default value if the estimated value < 200000. Setting a default value is because I found some smart contract methods might fail because of "out of gas" sometime. All these failure is because the gas spent is greater than gas estimation (80000 ~ 100000+) but less than 200000.

This change will have no impact on existing gas estimation, because current estimation is always bigger than 200000.

This fix is included in v1.1.0 branch.

from cofix-web-user-interface-v2.0.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.