-
Couldn't load subscription status.
- Fork 2.7k
Expose GRANDPA round state through RPC #4921
Description
We should be able to inspect the current GRANDPA round state externally, this is particularly useful in situations where finality is stalled (e.g. due to some voters being offline).
I propose we add an RPC method grandpa_roundState that returns something like:
{
"setId": 361,
"round": 1283,
"total_weight": 100,
"thresholdWeight": 67,
"prevotes": {
"currentWeight": 79,
"missing": [
// list of addresses of authorities missing votes
]
},
"precommits": {
"currentWeight": 12,
"missing": [
// list of addresses of authorities missing votes
]
}
}
Currently this data is not exposed by the finality-grandpa crate, there's paritytech/finality-grandpa#55 which should be tackled as part of this issue as well.
Regarding the addresses of validators that are missing votes it is a bit tricky. Ideally we'd like to expose the addresses of the stash account since these represent the main "identity" of a validator. But the client GRANDPA code only deals with session keys and it isn't trivial to fetch the associated stash keys.
cc @rphmeier