Use geth's eth API instead of ethclient on missing blocks for getHeaderByHash #181

Merged
prathamesh0 merged 1 commits from pm-change-getheaderbyhash into sharding 2022-07-20 04:04:44 +00:00
prathamesh0 commented 2022-07-19 15:03:02 +00:00 (Migrated from github.com)

Part of https://github.com/vulcanize/ipld-eth-server/issues/180

  • Use geth's eth API instead of ethclient on missing blocks for getHeaderByHash
    • To maintain compatibility with geth's eth API, GetHeaderByHash() is required to include totalDifficulty in the result
    • ethclient's HeaderByHash method returns just the header object which doesn't have the totalDifficulty
    • Since geth's getHeaderByHash API implementation includes totalDifficulty in the result, it is not required to be fetched separately
Part of https://github.com/vulcanize/ipld-eth-server/issues/180 - Use geth's eth API instead of ethclient on missing blocks for `getHeaderByHash` - To maintain compatibility with geth's eth API, `GetHeaderByHash()` is required to include `totalDifficulty` in the result - ethclient's `HeaderByHash` [method](https://github.com/ethereum/go-ethereum/blob/v1.10.20/ethclient/ethclient.go#L176) returns just the header object which doesn't have the `totalDifficulty` - Since geth's `getHeaderByHash` API [implementation](https://github.com/ethereum/go-ethereum/blob/v1.10.20/internal/ethapi/api.go#L708) includes `totalDifficulty` in the result, it is not required to be fetched separately
ashwinphatak (Migrated from github.com) approved these changes 2022-07-20 04:04:27 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/ipld-eth-server#181
No description provided.