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

XCM: Implement a blocking barrier #6670

Closed
wants to merge 3 commits into from

Conversation

KiChjang
Copy link
Contributor

@KiChjang KiChjang commented Feb 3, 2023

Rebased version of #5035.

Fixes #4813.

cumulus companion: paritytech/cumulus#2174

@KiChjang KiChjang added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. labels Feb 3, 2023
#[pallet::call_index(10)]
#[pallet::weight(100_000_000u64)]
pub fn force_suspension(origin: OriginFor<T>, suspended: bool) -> DispatchResult {
ensure_root(origin)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be a configuration item.

Copy link
Member

@gavofyork gavofyork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this actually does what it's meant to do.

This type would include the Suspended variant meaning "does not pass this barrier yet, but it might pass in a later block" .

This meaning was not implemented. It will need to be integrated properly into the Message Queue systems (i.e. pallet message queue), so they stop executing messages from any origin which returns Suspended until some time in the future (e.g. the next block).

As it stands it will do the same as it would for any other non-passing barriers: just drop the messages. Definitely not the intended behaviour.

@girazoki
Copy link
Contributor

I observe the PR includes a db read made by a barrier. I am assuming this could produce an unpaid db read, is it not that much of an issue because it can at most spam one db read per block? (I am assuming following messages processed in the same block will have the db read cached?)

@gavofyork
Copy link
Member

This should help paritytech/substrate#13424

@gavofyork
Copy link
Member

@KiChjang you going to get this one over the line now? With the Yield error it should be possible to implement properly.

@KiChjang
Copy link
Contributor Author

Wouldn't this be blocked on #6271 before we can actually use the queues here?

@gavofyork
Copy link
Member

possibly, but it doesn't matter - the API is in.

@KiChjang KiChjang mentioned this pull request Apr 14, 2023
@KiChjang
Copy link
Contributor Author

Will reopen this PR with some changes.

@KiChjang KiChjang closed this Apr 18, 2023
@KiChjang KiChjang deleted the kckyeung/xcm-blocking-barrier branch April 18, 2023 12:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XCM: Blocking Barrier
3 participants