[Feature]: Consumer chain validator queries #2161
Labels
scope: provider
Issues related to the provider chain
scope: UI
Addressing UX changes and improvements to user interface
type: feature-request
New feature or request improvement
Summary
With the advent of permissionless ICS it would be useful to have API methods returning data about the consumer chain validators that includes data coming from both the
x/staking
andprovider
modules.Having rich validator data simplifies client-side data fetching and makes interacting with delegation work flows much easier because a single source of on-chain data can be queries.
Problem Definition
At the moment of writing, clients must use the following data flow to obtain a filtered list of all consumer chain validators:
provider
) andvaloper
address used for delegationsopted_in_validators
for a consumer chainID/interchain_security/ccv/provider/opted_in_validators/{chain_id}
valcons
addresses of validators that have opted in to validate the consumer chainconsumer_validators
for a consumer chainID/interchain_security/ccv/provider/consumer_validators/{chain_id}
{valcons,power,consumerKey}
for validators that are required to validate the consumer chain in the current epoch/interchain_security/ccv/provider/consumer_commission_rate/{chain_id}/{provider_address}
valcons
on a particular chainProposed Feature
The flow described above is quite cumbersome to get around and can be reduced to a single query on the
provider
module that would return all the relevant data.Implement a query that returns enriched data for opted-in validators:
/interchain_security/ccv/provider/consumer_validators/{chain_id}
/interchain_security/ccv/provider/consumer_validators_extended/{chain_id}
The endpoint should always return opted-in validators and clearly specify if the opted-in is required to validate the current epoch. This should work for all chains regardless of the
spawnTime
param.Proposed return type (as json)
Possible states:
Opted-in, does not validate epoch
e.g relevant for chains with validator caps -> number of opted-in validators can be larger than the cap; anyone outside the cap is not validating
valset_cap = 20
valset_cap = 20
valset_cap = 20
valset_cap = 20
This should be implemented for both opt-in chains and top-N chains. There should be no distinction between chain types when querying.
Chains that have not reached spawn time
If possible, for chains that have not reached their spawn time and generated the consumer genesis make it so that the validators that would fall inside the
valset_cap
would havevalidates_current_epoch
set tofalse
.Do this because no validator is actually validating because the chain is not running as an ICS chain.
Tasks
The text was updated successfully, but these errors were encountered: