Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez committed Jul 26, 2023
1 parent dd97e08 commit a41d0d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pallets/xcmp-queue/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ mod benchmarks {

#[benchmark]
fn enqueue_xcmp_messages(n: Linear<0, 1000> /* FAIL-CI */) {
let msg = BoundedVec::<u8, XcmOverHrmpMaxLenOf<T>>::default();
let msg = BoundedVec::<u8, XcmpMaxLenOf<T>>::default();
let msgs = vec![msg; n as usize];

QueueConfig::<T>::mutate(|data| {
Expand Down
8 changes: 5 additions & 3 deletions pallets/xcmp-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub use pallet::*;

/// Index used to identify overweight XCMs.
pub type OverweightIndex = u64;
pub type XcmOverHrmpMaxLenOf<T> =
pub type XcmpMaxLenOf<T> =
<<T as Config>::XcmpQueue as EnqueueMessage<ParaId>>::MaxMessageLen;

const LOG_TARGET: &str = "xcmp_queue";
Expand Down Expand Up @@ -90,6 +90,8 @@ pub mod pallet {
type VersionWrapper: WrapVersion;

/// Enqueue an inbound horizontal message for later processing.
///
/// This defines the maximal message length via [`crate::XcmpMaxLenOf`].
type XcmpQueue: EnqueueMessage<ParaId>;

/// The maximum number of inbound XCMP channels that can be suspended simultaneously.
Expand Down Expand Up @@ -529,7 +531,7 @@ impl<T: Config> Pallet<T> {

fn enqueue_xcmp_messages(
sender: ParaId,
mut xcms: Vec<BoundedVec<u8, XcmOverHrmpMaxLenOf<T>>>,
mut xcms: Vec<BoundedVec<u8, XcmpMaxLenOf<T>>>,
meter: &mut WeightMeter,
) {
if meter
Expand Down Expand Up @@ -561,7 +563,7 @@ impl<T: Config> Pallet<T> {
/// We directly encode them again since that is needed later on.
fn split_concatenated_xcms(
data: &mut &[u8],
) -> Result<Vec<BoundedVec<u8, XcmOverHrmpMaxLenOf<T>>>, ()> {
) -> Result<Vec<BoundedVec<u8, XcmpMaxLenOf<T>>>, ()> {
// FAIL-CI add benchmark to check for OOM depending on `MAX_XCM_DECODE_DEPTH`.
let mut encoded_xcms = Vec::new();
while !data.is_empty() {
Expand Down

0 comments on commit a41d0d8

Please sign in to comment.