-
Notifications
You must be signed in to change notification settings - Fork 680
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
Transact without specifying weight #6228
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
@@ -94,7 +94,7 @@ use sp_staking::SessionIndex; | |||
#[cfg(any(feature = "std", test))] | |||
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}; |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 :))
0fc5cc8
to
a044c7c
Compare
bot fmt |
@franciscoaguirre https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7657414 was started for your command Comment |
@franciscoaguirre Command |
@bkontur Updated with feedback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, lgtm
Addresses #4284
For V5, removed
required_weight_at_most
fromTransact
.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.