Move vstaging to production (#7341)

* Move vstaging to production (and thus past session slashing).

WIP: test-runtime still needs to be fixed.

* Fix test-runtime.

---------

Co-authored-by: eskimor <eskimor@no-such-url.com>
This commit is contained in:
eskimor
2023-06-12 13:15:37 +02:00
committed by GitHub
parent d90173e438
commit 4527f24735
21 changed files with 236 additions and 122 deletions
+4 -4
View File
@@ -123,7 +123,7 @@ use sp_std::{collections::btree_map::BTreeMap, prelude::*};
sp_api::decl_runtime_apis! {
/// The API for querying the state of parachains on-chain.
#[api_version(4)]
#[api_version(5)]
pub trait ParachainHost<H: Encode + Decode = pcp::v2::Hash, N: Encode + Decode = pcp::v2::BlockNumber> {
/// Get the current validators.
fn validators() -> Vec<ValidatorId>;
@@ -220,18 +220,18 @@ sp_api::decl_runtime_apis! {
fn session_executor_params(session_index: SessionIndex) -> Option<ExecutorParams>;
/// Returns a list of validators that lost a past session dispute and need to be slashed.
#[api_version(5)]
/// NOTE: This function is only available since parachain host version 5.
fn unapplied_slashes() -> Vec<(SessionIndex, CandidateHash, vstaging::slashing::PendingSlashes)>;
/// Returns a merkle proof of a validator session key.
#[api_version(5)]
/// NOTE: This function is only available since parachain host version 5.
fn key_ownership_proof(
validator_id: ValidatorId,
) -> Option<vstaging::slashing::OpaqueKeyOwnershipProof>;
/// Submit an unsigned extrinsic to slash validators who lost a dispute about
/// a candidate of a past session.
#[api_version(5)]
/// NOTE: This function is only available since parachain host version 5.
fn submit_report_dispute_lost(
dispute_proof: vstaging::slashing::DisputeProof,
key_ownership_proof: vstaging::slashing::OpaqueKeyOwnershipProof,