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

pallet-xcm: Deprecate execute and send in favor of execute_blob and send_blob #3749

Merged
merged 53 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d9d97cc
feat(pallet-xcm): deprecate execute and send in favor of execute_blob…
franciscoaguirre Mar 19, 2024
d2359c6
Update polkadot/xcm/pallet-xcm/src/lib.rs
franciscoaguirre Mar 20, 2024
571b16c
fix(pallet-xcm): remove base function from controller traits
franciscoaguirre Mar 20, 2024
43ac662
fix(pallet-xcm): fmt
franciscoaguirre Mar 20, 2024
3655ba3
chore(pallet-xcm): add tests
franciscoaguirre Mar 20, 2024
d433de4
fix: add todos for pallet-xcm weights on all runtimes
franciscoaguirre Mar 20, 2024
ba086c2
fix(pallet-xcm): move MAX_XCM_ENCODED_SIZE to xcm crate
franciscoaguirre Mar 20, 2024
9f117d3
chore(xcm): add more xcm decoding tests
franciscoaguirre Mar 21, 2024
8c507ac
fix(weights::pallet_xcm): change todo! to Weight::MAX
franciscoaguirre Mar 21, 2024
5541d4e
chore(pallet-xcm): change message to encoded_message in blob extrinsics
franciscoaguirre Mar 21, 2024
3974e72
fix: remove usage of deprecated function, change max encoded size
franciscoaguirre Mar 21, 2024
01c629c
doc: add prdoc
franciscoaguirre Mar 21, 2024
caa74e6
fmt
franciscoaguirre Mar 21, 2024
cdae8bd
Merge branch 'master' into xcm-execute-blob
franciscoaguirre Mar 21, 2024
3f5683f
fix: add benchmark for execute_blob and send_blob
franciscoaguirre Mar 21, 2024
c8aa519
Merge branch 'master' into xcm-execute-blob
franciscoaguirre Mar 21, 2024
62d073b
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Mar 21, 2024
650094a
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Mar 21, 2024
be77fa2
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Mar 21, 2024
d6f9e1d
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Mar 21, 2024
5a31357
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Mar 21, 2024
bf05d62
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Mar 21, 2024
39ed827
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Mar 21, 2024
8e32e0b
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Mar 21, 2024
50d6a87
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Mar 21, 2024
0d8cc33
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Mar 21, 2024
169432c
chore(pallet-xcm): remove unnecessary tests
franciscoaguirre Mar 21, 2024
2419c1d
Merge branch 'master' into xcm-execute-blob
franciscoaguirre Mar 22, 2024
f549578
chore: fmt
franciscoaguirre Mar 22, 2024
72b00cc
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Mar 22, 2024
9b151ff
Patches for #3749 (#3821)
pgherveou Mar 25, 2024
b8a9955
Update polkadot/xcm/xcm-builder/src/controller.rs
franciscoaguirre Mar 25, 2024
56c920f
Update polkadot/xcm/xcm-builder/src/controller.rs
franciscoaguirre Mar 25, 2024
5e4f00b
doc(pallet-xcm): add doc comments to execute_blob and send_blob
franciscoaguirre Mar 25, 2024
8039abf
doc: update prdoc to mention pallet-contracts API changes
franciscoaguirre Mar 25, 2024
eb90b51
Merge branch 'master' into xcm-execute-blob
franciscoaguirre Mar 25, 2024
616d088
Update polkadot/xcm/pallet-xcm/src/tests/mod.rs
franciscoaguirre Mar 25, 2024
9a62004
Update polkadot/xcm/pallet-xcm/src/tests/mod.rs
franciscoaguirre Mar 25, 2024
12744e1
Update polkadot/xcm/pallet-xcm/src/lib.rs
franciscoaguirre Mar 25, 2024
bcb37c5
Update cumulus/parachains/integration-tests/emulated/tests/bridges/br…
franciscoaguirre Mar 25, 2024
55fd326
Update cumulus/parachains/integration-tests/emulated/tests/bridges/br…
franciscoaguirre Mar 25, 2024
25c3de1
Update cumulus/parachains/integration-tests/emulated/tests/bridges/br…
franciscoaguirre Mar 25, 2024
9251a2b
Update cumulus/parachains/integration-tests/emulated/common/src/impls.rs
franciscoaguirre Mar 25, 2024
f849435
Update cumulus/parachains/integration-tests/emulated/tests/assets/ass…
franciscoaguirre Mar 25, 2024
5141e32
Update cumulus/parachains/integration-tests/emulated/tests/assets/ass…
franciscoaguirre Mar 25, 2024
089f7d5
Update cumulus/parachains/integration-tests/emulated/tests/assets/ass…
franciscoaguirre Mar 25, 2024
5b8a875
Update cumulus/parachains/integration-tests/emulated/tests/bridges/br…
franciscoaguirre Mar 25, 2024
0f3f976
Update cumulus/parachains/integration-tests/emulated/tests/bridges/br…
franciscoaguirre Mar 25, 2024
2f52ad1
fix: don't panic in the runtime
franciscoaguirre Mar 25, 2024
e68fb13
fix(pallet-xcm): remove more instances of pallet-xcm execute
franciscoaguirre Mar 25, 2024
07dd350
fix(pallet-xcm): specify call in xcms in tests
franciscoaguirre Mar 25, 2024
3ffe01b
fmt
franciscoaguirre Mar 25, 2024
2110990
Merge branch 'master' into xcm-execute-blob
franciscoaguirre Mar 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ publish = false
workspace = true

[dependencies]

# Substrate
sp-core = { path = "../../../../../../../substrate/primitives/core", default-features = false }
sp-runtime = { path = "../../../../../../../substrate/primitives/runtime", default-features = false }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,18 +362,18 @@ macro_rules! impl_send_transact_helpers_for_relay_chain {
recipient: $crate::impls::ParaId,
call: $crate::impls::DoubleEncoded<()>
) {
use $crate::impls::{bx, Chain, RelayChain};
use $crate::impls::{bx, Chain, RelayChain, Encode};

<Self as $crate::impls::TestExt>::execute_with(|| {
let root_origin = <Self as Chain>::RuntimeOrigin::root();
let destination: $crate::impls::Location = <Self as RelayChain>::child_location_of(recipient);
let xcm = $crate::impls::xcm_transact_unpaid_execution(call, $crate::impls::OriginKind::Superuser);

// Send XCM `Transact`
$crate::impls::assert_ok!(<Self as [<$chain RelayPallet>]>::XcmPallet::send(
$crate::impls::assert_ok!(<Self as [<$chain RelayPallet>]>::XcmPallet::send_blob(
root_origin,
bx!(destination.into()),
bx!(xcm),
xcm.encode().try_into().unwrap(),
));
Self::assert_xcm_pallet_sent();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_system_assets_works() {
)]);

PenpalA::execute_with(|| {
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send(
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send_blob(
root_origin,
bx!(system_para_destination),
bx!(xcm),
xcm.encode().try_into().unwrap(),
));

PenpalA::assert_xcm_pallet_sent();
Expand Down Expand Up @@ -159,10 +159,10 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
)]);

PenpalA::execute_with(|| {
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send(
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send_blob(
root_origin,
bx!(system_para_destination),
bx!(xcm),
xcm.encode().try_into().unwrap(),
));

PenpalA::assert_xcm_pallet_sent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,10 @@ fn pay_xcm_fee_with_some_asset_swapped_for_native() {
penpal.clone(),
);

assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send(
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send_blob(
penpal_root,
bx!(asset_hub_location),
bx!(xcm),
xcm.encode().try_into().unwrap(),
));

PenpalA::assert_xcm_pallet_sent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_system_assets_works() {
)]);

PenpalA::execute_with(|| {
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send(
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send_blob(
root_origin,
bx!(system_para_destination),
bx!(xcm),
xcm.encode().try_into().unwrap(),
));

PenpalA::assert_xcm_pallet_sent();
Expand Down Expand Up @@ -159,10 +159,10 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
)]);

PenpalA::execute_with(|| {
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send(
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send_blob(
root_origin,
bx!(system_para_destination),
bx!(xcm),
xcm.encode().try_into().unwrap(),
));

PenpalA::assert_xcm_pallet_sent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,10 @@ fn pay_xcm_fee_with_some_asset_swapped_for_native() {
penpal.clone(),
);

assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send(
assert_ok!(<PenpalA as PenpalAPallet>::PolkadotXcm::send_blob(
penpal_root,
bx!(asset_hub_location),
bx!(xcm),
xcm.encode().try_into().unwrap(),
));

PenpalA::assert_xcm_pallet_sent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.

use crate::tests::*;
use codec::Encode;

#[test]
fn send_xcm_from_rococo_relay_to_westend_asset_hub_should_fail_on_not_applicable() {
Expand All @@ -26,7 +27,7 @@ fn send_xcm_from_rococo_relay_to_westend_asset_hub_should_fail_on_not_applicable

let remote_xcm = Xcm(vec![ClearOrigin]);

let xcm = VersionedXcm::from(Xcm(vec![
let xcm = VersionedXcm::from(Xcm::<()>(vec![
UnpaidExecution { weight_limit, check_origin },
ExportMessage {
network: WestendId.into(),
Expand All @@ -38,10 +39,10 @@ fn send_xcm_from_rococo_relay_to_westend_asset_hub_should_fail_on_not_applicable
// Rococo Global Consensus
// Send XCM message from Relay Chain to Bridge Hub source Parachain
Rococo::execute_with(|| {
assert_ok!(<Rococo as RococoPallet>::XcmPallet::send(
assert_ok!(<Rococo as RococoPallet>::XcmPallet::send_blob(
sudo_origin,
bx!(destination),
bx!(xcm),
xcm.encode().try_into().unwrap(),
));

type RuntimeEvent = <Rococo as Chain>::RuntimeEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn create_agent() {

let create_agent_call = SnowbridgeControl::Control(ControlCall::CreateAgent {});
// Construct XCM to create an agent for para 1001
let remote_xcm = VersionedXcm::from(Xcm(vec![
let remote_xcm = VersionedXcm::from(Xcm::<()>(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
DescendOrigin(Parachain(origin_para).into()),
Transact {
Expand All @@ -96,10 +96,10 @@ fn create_agent() {
// Rococo Global Consensus
// Send XCM message from Relay Chain to Bridge Hub source Parachain
Rococo::execute_with(|| {
assert_ok!(<Rococo as RococoPallet>::XcmPallet::send(
assert_ok!(<Rococo as RococoPallet>::XcmPallet::send_blob(
sudo_origin,
bx!(destination),
bx!(remote_xcm),
remote_xcm.encode().try_into().unwrap(),
));

type RuntimeEvent = <Rococo as Chain>::RuntimeEvent;
Expand Down Expand Up @@ -141,7 +141,7 @@ fn create_channel() {

let create_agent_call = SnowbridgeControl::Control(ControlCall::CreateAgent {});
// Construct XCM to create an agent for para 1001
let create_agent_xcm = VersionedXcm::from(Xcm(vec![
let create_agent_xcm = VersionedXcm::from(Xcm::<()>(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
DescendOrigin(Parachain(origin_para).into()),
Transact {
Expand All @@ -154,7 +154,7 @@ fn create_channel() {
let create_channel_call =
SnowbridgeControl::Control(ControlCall::CreateChannel { mode: OperatingMode::Normal });
// Construct XCM to create a channel for para 1001
let create_channel_xcm = VersionedXcm::from(Xcm(vec![
let create_channel_xcm = VersionedXcm::from(Xcm::<()>(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
DescendOrigin(Parachain(origin_para).into()),
Transact {
Expand All @@ -167,16 +167,16 @@ fn create_channel() {
// Rococo Global Consensus
// Send XCM message from Relay Chain to Bridge Hub source Parachain
Rococo::execute_with(|| {
assert_ok!(<Rococo as RococoPallet>::XcmPallet::send(
assert_ok!(<Rococo as RococoPallet>::XcmPallet::send_blob(
sudo_origin.clone(),
bx!(destination.clone()),
bx!(create_agent_xcm),
create_agent_xcm.encode().try_into().unwrap(),
));

assert_ok!(<Rococo as RococoPallet>::XcmPallet::send(
assert_ok!(<Rococo as RococoPallet>::XcmPallet::send_blob(
sudo_origin,
bx!(destination),
bx!(create_channel_xcm),
create_channel_xcm.encode().try_into().unwrap(),
));

type RuntimeEvent = <Rococo as Chain>::RuntimeEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ publish = false
workspace = true

[dependencies]
codec = { package = "parity-scale-codec", version = "3.6.0" }

# Substrate
frame-support = { path = "../../../../../../../substrate/frame/support", default-features = false }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.

use crate::tests::*;
use codec::Encode;

#[test]
fn send_xcm_from_westend_relay_to_rococo_asset_hub_should_fail_on_not_applicable() {
Expand All @@ -26,7 +27,7 @@ fn send_xcm_from_westend_relay_to_rococo_asset_hub_should_fail_on_not_applicable

let remote_xcm = Xcm(vec![ClearOrigin]);

let xcm = VersionedXcm::from(Xcm(vec![
let xcm = VersionedXcm::from(Xcm::<()>(vec![
UnpaidExecution { weight_limit, check_origin },
ExportMessage {
network: RococoId,
Expand All @@ -38,10 +39,10 @@ fn send_xcm_from_westend_relay_to_rococo_asset_hub_should_fail_on_not_applicable
// Westend Global Consensus
// Send XCM message from Relay Chain to Bridge Hub source Parachain
Westend::execute_with(|| {
assert_ok!(<Westend as WestendPallet>::XcmPallet::send(
assert_ok!(<Westend as WestendPallet>::XcmPallet::send_blob(
sudo_origin,
bx!(destination),
bx!(xcm),
xcm.encode().try_into().unwrap(),
));

type RuntimeEvent = <Westend as Chain>::RuntimeEvent;
Expand Down
Loading
Loading