Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add broker pallet to coretime-westend #3272

Merged
merged 21 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions cumulus/parachains/chain-specs/coretime-westend.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ sp-version = { path = "../../../../../substrate/primitives/version", default-fea
# Polkadot
pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false }
pallet-xcm-benchmarks = { path = "../../../../../polkadot/xcm/pallet-xcm-benchmarks", default-features = false, optional = true }
polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false }
polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false }
polkadot-runtime-common = { path = "../../../../../polkadot/runtime/common", default-features = false }
rococo-runtime-constants = { path = "../../../../../polkadot/runtime/rococo/constants", default-features = false }
Expand Down Expand Up @@ -115,7 +114,6 @@ std = [
"pallet-xcm/std",
"parachain-info/std",
"parachains-common/std",
"polkadot-core-primitives/std",
"polkadot-parachain-primitives/std",
"polkadot-runtime-common/std",
"rococo-runtime-constants/std",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ use pallet_broker::{CoreAssignment, CoreIndex, CoretimeInterface, PartsOf57600,
use parachains_common::{AccountId, Balance, BlockNumber};
use xcm::latest::prelude::*;

// TODO: check AccountId import
pub struct CreditToCollatorPot;
impl OnUnbalanced<Credit<AccountId, Balances>> for CreditToCollatorPot {
fn on_nonzero_unbalanced(credit: Credit<polkadot_core_primitives::AccountId, Balances>) {
fn on_nonzero_unbalanced(credit: Credit<AccountId, Balances>) {
let staking_pot = CollatorSelection::account_id();
let _ = <Balances as Balanced<_>>::resolve(&staking_pot, credit);
}
Expand Down Expand Up @@ -81,7 +80,7 @@ pub struct CoretimeAllocator;
impl CoretimeInterface for CoretimeAllocator {
type AccountId = AccountId;
type Balance = Balance;
type RealyChainBlockNumberProvider = RelaychainDataProvider<Runtime>;
type RelayChainBlockNumberProvider = RelaychainDataProvider<Runtime>;

fn request_core_count(count: CoreIndex) {
use crate::coretime::CoretimeProviderCalls::RequestCoreCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ impl<Call> XcmWeightInfo<Call> for CoretimeRococoXcmWeight<Call> {
XcmGeneric::<Runtime>::clear_transact_status()
}
fn universal_origin(_: &Junction) -> Weight {
XcmGeneric::<Runtime>::universal_origin()
Weight::MAX
}
fn export_message(_: &NetworkId, _: &Junctions, _: &Xcm<()>) -> Weight {
Weight::MAX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,16 +312,6 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Minimum execution time: 2_082_000 picoseconds.
Weight::from_parts(2_144_000, 0)
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
pub fn universal_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `1489`
// Minimum execution time: 4_275_000 picoseconds.
Weight::from_parts(4_381_000, 1489)
.saturating_add(T::DbWeight::get().reads(1))
}
pub fn set_fees_mode() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
Expand Down
12 changes: 6 additions & 6 deletions cumulus/parachains/runtimes/coretime/coretime-westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ pallet-aura = { path = "../../../../../substrate/frame/aura", default-features =
pallet-authorship = { path = "../../../../../substrate/frame/authorship", default-features = false }
pallet-balances = { path = "../../../../../substrate/frame/balances", default-features = false }
pallet-message-queue = { path = "../../../../../substrate/frame/message-queue", default-features = false }
pallet-broker = { path = "../../../../../substrate/frame/broker", default-features = false }
pallet-multisig = { path = "../../../../../substrate/frame/multisig", default-features = false }
pallet-session = { path = "../../../../../substrate/frame/session", default-features = false }
pallet-sudo = { path = "../../../../../substrate/frame/sudo", default-features = false }
pallet-timestamp = { path = "../../../../../substrate/frame/timestamp", default-features = false }
pallet-transaction-payment = { path = "../../../../../substrate/frame/transaction-payment", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { path = "../../../../../substrate/frame/transaction-payment/rpc/runtime-api", default-features = false }
Expand All @@ -55,7 +55,6 @@ sp-version = { path = "../../../../../substrate/primitives/version", default-fea
# Polkadot
pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false }
pallet-xcm-benchmarks = { path = "../../../../../polkadot/xcm/pallet-xcm-benchmarks", default-features = false, optional = true }
polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false }
polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false }
polkadot-runtime-common = { path = "../../../../../polkadot/runtime/common", default-features = false }
westend-runtime-constants = { path = "../../../../../polkadot/runtime/westend/constants", default-features = false }
Expand Down Expand Up @@ -100,11 +99,11 @@ std = [
"pallet-aura/std",
"pallet-authorship/std",
"pallet-balances/std",
"pallet-broker/std",
"pallet-collator-selection/std",
"pallet-message-queue/std",
"pallet-multisig/std",
"pallet-session/std",
"pallet-sudo/std",
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
Expand All @@ -113,7 +112,6 @@ std = [
"pallet-xcm/std",
"parachain-info/std",
"parachains-common/std",
"polkadot-core-primitives/std",
"polkadot-parachain-primitives/std",
"polkadot-runtime-common/std",
"scale-info/std",
Expand Down Expand Up @@ -150,10 +148,10 @@ runtime-benchmarks = [
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-broker/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
"pallet-sudo/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
Expand All @@ -178,11 +176,11 @@ try-runtime = [
"pallet-aura/try-runtime",
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-broker/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-message-queue/try-runtime",
"pallet-multisig/try-runtime",
"pallet-session/try-runtime",
"pallet-sudo/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-utility/try-runtime",
Expand All @@ -193,3 +191,5 @@ try-runtime = [
]

experimental = ["pallet-aura/experimental"]

fast-runtime = []
10 changes: 9 additions & 1 deletion cumulus/parachains/runtimes/coretime/coretime-westend/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Expand Down
Loading
Loading