Code Monkey home page Code Monkey logo

Comments (4)

klkvr avatar klkvr commented on June 12, 2024

just confirming that you are hitting max fee per gas less than block base fee while calling eth_estimateGas on anvil? or it is happening when sending transactions?

from foundry.

clarkohw avatar clarkohw commented on June 12, 2024

@klkvr It happens when i try to send a transaction. I looked around in the code and found that it is due to some automatic gas config that hardhat is taking care of. the source of the difference is in the eth_feeHistory method. Hardhat uses this to calculate the maxFeePerGas value to set. For the following request, i get different results for different versions
cast rpc eth_feeHistory 0x1 latest

On nightly-2cb875799419c907cc3709e586ece2559e6b340e (working for me):
{"gasUsedRatio":[],"oldestBlock":"0x0","reward":[]}

On the most recent version:
{"baseFeePerGas":["0x3b9aca00","0x1dcd6500"],"gasUsedRatio":[0.0],"oldestBlock":"0x0","reward":[]}

In the most recent version, i think its a little odd that there are two entries returned, when no blocks have been mined on the node, but this seems to be the source of the issue. Not sure if this is intended behavior or not.

it seems to be fixed in the most recent version of hardhat, which I can't upgrade to at the moment, but given that other issues in other places arose around the same time (previously mentioned issues), i'm wondering if its intended.

from foundry.

klkvr avatar klkvr commented on June 12, 2024

Fee history contains items for genesis block and for the next block (pending) which is correct I believe, not sure why exactly such response makes hardhat to produce an invalid transaction

from foundry.

clarkohw avatar clarkohw commented on June 12, 2024

I see thanks for the explanation. That makes sense, but is it a little odd that the next block value: 0x1dcd6500 is 500,000,000 when the node base fee is 1,000,000,000?

from foundry.

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.