Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Expose GRANDPA round state through RPC #4921

@andresilva

Description

@andresilva

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

Metadata

Metadata

Assignees

Labels

J0-enhancementAn additional feature request.Z2-mediumCan be fixed by a coder with good Rust knowledge but little knowledge of the codebase.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions