Open calvinaco opened 3 years ago
Three things to follow up:
For getting delegations list on each validator, I could think of two ways to do this:
Delegation.Shares.Sub
or Delegation.Shares.Add
).Validator
, Delegation
, Redelegation
entries on our own indexing server.One serious problem for adding new events on CosmosSDK is that, even if these events are added to a new version of CosmosSDK, the old blocks won't emit the newly added events.
As the old blocks need to be synced with the old binaries, which are using old version CosmosSDK.
https://github.com/cosmos/cosmos-sdk/discussions/10799
According to the discussion in the above thread. We will need to setup multiple archive nodes that stop at different upgrade height, using different versions of binaries.
So that we could query historical states from this set of nodes.
This has not been tested on crypto.org mainnet yet. (We haven't got the new archive nodes yet)
But Validators
, Validator
and ValidatorDelegations
gRPC endpoints works well on croeseid-4
node. croeseid-4
is at about height 2,000,000. I am able to query historical states with the endpoints at around latest, 1,000,000 and 50,000.
In the next step, we will try to port the logic from CosmosSDK to our repo.
Mainly for the following reasons:
x/upgrade
module), it will be difficult for them to set up multiple archive nodes.This will be a huge task. I plan to introduce a new projection and then let the projection support each message one by one.
The target of the new projection:
Steps:
- [ ] Problem: New validator projection. Handle MsgCreateValidator
.
- [ ] Problem: New validator projection. Handle MsgDelegate
.
- [ ] Problem: New validator projection. Handle MsgUndelegate
.
- [ ] Problem: New validator projection. Handle MsgRedelegate
.
- [ ] Problem: New validator projection. Handle slash
event.
After reading CosmosSDK document and diving into their codebase, I had some findings.
Here are my notes: https://github.com/crypto-com/chain-indexing/wiki/Staking-Notes https://github.com/crypto-com/chain-indexing/wiki/Slashing-Notes