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

Added fallback_max_weight to Transact for sending messages to V4 chai… #6778

Merged
merged 6 commits into from
Dec 9, 2024

Conversation

franciscoaguirre
Copy link
Contributor

@franciscoaguirre franciscoaguirre commented Dec 5, 2024

Backport of #6643 to stable2412.

We need it before the release so we have a good story with chains that haven't upgraded yet.

…ns (#6643)

Closes: #6585

Removing the `require_weight_at_most` parameter in V5 Transact had only
one problem. Converting a message from V5 to V4 to send to chains that
didn't upgrade yet. The conversion would not know what weight to give to
the Transact, since V4 and below require it.

To fix this, I added back the weight in the form of an `Option<Weight>`
called `fallback_max_weight`. This can be set to `None` if you don't
intend to deal with a chain that hasn't upgraded yet. If you set it to
`Some(_)`, the behaviour is the same. The plan is to totally remove this
in V6 since there will be a good conversion path from V6 to V5.

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Adrian Catangiu <adrian@parity.io>
@franciscoaguirre franciscoaguirre added the T6-XCM This PR/Issue is related to XCM. label Dec 5, 2024
@franciscoaguirre franciscoaguirre self-assigned this Dec 5, 2024
@franciscoaguirre franciscoaguirre requested a review from a team as a code owner December 5, 2024 17:28
@paritytech-review-bot paritytech-review-bot bot requested a review from a team December 5, 2024 17:29
Copy link

github-actions bot commented Dec 5, 2024

This pull request is amending an existing release. Please proceed with extreme caution,
as to not impact downstream teams that rely on the stability of it. Some things to consider:

  • Backports are only for 'patch' or 'minor' changes. No 'major' or other breaking change.
  • Should be a legit fix for some bug, not adding tons of new features.
  • Must either be already audited or not need an audit.
Emergency Bypass

If you really need to bypass this check: add validate: false to each crate
in the Prdoc where a breaking change is introduced. This will release a new major
version of that crate and all its reverse dependencies and basically break the release.

polkadot/xcm/src/v4/mod.rs Outdated Show resolved Hide resolved
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
@paritytech-review-bot paritytech-review-bot bot requested a review from a team December 8, 2024 22:03
@franciscoaguirre franciscoaguirre enabled auto-merge (squash) December 8, 2024 22:09
bkontur
bkontur previously approved these changes Dec 9, 2024
polkadot/xcm/src/v4/mod.rs Outdated Show resolved Hide resolved
x3c41a
x3c41a previously approved these changes Dec 9, 2024
To fix this, XCM v5 Transact now also takes a `fallback_max_weight: Option<Weight>` parameter.
This can be set to `None` if the instruction is not meant to be sent to chains running XCM versions lower than V5.
If set to `Some(weight)`, a subsequent conversion to V4 will result in `Transact { require_weight_at_most: weight, .. }`.
The plan is to remove this workaround in V6 since there will be a good conversion path from V6 to V5.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have already have a list of things we want to have in v6? It'd be good to add this one straight away so that we don't forget about it.

polkadot/xcm/src/v4/mod.rs Outdated Show resolved Hide resolved
@franciscoaguirre franciscoaguirre dismissed stale reviews from x3c41a and bkontur via 8ea1ea6 December 9, 2024 12:23
@paritytech-review-bot paritytech-review-bot bot requested a review from a team December 9, 2024 12:24
x3c41a
x3c41a previously approved these changes Dec 9, 2024
bkontur
bkontur previously approved these changes Dec 9, 2024
@franciscoaguirre franciscoaguirre dismissed stale reviews from bkontur and x3c41a via 600d00d December 9, 2024 14:30
@paritytech-review-bot paritytech-review-bot bot requested a review from a team December 9, 2024 14:31
@EgorPopelyaev EgorPopelyaev merged commit 5e47c23 into stable2412 Dec 9, 2024
182 of 197 checks passed
@EgorPopelyaev EgorPopelyaev deleted the transact-fallback-max-weight-stable2412 branch December 9, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T6-XCM This PR/Issue is related to XCM.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants