Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Bump executor params to API v4 (backport from #6698)
Browse files Browse the repository at this point in the history
  • Loading branch information
s0me0ne-unkn0wn committed Feb 14, 2023
1 parent 83e8fe4 commit 96f7a45
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion node/subsystem-types/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ impl RuntimeApiRequest {
pub const DISPUTES_RUNTIME_REQUIREMENT: u32 = 3;

/// `ExecutorParams`
pub const EXECUTOR_PARAMS_RUNTIME_REQUIREMENT: u32 = 3;
pub const EXECUTOR_PARAMS_RUNTIME_REQUIREMENT: u32 = 4;
}

/// A message to the Runtime API subsystem.
Expand Down
6 changes: 5 additions & 1 deletion node/subsystem-util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,15 @@ pub async fn executor_params_at_relay_parent(
// Failed to communicate with the runtime
Err(Error::Oneshot(err))
},
Ok(Err(_)) => {
Ok(Err(RuntimeApiError::NotSupported { .. })) => {
// Runtime doesn't yet support the api requested, should execute anyway
// with default set of parameters
Ok(ExecutorParams::default())
},
Ok(Err(err)) => {
// Runtime failed to execute the request
Err(Error::RuntimeApi(err))
},
Ok(Ok(None)) => {
// Storage doesn't contain a parameter set for the given session; should
// never happen
Expand Down
2 changes: 1 addition & 1 deletion primitives/src/runtime_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ sp_api::decl_runtime_apis! {
fn disputes() -> Vec<(SessionIndex, CandidateHash, DisputeState<BlockNumber>)>;

/// Returns execution parameters for the session.
#[api_version(3)]
#[api_version(4)]
fn session_executor_params(session_index: SessionIndex) -> Option<vstaging::ExecutorParams>;
}
}
2 changes: 1 addition & 1 deletion runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,7 @@ sp_api::impl_runtime_apis! {
}
}

#[api_version(3)]
#[api_version(4)]
impl primitives::runtime_api::ParachainHost<Block, Hash, BlockNumber> for Runtime {
fn validators() -> Vec<ValidatorId> {
parachains_runtime_api_impl::validators::<Runtime>()
Expand Down
2 changes: 1 addition & 1 deletion runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ sp_api::impl_runtime_apis! {
}
}

#[api_version(3)]
#[api_version(4)]
impl primitives::runtime_api::ParachainHost<Block, Hash, BlockNumber> for Runtime {
fn validators() -> Vec<ValidatorId> {
parachains_runtime_api_impl::validators::<Runtime>()
Expand Down

0 comments on commit 96f7a45

Please sign in to comment.