pvf-precheck: hook up runtime API (#4542)

This commit hooks up the API provided by #4457 to the runtime API
subsystem. In a following PR this API will be consumed by the PVF
pre-checking subsystem.

Co-authored-by: Chris Sosnin <chris125_@live.com>

Co-authored-by: Chris Sosnin <chris125_@live.com>
This commit is contained in:
Sergei Shulepov
2021-12-21 15:15:30 +01:00
committed by GitHub
parent 5a3ee43cda
commit 3cb138d236
12 changed files with 220 additions and 9 deletions
+10 -2
View File
@@ -38,9 +38,9 @@ use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use primitives::v1::{
AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CommittedCandidateReceipt,
CoreState, GroupRotationInfo, Hash, Id, InboundDownwardMessage, InboundHrmpMessage, Moment,
Nonce, OccupiedCoreAssumption, PersistedValidationData, ScrapedOnChainVotes,
Nonce, OccupiedCoreAssumption, PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes,
SessionInfo as SessionInfoData, Signature, ValidationCode, ValidationCodeHash, ValidatorId,
ValidatorIndex,
ValidatorIndex, ValidatorSignature,
};
use runtime_common::{
assigned_slots, auctions, crowdloan, impls::ToAuthor, paras_registrar, paras_sudo_wrapper,
@@ -1372,6 +1372,14 @@ sp_api::impl_runtime_apis! {
fn on_chain_votes() -> Option<ScrapedOnChainVotes<Hash>> {
runtime_api_impl::on_chain_votes::<Runtime>()
}
fn submit_pvf_check_statement(stmt: PvfCheckStatement, signature: ValidatorSignature) {
runtime_api_impl::submit_pvf_check_statement::<Runtime>(stmt, signature)
}
fn pvfs_require_precheck() -> Vec<ValidationCodeHash> {
runtime_api_impl::pvfs_require_precheck::<Runtime>()
}
}
impl fg_primitives::GrandpaApi<Block> for Runtime {