Skip to content

Transact without specifying weight#6228

Merged
acatangiu merged 11 commits intoxcm-v5from
transact-without-specifying-weight
Oct 29, 2024
Merged

Transact without specifying weight#6228
acatangiu merged 11 commits intoxcm-v5from
transact-without-specifying-weight

Conversation

@franciscoaguirre
Copy link
Copy Markdown
Contributor

@franciscoaguirre franciscoaguirre commented Oct 24, 2024

Addresses #4284

For V5, removed required_weight_at_most from Transact.
The weigher now has to decode the call inside of a transaction in order to know it's dispatch weight.
It's harder to make mistakes now, since the user no longer specifies a weight value which might be wrong.

@franciscoaguirre franciscoaguirre requested review from a team as code owners October 24, 2024 19:31
@paritytech-review-bot paritytech-review-bot bot requested a review from a team October 24, 2024 19:32
@acatangiu acatangiu added the T6-XCM This PR/Issue is related to XCM. label Oct 25, 2024
@acatangiu acatangiu changed the base branch from master to xcm-v5 October 25, 2024 13:29
@acatangiu acatangiu mentioned this pull request Oct 25, 2024
10 tasks
Copy link
Copy Markdown
Contributor

@acatangiu acatangiu left a comment

Choose a reason for hiding this comment

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

Nice!

use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
use xcm::v4::{Assets, InteriorLocation, Location, SendError, SendResult, SendXcm, XcmHash};
use xcm::v5::{Assets, InteriorLocation, Location, SendError, SendResult, SendXcm, XcmHash};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@franciscoaguirre yes, yes, my favorite, I think we should use xcm::latest here :D

@seadanda I also think we should refactor polkadot/runtime/parachains/src/coretime/mod.rs to use xcm::latest instead of the specific xcmV4 version. If I understand correctly, this pallet only sends some XCM at some point and does not store XCM data/structs, so it should be fine and preferable to use xcm::latest.

Keeping this pallet on xcmV4 while migrating the rest to xcmV5 could lead to potential issues, as we would need to manage multiple imports in the fellows' runtimes, e.g., xcm::v4::SendXcm and xcm::v5::SendXcm.

For now, it’s fine on the master since xcmV4 is the latest version. However, I recommend refactoring the coretime pallet directly on the master branch before merging xcmV5.

"Max weight bigger than require at most",
);

return Err(XcmError::MaxWeightInvalid)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

haha, now we could remove MaxWeightInvalid from the xcm spec - related to the #6199
(no need to do anything here, just a comment :))

@franciscoaguirre franciscoaguirre force-pushed the transact-without-specifying-weight branch from 0fc5cc8 to a044c7c Compare October 28, 2024 21:00
@franciscoaguirre
Copy link
Copy Markdown
Contributor Author

bot fmt

@command-bot
Copy link
Copy Markdown

command-bot bot commented Oct 28, 2024

@franciscoaguirre https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7657414 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 5-362fa557-75ae-4470-96a8-d0294355ceb1 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link
Copy Markdown

command-bot bot commented Oct 28, 2024

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

@franciscoaguirre
Copy link
Copy Markdown
Contributor Author

@bkontur Updated with feedback

Copy link
Copy Markdown
Contributor

@bkontur bkontur left a comment

Choose a reason for hiding this comment

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

nice, lgtm

@acatangiu acatangiu merged commit a1b8381 into xcm-v5 Oct 29, 2024
@acatangiu acatangiu deleted the transact-without-specifying-weight branch October 29, 2024 09:43
github-merge-queue bot pushed a commit that referenced this pull request Nov 6, 2024
# Context

This PR aims to introduce XCMv5, for now it's in progress and will be
updated over time.
This branch will serve as a milestone branch for merging in all features
we want to add to XCM, roughly outlined
[here](polkadot-fellows/xcm-format#60).
More features could be added.

## TODO
- [x] Migrate foreign assets from v3 to v4
- [x] Setup v5 skeleton
- [x] Remove XCMv2
- [x] #5390
- [x] #5585
- [x] #5420
- [x] #5876
- [x] #5971
- [x] #6148
- [x] #6228

Fixes #3434 
Fixes #4190
Fixes #5209
Fixes #5241
Fixes #4284

---------

Signed-off-by: Adrian Catangiu <[email protected]>
Co-authored-by: Adrian Catangiu <[email protected]>
Co-authored-by: Andrii <[email protected]>
Co-authored-by: Branislav Kontur <[email protected]>
Co-authored-by: Joseph Zhao <[email protected]>
Co-authored-by: Nazar Mokrynskyi <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: command-bot <>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Serban Iorga <[email protected]>
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.

3 participants