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

returns blocks via hashes #8

Closed
wants to merge 5 commits into from
Closed

returns blocks via hashes #8

wants to merge 5 commits into from

Conversation

nbaztec
Copy link

@nbaztec nbaztec commented Sep 1, 2023

What 💻

  • Adds a concept of block hash for the test node. The block hash is computed as a keccak256 of the block_number and the tx_hash.
  • Fixes the behavior of eth_getBlockByHash to now return a block via its hash. Previously the hash was matched with a transaction instead.
  • Allows fetching for historical blocks over network if a fork source has been specified. The block is cached for any subsequent requests.

Why ✋

  • Users of the test node can now expect the correct behavior when they call eth_getBlockByHash.
  • Any missing historical blocks are now fetched and cached if a fork source has been provided. This aligns with the user expectations for this method call.
  • The block specification of the test node is now more consistent with having an appropriate block hash, which is in line with user expectations.

Evidence 📷

Passing unit tests:
image

Notes 📝

Fixes #25

@nbaztec
Copy link
Author

nbaztec commented Dec 11, 2023

merged upstream

@nbaztec nbaztec closed this Dec 11, 2023
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 this pull request may close these issues.

1 participant