You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently expose validator sets through AccessibleState.GetSnowContext().ValidatorState in stateful precompile function. Meaning that we can actually perform a query for subnet validators (and even other subnet validators) and provide this functionality to smart contracts. This could be very handy for governance, delegations, rewards and staking operations.
The text was updated successfully, but these errors were encountered:
//SPDX-License-Identifier: MITpragma solidity^0.8.0;
interfaceIValidatorQuerier {
// Returns the validator ID list of the current subnet and the height at which it was fetched.// The order of the list is lexicographically sorted by validator ID.function getCurrentValidatorList() externalviewreturns (bytes20[] calldatavalidatorList, uint64pChainHeight);
// Returns the validator ID list of the subnet with [subnetID] and the height at [pChainHeight].// The order of the list is lexicographically sorted by validator ID.function getValidatorListAt(
bytes32subnetID,
uint64pChainHeight
) externalviewreturns (bytes20[] calldatavalidatorIDs);
// Returns the stake weight of the validator with [validatorID] in the subnet with [subnetID] at [pChainHeight].function getWeight(bytes32subnetID, bytes20validatorID, uint64pChainHeight) externalviewreturns (uint64weight);
// Returns the BLS public key of the validator with [validatorID] in the subnet with [subnetID] at [pChainHeight].function getBLSPublicKey(
bytes32subnetID,
bytes20validatorID,
uint64pChainHeight
) externalviewreturns (bytescalldatablsPublicKey);
// Returns the subnet ID of the current subnet.function getCurrentSubnetID() externalviewreturns (bytes32subnetID);
// Returns the current height of the P-Chain.function getCurrentPChainHeight() externalviewreturns (uint64pChainHeight);
}
We currently expose validator sets through
AccessibleState.GetSnowContext().ValidatorState
in stateful precompile function. Meaning that we can actually perform a query for subnet validators (and even other subnet validators) and provide this functionality to smart contracts. This could be very handy for governance, delegations, rewards and staking operations.The text was updated successfully, but these errors were encountered: