referrerpolicy=no-referrer-when-downgrade
xcm_fuzzer::relay_chain

Type Alias MessageQueue

Source
pub type MessageQueue = Pallet<Runtime>;

Aliased Type§

struct MessageQueue(/* private fields */);

Implementations

§

impl<T> Pallet<T>
where T: Config,

pub fn do_execute_overweight( origin: <<T as Config>::MessageProcessor as ProcessMessage>::Origin, page_index: u32, index: <T as Config>::Size, weight_limit: Weight, ) -> Result<Weight, Error<T>>

Try to execute a single message that was marked as overweight.

The weight_limit is the weight that can be consumed to execute the message. The base weight of the function it self must be measured by the caller.

pub fn do_try_state() -> Result<(), DispatchError>

Ensure the correctness of state of this pallet.

§Assumptions-

If serviceHead points to a ready Queue, then BookState of that Queue has:

  • message_count > 0
  • size > 0
  • end > begin
  • Some(ready_neighbours)
  • If ready_neighbours.next == self.origin, then ready_neighbours.prev == self.origin (only queue in ring)

For Pages(begin to end-1) in BookState:

  • remaining > 0
  • remaining_size > 0
  • first <= last
  • Every page can be decoded into peek_* functions

pub fn debug_info() -> String

Print the pages in each queue and the messages in each page.

Processed messages are prefixed with a * and the current beginning page with a >.

§Example output
queue Here:
  page 0: []
> page 1: []
  page 2: ["\0weight=4", "\0c", ]
  page 3: ["\0bigbig 1", ]
  page 4: ["\0bigbig 2", ]
  page 5: ["\0bigbig 3", ]
§

impl<T> Pallet<T>
where T: Config,

pub fn reap_page( origin: <T as Config>::RuntimeOrigin, message_origin: <<T as Config>::MessageProcessor as ProcessMessage>::Origin, page_index: u32, ) -> Result<(), DispatchError>

Remove a page which has no more messages remaining to be processed or is stale.

pub fn execute_overweight( origin: <T as Config>::RuntimeOrigin, message_origin: <<T as Config>::MessageProcessor as ProcessMessage>::Origin, page: u32, index: <T as Config>::Size, weight_limit: Weight, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Execute an overweight message.

Temporary processing errors will be propagated whereas permanent errors are treated as success condition.

  • origin: Must be Signed.
  • message_origin: The origin from which the message to be executed arrived.
  • page: The page in the queue in which the message to be executed is sitting.
  • index: The index into the queue of the message to be executed.
  • weight_limit: The maximum amount of weight allowed to be consumed in the execution of the message.

Benchmark complexity considerations: O(index + weight_limit).

Trait Implementations

§

impl<T> BeforeAllRuntimeMigrations for Pallet<T>
where T: Config,

§

fn before_all_runtime_migrations() -> Weight

Something that should happen before runtime migrations are executed.
§

impl<T> Benchmarking for Pallet<T>
where T: Config + Config, <<T as Config>::MessageProcessor as ProcessMessage>::Origin: From<u32> + PartialEq, <T as Config>::Size: From<u32>,

§

fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>

Get the benchmarks available for this pallet. Generally there is one benchmark per extrinsic, so these are sometimes just called “extrinsics”. Read more
§

fn run_benchmark( extrinsic: &[u8], c: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32, ) -> Result<Vec<BenchmarkResult>, BenchmarkError>

Run the benchmarks for this pallet.
§

impl<T> Callable<T> for Pallet<T>
where T: Config,

§

type RuntimeCall = Call<T>

§

impl<T> Clone for Pallet<T>

§

fn clone(&self) -> Pallet<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T> Debug for Pallet<T>

§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

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,

§

impl<T> EnqueueMessage<<<T as Config>::MessageProcessor as ProcessMessage>::Origin> for Pallet<T>
where T: Config,

§

type MaxMessageLen = MaxMessageLen<<<T as Config>::MessageProcessor as ProcessMessage>::Origin, <T as Config>::Size, <T as Config>::HeapSize>

The maximal length any enqueued message may have.
§

fn enqueue_message( message: BoundedSlice<'_, u8, <Pallet<T> as EnqueueMessage<<<T as Config>::MessageProcessor as ProcessMessage>::Origin>>::MaxMessageLen>, origin: <<T as Config>::MessageProcessor as ProcessMessage>::Origin, )

Enqueue a single message from a specific origin.
§

fn enqueue_messages<'a>( messages: impl Iterator<Item = BoundedSlice<'a, u8, <Pallet<T> as EnqueueMessage<<<T as Config>::MessageProcessor as ProcessMessage>::Origin>>::MaxMessageLen>>, origin: <<T as Config>::MessageProcessor as ProcessMessage>::Origin, )

Enqueue multiple messages from a specific origin.
§

fn sweep_queue( origin: <<T as Config>::MessageProcessor as ProcessMessage>::Origin, )

Any remaining unprocessed messages should happen only lazily, not proactively.
§

fn footprint( origin: <<T as Config>::MessageProcessor as ProcessMessage>::Origin, ) -> QueueFootprint

Return the state footprint of the given queue.
§

impl<T> ForceSetHead<<<T as Config>::MessageProcessor as ProcessMessage>::Origin> for Pallet<T>
where T: Config,

§

fn force_set_head( weight: &mut WeightMeter, origin: &<<T as Config>::MessageProcessor as ProcessMessage>::Origin, ) -> Result<bool, ()>

Set the ServiceHead to origin. Read more
§

impl<T> GetStorageVersion for Pallet<T>
where T: Config,

§

type InCodeStorageVersion = NoStorageVersionSet

This type is generated by the pallet macro. Read more
§

fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion

Returns the in-code storage version as specified in the storage_version attribute, or [NoStorageVersionSet] if the attribute is missing.
§

fn on_chain_storage_version() -> StorageVersion

Returns the storage version of the pallet as last set in the actual on-chain storage.
§

fn current_storage_version() -> Self::InCodeStorageVersion

👎Deprecated: This method has been renamed to in_code_storage_version and will be removed after March 2024.
DEPRECATED: Use [Self::current_storage_version] instead. Read more
§

impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

§

fn on_initialize( _n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight

Block initialization hook. This is called at the very beginning of block execution. Read more
§

fn on_idle( _n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, remaining_weight: Weight, ) -> Weight

Hook to consume a block’s idle time. This will run when the block is being finalized (before [Hooks::on_finalize]). Read more
§

fn try_state( _: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Result<(), DispatchError>

Execute the sanity checks of this pallet, per block. Read more
§

fn on_finalize(_n: BlockNumber)

Block finalization hook. This is called at the very end of block execution. Read more
§

fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)

A hook to run logic after inherent application. Read more
§

fn on_runtime_upgrade() -> Weight

Hook executed when a code change (aka. a “runtime upgrade”) is detected by the FRAME Executive pallet. Read more
§

fn pre_upgrade() -> Result<Vec<u8>, DispatchError>

Execute some pre-checks prior to a runtime upgrade. Read more
§

fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>

Execute some post-checks after a runtime upgrade. Read more
§

fn offchain_worker(_n: BlockNumber)

Implementing this function on a pallet allows you to perform long-running tasks that are dispatched as separate threads, and entirely independent of the main blockchain execution. Read more
§

fn integrity_test()

Check the integrity of this pallet’s configuration. Read more
§

impl<T> IntegrityTest for Pallet<T>
where T: Config,

§

fn integrity_test()

See [Hooks::integrity_test].
§

impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

§

fn offchain_worker( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )

This function is being called after every block import (when fully synced). Read more
§

impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

§

fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )

See [Hooks::on_finalize].
§

impl<T> OnGenesis for Pallet<T>
where T: Config,

§

fn on_genesis()

Something that should happen at genesis.
§

impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

§

fn on_idle( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, remaining_weight: Weight, ) -> Weight

See [Hooks::on_idle].
§

impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

§

fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight

See [Hooks::on_initialize].
§

impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

§

fn on_poll( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, weight: &mut WeightMeter, )

Code to execute every now and then at the beginning of the block after inherent application. Read more
§

impl<T> OnRuntimeUpgrade for Pallet<T>
where T: Config,

§

fn on_runtime_upgrade() -> Weight

See [Hooks::on_runtime_upgrade].
§

fn pre_upgrade() -> Result<Vec<u8>, DispatchError>

See [Hooks::pre_upgrade].
§

fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>

See [Hooks::post_upgrade].
§

fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>

The expected and default behavior of this method is to handle executing pre_upgrade -> on_runtime_upgrade -> post_upgrade hooks for a migration. Read more
§

impl<T> PalletInfoAccess for Pallet<T>
where T: Config,

§

fn index() -> usize

Index of the pallet as configured in the runtime.
§

fn name() -> &'static str

Name of the pallet as configured in the runtime.
§

fn name_hash() -> [u8; 16]

Two128 hash of name.
§

fn module_name() -> &'static str

Name of the Rust module containing the pallet.
§

fn crate_version() -> CrateVersion

Version of the crate containing the pallet.
§

impl<T> PalletsInfoAccess for Pallet<T>
where T: Config,

§

fn count() -> usize

The number of pallets’ information that this type represents. Read more
§

fn infos() -> Vec<PalletInfoData>

All of the pallets’ information that this type represents.
§

impl<T> PartialEq for Pallet<T>

§

fn eq(&self, other: &Pallet<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T> ServiceQueues for Pallet<T>
where T: Config,

§

fn execute_overweight( weight_limit: Weight, _: <Pallet<T> as ServiceQueues>::OverweightMessageAddress, ) -> Result<Weight, ExecuteOverweightError>

Execute a single overweight message.

The weight limit must be enough for execute_overweight and the message execution itself.

§

type OverweightMessageAddress = (<<T as Config>::MessageProcessor as ProcessMessage>::Origin, u32, <T as Config>::Size)

Addresses a specific overweight message.
§

fn service_queues(weight_limit: Weight) -> Weight

Service all message queues in some fair manner. Read more
§

impl<T> StorageInfoTrait for Pallet<T>
where T: Config,

§

fn storage_info() -> Vec<StorageInfo>

§

impl<T> TryDecodeEntireStorage for Pallet<T>
where T: Config,

§

fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>

Decode the entire data under the given storage, returning Ok(bytes_decoded) if success.
§

impl<T> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

§

fn try_state( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, _s: Select, ) -> Result<(), DispatchError>

Execute the state checks.
§

impl<T> ViewFunctionIdPrefix for Pallet<T>
where T: Config,

§

fn prefix() -> [u8; 16]

§

impl<T> WhitelistedStorageKeys for Pallet<T>
where T: Config,

§

fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>

Returns a 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.
§

impl<T> Eq for Pallet<T>