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: ethBlockByHash endpoint #304

Merged
merged 9 commits into from
Aug 26, 2024
Merged

fix: ethBlockByHash endpoint #304

merged 9 commits into from
Aug 26, 2024

Conversation

avilagaston9
Copy link
Contributor

@avilagaston9 avilagaston9 commented Aug 23, 2024

Motivation

We are currently not matching the expected response from Hive on the eth_getBlockByHash endpoint.

Description

  • Moves BlockSerializable to the RPC module.
  • Renames BlockSerializable to RpcBlock.
  • Creates FullBlockBody which holds RpcTransaction instead of Transaction to match the Hive expected output.
  • Adds logic to calculate TotalDifficulty of blocks.

Observations

#307 was created to remove TotalDifficulty calculation logic added by this PR. This is because this field it is not being used since the merge, but it is still required to pass Hive tests.

Closes #269

@avilagaston9 avilagaston9 requested a review from a team as a code owner August 23, 2024 13:02
@avilagaston9 avilagaston9 marked this pull request as draft August 23, 2024 13:03
@avilagaston9 avilagaston9 changed the title refactor: BlockSerializable to RpcBlock fix: ethBlockByHash endpoint Aug 23, 2024
@@ -430,67 +428,14 @@ fn calc_excess_blob_gas(parent_header: &BlockHeader) -> u64 {
}
}

#[allow(unused)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great refactor!

@avilagaston9 avilagaston9 marked this pull request as ready for review August 26, 2024 16:07
Copy link
Contributor

@fmoletta fmoletta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@fmoletta fmoletta added this pull request to the merge queue Aug 26, 2024
Merged via the queue into main with commit 60a89f0 Aug 26, 2024
6 checks passed
@fmoletta fmoletta deleted the get-block-by-hash branch August 26, 2024 17:07
mpaulucci pushed a commit to mpaulucci/lambda_ethereum_rust that referenced this pull request Oct 16, 2024
**Motivation**

We are currently not matching the expected response from Hive on the
`eth_getBlockByHash` endpoint.

**Description**

- Moves `BlockSerializable` to the RPC module.
- Renames `BlockSerializable` to `RpcBlock`.
- Creates `FullBlockBody` which holds `RpcTransaction` instead of
`Transaction` to match the Hive expected output.
- Adds logic to calculate `TotalDifficulty` of blocks.

**Observations**

lambdaclass#307 was created to remove `TotalDifficulty` calculation logic added by
this PR. This is because this field it is not being used since the
merge, but it is still required to pass Hive tests.

Closes lambdaclass#269
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.

Hive Testing: eth_getBlockByHash
3 participants