Polkadot Release Analysis v0.9.43

Appendix:

Remove the Copy bound on AssetId

PR: https://github.com/paritytech/substrate/pull/14158
Related: Make `AssetId` and `MultiLocation` non-`Copy`; make `Instruction` 92% smaller by koute · Pull Request #7236 · paritytech/polkadot · GitHub

This PR is removing the Copy trait from the AssetId type due to size optimization in XCM messages. Please be mindful about this change since it will have many implications in pallets relying on traits like the Inspect for example.

  error[E0382]: use of moved value: `asset_id`
     |
  93 |             ensure!(T::Assets::asset_exists(asset_id), Error::<T>::AssetDoesNotExist);
     |                                             -------- value moved here
  ...
  97 |                 !AssetIdMultiLocation::<T>::contains_key(asset_id),
     |                                                          ^^^^^^^^ value used here after move
     |
     = note: move occurs because `asset_id` has type `<<T as pallet::Config>::Assets as frame_support::traits::fungibles::Inspect<<T as frame_system::Config>::AccountId>>::AssetId`, which does not implement the `Copy` trait

As it is mentioned in Make `AssetId` and `MultiLocation` non-`Copy`; make `Instruction` 92% smaller by koute · Pull Request #7236 · paritytech/polkadot · GitHub, now those values have to be clone()d

4 Likes