mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 21:51:06 +00:00
add NodeFeatures field to HostConfiguration and runtime API (#2177)
Adds a `NodeFeatures` bitfield value to the runtime `HostConfiguration`, with the purpose of coordinating the enabling of node-side features, such as: https://github.com/paritytech/polkadot-sdk/issues/628 and https://github.com/paritytech/polkadot-sdk/issues/598. These are features that require all validators enable them at the same time, assuming all/most nodes have upgraded their node versions. This PR doesn't add any feature yet. These are coming in future PRs. Also adds a runtime API for querying the state of the client features and an extrinsic for setting/unsetting a feature by its index in the bitfield. Note: originally part of: https://github.com/paritytech/polkadot-sdk/pull/1644, but posted as standalone to be reused by other PRs until the initial PR is merged
This commit is contained in:
@@ -24,6 +24,7 @@ use polkadot_overseer::RuntimeApiSubsystemClient;
|
||||
use polkadot_primitives::{
|
||||
async_backing::{AsyncBackingParams, BackingState},
|
||||
slashing,
|
||||
vstaging::NodeFeatures,
|
||||
};
|
||||
use sc_authority_discovery::{AuthorityDiscovery, Error as AuthorityDiscoveryError};
|
||||
use sp_api::{ApiError, RuntimeApiInfo};
|
||||
@@ -364,6 +365,10 @@ impl RuntimeApiSubsystemClient for BlockChainRpcClient {
|
||||
) -> Result<Option<BackingState>, ApiError> {
|
||||
Ok(self.rpc_client.parachain_host_para_backing_state(at, para_id).await?)
|
||||
}
|
||||
|
||||
async fn node_features(&self, at: Hash) -> Result<NodeFeatures, ApiError> {
|
||||
Ok(self.rpc_client.parachain_host_node_features(at).await?)
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
|
||||
@@ -31,7 +31,9 @@ use parity_scale_codec::{Decode, Encode};
|
||||
use cumulus_primitives_core::{
|
||||
relay_chain::{
|
||||
async_backing::{AsyncBackingParams, BackingState},
|
||||
slashing, BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash,
|
||||
slashing,
|
||||
vstaging::NodeFeatures,
|
||||
BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash,
|
||||
CommittedCandidateReceipt, CoreState, DisputeState, ExecutorParams, GroupRotationInfo,
|
||||
Hash as RelayHash, Header as RelayHeader, InboundHrmpMessage, OccupiedCoreAssumption,
|
||||
PvfCheckStatement, ScrapedOnChainVotes, SessionIndex, SessionInfo, ValidationCode,
|
||||
@@ -597,6 +599,14 @@ impl RelayChainRpcClient {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn parachain_host_node_features(
|
||||
&self,
|
||||
at: RelayHash,
|
||||
) -> Result<NodeFeatures, RelayChainError> {
|
||||
self.call_remote_runtime_function("ParachainHost_node_features", at, None::<()>)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn parachain_host_disabled_validators(
|
||||
&self,
|
||||
at: RelayHash,
|
||||
|
||||
Reference in New Issue
Block a user