Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XCMP Defer XCM Prototype #3

Open
wants to merge 35 commits into
base: polkadot-v0.9.38
Choose a base branch
from

Conversation

apopiak
Copy link

@apopiak apopiak commented Apr 20, 2023

Adds a mechanism for deferring XCMs. The new config XcmDeferFilter allows the implementer to defer the execution of an XCM by a number of relay chain blocks.

Todos

  • use current relay block number instead of sent_at
    • fix benchmarking test failure
  • remove unused code
  • defer when unable to interpret (version conversion)

let deferred_xcm_messages = vec![deferred_message.clone(); max_messages];
crate::Pallet::<T>::inject_deferred_messages(para_id, deferred_xcm_messages.try_into().unwrap());
assert_eq!(crate::Pallet::<T>::deferred_messages(para_id).len(), max_messages);
// TODO: figure out how to get the weight of the xcm in a production runtime (Weigher not available)
Copy link

Choose a reason for hiding this comment

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

todo, wondering how we could solve this

pallets/xcmp-queue/src/lib.rs Outdated Show resolved Hide resolved
pallets/xcmp-queue/src/lib.rs Outdated Show resolved Hide resolved
pallets/xcmp-queue/src/lib.rs Outdated Show resolved Hide resolved
pallets/xcmp-queue/src/lib.rs Outdated Show resolved Hide resolved
pallets/xcmp-queue/src/lib.rs Outdated Show resolved Hide resolved
pallets/xcmp-queue/src/lib.rs Outdated Show resolved Hide resolved
pallets/xcmp-queue/src/tests.rs Show resolved Hide resolved
deferred_to: 6,
};

assert_eq!(
Copy link

Choose a reason for hiding this comment

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

I would create a helper method macro called assert_deferred_messages, with para id and vec of messages, so we can use it in most tests.

It helps with readability, but also simplifies changes if something is modified within DeferredXcmMessages storage

pallets/xcmp-queue/src/lib.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants