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

ETH.getBlockByHash goes into infinite loop if block not found #716

Closed
acolytec3 opened this issue Jan 22, 2025 · 0 comments · Fixed by #717
Closed

ETH.getBlockByHash goes into infinite loop if block not found #716

acolytec3 opened this issue Jan 22, 2025 · 0 comments · Fixed by #717

Comments

@acolytec3
Copy link
Collaborator

In the course of working on #710, I discovered that our client.ETH.getBlockByHash implementation can go into an infinite loop if we manage to index a blockhash <> block number mapping but where the block isn't stored correctly in the DB. At the moment, this appears to mainly be an issue when the node doesn't have any external peer connections.

The issue occurs in this code branch. We don't find the block by the hash, but we do have a mapping of the block hash to block number so we try looking it up by number. If we don't find it by number, but do have the number to hash mapping, we then try to look it up by hash again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant