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

Hardhat forking doesn't fork latest block by default #6029

Open
old-mikser opened this issue Dec 9, 2024 · 1 comment
Open

Hardhat forking doesn't fork latest block by default #6029

old-mikser opened this issue Dec 9, 2024 · 1 comment
Labels
status:needs-decision We need to make a decision about this
Milestone

Comments

@old-mikser
Copy link

old-mikser commented Dec 9, 2024

My hardhat version is 2.22.17

I'm trying to run forked state of the blockchain with my local node (I also tried with remote nodes and got same results).
I have very simple setup:

networks: { hardhat: { forking: { url: "http://127.0.0.1:8545", } } }

It forks network around 80-120 blocks behind, which is strange for me. When I'm using block number explicitly (current or 1-2 behind) it works as it should.

I thought that expected behavior of getting fork based on the latest block is just to set URL without blockNumber. Since there is now option like blockNumber: "latest what is the most clean way to achieve it? Or am I doing something wrong?

@fvictorio fvictorio added this to Hardhat Dec 9, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Hardhat Dec 9, 2024
@kanej kanej added status:needs-decision We need to make a decision about this and removed status:triaging labels Jan 20, 2025
@kanej kanej moved this from Backlog to To-do in Hardhat Jan 20, 2025
@kanej kanej added this to the vnext milestone Jan 20, 2025
@kanej
Copy link
Member

kanej commented Jan 20, 2025

Supporting an option like blockNumber: "latest" would be a breaking change to the API.
I am going to add this for consideration in the Hardhat 3 API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:needs-decision We need to make a decision about this
Projects
Status: To-do
Development

No branches or pull requests

3 participants