Make eth_getHeaderByHash API work for missing blocks with snap synced node #180

Closed
opened 2022-07-19 14:36:02 +00:00 by prathamesh0 · 0 comments
prathamesh0 commented 2022-07-19 14:36:02 +00:00 (Migrated from github.com)

In the current eth_getHeaderByHash API implementation, if the header is not present in the database, a writeStateDiffFor call is made to statediffing geth.

But when the geth node is snap synced, the writeStateDiffFor call fails for blocks below the sync height. As a result, the rpcMarshalHeader method is unable to get total difficulty from the database.

In the current `eth_getHeaderByHash` API [implementation](https://github.com/vulcanize/ipld-eth-server/blob/release-v4.1.1-alpha/pkg/eth/api.go#L114), if the header is not present in the database, a `writeStateDiffFor` call is made to statediffing geth. But when the geth node is snap synced, the `writeStateDiffFor` call fails for blocks below the sync height. As a result, the `rpcMarshalHeader` [method](https://github.com/vulcanize/ipld-eth-server/blob/release-v4.1.1-alpha/pkg/eth/api.go#L135) is unable to get total difficulty from the database.
Sign in to join this conversation.
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#180
No description provided.