rpc: implement header and header_by_hash queries#7270
Conversation
alexanderbez
left a comment
There was a problem hiding this comment.
Changes look reasonable to me. I think there are some unnecessary/redundant comments in the handler implementations.
There was a problem hiding this comment.
its fine to add this but note this isn't required on the Tendermint side. This doesn't provide much benefit since applications like evmos are wrapping the rpc and since the IO is the same for block and header there isn't much saving here.
Wrapping local client on the app side and exposing a header method on the evm rpc would suffice.
Do we think this will be used by others as well?
|
The implementation seems clear, and I think there isn't a real reason not to do this: I think it improves the ergonomics, and it could reduce the amount of data that you end up sending across the wire. While I think we should in general avoid expanding the surface of the RPC, I don't think saying "yes" to this makes it harder to say "no" to other methods in the future. |
|
Yeah. I don't love expanding the RPC, but I agree with @tychoish's analysis. |
cmwaters
left a comment
There was a problem hiding this comment.
As the others have already alluded to, we came to the conclusion in our meeting that these changes to the RPC API make sense. A few changes need to be made before merging. We also need to add an entry to internal/rpc/core/routes.go and light/proxy/routes.go. Lastly we'll need to make an update to the spec but I can go do that once this has merged.
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
(cherry picked from commit 5f57d84) # Conflicts: # CHANGELOG_PENDING.md # rpc/client/mocks/client.go # rpc/client/rpc_test.go
…367) (cherry picked from commit b4396d7)
Introduces
headerandheader_by_hashqueries to the RPC client. This is useful for Evmos JSON-RPC to avoid querying the block endpoint for theeth_headerandeth_header_by_hashJSON-RPC endpoints