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

fix: pick latest fork block safely #2057

Merged
merged 1 commit into from
Jun 22, 2022

Conversation

mattsse
Copy link
Member

@mattsse mattsse commented Jun 21, 2022

Motivation

Ref #2036

depending on the endpoint, eth_getBlockByNumber may still return a pending block for the block number returned by `eth_blockNumber

Solution

if not set, we find the latest block that has a hash field.
we start with "latest" and walk back, but at most 2 blocks, which should be sufficient

@mattsse mattsse added C-anvil Command: anvil T-bug Type: bug labels Jun 21, 2022
@onbjerg onbjerg merged commit 901f12b into foundry-rs:master Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-anvil Command: anvil T-bug Type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants