mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 05:51:02 +00:00
Parachain improvements (#1905)
* Parachain improvements - Set the parachains configuration in Rococo genesis - Don't stop the overseer when a subsystem job is stopped - Several small code changes * Remove unused functionality * Return error from the runtime instead of printing it * Apply suggestions from code review Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com> * Update primitives/src/v1.rs Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com> * Update primitives/src/v1.rs Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com> * Fix test * Revert "Update primitives/src/v1.rs" This reverts commit 11fce2785acd1de481ca57815b8e18400f09fd52. * Revert "Update primitives/src/v1.rs" This reverts commit d6439fed4f954360c89fb1e12b73954902c76a41. * Revert "Return error from the runtime instead of printing it" This reverts commit cb4b5c0830ac516a6d54b2c24197e9354f2b98cb. * Revert "Fix test" This reverts commit 0c5fa1b5566d4cd3c55a55d485e707165ce7a59e. * Update runtime/parachains/src/runtime_api_impl/v1.rs Co-authored-by: Sergei Shulepov <sergei@parity.io> Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com> Co-authored-by: Sergei Shulepov <sergei@parity.io>
This commit is contained in:
@@ -7,10 +7,9 @@ edition = "2018"
|
||||
[dependencies]
|
||||
bitvec = { version = "0.17.4", default-features = false, features = ["alloc"] }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false, features = ["derive"] }
|
||||
log = { version = "0.3.9", optional = true }
|
||||
log = "0.4.11"
|
||||
rustc-hex = { version = "2.0.1", default-features = false }
|
||||
serde = { version = "1.0.102", default-features = false }
|
||||
serde_derive = { version = "1.0.102", optional = true }
|
||||
serde = { version = "1.0.102", features = [ "derive" ], optional = true }
|
||||
|
||||
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
@@ -62,10 +61,8 @@ no_std = []
|
||||
std = [
|
||||
"bitvec/std",
|
||||
"codec/std",
|
||||
"log",
|
||||
"rustc-hex/std",
|
||||
"serde_derive",
|
||||
"serde/std",
|
||||
"serde",
|
||||
"primitives/std",
|
||||
"inherents/std",
|
||||
"sp-core/std",
|
||||
|
||||
@@ -29,8 +29,8 @@ use codec::{Encode, Decode};
|
||||
use frame_system::ensure_root;
|
||||
|
||||
/// All configuration of the runtime with respect to parachains and parathreads.
|
||||
#[derive(Clone, Encode, Decode, PartialEq, Default)]
|
||||
#[cfg_attr(test, derive(Debug))]
|
||||
#[derive(Clone, Encode, Decode, PartialEq, Default, sp_core::RuntimeDebug)]
|
||||
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub struct HostConfiguration<BlockNumber> {
|
||||
/// The minimum frequency at which parachains can update their validation code.
|
||||
pub validation_upgrade_frequency: BlockNumber,
|
||||
|
||||
@@ -222,8 +222,21 @@ pub fn check_validation_outputs<T: initializer::Trait>(
|
||||
para_id: ParaId,
|
||||
outputs: primitives::v1::ValidationOutputs,
|
||||
) -> bool {
|
||||
// we strip detailed information from error here for the sake of simplicity of runtime API.
|
||||
<inclusion::Module<T>>::check_validation_outputs(para_id, outputs).is_ok()
|
||||
match <inclusion::Module<T>>::check_validation_outputs(para_id, outputs) {
|
||||
Ok(()) => true,
|
||||
Err(e) => {
|
||||
frame_support::debug::RuntimeLogger::init();
|
||||
let err: &'static str = e.into();
|
||||
log::debug!(
|
||||
target: "candidate_validation",
|
||||
"Validation outputs checking for parachain `{}` failed: {}",
|
||||
u32::from(para_id),
|
||||
err,
|
||||
);
|
||||
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Implementation for the `session_index_for_child` function of the runtime API.
|
||||
|
||||
Reference in New Issue
Block a user