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

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
  • Loading branch information
ggwpez committed Mar 28, 2023
1 parent 2e51605 commit d131542
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion pallets/parachain-system/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ mod benchmarks {
};
let msgs = vec![msg; n as usize];
let head = mqp_head(&msgs);
LastDmqMqcHead::<T>::take();

#[block]
{
Expand Down
2 changes: 0 additions & 2 deletions pallets/parachain-system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,6 @@ impl<T: Config> Pallet<T> {
let weight_used = T::WeightInfo::enqueue_inbound_downward_messages(dm_count);
if dm_count != 0 {
Self::deposit_event(Event::DownwardMessagesReceived { count: dm_count });
let _max_weight =
<ReservedDmpWeightOverride<T>>::get().unwrap_or_else(T::ReservedDmpWeight::get);

for m in &downward_messages {
dmq_head.extend_downward(m);
Expand Down
2 changes: 2 additions & 0 deletions pallets/parachain-system/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.

//! Test setup and helpers.
#![cfg(test)]

use super::*;
Expand Down
10 changes: 6 additions & 4 deletions pallets/xcmp-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ pub mod pallet {
/// Enqueue an inbound horizontal message for later processing.
type XcmpQueue: EnqueueMessage<ParaId>;

/// This pallet itself implements the [`frame_support::traits::ProcessMessage`] trait. After checking the suspension logic it forwards the messages to this `XcmpProcessor` type.
/// The message processor that this pallet uses after checking the suspension logic.
type XcmpProcessor: ProcessMessage<Origin = ParaId>;

/// The maximum number of inbound XCMP channels that can be suspended simultaneously.
///
/// Any further channel suspensions will fail and messages may get dropped without further notice. Choosing a high value (1000) is okay; the trade-off that is described in [InboundXcmpSuspended] still applies at that scale.
/// Any further channel suspensions will fail and messages may get dropped without further
/// notice. Choosing a high value (1000) is okay; the trade-off that is described in [InboundXcmpSuspended] still applies at that scale.
#[pallet::constant]
type MaxInboundSuspended: Get<u32>;

Expand Down Expand Up @@ -599,7 +600,8 @@ impl<T: Config> OnQueueChanged<ParaId> for Pallet<T> {
log::warn!("XCMP queue for sibling {:?} is full; suspending channel.", para);

if let Err(err) = Self::send_signal(para, ChannelSignal::Suspend) {
// This is an edge-case, but we will not regard the channel as `Suspended` without confirmation. It will just re-try to suspend in the next block.
// This is an edge-case, but we will not regard the channel as `Suspended` without
// confirmation. It will just re-try to suspend in the next block.
log::error!("Cannot suspend channel from sibling {:?}: {:?}; further messages may be dropped.", para, err);
} else if let Err(err) = suspended_channels.try_insert(para) {
log::error!("Too many channels suspended; cannot suspend sibling {:?}: {:?}; further messages may be dropped.", para, err);
Expand Down Expand Up @@ -635,7 +637,6 @@ impl<T: Config> ProcessMessage for Pallet<T> {
return Err(ProcessMessageError::Yield)
}

// This should not be benchmarked since it already meters its own weight.
T::XcmpProcessor::process_message(message, origin, meter)
}
}
Expand All @@ -661,6 +662,7 @@ impl<T: Config> XcmpMessageHandler for Pallet<T> {
match format {
XcmpMessageFormat::Signals =>
while !data.is_empty() {
// FAIL-CI consume weight here and above/below
match ChannelSignal::decode(&mut data) {
Ok(ChannelSignal::Suspend) => Self::suspend_channel(sender),
Ok(ChannelSignal::Resume) => Self::resume_channel(sender),
Expand Down
2 changes: 1 addition & 1 deletion parachains/runtimes/contracts/contracts-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ impl pallet_message_queue::Config for Runtime {
>;
#[cfg(not(feature = "runtime-benchmarks"))]
type MessageProcessor = parachains_common::process_xcm_message::SplitMessages<
process_xcm_message::ProcessXcmMessage<
parachains_common::process_xcm_message::ProcessXcmMessage<
cumulus_primitives_core::AggregateMessageOrigin,
xcm_executor::XcmExecutor<xcm_config::XcmConfig>,
RuntimeCall,
Expand Down

0 comments on commit d131542

Please sign in to comment.