polkadot-sdk icon indicating copy to clipboard operation
polkadot-sdk copied to clipboard

Remove redundant XCMs from dry run's forwarded xcms

Open franciscoaguirre opened this issue 1 year ago • 3 comments

Description

This PR addresses https://github.com/paritytech/polkadot-sdk/issues/5878.

After dry running an xcm on asset hub, we had redundant xcms showing up in the forwarded_xcms field of the dry run effects returned. These were caused by two things:

  • The UpwardMessageSender router always added an element even if there were no messages.
  • The two routers on asset hub westend related to bridging (to rococo and sepolia) getting the message from their queues when their queues is actually the same xcmp queue that was already contemplated.

In order to fix this, we check for no messages in UMP and clear the implementation of InspectMessageQueues for these bridging routers. Keep in mind that the bridged message is still sent, as normal via the xcmp-queue to Bridge Hub. To keep on dry-running the journey of the message, the next hop to dry-run is Bridge Hub. That'll be tackled in a different PR.

Added a test in bridge-hub-westend-integration-tests and bridge-hub-rococo-integration-tests that show that dry-running a transfer across the bridge from asset hub results in one and only one message sent to bridge hub.

TODO

  • [x] Functionality
  • [x] Test

franciscoaguirre avatar Oct 03 '24 11:10 franciscoaguirre

bot fmt

franciscoaguirre avatar Oct 04 '24 10:10 franciscoaguirre

@franciscoaguirre https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7502715 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 13-38347683-8f6c-42d5-bf57-7291f131f911 to cancel this command or bot cancel to cancel all commands in this pull request.

command-bot[bot] avatar Oct 04 '24 10:10 command-bot[bot]

@franciscoaguirre Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7502715 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7502715/artifacts/download.

command-bot[bot] avatar Oct 04 '24 10:10 command-bot[bot]

there are a few failing tests (pallet-xcm-bridge-hub-router tests::get_messages_works) that need updating, otherwise this is good to go 🚀

acatangiu avatar Oct 10 '24 07:10 acatangiu

Created backport PR for stable2407:

  • #6004 with remaining conflicts!

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-5913-to-stable2407
git worktree add --checkout .worktree/backport-5913-to-stable2407 backport-5913-to-stable2407
cd .worktree/backport-5913-to-stable2407
git reset --hard HEAD^
git cherry-pick -x 4a70b2cffb23db148a9af50cfbf13c4655dbaf7b
git push --force-with-lease

Created backport PR for stable2409:

  • #6005 with remaining conflicts!

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-5913-to-stable2409
git worktree add --checkout .worktree/backport-5913-to-stable2409 backport-5913-to-stable2409
cd .worktree/backport-5913-to-stable2409
git reset --hard HEAD^
git cherry-pick -x 4a70b2cffb23db148a9af50cfbf13c4655dbaf7b
git push --force-with-lease