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

feat: add last blocktime endpoint #361

Merged
merged 2 commits into from
Sep 19, 2022
Merged

Conversation

dongsam
Copy link
Contributor

@dongsam dongsam commented Sep 17, 2022

Description

Add /mint/v1beta1/last_block_time endpoint to get last_block_time by grpc
The mint module stores last_block_time in blocks for inflation calculation but has not provided endpoints so far. Currently, in order to obtain a specific block time, a call must be made by rpc, but it can be obtained through grpc query by opening the corresponding endpoint.


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Appropriate labels applied
  • Targeted PR against correct branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@dongsam dongsam force-pushed the 360-add-last-blocktime-endpoint branch from b5603d3 to fda8610 Compare September 17, 2022 14:24
@dongsam dongsam marked this pull request as ready for review September 17, 2022 14:59
@hallazzang
Copy link
Contributor

I'm wondering why the last block time should also be exposed through gRPC.

@dongsam
Copy link
Contributor Author

dongsam commented Sep 18, 2022

I'm wondering why the last block time should also be exposed through gRPC.

@hallazzang

As an example, we need to know the block time of every block to calculate the uptime in market maker scoring system, where it is much more efficient to call the only last block time with gRPC than to get the whole block information through tendermint rpc and parse the block time

Copy link
Contributor

@hallazzang hallazzang left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@dongsam dongsam merged commit 5463129 into main Sep 19, 2022
@dongsam dongsam removed the c-sync label Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants