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

The eth_feeHistory called by default when calling eth_sendTransaction returns undefined #3395

Closed
sunchengzhu opened this issue Dec 4, 2022 · 5 comments · Fixed by #3426
Closed
Assignees

Comments

@sunchengzhu
Copy link

sunchengzhu commented Dec 4, 2022

I noticed that when I use hardhat to call eth_sendTransaction, such as contract.deploy, if it is sent to a node that supports eip 1559(local hardhat node or goerli) , it will call eth_feeHistory, but it returns undefined.

The corresponding code logic is in _suggestEip1559FeePriceValues() of gas-providers.ts

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2022

This issue is also being tracked on Linear.

We use Linear to manage our development process, but we keep the conversations on Github.

LINEAR-ID: 454495df-a38f-4d4b-9e0b-0374cc0cedcb

@sunchengzhu sunchengzhu changed the title The eth_feeHistory called by default when calling eth_sendTransaction returns undefine The eth_feeHistory called by default when calling eth_sendTransaction returns undefined Dec 4, 2022
@fvictorio
Copy link
Member

Hi @sunchengzhu, I'm not sure I understand the issue here. Is the Hardhat endpoint returning undefined for an eth_feeHistory call? Or is Hardhat sending an eth_feeHistory to another node, and getting undefined?

@sunchengzhu
Copy link
Author

sunchengzhu commented Dec 6, 2022

Hi @fvictorio,I mean eth_feeHistory in _suggestEip1559FeePriceValues() will return undefined when I send transaction to local hardhat node or goerli node
_suggestEip1559FeePriceValues() is called when using hardhat to send transactions, such as deploying contracts.

It is feasible to send eth_feeHistory to the node directly through the curl command

curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x1", "latest", []] }' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1337,"result":{"oldestBlock":"0x0","baseFeePerGas":["0x3b9aca00","0x342770c0"],"gasUsedRatio":[0]}}

@fvictorio
Copy link
Member

Thanks a lot @sunchengzhu, this helped me find a very subtle bug.

@gitpoap-bot @sunchengzhu deserves a gitpoap

@gitpoap-bot
Copy link

gitpoap-bot bot commented Dec 14, 2022

Congrats, @sunchengzhu ! You've earned a GitPOAP for your contribution!

GitPOAP: 2022 Hardhat Contributor:

GitPOAP: 2022 Hardhat Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants