paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.com/
1.89k stars 696 forks source link

[XCM] `pallet_xcm` internal data changes proposal #6188

Open bkontur opened 3 weeks ago

bkontur commented 3 weeks ago

Part of: https://github.com/paritytech/polkadot-sdk/issues/3214 Follow-up of: https://github.com/paritytech/polkadot-sdk/pull/6148

RemoteLockedFungibles

actual shape:

    pallet::storage]
    pub(super) type RemoteLockedFungibles<T: Config> = StorageDoubleMap<
        _,
        (
            NMapKey<Twox64Concat, XcmVersion>,
            NMapKey<Blake2_128Concat, T::AccountId>,
            NMapKey<Blake2_128Concat, VersionedAssetId>,
        ),
        RemoteLockedFungibleRecord<T::RemoteLockConsumerIdentifier, T::MaxRemoteLockConsumers>,
        OptionQuery,
    >;

proposed shape: - we don't need XcmVersion nmapkey prefx here

    #[pallet::storage]
    pub(super) type RemoteLockedFungibles<T: Config> = StorageDoubleMap<
        _,
        Blake2_128Concat,
        T::AccountId,
        Blake2_128Concat,
        VersionedAssetId,
        RemoteLockedFungibleRecord<T::RemoteLockConsumerIdentifier, T::MaxRemoteLockConsumers>,
        OptionQuery,
    >;

RecordedXcm change stored xcm::latest::Xcm to xcm::VersionedXcm ?

Does RecordedXcm work when adding a new XCM version? Possibly it could work, when XCM is compatible.

Bump storage version