-
Notifications
You must be signed in to change notification settings - Fork 170
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: new rpc RawCheckpoints #372
Conversation
4558e01
to
7824663
Compare
a37569c
to
cd3081b
Compare
f3e78bf
to
5874e85
Compare
@@ -24,6 +24,13 @@ service Query { | |||
"/babylon/checkpointing/v1/raw_checkpoint/{epoch_num}"; | |||
} | |||
|
|||
// RawCheckpoints queries a checkpoints at a given epoch number. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no epoch number in the request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, was a typo, fixed now
|
||
var checkpointList []*types.RawCheckpointWithMeta | ||
pageRes, err := query.Paginate(store, req.Pagination, func(key, value []byte) error { | ||
ckptWithMeta, err := types.BytesToCkptWithMeta(k.cdc, value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use unmarshal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BytesToCkptWithMeta
unmarshals, its used in other places in code as well so used the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to MustUnmarshal
as per our offline discussion.
Co-authored-by: Vitalis Salis <VitSalis@gmail.com>
Description
This PR is part of optimizations done to improve babylon-api performance.
The explorer calls
RawCheckpoint
rpc multiple times for each epoch. I have added a new rpcRawCheckpoints
which can ingest a range of epochs using pagination params.Testing
Added fuzz, e2e tests and cli queries.