Skip to content

XCMP Defer XCM Prototype#3

Open
apopiak wants to merge 35 commits into
polkadot-v0.9.38from
feat/xcmp-defer-xcm-v9-38
Open

XCMP Defer XCM Prototype#3
apopiak wants to merge 35 commits into
polkadot-v0.9.38from
feat/xcmp-defer-xcm-v9-38

Conversation

@apopiak

@apopiak apopiak commented Apr 20, 2023

Copy link
Copy Markdown

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
Copy Markdown

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

Comment thread pallets/xcmp-queue/src/lib.rs Outdated
Comment thread pallets/xcmp-queue/src/lib.rs Outdated
Comment thread pallets/xcmp-queue/src/lib.rs Outdated
Comment thread pallets/xcmp-queue/src/lib.rs Outdated
Comment thread pallets/xcmp-queue/src/lib.rs Outdated
Comment thread pallets/xcmp-queue/src/lib.rs Outdated
Comment thread pallets/xcmp-queue/src/tests.rs
Comment thread pallets/xcmp-queue/src/tests.rs Outdated
deferred_to: 6,
};

assert_eq!(

Copy link
Copy Markdown

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

Comment thread pallets/xcmp-queue/src/lib.rs Outdated
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