primitives: Move out of staging released APIs (#3925)

Runtime release 1.2 includes bumping of the ParachainHost APIs up to
v10, so let's move all the released APIs out of vstaging folder, this PR
does not include any logic changes only renaming of the modules and some
moving around.

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
This commit is contained in:
Alexandru Gheorghe
2024-04-01 16:03:26 +03:00
committed by GitHub
parent e6bd920543
commit d6f68bb906
46 changed files with 240 additions and 279 deletions
@@ -26,9 +26,7 @@ use polkadot_core_primitives::{Block, BlockNumber, Hash, Header};
use polkadot_overseer::{ChainApiBackend, RuntimeApiSubsystemClient};
use polkadot_primitives::{
async_backing::{AsyncBackingParams, BackingState},
slashing,
vstaging::{ApprovalVotingParams, NodeFeatures},
CoreIndex,
slashing, ApprovalVotingParams, CoreIndex, NodeFeatures,
};
use sc_authority_discovery::{AuthorityDiscovery, Error as AuthorityDiscoveryError};
use sc_client_api::AuxStore;
@@ -32,13 +32,12 @@ use parity_scale_codec::{Decode, Encode};
use cumulus_primitives_core::{
relay_chain::{
async_backing::{AsyncBackingParams, BackingState},
slashing,
vstaging::{ApprovalVotingParams, NodeFeatures},
BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash,
CommittedCandidateReceipt, CoreIndex, CoreState, DisputeState, ExecutorParams,
GroupRotationInfo, Hash as RelayHash, Header as RelayHeader, InboundHrmpMessage,
OccupiedCoreAssumption, PvfCheckStatement, ScrapedOnChainVotes, SessionIndex, SessionInfo,
ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex, ValidatorSignature,
slashing, ApprovalVotingParams, BlockNumber, CandidateCommitments, CandidateEvent,
CandidateHash, CommittedCandidateReceipt, CoreIndex, CoreState, DisputeState,
ExecutorParams, GroupRotationInfo, Hash as RelayHash, Header as RelayHeader,
InboundHrmpMessage, NodeFeatures, OccupiedCoreAssumption, PvfCheckStatement,
ScrapedOnChainVotes, SessionIndex, SessionInfo, ValidationCode, ValidationCodeHash,
ValidatorId, ValidatorIndex, ValidatorSignature,
},
InboundDownwardMessage, ParaId, PersistedValidationData,
};
@@ -45,8 +45,8 @@ use polkadot_node_subsystem::{
};
use polkadot_node_subsystem_util::{determine_new_blocks, runtime::RuntimeInfo};
use polkadot_primitives::{
vstaging::node_features, BlockNumber, CandidateEvent, CandidateHash, CandidateReceipt,
ConsensusLog, CoreIndex, GroupIndex, Hash, Header, SessionIndex,
node_features, BlockNumber, CandidateEvent, CandidateHash, CandidateReceipt, ConsensusLog,
CoreIndex, GroupIndex, Hash, Header, SessionIndex,
};
use sc_keystore::LocalKeystore;
use sp_consensus_slots::Slot;
@@ -619,8 +619,8 @@ pub(crate) mod tests {
use polkadot_node_subsystem_test_helpers::make_subsystem_context;
use polkadot_node_subsystem_util::database::Database;
use polkadot_primitives::{
vstaging::{node_features::FeatureIndex, NodeFeatures},
ExecutorParams, Id as ParaId, IndexedVec, SessionInfo, ValidatorId, ValidatorIndex,
node_features::FeatureIndex, ExecutorParams, Id as ParaId, IndexedVec, NodeFeatures,
SessionInfo, ValidatorId, ValidatorIndex,
};
pub(crate) use sp_consensus_babe::{
digests::{CompatibleDigestItem, PreDigest, SecondaryVRFPreDigest},
@@ -54,10 +54,10 @@ use polkadot_node_subsystem_util::{
TimeoutExt,
};
use polkadot_primitives::{
vstaging::{ApprovalVoteMultipleCandidates, ApprovalVotingParams},
BlockNumber, CandidateHash, CandidateIndex, CandidateReceipt, CoreIndex, DisputeStatement,
ExecutorParams, GroupIndex, Hash, PvfExecKind, SessionIndex, SessionInfo,
ValidDisputeStatementKind, ValidatorId, ValidatorIndex, ValidatorPair, ValidatorSignature,
ApprovalVoteMultipleCandidates, ApprovalVotingParams, BlockNumber, CandidateHash,
CandidateIndex, CandidateReceipt, CoreIndex, DisputeStatement, ExecutorParams, GroupIndex,
Hash, PvfExecKind, SessionIndex, SessionInfo, ValidDisputeStatementKind, ValidatorId,
ValidatorIndex, ValidatorPair, ValidatorSignature,
};
use sc_keystore::LocalKeystore;
use sp_application_crypto::Pair;
@@ -37,8 +37,8 @@ use polkadot_node_subsystem_test_helpers as test_helpers;
use polkadot_node_subsystem_util::TimeoutExt;
use polkadot_overseer::HeadSupportsParachains;
use polkadot_primitives::{
vstaging::NodeFeatures, ApprovalVote, CandidateCommitments, CandidateEvent, CoreIndex,
GroupIndex, Header, Id as ParaId, IndexedVec, ValidationCode, ValidatorSignature,
ApprovalVote, CandidateCommitments, CandidateEvent, CoreIndex, GroupIndex, Header,
Id as ParaId, IndexedVec, NodeFeatures, ValidationCode, ValidatorSignature,
};
use std::time::Duration;
+5 -6
View File
@@ -105,12 +105,11 @@ use polkadot_node_subsystem_util::{
Validator,
};
use polkadot_primitives::{
vstaging::{node_features::FeatureIndex, NodeFeatures},
BackedCandidate, CandidateCommitments, CandidateHash, CandidateReceipt,
CommittedCandidateReceipt, CoreIndex, CoreState, ExecutorParams, GroupIndex, GroupRotationInfo,
Hash, Id as ParaId, IndexedVec, PersistedValidationData, PvfExecKind, SessionIndex,
SigningContext, ValidationCode, ValidatorId, ValidatorIndex, ValidatorSignature,
ValidityAttestation,
node_features::FeatureIndex, BackedCandidate, CandidateCommitments, CandidateHash,
CandidateReceipt, CommittedCandidateReceipt, CoreIndex, CoreState, ExecutorParams, GroupIndex,
GroupRotationInfo, Hash, Id as ParaId, IndexedVec, NodeFeatures, PersistedValidationData,
PvfExecKind, SessionIndex, SigningContext, ValidationCode, ValidatorId, ValidatorIndex,
ValidatorSignature, ValidityAttestation,
};
use sp_keystore::KeystorePtr;
use statement_table::{
+2 -2
View File
@@ -33,8 +33,8 @@ use polkadot_node_subsystem::{
};
use polkadot_node_subsystem_test_helpers as test_helpers;
use polkadot_primitives::{
vstaging::node_features, CandidateDescriptor, GroupRotationInfo, HeadData,
PersistedValidationData, PvfExecKind, ScheduledCore, SessionIndex, LEGACY_MIN_BACKING_VOTES,
node_features, CandidateDescriptor, GroupRotationInfo, HeadData, PersistedValidationData,
PvfExecKind, ScheduledCore, SessionIndex, LEGACY_MIN_BACKING_VOTES,
};
use rstest::rstest;
use sp_application_crypto::AppCrypto;
@@ -61,9 +61,9 @@ use polkadot_node_subsystem_test_helpers::{
make_buffered_subsystem_context, mock::new_leaf, TestSubsystemContextHandle,
};
use polkadot_primitives::{
vstaging::NodeFeatures, ApprovalVote, BlockNumber, CandidateCommitments, CandidateEvent,
CandidateHash, CandidateReceipt, CoreIndex, DisputeStatement, ExecutorParams, GroupIndex, Hash,
HeadData, Header, IndexedVec, MultiDisputeStatementSet, ScrapedOnChainVotes, SessionIndex,
ApprovalVote, BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash,
CandidateReceipt, CoreIndex, DisputeStatement, ExecutorParams, GroupIndex, Hash, HeadData,
Header, IndexedVec, MultiDisputeStatementSet, NodeFeatures, ScrapedOnChainVotes, SessionIndex,
SessionInfo, SigningContext, ValidDisputeStatementKind, ValidatorId, ValidatorIndex,
ValidatorSignature,
};
+3 -3
View File
@@ -42,9 +42,9 @@ use polkadot_node_subsystem_util::{
TimeoutExt,
};
use polkadot_primitives::{
vstaging::{node_features::FeatureIndex, NodeFeatures},
BackedCandidate, BlockNumber, CandidateHash, CandidateReceipt, CoreIndex, CoreState, Hash,
Id as ParaId, OccupiedCoreAssumption, SessionIndex, SignedAvailabilityBitfield, ValidatorIndex,
node_features::FeatureIndex, BackedCandidate, BlockNumber, CandidateHash, CandidateReceipt,
CoreIndex, CoreState, Hash, Id as ParaId, NodeFeatures, OccupiedCoreAssumption, SessionIndex,
SignedAvailabilityBitfield, ValidatorIndex,
};
use std::collections::{BTreeMap, HashMap};
+10 -15
View File
@@ -20,14 +20,12 @@ use schnellru::{ByLength, LruMap};
use sp_consensus_babe::Epoch;
use polkadot_primitives::{
async_backing, slashing,
vstaging::{self, ApprovalVotingParams},
AuthorityDiscoveryId, BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash,
CommittedCandidateReceipt, CoreIndex, CoreState, DisputeState, ExecutorParams,
GroupRotationInfo, Hash, Id as ParaId, InboundDownwardMessage, InboundHrmpMessage,
OccupiedCoreAssumption, PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes,
SessionIndex, SessionInfo, ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex,
ValidatorSignature,
async_backing, slashing, ApprovalVotingParams, AuthorityDiscoveryId, BlockNumber,
CandidateCommitments, CandidateEvent, CandidateHash, CommittedCandidateReceipt, CoreIndex,
CoreState, DisputeState, ExecutorParams, GroupRotationInfo, Hash, Id as ParaId,
InboundDownwardMessage, InboundHrmpMessage, NodeFeatures, OccupiedCoreAssumption,
PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes, SessionIndex, SessionInfo,
ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex, ValidatorSignature,
};
/// For consistency we have the same capacity for all caches. We use 128 as we'll only need that
@@ -69,7 +67,7 @@ pub(crate) struct RequestResultCache {
disabled_validators: LruMap<Hash, Vec<ValidatorIndex>>,
para_backing_state: LruMap<(Hash, ParaId), Option<async_backing::BackingState>>,
async_backing_params: LruMap<Hash, async_backing::AsyncBackingParams>,
node_features: LruMap<SessionIndex, vstaging::NodeFeatures>,
node_features: LruMap<SessionIndex, NodeFeatures>,
approval_voting_params: LruMap<SessionIndex, ApprovalVotingParams>,
claim_queue: LruMap<Hash, BTreeMap<CoreIndex, VecDeque<ParaId>>>,
}
@@ -454,17 +452,14 @@ impl RequestResultCache {
self.minimum_backing_votes.insert(session_index, minimum_backing_votes);
}
pub(crate) fn node_features(
&mut self,
session_index: SessionIndex,
) -> Option<&vstaging::NodeFeatures> {
pub(crate) fn node_features(&mut self, session_index: SessionIndex) -> Option<&NodeFeatures> {
self.node_features.get(&session_index).map(|f| &*f)
}
pub(crate) fn cache_node_features(
&mut self,
session_index: SessionIndex,
features: vstaging::NodeFeatures,
features: NodeFeatures,
) {
self.node_features.insert(session_index, features);
}
@@ -594,6 +589,6 @@ pub(crate) enum RequestResult {
DisabledValidators(Hash, Vec<ValidatorIndex>),
ParaBackingState(Hash, ParaId, Option<async_backing::BackingState>),
AsyncBackingParams(Hash, async_backing::AsyncBackingParams),
NodeFeatures(SessionIndex, vstaging::NodeFeatures),
NodeFeatures(SessionIndex, NodeFeatures),
ClaimQueue(Hash, BTreeMap<CoreIndex, VecDeque<ParaId>>),
}
+6 -8
View File
@@ -20,14 +20,12 @@ use polkadot_node_primitives::{BabeAllowedSlots, BabeEpoch, BabeEpochConfigurati
use polkadot_node_subsystem::SpawnGlue;
use polkadot_node_subsystem_test_helpers::make_subsystem_context;
use polkadot_primitives::{
async_backing, slashing,
vstaging::{ApprovalVotingParams, NodeFeatures},
AuthorityDiscoveryId, BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash,
CommittedCandidateReceipt, CoreIndex, CoreState, DisputeState, ExecutorParams,
GroupRotationInfo, Id as ParaId, InboundDownwardMessage, InboundHrmpMessage,
OccupiedCoreAssumption, PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes,
SessionIndex, SessionInfo, Slot, ValidationCode, ValidationCodeHash, ValidatorId,
ValidatorIndex, ValidatorSignature,
async_backing, slashing, ApprovalVotingParams, AuthorityDiscoveryId, BlockNumber,
CandidateCommitments, CandidateEvent, CandidateHash, CommittedCandidateReceipt, CoreIndex,
CoreState, DisputeState, ExecutorParams, GroupRotationInfo, Id as ParaId,
InboundDownwardMessage, InboundHrmpMessage, NodeFeatures, OccupiedCoreAssumption,
PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes, SessionIndex, SessionInfo,
Slot, ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex, ValidatorSignature,
};
use sp_api::ApiError;
use sp_core::testing::TaskExecutor;
@@ -147,9 +147,7 @@ mod tests {
AllMessages, AvailabilityDistributionMessage, RuntimeApiMessage, RuntimeApiRequest,
};
use polkadot_node_subsystem_test_helpers as test_helpers;
use polkadot_primitives::{
vstaging::NodeFeatures, CandidateHash, ExecutorParams, Hash, ValidatorIndex,
};
use polkadot_primitives::{CandidateHash, ExecutorParams, Hash, NodeFeatures, ValidatorIndex};
use test_helpers::mock::make_ferdie_keystore;
use super::*;
@@ -25,7 +25,7 @@ use polkadot_node_primitives::{BlockData, ErasureChunk, PoV};
use polkadot_node_subsystem_test_helpers::mock::new_leaf;
use polkadot_node_subsystem_util::runtime::RuntimeInfo;
use polkadot_primitives::{
vstaging::NodeFeatures, BlockNumber, CoreState, ExecutorParams, GroupIndex, Hash, Id as ParaId,
BlockNumber, CoreState, ExecutorParams, GroupIndex, Hash, Id as ParaId, NodeFeatures,
ScheduledCore, SessionIndex, SessionInfo,
};
use sp_core::traits::SpawnNamed;
@@ -47,8 +47,8 @@ use polkadot_node_subsystem::{
};
use polkadot_node_subsystem_test_helpers as test_helpers;
use polkadot_primitives::{
vstaging::NodeFeatures, CandidateHash, CoreState, ExecutorParams, GroupIndex, Hash,
Id as ParaId, ScheduledCore, SessionInfo, ValidatorIndex,
CandidateHash, CoreState, ExecutorParams, GroupIndex, Hash, Id as ParaId, NodeFeatures,
ScheduledCore, SessionInfo, ValidatorIndex,
};
use test_helpers::mock::{make_ferdie_keystore, new_leaf};
@@ -45,9 +45,8 @@ use polkadot_node_subsystem::{
use polkadot_node_subsystem_test_helpers as test_helpers;
use polkadot_node_subsystem_util::{reputation::add_reputation, TimeoutExt};
use polkadot_primitives::{
vstaging::NodeFeatures, AuthorityDiscoveryId, CollatorPair, ExecutorParams, GroupIndex,
GroupRotationInfo, IndexedVec, ScheduledCore, SessionIndex, SessionInfo, ValidatorId,
ValidatorIndex,
AuthorityDiscoveryId, CollatorPair, ExecutorParams, GroupIndex, GroupRotationInfo, IndexedVec,
NodeFeatures, ScheduledCore, SessionIndex, SessionInfo, ValidatorId, ValidatorIndex,
};
use polkadot_primitives_test_helpers::TestCandidateBuilder;
use test_helpers::mock::new_leaf;
@@ -57,8 +57,8 @@ use polkadot_node_subsystem_test_helpers::{
subsystem_test_harness, TestSubsystemContextHandle,
};
use polkadot_primitives::{
vstaging::NodeFeatures, AuthorityDiscoveryId, CandidateHash, CandidateReceipt, ExecutorParams,
Hash, SessionIndex, SessionInfo,
AuthorityDiscoveryId, CandidateHash, CandidateReceipt, ExecutorParams, Hash, NodeFeatures,
SessionIndex, SessionInfo,
};
use self::mock::{
@@ -43,7 +43,7 @@ use polkadot_node_subsystem::{
};
use polkadot_node_subsystem_test_helpers::mock::{make_ferdie_keystore, new_leaf};
use polkadot_primitives::{
vstaging::NodeFeatures, ExecutorParams, GroupIndex, Hash, HeadData, Id as ParaId, IndexedVec,
ExecutorParams, GroupIndex, Hash, HeadData, Id as ParaId, IndexedVec, NodeFeatures,
SessionInfo, ValidationCode,
};
use polkadot_primitives_test_helpers::{
@@ -292,7 +292,7 @@ impl GroupStatements {
mod tests {
use super::*;
use polkadot_primitives::v6::{Hash, SigningContext, ValidatorPair};
use polkadot_primitives::v7::{Hash, SigningContext, ValidatorPair};
use sp_application_crypto::Pair as PairT;
#[test]
+2 -2
View File
@@ -123,8 +123,8 @@ fn default_parachains_host_configuration(
) -> polkadot_runtime_parachains::configuration::HostConfiguration<polkadot_primitives::BlockNumber>
{
use polkadot_primitives::{
vstaging::{node_features::FeatureIndex, ApprovalVotingParams},
AsyncBackingParams, MAX_CODE_SIZE, MAX_POV_SIZE,
node_features::FeatureIndex, ApprovalVotingParams, AsyncBackingParams, MAX_CODE_SIZE,
MAX_POV_SIZE,
};
polkadot_runtime_parachains::configuration::HostConfiguration {
@@ -41,8 +41,8 @@ use polkadot_node_primitives::approval::{
v2::{CoreBitfield, IndirectAssignmentCertV2, IndirectSignedApprovalVoteV2},
};
use polkadot_primitives::{
vstaging::ApprovalVoteMultipleCandidates, CandidateEvent, CandidateHash, CandidateIndex,
CoreIndex, Hash, SessionInfo, Slot, ValidatorId, ValidatorIndex, ASSIGNMENT_KEY_TYPE_ID,
ApprovalVoteMultipleCandidates, CandidateEvent, CandidateHash, CandidateIndex, CoreIndex, Hash,
SessionInfo, Slot, ValidatorId, ValidatorIndex, ASSIGNMENT_KEY_TYPE_ID,
};
use rand::{seq::SliceRandom, RngCore, SeedableRng};
use rand_chacha::ChaCha20Rng;
@@ -26,7 +26,7 @@ use polkadot_node_subsystem::{
};
use polkadot_node_subsystem_types::OverseerSignal;
use polkadot_primitives::{
vstaging::NodeFeatures, CandidateEvent, CandidateReceipt, CoreState, GroupIndex, IndexedVec,
CandidateEvent, CandidateReceipt, CoreState, GroupIndex, IndexedVec, NodeFeatures,
OccupiedCore, SessionIndex, SessionInfo, ValidatorIndex,
};
use sp_consensus_babe::Epoch as BabeEpoch;
+8 -10
View File
@@ -42,16 +42,14 @@ use polkadot_node_primitives::{
ValidationResult,
};
use polkadot_primitives::{
async_backing, slashing,
vstaging::{ApprovalVotingParams, NodeFeatures},
AuthorityDiscoveryId, BackedCandidate, BlockNumber, CandidateEvent, CandidateHash,
CandidateIndex, CandidateReceipt, CollatorId, CommittedCandidateReceipt, CoreIndex, CoreState,
DisputeState, ExecutorParams, GroupIndex, GroupRotationInfo, Hash, HeadData,
Header as BlockHeader, Id as ParaId, InboundDownwardMessage, InboundHrmpMessage,
MultiDisputeStatementSet, OccupiedCoreAssumption, PersistedValidationData, PvfCheckStatement,
PvfExecKind, SessionIndex, SessionInfo, SignedAvailabilityBitfield,
SignedAvailabilityBitfields, ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex,
ValidatorSignature,
async_backing, slashing, ApprovalVotingParams, AuthorityDiscoveryId, BackedCandidate,
BlockNumber, CandidateEvent, CandidateHash, CandidateIndex, CandidateReceipt, CollatorId,
CommittedCandidateReceipt, CoreIndex, CoreState, DisputeState, ExecutorParams, GroupIndex,
GroupRotationInfo, Hash, HeadData, Header as BlockHeader, Id as ParaId, InboundDownwardMessage,
InboundHrmpMessage, MultiDisputeStatementSet, NodeFeatures, OccupiedCoreAssumption,
PersistedValidationData, PvfCheckStatement, PvfExecKind, SessionIndex, SessionInfo,
SignedAvailabilityBitfield, SignedAvailabilityBitfields, ValidationCode, ValidationCodeHash,
ValidatorId, ValidatorIndex, ValidatorSignature,
};
use polkadot_statement_table::v2::Misbehavior;
use std::{
@@ -16,16 +16,12 @@
use async_trait::async_trait;
use polkadot_primitives::{
async_backing,
runtime_api::ParachainHost,
slashing,
vstaging::{self, ApprovalVotingParams},
Block, BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash,
CommittedCandidateReceipt, CoreIndex, CoreState, DisputeState, ExecutorParams,
GroupRotationInfo, Hash, Header, Id, InboundDownwardMessage, InboundHrmpMessage,
OccupiedCoreAssumption, PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes,
SessionIndex, SessionInfo, ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex,
ValidatorSignature,
async_backing, runtime_api::ParachainHost, slashing, ApprovalVotingParams, Block, BlockNumber,
CandidateCommitments, CandidateEvent, CandidateHash, CommittedCandidateReceipt, CoreIndex,
CoreState, DisputeState, ExecutorParams, GroupRotationInfo, Hash, Header, Id,
InboundDownwardMessage, InboundHrmpMessage, NodeFeatures, OccupiedCoreAssumption,
PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes, SessionIndex, SessionInfo,
ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex, ValidatorSignature,
};
use sc_client_api::{AuxStore, HeaderBackend};
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
@@ -324,7 +320,7 @@ pub trait RuntimeApiSubsystemClient {
// === v9 ===
/// Get the node features.
async fn node_features(&self, at: Hash) -> Result<vstaging::NodeFeatures, ApiError>;
async fn node_features(&self, at: Hash) -> Result<NodeFeatures, ApiError>;
// == v10: Approval voting params ==
/// Approval voting configuration parameters
@@ -586,7 +582,7 @@ where
self.client.runtime_api().async_backing_params(at)
}
async fn node_features(&self, at: Hash) -> Result<vstaging::NodeFeatures, ApiError> {
async fn node_features(&self, at: Hash) -> Result<NodeFeatures, ApiError> {
self.client.runtime_api().node_features(at)
}
@@ -30,12 +30,11 @@ use polkadot_node_subsystem::{
};
use polkadot_node_subsystem_types::UnpinHandle;
use polkadot_primitives::{
slashing,
vstaging::{node_features::FeatureIndex, NodeFeatures},
AsyncBackingParams, CandidateEvent, CandidateHash, CoreState, EncodeAs, ExecutorParams,
GroupIndex, GroupRotationInfo, Hash, IndexedVec, OccupiedCore, ScrapedOnChainVotes,
SessionIndex, SessionInfo, Signed, SigningContext, UncheckedSigned, ValidationCode,
ValidationCodeHash, ValidatorId, ValidatorIndex, LEGACY_MIN_BACKING_VOTES,
node_features::FeatureIndex, slashing, AsyncBackingParams, CandidateEvent, CandidateHash,
CoreState, EncodeAs, ExecutorParams, GroupIndex, GroupRotationInfo, Hash, IndexedVec,
NodeFeatures, OccupiedCore, ScrapedOnChainVotes, SessionIndex, SessionInfo, Signed,
SigningContext, UncheckedSigned, ValidationCode, ValidationCodeHash, ValidatorId,
ValidatorIndex, LEGACY_MIN_BACKING_VOTES,
};
use crate::{
+19 -18
View File
@@ -20,7 +20,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
// `v6` is currently the latest stable version of the runtime API.
pub mod v6;
pub mod v7;
// The 'staging' version is special - it contains primitives which are
// still in development. Once they are considered stable, they will be
@@ -33,26 +33,27 @@ pub mod runtime_api;
// Current primitives not requiring versioning are exported here.
// Primitives requiring versioning must not be exported and must be referred by an exact version.
pub use v6::{
pub use v7::{
async_backing, byzantine_threshold, check_candidate_backing, collator_signature_payload,
effective_minimum_backing_votes, executor_params, metric_definitions, slashing,
effective_minimum_backing_votes, executor_params, metric_definitions, node_features, slashing,
supermajority_threshold, well_known_keys, AbridgedHostConfiguration, AbridgedHrmpChannel,
AccountId, AccountIndex, AccountPublic, ApprovalVote, AssignmentId, AsyncBackingParams,
AuthorityDiscoveryId, AvailabilityBitfield, BackedCandidate, Balance, BlakeTwo256, Block,
BlockId, BlockNumber, CandidateCommitments, CandidateDescriptor, CandidateEvent, CandidateHash,
CandidateIndex, CandidateReceipt, CheckedDisputeStatementSet, CheckedMultiDisputeStatementSet,
CollatorId, CollatorSignature, CommittedCandidateReceipt, CompactStatement, ConsensusLog,
CoreIndex, CoreState, DisputeState, DisputeStatement, DisputeStatementSet, DownwardMessage,
EncodeAs, ExecutorParam, ExecutorParamError, ExecutorParams, ExecutorParamsHash,
AccountId, AccountIndex, AccountPublic, ApprovalVote, ApprovalVoteMultipleCandidates,
ApprovalVotingParams, AssignmentId, AsyncBackingParams, AuthorityDiscoveryId,
AvailabilityBitfield, BackedCandidate, Balance, BlakeTwo256, Block, BlockId, BlockNumber,
CandidateCommitments, CandidateDescriptor, CandidateEvent, CandidateHash, CandidateIndex,
CandidateReceipt, CheckedDisputeStatementSet, CheckedMultiDisputeStatementSet, CollatorId,
CollatorSignature, CommittedCandidateReceipt, CompactStatement, ConsensusLog, CoreIndex,
CoreState, DisputeState, DisputeStatement, DisputeStatementSet, DownwardMessage, EncodeAs,
ExecutorParam, ExecutorParamError, ExecutorParams, ExecutorParamsHash,
ExplicitDisputeStatement, GroupIndex, GroupRotationInfo, Hash, HashT, HeadData, Header,
HorizontalMessages, HrmpChannelId, Id, InboundDownwardMessage, InboundHrmpMessage, IndexedVec,
InherentData, InvalidDisputeStatementKind, Moment, MultiDisputeStatementSet, Nonce,
OccupiedCore, OccupiedCoreAssumption, OutboundHrmpMessage, ParathreadClaim, ParathreadEntry,
PersistedValidationData, PvfCheckStatement, PvfExecKind, PvfPrepKind, RuntimeMetricLabel,
RuntimeMetricLabelValue, RuntimeMetricLabelValues, RuntimeMetricLabels, RuntimeMetricOp,
RuntimeMetricUpdate, ScheduledCore, ScrapedOnChainVotes, SessionIndex, SessionInfo, Signature,
Signed, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SignedStatement,
SigningContext, Slot, UncheckedSigned, UncheckedSignedAvailabilityBitfield,
InherentData, InvalidDisputeStatementKind, Moment, MultiDisputeStatementSet, NodeFeatures,
Nonce, OccupiedCore, OccupiedCoreAssumption, OutboundHrmpMessage, ParathreadClaim,
ParathreadEntry, PersistedValidationData, PvfCheckStatement, PvfExecKind, PvfPrepKind,
RuntimeMetricLabel, RuntimeMetricLabelValue, RuntimeMetricLabelValues, RuntimeMetricLabels,
RuntimeMetricOp, RuntimeMetricUpdate, ScheduledCore, ScrapedOnChainVotes, SessionIndex,
SessionInfo, Signature, Signed, SignedAvailabilityBitfield, SignedAvailabilityBitfields,
SignedStatement, SigningContext, Slot, UncheckedSigned, UncheckedSignedAvailabilityBitfield,
UncheckedSignedAvailabilityBitfields, UncheckedSignedStatement, UpgradeGoAhead,
UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode,
ValidationCodeHash, ValidatorId, ValidatorIndex, ValidatorSignature, ValidityAttestation,
@@ -63,4 +64,4 @@ pub use v6::{
};
#[cfg(feature = "std")]
pub use v6::{AssignmentPair, CollatorPair, ValidatorPair};
pub use v7::{AssignmentPair, CollatorPair, ValidatorPair};
+6 -8
View File
@@ -114,13 +114,11 @@
//! separated from the stable primitives.
use crate::{
async_backing, slashing,
vstaging::{self, ApprovalVotingParams},
AsyncBackingParams, BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash,
CommittedCandidateReceipt, CoreIndex, CoreState, DisputeState, ExecutorParams,
GroupRotationInfo, Hash, OccupiedCoreAssumption, PersistedValidationData, PvfCheckStatement,
ScrapedOnChainVotes, SessionIndex, SessionInfo, ValidatorId, ValidatorIndex,
ValidatorSignature,
async_backing, slashing, ApprovalVotingParams, AsyncBackingParams, BlockNumber,
CandidateCommitments, CandidateEvent, CandidateHash, CommittedCandidateReceipt, CoreIndex,
CoreState, DisputeState, ExecutorParams, GroupRotationInfo, Hash, NodeFeatures,
OccupiedCoreAssumption, PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes,
SessionIndex, SessionInfo, ValidatorId, ValidatorIndex, ValidatorSignature,
};
use polkadot_core_primitives as pcp;
@@ -279,7 +277,7 @@ sp_api::decl_runtime_apis! {
/// Get node features.
/// This is a staging method! Do not use on production runtimes!
#[api_version(9)]
fn node_features() -> vstaging::NodeFeatures;
fn node_features() -> NodeFeatures;
/***** Added in v10 *****/
/// Approval voting configuration parameters
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! `V6` Primitives.
//! `V7` Primitives.
use bitvec::{field::BitField, slice::BitSlice, vec::BitVec};
use parity_scale_codec::{Decode, Encode};
@@ -1184,6 +1184,32 @@ impl<'a> ApprovalVoteMultipleCandidates<'a> {
}
}
/// Approval voting configuration parameters
#[derive(
RuntimeDebug,
Copy,
Clone,
PartialEq,
Encode,
Decode,
TypeInfo,
serde::Serialize,
serde::Deserialize,
)]
pub struct ApprovalVotingParams {
/// The maximum number of candidates `approval-voting` can vote for with
/// a single signatures.
///
/// Setting it to 1, means we send the approval as soon as we have it available.
pub max_approval_coalesce_count: u32,
}
impl Default for ApprovalVotingParams {
fn default() -> Self {
Self { max_approval_coalesce_count: 1 }
}
}
/// Custom validity errors used in Polkadot while validating transactions.
#[repr(u8)]
pub enum ValidityError {
@@ -1947,6 +1973,29 @@ pub enum PvfExecKind {
Approval,
}
/// Bit indices in the `HostConfiguration.node_features` that correspond to different node features.
pub type NodeFeatures = BitVec<u8, bitvec::order::Lsb0>;
/// Module containing feature-specific bit indices into the `NodeFeatures` bitvec.
pub mod node_features {
/// A feature index used to identify a bit into the node_features array stored
/// in the HostConfiguration.
#[repr(u8)]
pub enum FeatureIndex {
/// Tells if tranch0 assignments could be sent in a single certificate.
/// Reserved for: `<https://github.com/paritytech/polkadot-sdk/issues/628>`
EnableAssignmentsV2 = 0,
/// This feature enables the extension of `BackedCandidate::validator_indices` by 8 bits.
/// The value stored there represents the assumed core index where the candidates
/// are backed. This is needed for the elastic scaling MVP.
ElasticScalingMVP = 1,
/// First unassigned feature bit.
/// Every time a new feature flag is assigned it should take this value.
/// and this should be incremented.
FirstUnassigned = 2,
}
}
#[cfg(test)]
mod tests {
use super::*;
+1 -52
View File
@@ -17,7 +17,7 @@
//! Staging Primitives.
// Put any primitives used by staging APIs functions here
pub use crate::v6::*;
use crate::v7::*;
use sp_std::prelude::*;
use parity_scale_codec::{Decode, Encode};
@@ -25,32 +25,6 @@ use primitives::RuntimeDebug;
use scale_info::TypeInfo;
use sp_arithmetic::Perbill;
/// Approval voting configuration parameters
#[derive(
RuntimeDebug,
Copy,
Clone,
PartialEq,
Encode,
Decode,
TypeInfo,
serde::Serialize,
serde::Deserialize,
)]
pub struct ApprovalVotingParams {
/// The maximum number of candidates `approval-voting` can vote for with
/// a single signatures.
///
/// Setting it to 1, means we send the approval as soon as we have it available.
pub max_approval_coalesce_count: u32,
}
impl Default for ApprovalVotingParams {
fn default() -> Self {
Self { max_approval_coalesce_count: 1 }
}
}
/// Scheduler configuration parameters. All coretime/ondemand parameters are here.
#[derive(
RuntimeDebug,
@@ -125,28 +99,3 @@ impl<BlockNumber: Default + From<u32>> Default for SchedulerParams<BlockNumber>
}
}
}
use bitvec::vec::BitVec;
/// Bit indices in the `HostConfiguration.node_features` that correspond to different node features.
pub type NodeFeatures = BitVec<u8, bitvec::order::Lsb0>;
/// Module containing feature-specific bit indices into the `NodeFeatures` bitvec.
pub mod node_features {
/// A feature index used to identify a bit into the node_features array stored
/// in the HostConfiguration.
#[repr(u8)]
pub enum FeatureIndex {
/// Tells if tranch0 assignments could be sent in a single certificate.
/// Reserved for: `<https://github.com/paritytech/polkadot-sdk/issues/628>`
EnableAssignmentsV2 = 0,
/// This feature enables the extension of `BackedCandidate::validator_indices` by 8 bits.
/// The value stored there represents the assumed core index where the candidates
/// are backed. This is needed for the elastic scaling MVP.
ElasticScalingMVP = 1,
/// First unassigned feature bit.
/// Every time a new feature flag is assigned it should take this value.
/// and this should be incremented.
FirstUnassigned = 2,
}
}
+7 -7
View File
@@ -25,13 +25,13 @@ use bitvec::{order::Lsb0 as BitOrderLsb0, vec::BitVec};
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;
use primitives::{
collator_signature_payload, vstaging::node_features::FeatureIndex, AvailabilityBitfield,
BackedCandidate, CandidateCommitments, CandidateDescriptor, CandidateHash, CollatorId,
CollatorSignature, CommittedCandidateReceipt, CompactStatement, CoreIndex, DisputeStatement,
DisputeStatementSet, GroupIndex, HeadData, Id as ParaId, IndexedVec,
InherentData as ParachainsInherentData, InvalidDisputeStatementKind, PersistedValidationData,
SessionIndex, SigningContext, UncheckedSigned, ValidDisputeStatementKind, ValidationCode,
ValidatorId, ValidatorIndex, ValidityAttestation,
collator_signature_payload, node_features::FeatureIndex, AvailabilityBitfield, BackedCandidate,
CandidateCommitments, CandidateDescriptor, CandidateHash, CollatorId, CollatorSignature,
CommittedCandidateReceipt, CompactStatement, CoreIndex, DisputeStatement, DisputeStatementSet,
GroupIndex, HeadData, Id as ParaId, IndexedVec, InherentData as ParachainsInherentData,
InvalidDisputeStatementKind, PersistedValidationData, SessionIndex, SigningContext,
UncheckedSigned, ValidDisputeStatementKind, ValidationCode, ValidatorId, ValidatorIndex,
ValidityAttestation,
};
use sp_core::{sr25519, H256};
use sp_runtime::{
@@ -26,10 +26,9 @@ use polkadot_parachain_primitives::primitives::{
MAX_HORIZONTAL_MESSAGE_NUM, MAX_UPWARD_MESSAGE_NUM,
};
use primitives::{
vstaging::{ApprovalVotingParams, NodeFeatures},
AsyncBackingParams, Balance, ExecutorParamError, ExecutorParams, SessionIndex,
LEGACY_MIN_BACKING_VOTES, MAX_CODE_SIZE, MAX_HEAD_DATA_SIZE, MAX_POV_SIZE,
ON_DEMAND_MAX_QUEUE_MAX_SIZE,
ApprovalVotingParams, AsyncBackingParams, Balance, ExecutorParamError, ExecutorParams,
NodeFeatures, SessionIndex, LEGACY_MIN_BACKING_VOTES, MAX_CODE_SIZE, MAX_HEAD_DATA_SIZE,
MAX_POV_SIZE, ON_DEMAND_MAX_QUEUE_MAX_SIZE,
};
use sp_runtime::{traits::Zero, Perbill};
use sp_std::prelude::*;
@@ -20,7 +20,7 @@ use crate::configuration::{Config, Pallet};
use frame_support::{pallet_prelude::*, traits::Defensive, weights::Weight};
use frame_system::pallet_prelude::BlockNumberFor;
use primitives::{
vstaging::NodeFeatures, AsyncBackingParams, Balance, ExecutorParams, SessionIndex,
AsyncBackingParams, Balance, ExecutorParams, NodeFeatures, SessionIndex,
LEGACY_MIN_BACKING_VOTES, ON_DEMAND_DEFAULT_QUEUE_MAX_SIZE,
};
use sp_runtime::Perbill;
@@ -22,14 +22,13 @@ use frame_support::{
};
use frame_system::pallet_prelude::BlockNumberFor;
use primitives::{
vstaging::ApprovalVotingParams, AsyncBackingParams, ExecutorParams, SessionIndex,
ApprovalVotingParams, AsyncBackingParams, ExecutorParams, NodeFeatures, SessionIndex,
LEGACY_MIN_BACKING_VOTES, ON_DEMAND_DEFAULT_QUEUE_MAX_SIZE,
};
use sp_std::vec::Vec;
use frame_support::traits::OnRuntimeUpgrade;
use polkadot_core_primitives::Balance;
use primitives::vstaging::NodeFeatures;
use sp_arithmetic::Perbill;
use super::v10::V10HostConfiguration;
+5 -5
View File
@@ -25,11 +25,11 @@ use frame_system::pallet_prelude::*;
use parity_scale_codec::{Decode, Encode};
use polkadot_runtime_metrics::get_current_time;
use primitives::{
byzantine_threshold, supermajority_threshold, vstaging::ApprovalVoteMultipleCandidates,
ApprovalVote, CandidateHash, CheckedDisputeStatementSet, CheckedMultiDisputeStatementSet,
CompactStatement, ConsensusLog, DisputeState, DisputeStatement, DisputeStatementSet,
ExplicitDisputeStatement, InvalidDisputeStatementKind, MultiDisputeStatementSet, SessionIndex,
SigningContext, ValidDisputeStatementKind, ValidatorId, ValidatorIndex, ValidatorSignature,
byzantine_threshold, supermajority_threshold, ApprovalVote, ApprovalVoteMultipleCandidates,
CandidateHash, CheckedDisputeStatementSet, CheckedMultiDisputeStatementSet, CompactStatement,
ConsensusLog, DisputeState, DisputeStatement, DisputeStatementSet, ExplicitDisputeStatement,
InvalidDisputeStatementKind, MultiDisputeStatementSet, SessionIndex, SigningContext,
ValidDisputeStatementKind, ValidatorId, ValidatorIndex, ValidatorSignature,
};
use scale_info::TypeInfo;
use sp_runtime::{
@@ -20,7 +20,7 @@ use frame_benchmarking::{benchmarks, impl_benchmark_test_suite};
use frame_system::RawOrigin;
use sp_std::{cmp::min, collections::btree_map::BTreeMap};
use primitives::v6::GroupIndex;
use primitives::v7::GroupIndex;
use crate::builder::BenchBuilder;
@@ -43,9 +43,9 @@ use frame_support::{
use frame_system::pallet_prelude::*;
use pallet_babe::{self, ParentBlockRandomness};
use primitives::{
effective_minimum_backing_votes, vstaging::node_features::FeatureIndex, BackedCandidate,
CandidateHash, CandidateReceipt, CheckedDisputeStatementSet, CheckedMultiDisputeStatementSet,
CoreIndex, DisputeStatementSet, HeadData, InherentData as ParachainsInherentData,
effective_minimum_backing_votes, node_features::FeatureIndex, BackedCandidate, CandidateHash,
CandidateReceipt, CheckedDisputeStatementSet, CheckedMultiDisputeStatementSet, CoreIndex,
DisputeStatementSet, HeadData, InherentData as ParachainsInherentData,
MultiDisputeStatementSet, ScrapedOnChainVotes, SessionIndex, SignedAvailabilityBitfields,
SigningContext, UncheckedSignedAvailabilityBitfield, UncheckedSignedAvailabilityBitfields,
ValidatorId, ValidatorIndex, ValidityAttestation, PARACHAINS_INHERENT_IDENTIFIER,
@@ -26,5 +26,5 @@
//! 2. Move methods from `vstaging` to `v3`. The new stable version should include all methods from
//! `vstaging` tagged with the new version number (e.g. all `v3` methods).
pub mod v7;
pub mod v10;
pub mod vstaging;
@@ -14,7 +14,7 @@
//! A module exporting runtime API implementation functions for all runtime APIs using `v5`
//! primitives.
//!
//! Runtimes implementing the v2 runtime API are recommended to forward directly to these
//! Runtimes implementing the v10 runtime API are recommended to forward directly to these
//! functions.
use crate::{
@@ -29,11 +29,12 @@ use primitives::{
AsyncBackingParams, BackingState, CandidatePendingAvailability, Constraints,
InboundHrmpLimitations, OutboundHrmpChannelLimitations,
},
slashing, AuthorityDiscoveryId, CandidateEvent, CandidateHash, CommittedCandidateReceipt,
CoreIndex, CoreState, DisputeState, ExecutorParams, GroupIndex, GroupRotationInfo, Hash,
Id as ParaId, InboundDownwardMessage, InboundHrmpMessage, OccupiedCore, OccupiedCoreAssumption,
PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes, SessionIndex, SessionInfo,
ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex, ValidatorSignature,
slashing, ApprovalVotingParams, AuthorityDiscoveryId, CandidateEvent, CandidateHash,
CommittedCandidateReceipt, CoreIndex, CoreState, DisputeState, ExecutorParams, GroupIndex,
GroupRotationInfo, Hash, Id as ParaId, InboundDownwardMessage, InboundHrmpMessage,
NodeFeatures, OccupiedCore, OccupiedCoreAssumption, PersistedValidationData, PvfCheckStatement,
ScrapedOnChainVotes, SessionIndex, SessionInfo, ValidationCode, ValidationCodeHash,
ValidatorId, ValidatorIndex, ValidatorSignature,
};
use sp_runtime::traits::One;
use sp_std::{collections::btree_map::BTreeMap, prelude::*};
@@ -517,3 +518,24 @@ pub fn backing_state<T: initializer::Config>(
pub fn async_backing_params<T: configuration::Config>() -> AsyncBackingParams {
<configuration::Pallet<T>>::config().async_backing_params
}
/// Implementation for `DisabledValidators`
// CAVEAT: this should only be called on the node side
// as it might produce incorrect results on session boundaries
pub fn disabled_validators<T>() -> Vec<ValidatorIndex>
where
T: shared::Config,
{
<shared::Pallet<T>>::disabled_validators()
}
/// Returns the current state of the node features.
pub fn node_features<T: initializer::Config>() -> NodeFeatures {
<configuration::Pallet<T>>::config().node_features
}
/// Approval voting subsystem configuration parameters
pub fn approval_voting_params<T: initializer::Config>() -> ApprovalVotingParams {
let config = <configuration::Pallet<T>>::config();
config.approval_voting_params
}
@@ -16,36 +16,9 @@
//! Put implementations of functions from staging APIs here.
use crate::{configuration, initializer, scheduler, shared};
use primitives::{
vstaging::{ApprovalVotingParams, NodeFeatures},
CoreIndex, Id as ParaId, ValidatorIndex,
};
use sp_std::{
collections::{btree_map::BTreeMap, vec_deque::VecDeque},
prelude::Vec,
};
/// Implementation for `DisabledValidators`
// CAVEAT: this should only be called on the node side
// as it might produce incorrect results on session boundaries
pub fn disabled_validators<T>() -> Vec<ValidatorIndex>
where
T: shared::Config,
{
<shared::Pallet<T>>::disabled_validators()
}
/// Returns the current state of the node features.
pub fn node_features<T: initializer::Config>() -> NodeFeatures {
<configuration::Pallet<T>>::config().node_features
}
/// Approval voting subsystem configuration parameters
pub fn approval_voting_params<T: initializer::Config>() -> ApprovalVotingParams {
let config = <configuration::Pallet<T>>::config();
config.approval_voting_params
}
use crate::scheduler;
use primitives::{CoreIndex, Id as ParaId};
use sp_std::collections::{btree_map::BTreeMap, vec_deque::VecDeque};
/// Returns the claimqueue from the scheduler
pub fn claim_queue<T: scheduler::Config>() -> BTreeMap<CoreIndex, VecDeque<ParaId>> {
+10 -13
View File
@@ -23,13 +23,12 @@
use pallet_nis::WithMaximumOf;
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use primitives::{
slashing,
vstaging::{ApprovalVotingParams, NodeFeatures},
AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CandidateHash,
CommittedCandidateReceipt, CoreState, DisputeState, ExecutorParams, GroupRotationInfo, Hash,
Id as ParaId, InboundDownwardMessage, InboundHrmpMessage, Moment, Nonce,
OccupiedCoreAssumption, PersistedValidationData, ScrapedOnChainVotes, SessionInfo, Signature,
ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex, PARACHAIN_KEY_TYPE_ID,
slashing, AccountId, AccountIndex, ApprovalVotingParams, Balance, BlockNumber, CandidateEvent,
CandidateHash, CommittedCandidateReceipt, CoreState, DisputeState, ExecutorParams,
GroupRotationInfo, Hash, Id as ParaId, InboundDownwardMessage, InboundHrmpMessage, Moment,
NodeFeatures, Nonce, OccupiedCoreAssumption, PersistedValidationData, ScrapedOnChainVotes,
SessionInfo, Signature, ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex,
PARACHAIN_KEY_TYPE_ID,
};
use rococo_runtime_constants::system_parachain::BROKER_ID;
use runtime_common::{
@@ -53,9 +52,7 @@ use runtime_parachains::{
inclusion::{AggregateMessageOrigin, UmpQueueId},
initializer as parachains_initializer, origin as parachains_origin, paras as parachains_paras,
paras_inherent as parachains_paras_inherent,
runtime_api_impl::{
v7 as parachains_runtime_api_impl, vstaging as parachains_staging_runtime_api_impl,
},
runtime_api_impl::v10 as parachains_runtime_api_impl,
scheduler as parachains_scheduler, session_info as parachains_session_info,
shared as parachains_shared,
};
@@ -2017,15 +2014,15 @@ sp_api::impl_runtime_apis! {
}
fn approval_voting_params() -> ApprovalVotingParams {
parachains_staging_runtime_api_impl::approval_voting_params::<Runtime>()
parachains_runtime_api_impl::approval_voting_params::<Runtime>()
}
fn disabled_validators() -> Vec<ValidatorIndex> {
parachains_staging_runtime_api_impl::disabled_validators::<Runtime>()
parachains_runtime_api_impl::disabled_validators::<Runtime>()
}
fn node_features() -> NodeFeatures {
parachains_staging_runtime_api_impl::node_features::<Runtime>()
parachains_runtime_api_impl::node_features::<Runtime>()
}
}
+9 -10
View File
@@ -27,11 +27,10 @@ use sp_std::{collections::btree_map::BTreeMap, prelude::*};
use polkadot_runtime_parachains::{
assigner_parachains as parachains_assigner_parachains,
configuration as parachains_configuration, disputes as parachains_disputes,
disputes::slashing as parachains_slashing,
dmp as parachains_dmp, hrmp as parachains_hrmp, inclusion as parachains_inclusion,
initializer as parachains_initializer, origin as parachains_origin, paras as parachains_paras,
paras_inherent as parachains_paras_inherent,
runtime_api_impl::{v7 as runtime_impl, vstaging as staging_runtime_impl},
disputes::slashing as parachains_slashing, dmp as parachains_dmp, hrmp as parachains_hrmp,
inclusion as parachains_inclusion, initializer as parachains_initializer,
origin as parachains_origin, paras as parachains_paras,
paras_inherent as parachains_paras_inherent, runtime_api_impl::v10 as runtime_impl,
scheduler as parachains_scheduler, session_info as parachains_session_info,
shared as parachains_shared,
};
@@ -971,16 +970,16 @@ sp_api::impl_runtime_apis! {
runtime_impl::async_backing_params::<Runtime>()
}
fn approval_voting_params() -> primitives::vstaging::ApprovalVotingParams {
staging_runtime_impl::approval_voting_params::<Runtime>()
fn approval_voting_params() -> primitives::ApprovalVotingParams {
runtime_impl::approval_voting_params::<Runtime>()
}
fn disabled_validators() -> Vec<ValidatorIndex> {
staging_runtime_impl::disabled_validators::<Runtime>()
runtime_impl::disabled_validators::<Runtime>()
}
fn node_features() -> primitives::vstaging::NodeFeatures {
staging_runtime_impl::node_features::<Runtime>()
fn node_features() -> primitives::NodeFeatures {
runtime_impl::node_features::<Runtime>()
}
}
+10 -14
View File
@@ -45,14 +45,12 @@ use pallet_session::historical as session_historical;
use pallet_transaction_payment::{CurrencyAdapter, FeeDetails, RuntimeDispatchInfo};
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use primitives::{
slashing,
vstaging::{ApprovalVotingParams, NodeFeatures},
AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CandidateHash,
CommittedCandidateReceipt, CoreState, DisputeState, ExecutorParams, GroupRotationInfo, Hash,
Id as ParaId, InboundDownwardMessage, InboundHrmpMessage, Moment, Nonce,
OccupiedCoreAssumption, PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes,
SessionInfo, Signature, ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex,
ValidatorSignature, PARACHAIN_KEY_TYPE_ID,
slashing, AccountId, AccountIndex, ApprovalVotingParams, Balance, BlockNumber, CandidateEvent,
CandidateHash, CommittedCandidateReceipt, CoreState, DisputeState, ExecutorParams,
GroupRotationInfo, Hash, Id as ParaId, InboundDownwardMessage, InboundHrmpMessage, Moment,
NodeFeatures, Nonce, OccupiedCoreAssumption, PersistedValidationData, PvfCheckStatement,
ScrapedOnChainVotes, SessionInfo, Signature, ValidationCode, ValidationCodeHash, ValidatorId,
ValidatorIndex, ValidatorSignature, PARACHAIN_KEY_TYPE_ID,
};
use runtime_common::{
assigned_slots, auctions, crowdloan,
@@ -75,9 +73,7 @@ use runtime_parachains::{
inclusion::{AggregateMessageOrigin, UmpQueueId},
initializer as parachains_initializer, origin as parachains_origin, paras as parachains_paras,
paras_inherent as parachains_paras_inherent, reward_points as parachains_reward_points,
runtime_api_impl::{
v7 as parachains_runtime_api_impl, vstaging as parachains_staging_runtime_api_impl,
},
runtime_api_impl::v10 as parachains_runtime_api_impl,
scheduler as parachains_scheduler, session_info as parachains_session_info,
shared as parachains_shared,
};
@@ -2080,15 +2076,15 @@ sp_api::impl_runtime_apis! {
}
fn approval_voting_params() -> ApprovalVotingParams {
parachains_staging_runtime_api_impl::approval_voting_params::<Runtime>()
parachains_runtime_api_impl::approval_voting_params::<Runtime>()
}
fn disabled_validators() -> Vec<ValidatorIndex> {
parachains_staging_runtime_api_impl::disabled_validators::<Runtime>()
parachains_runtime_api_impl::disabled_validators::<Runtime>()
}
fn node_features() -> NodeFeatures {
parachains_staging_runtime_api_impl::node_features::<Runtime>()
parachains_runtime_api_impl::node_features::<Runtime>()
}
}