Skip to content

Commit

Permalink
Add broker pallet to coretime-westend (paritytech#3272)
Browse files Browse the repository at this point in the history
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: paritytech/devops#2725

---------

Co-authored-by: command-bot <>
Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Anton Vilhelm Ásgeirsson <[email protected]>
  • Loading branch information
3 people authored Feb 16, 2024
1 parent 64ea4c5 commit 65d3d08
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion substrate/bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2027,7 +2027,7 @@ pub struct CoretimeProvider;
impl CoretimeInterface for CoretimeProvider {
type AccountId = AccountId;
type Balance = Balance;
type RealyChainBlockNumberProvider = System;
type RelayChainBlockNumberProvider = System;
fn request_core_count(_count: CoreIndex) {}
fn request_revenue_info_at(_when: u32) {}
fn credit_account(_who: Self::AccountId, _amount: Self::Balance) {}
Expand Down
6 changes: 3 additions & 3 deletions substrate/frame/broker/src/coretime_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub enum CoreAssignment {
pub type RCBlockNumberOf<T> = <RCBlockNumberProviderOf<T> as BlockNumberProvider>::BlockNumber;

/// Relay chain block number provider of `T` that implements [`CoretimeInterface`].
pub type RCBlockNumberProviderOf<T> = <T as CoretimeInterface>::RealyChainBlockNumberProvider;
pub type RCBlockNumberProviderOf<T> = <T as CoretimeInterface>::RelayChainBlockNumberProvider;

/// Type able to accept Coretime scheduling instructions and provide certain usage information.
/// Generally implemented by the Relay-chain or some means of communicating with it.
Expand All @@ -65,7 +65,7 @@ pub trait CoretimeInterface {
type Balance: AtLeast32BitUnsigned;

/// A provider for the relay chain block number.
type RealyChainBlockNumberProvider: BlockNumberProvider;
type RelayChainBlockNumberProvider: BlockNumberProvider;

/// Requests the Relay-chain to alter the number of schedulable cores to `count`. Under normal
/// operation, the Relay-chain SHOULD send a `notify_core_count(count)` message back.
Expand Down Expand Up @@ -128,7 +128,7 @@ pub trait CoretimeInterface {
impl CoretimeInterface for () {
type AccountId = ();
type Balance = u64;
type RealyChainBlockNumberProvider = ();
type RelayChainBlockNumberProvider = ();

fn request_core_count(_count: CoreIndex) {}
fn request_revenue_info_at(_when: RCBlockNumberOf<Self>) {}
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/broker/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub struct TestCoretimeProvider;
impl CoretimeInterface for TestCoretimeProvider {
type AccountId = u64;
type Balance = u64;
type RealyChainBlockNumberProvider = System;
type RelayChainBlockNumberProvider = System;
fn request_core_count(count: CoreIndex) {
CoreCountInbox::<Test>::put(count);
}
Expand Down

0 comments on commit 65d3d08

Please sign in to comment.