pub type OnDemandAssignmentProvider = Pallet<Runtime>;
Aliased Type§
struct OnDemandAssignmentProvider(/* private fields */);
Implementations
Source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
Sourcepub fn place_order_allow_death(
origin: <T as Config>::RuntimeOrigin,
max_amount: <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance,
para_id: Id,
) -> Result<(), DispatchError>
👎Deprecated: This will be removed in favor of using place_order_with_credits
pub fn place_order_allow_death( origin: <T as Config>::RuntimeOrigin, max_amount: <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance, para_id: Id, ) -> Result<(), DispatchError>
place_order_with_credits
Create a single on demand core order. Will use the spot price for the current block and will reap the account if needed.
Parameters:
origin
: The sender of the call, funds will be withdrawn from this account.max_amount
: The maximum balance to withdraw from the origin to place an order.para_id
: AParaId
the origin wants to provide blockspace for.
Errors:
InsufficientBalance
: from the Currency implementationQueueFull
SpotPriceHigherThanMaxAmount
Events:
OnDemandOrderPlaced
Sourcepub fn place_order_keep_alive(
origin: <T as Config>::RuntimeOrigin,
max_amount: <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance,
para_id: Id,
) -> Result<(), DispatchError>
👎Deprecated: This will be removed in favor of using place_order_with_credits
pub fn place_order_keep_alive( origin: <T as Config>::RuntimeOrigin, max_amount: <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance, para_id: Id, ) -> Result<(), DispatchError>
place_order_with_credits
Same as the place_order_allow_death
call , but with a
check that placing the order will not reap the account.
Parameters:
origin
: The sender of the call, funds will be withdrawn from this account.max_amount
: The maximum balance to withdraw from the origin to place an order.para_id
: AParaId
the origin wants to provide blockspace for.
Errors:
InsufficientBalance
: from the Currency implementationQueueFull
SpotPriceHigherThanMaxAmount
Events:
OnDemandOrderPlaced
Sourcepub fn place_order_with_credits(
origin: <T as Config>::RuntimeOrigin,
max_amount: <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance,
para_id: Id,
) -> Result<(), DispatchError>
pub fn place_order_with_credits( origin: <T as Config>::RuntimeOrigin, max_amount: <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance, para_id: Id, ) -> Result<(), DispatchError>
Create a single on demand core order with credits. Will charge the owner’s on-demand credit account the spot price for the current block.
Parameters:
origin
: The sender of the call, on-demand credits will be withdrawn from this account.max_amount
: The maximum number of credits to spend from the origin to place an order.para_id
: AParaId
the origin wants to provide blockspace for.
Errors:
InsufficientCredits
QueueFull
SpotPriceHigherThanMaxAmount
Events:
OnDemandOrderPlaced
Source§impl<T> Pallet<T>
impl<T> Pallet<T>
Sourcepub fn pop_assignment_for_core(core_index: CoreIndex) -> Option<Assignment>
pub fn pop_assignment_for_core(core_index: CoreIndex) -> Option<Assignment>
Take the next queued entry that is available for a given core index.
Parameters:
core_index
: The core index
Sourcepub fn assignment_duplicated(para_id: Id, core_index: CoreIndex)
pub fn assignment_duplicated(para_id: Id, core_index: CoreIndex)
Report that an assignment was duplicated by the scheduler.
Sourcepub fn report_processed(para_id: Id, core_index: CoreIndex)
pub fn report_processed(para_id: Id, core_index: CoreIndex)
Report that the para_id
& core_index
combination was processed.
This should be called once it is clear that the assignment won’t get pushed back anymore.
In other words for each pop_assignment_for_core
a call to this function or
push_back_assignment
must follow, but only one.
Sourcepub fn push_back_assignment(para_id: Id, core_index: CoreIndex)
pub fn push_back_assignment(para_id: Id, core_index: CoreIndex)
Push an assignment back to the front of the queue.
The assignment has not been processed yet. Typically used on session boundaries.
NOTE: We are not checking queue size here. So due to push backs it is possible that we exceed the maximum queue size slightly.
Parameters:
para_id
: The para that did not make it.core_index
: The core the para was scheduled on.
Sourcepub fn credit_account(
who: <T as Config>::AccountId,
amount: <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance,
)
pub fn credit_account( who: <T as Config>::AccountId, amount: <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance, )
Adds credits to the specified account.
Parameters:
who
: Credit receiver.amount
: The amount of new credits the account will receive.
Sourcepub fn claim_revenue_until(
when: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
) -> <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance
pub fn claim_revenue_until( when: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance
Collect the revenue from the when
blockheight
Sourcepub fn account_id() -> <T as Config>::AccountId
pub fn account_id() -> <T as Config>::AccountId
Account of the pallet pot, where the funds from instantaneous coretime sale are accumulated.
pub fn populate_queue(para_id: Id, num: u32)
Trait Implementations
Source§impl<T> BeforeAllRuntimeMigrations for Pallet<T>where
T: Config,
impl<T> BeforeAllRuntimeMigrations for Pallet<T>where
T: Config,
Source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
Source§impl<T> Benchmarking for Pallet<T>
impl<T> Benchmarking for Pallet<T>
Source§fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
Source§fn run_benchmark(
extrinsic: &[u8],
c: &[(BenchmarkParameter, u32)],
whitelist: &[TrackedStorageKey],
verify: bool,
internal_repeats: u32,
) -> Result<Vec<BenchmarkResult>, BenchmarkError>
fn run_benchmark( extrinsic: &[u8], c: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32, ) -> Result<Vec<BenchmarkResult>, BenchmarkError>
Source§impl<T> DispatchViewFunction for Pallet<T>where
T: Config,
impl<T> DispatchViewFunction for Pallet<T>where
T: Config,
fn dispatch_view_function<O>(
id: &ViewFunctionId,
input: &mut &[u8],
output: &mut O,
) -> Result<(), ViewFunctionDispatchError>where
O: Output,
Source§impl<T> GetStorageVersion for Pallet<T>where
T: Config,
impl<T> GetStorageVersion for Pallet<T>where
T: Config,
Source§fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion
fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion
storage_version
attribute, or
NoStorageVersionSet
if the attribute is missing.Source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
Source§fn current_storage_version() -> Self::InCodeStorageVersion
fn current_storage_version() -> Self::InCodeStorageVersion
in_code_storage_version
and will be removed after March 2024.Self::current_storage_version
instead. Read moreSource§impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn on_initialize(
_now: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
) -> Weight
fn on_initialize( _now: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight
Source§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
Source§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
). Read moreSource§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive
pallet. Read moreSource§fn try_state(_n: BlockNumber) -> Result<(), DispatchError>
fn try_state(_n: BlockNumber) -> Result<(), DispatchError>
Source§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Source§fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
Source§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
Source§fn integrity_test()
fn integrity_test()
Source§impl<T> IntegrityTest for Pallet<T>where
T: Config,
impl<T> IntegrityTest for Pallet<T>where
T: Config,
Source§impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn on_finalize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
)
fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )
Hooks::on_finalize
.Source§impl<T> OnGenesis for Pallet<T>where
T: Config,
impl<T> OnGenesis for Pallet<T>where
T: Config,
Source§fn on_genesis()
fn on_genesis()
Source§impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn on_initialize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
) -> Weight
fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight
Hooks::on_initialize
.Source§impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnRuntimeUpgrade for Pallet<T>where
T: Config,
impl<T> OnRuntimeUpgrade for Pallet<T>where
T: Config,
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Source§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Hooks::pre_upgrade
.Source§fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
Hooks::post_upgrade
.Source§fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
pre_upgrade
->
on_runtime_upgrade
-> post_upgrade
hooks for a migration. Read moreSource§impl<T> PalletInfoAccess for Pallet<T>where
T: Config,
impl<T> PalletInfoAccess for Pallet<T>where
T: Config,
Source§fn module_name() -> &'static str
fn module_name() -> &'static str
Source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Source§impl<T> PalletsInfoAccess for Pallet<T>where
T: Config,
impl<T> PalletsInfoAccess for Pallet<T>where
T: Config,
Source§impl<T> StorageInfoTrait for Pallet<T>where
T: Config,
impl<T> StorageInfoTrait for Pallet<T>where
T: Config,
fn storage_info() -> Vec<StorageInfo>
Source§impl<T> TryDecodeEntireStorage for Pallet<T>where
T: Config,
impl<T> TryDecodeEntireStorage for Pallet<T>where
T: Config,
Source§fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
Ok(bytes_decoded)
if success.Source§impl<T> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
Source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Vec<TrackedStorageKey>
indicating the storage keys that
should be whitelisted during benchmarking. This means that those keys
will be excluded from the benchmarking performance calculation.