Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Ensure outbound queue stop processing messages when PalletOperatingMo…
Browse files Browse the repository at this point in the history
…de is halted (paritytech#939)

* Fix: Issue 9

* Move check back to submit

* Update cumulus
  • Loading branch information
yrong authored Sep 4, 2023
1 parent 4931897 commit 63001eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cumulus
Submodule cumulus updated 0 files
3 changes: 3 additions & 0 deletions parachain/pallets/outbound-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ pub mod pallet {
}

fn submit(ticket: Self::Ticket) -> Result<MessageHash, SubmitError> {
// Make sure the bridge not halted
Self::ensure_not_halted().map_err(|_| SubmitError::BridgeHalted)?;
T::MessageQueue::enqueue_message(
ticket.message.as_bounded_slice(),
Expand All @@ -356,6 +357,8 @@ pub mod pallet {
meter: &mut frame_support::weights::WeightMeter,
_: &mut [u8; 32],
) -> Result<bool, ProcessMessageError> {
// Make sure the bridge not halted
Self::ensure_not_halted().map_err(|_| ProcessMessageError::Yield)?;
// Yield if we don't want to accept any more messages in the current block.
// There is hard limit to ensure the weight of `on_finalize` is bounded.
ensure!(
Expand Down

0 comments on commit 63001eb

Please sign in to comment.