Replies: 1 comment 6 replies
-
This is false. There is a gRPC header that you can supply that will fetch you the data at any given height (assuming you're querying against an archive node). |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am a developer from Crypto.com blockchain team.
We have an indexing server that pulls block data and block events, parses it and convert it to our customized format, and store to a DB. The indexing server also has RESTful APIs, so users could query the parsed data.
We are targeting to make our indexing server compatible with most CosmosSDK based blockchains.
Problem
There are three requirements we would like to fulfill in our future indexing server
Currently, when users request Validator information, such as how many tokens are delegated to the validator, we are just redirecting the request to the Cosmos RPC to fetch the number (same case in fetching validator’s delegations list). Our indexing server does not have the logic to calculate it.
But now, we are interested to calculate these numbers through our own indexing server. The main reason is the current Cosmos RPC only provides the latest status for validators, but not the history data.
Solution 1: add new events on CosmosSDK
After some study on the CosmosSDK staking and slashing modules, we found it difficult to calculate these numbers relying solely on block data and block events.
As when a slash happens,
UnbindingDelegation
andRedelegation
destination validator’s tokens are also slashed. There is no event emitted to indicate the tokens slashed onUnbondingDelegation
, and no event to indicate the tokens slashed onRedelegation
destination validator.We thought about creating a PR and adding the new events to CosmosSDK. But it won’t help in our case. As the new version of the CosmosSDK will only be included in a new version of our Crypto.org Chain node binary. To sync the previous block, one will still use the old binary, which is using the old version of SDK and no newly added event is emitted.
Solution 2: port the calculation logic to our indexing server
We port the data structures and calculation logic of the following structs on CosmosSDK to our indexing server.
The list of structs includes
Validator
,Delegation
,UnbindingDelegation
andRedelegation
.We would want to give a check with the Cosmos SDK community/team to verify our thought. Do we miss anything? Or will there be any easier approach to fulfill the requirements?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions