Coretime Zombienet test (#2867)

This adds a Zombienet test for Coretime.

Requires: https://github.com/paritytech/polkadot-sdk/pull/2862

---------

Co-authored-by: Javier Viola <javier@parity.io>
Co-authored-by: Javier Viola <363911+pepoviola@users.noreply.github.com>
This commit is contained in:
Bastian Köcher
2024-01-08 18:41:02 +00:00
committed by GitHub
parent 1914775bd4
commit 4fdab499c4
11 changed files with 118 additions and 71 deletions
@@ -194,3 +194,5 @@ try-runtime = [
]
experimental = ["pallet-aura/experimental"]
fast-runtime = []
@@ -19,7 +19,15 @@ fn main() {
.with_current_project()
.export_heap_base()
.import_memory()
.build()
.build();
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.set_file_name("fast_runtime_binary.rs")
.enable_feature("fast-runtime")
.import_memory()
.export_heap_base()
.build();
}
#[cfg(not(feature = "std"))]
@@ -17,6 +17,7 @@
use crate::*;
use codec::{Decode, Encode};
use cumulus_pallet_parachain_system::RelaychainDataProvider;
use cumulus_primitives_core::relay_chain;
use frame_support::{
parameter_types,
traits::{
@@ -51,11 +52,16 @@ enum CoretimeProviderCalls {
#[codec(index = 1)]
RequestCoreCount(CoreIndex),
#[codec(index = 2)]
RequestRevenueInfoAt(BlockNumber),
RequestRevenueInfoAt(relay_chain::BlockNumber),
#[codec(index = 3)]
CreditAccount(AccountId, Balance),
#[codec(index = 4)]
AssignCore(CoreIndex, BlockNumber, Vec<(CoreAssignment, PartsOf57600)>, Option<BlockNumber>),
AssignCore(
CoreIndex,
relay_chain::BlockNumber,
Vec<(CoreAssignment, PartsOf57600)>,
Option<relay_chain::BlockNumber>,
),
}
parameter_types! {
@@ -181,7 +187,7 @@ impl CoretimeInterface for CoretimeAllocator {
},
Instruction::Transact {
origin_kind: OriginKind::Native,
require_weight_at_most: Weight::from_parts(1000000000, 200000),
require_weight_at_most: Weight::from_parts(1_000_000_000, 200000),
call: assign_core_call.encode().into(),
},
]);
@@ -215,6 +221,9 @@ impl pallet_broker::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type OnRevenue = CreditToCollatorPot;
#[cfg(feature = "fast-runtime")]
type TimeslicePeriod = ConstU32<10>;
#[cfg(not(feature = "fast-runtime"))]
type TimeslicePeriod = ConstU32<80>;
type MaxLeasedCores = ConstU32<50>;
type MaxReservedCores = ConstU32<10>;
@@ -21,6 +21,14 @@
#[cfg(feature = "std")]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
/// Provides the `WASM_BINARY` build with `fast-runtime` feature enabled.
///
/// This is for example useful for local test chains.
#[cfg(feature = "std")]
pub mod fast_runtime_binary {
include!(concat!(env!("OUT_DIR"), "/fast_runtime_binary.rs"));
}
mod coretime;
mod weights;
pub mod xcm_config;