Add broker pallet to coretime-westend (#3272)

This brings functionality to Westend's Coretime Chain runtime, where
previously it was not much more than a shell.

It is assumed that the Coretime pallet will have the same index in the
Westend runtime as it does in Rococo for the runtime calls.

TODO:
- [x] Generate chainspec
- [x] Regenerate weights
- [x] Check hardcoded RuntimeCall weights against relay weights for
transacts

Aura key generation: https://github.com/paritytech/devops/issues/2725

---------

Co-authored-by: command-bot <>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Anton Vilhelm Ásgeirsson <antonva@users.noreply.github.com>
This commit is contained in:
Dónal Murray
2024-02-16 13:05:15 +00:00
committed by GitHub
parent 34352e82cf
commit 99234440f0
36 changed files with 1997 additions and 1017 deletions
@@ -29,6 +29,8 @@ pub enum CoretimeRuntimeType {
// Benchmarks
RococoDevelopment,
// Live
Westend,
// Local
WestendLocal,
// Benchmarks
@@ -43,6 +45,7 @@ impl FromStr for CoretimeRuntimeType {
rococo::CORETIME_ROCOCO => Ok(CoretimeRuntimeType::Rococo),
rococo::CORETIME_ROCOCO_LOCAL => Ok(CoretimeRuntimeType::RococoLocal),
rococo::CORETIME_ROCOCO_DEVELOPMENT => Ok(CoretimeRuntimeType::RococoDevelopment),
westend::CORETIME_WESTEND => Ok(CoretimeRuntimeType::Westend),
westend::CORETIME_WESTEND_LOCAL => Ok(CoretimeRuntimeType::WestendLocal),
westend::CORETIME_WESTEND_DEVELOPMENT => Ok(CoretimeRuntimeType::WestendDevelopment),
_ => Err(format!("Value '{}' is not configured yet", value)),
@@ -56,6 +59,7 @@ impl From<CoretimeRuntimeType> for &str {
CoretimeRuntimeType::Rococo => rococo::CORETIME_ROCOCO,
CoretimeRuntimeType::RococoLocal => rococo::CORETIME_ROCOCO_LOCAL,
CoretimeRuntimeType::RococoDevelopment => rococo::CORETIME_ROCOCO_DEVELOPMENT,
CoretimeRuntimeType::Westend => westend::CORETIME_WESTEND,
CoretimeRuntimeType::WestendLocal => westend::CORETIME_WESTEND_LOCAL,
CoretimeRuntimeType::WestendDevelopment => westend::CORETIME_WESTEND_DEVELOPMENT,
}
@@ -65,7 +69,7 @@ impl From<CoretimeRuntimeType> for &str {
impl From<CoretimeRuntimeType> for ChainType {
fn from(runtime_type: CoretimeRuntimeType) -> Self {
match runtime_type {
CoretimeRuntimeType::Rococo => ChainType::Live,
CoretimeRuntimeType::Rococo | CoretimeRuntimeType::Westend => ChainType::Live,
CoretimeRuntimeType::RococoLocal | CoretimeRuntimeType::WestendLocal =>
ChainType::Local,
CoretimeRuntimeType::RococoDevelopment | CoretimeRuntimeType::WestendDevelopment =>
@@ -82,12 +86,15 @@ impl CoretimeRuntimeType {
pub fn load_config(&self) -> Result<Box<dyn ChainSpec>, String> {
match self {
CoretimeRuntimeType::Rococo => Ok(Box::new(GenericChainSpec::from_json_bytes(
&include_bytes!("../../../parachains/chain-specs/coretime-rococo.json")[..],
&include_bytes!("../../chain-specs/coretime-rococo.json")[..],
)?)),
CoretimeRuntimeType::RococoLocal =>
Ok(Box::new(rococo::local_config(*self, "rococo-local"))),
CoretimeRuntimeType::RococoDevelopment =>
Ok(Box::new(rococo::local_config(*self, "rococo-dev"))),
CoretimeRuntimeType::Westend => Ok(Box::new(GenericChainSpec::from_json_bytes(
&include_bytes!("../../../parachains/chain-specs/coretime-westend.json")[..],
)?)),
CoretimeRuntimeType::WestendLocal =>
Ok(Box::new(westend::local_config(*self, "westend-local"))),
CoretimeRuntimeType::WestendDevelopment =>
@@ -213,6 +220,7 @@ pub mod westend {
use parachains_common::{AccountId, AuraId, Balance};
use sp_core::sr25519;
pub(crate) const CORETIME_WESTEND: &str = "coretime-westend";
pub(crate) const CORETIME_WESTEND_LOCAL: &str = "coretime-westend-local";
pub(crate) const CORETIME_WESTEND_DEVELOPMENT: &str = "coretime-westend-dev";
const CORETIME_WESTEND_ED: Balance = coretime_westend_runtime::ExistentialDeposit::get();