Skip to content

feat(pallet-xcm): Add supported_version to pallet-xcm genesis config#9225

Merged
bkontur merged 2 commits intoparitytech:masterfrom
moonbeam-foundation:rq/add-genesis-supported-version-to-pallet-xcm
Jul 17, 2025
Merged

feat(pallet-xcm): Add supported_version to pallet-xcm genesis config#9225
bkontur merged 2 commits intoparitytech:masterfrom
moonbeam-foundation:rq/add-genesis-supported-version-to-pallet-xcm

Conversation

@RomarQ
Copy link
Copy Markdown
Contributor

@RomarQ RomarQ commented Jul 16, 2025

Relates to: polkadot-fellows/runtimes#544
Closes #9075

Adds a supported_version field to the pallet-xcm genesis config. Which allows specifying versioned locations at genesis.

@RomarQ RomarQ requested a review from a team as a code owner July 16, 2025 13:19
@bkontur
Copy link
Copy Markdown
Contributor

bkontur commented Jul 16, 2025

/cmd fmt

@RomarQ
Copy link
Copy Markdown
Contributor Author

RomarQ commented Jul 16, 2025

Added major to the bump field since it is a breaking change. Let me know if I should change it to something else.

@bkontur bkontur added the T6-XCM This PR/Issue is related to XCM. label Jul 16, 2025
@bkontur
Copy link
Copy Markdown
Contributor

bkontur commented Jul 16, 2025

Added major to the bump field since it is a breaking change. Let me know if I should change it to something else.

yes, let's wait for SemVer CI job and see

@bkontur
Copy link
Copy Markdown
Contributor

bkontur commented Jul 16, 2025

Added major to the bump field since it is a breaking change. Let me know if I should change it to something else.

yes, let's wait for SemVer CI job and see

Well, yes, it needs to be major.


But if we have all the fields private and use some builder pattern for GenesisConfigs, then adding new fields wouldn't cause major all the time.

I think it should be quite easy to expand builder functions for all GenesisConfig struct fields on #[pallet::genesis_config], something like this:

impl<T: Config> GenesisConfig<T> {
        pub fn safe_xcm_version(mut self, safe_xcm_version: Option<XcmVersion>) -> GenesisConfig<T> {
            self.safe_xcm_version = safe_xcm_version;
            self
        }

        pub fn supported_version(mut self, supported_version: Vec<(Location, XcmVersion)>) -> GenesisConfig<T> {
            self.supported_version = supported_version;
            self
        }
    }

I will probably created a separate issue, looks like a very nice easy DX improvement: #9228

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.

@RomarQ thank you :)

@bkontur bkontur added this pull request to the merge queue Jul 17, 2025
Merged via the queue into paritytech:master with commit 6ecd837 Jul 17, 2025
345 of 414 checks passed
EgorPopelyaev added a commit to EgorPopelyaev/polkadot-sdk that referenced this pull request Jul 17, 2025
* Allow create backport branches to unstable by A4-backport-unstable* tag (paritytech#9167)

In this
[PR](paritytech#9139 (comment)),
I added the `A4-backport-unstable2507` label, but no backport branch was
created for `unstable2507`.

Was this intentional or just an oversight or did I miss anything in the
release channel?
How do we do backports to unstable2507? If manually, just close this.

cc: @EgorPopelyaev - this PR is just a blind draft (not sure if it
works), probably more needs to be fixed and properly tested. If we
really need this, could you please take it over the finish line? If not,
just close it :)

Co-authored-by: Egor_P <egor@parity.io>

* feat(pallet-xcm): Add supported_version to pallet-xcm genesis config (paritytech#9225)

Relates to: polkadot-fellows/runtimes#544
Closes paritytech#9075

Adds a `supported_version` field to the pallet-xcm genesis config. Which
allows specifying versioned locations at genesis.

* Don't use labels for branch names creation

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: Rodrigo Quelhas <22591718+RomarQ@users.noreply.github.com>
epo-release-automation-app bot pushed a commit to EgorPopelyaev/polkadot-sdk that referenced this pull request Jul 17, 2025
* Allow create backport branches to unstable by A4-backport-unstable* tag (paritytech#9167)

In this
[PR](paritytech#9139 (comment)),
I added the `A4-backport-unstable2507` label, but no backport branch was
created for `unstable2507`.

Was this intentional or just an oversight or did I miss anything in the
release channel?
How do we do backports to unstable2507? If manually, just close this.

cc: @EgorPopelyaev - this PR is just a blind draft (not sure if it
works), probably more needs to be fixed and properly tested. If we
really need this, could you please take it over the finish line? If not,
just close it :)

Co-authored-by: Egor_P <egor@parity.io>

* feat(pallet-xcm): Add supported_version to pallet-xcm genesis config (paritytech#9225)

Relates to: polkadot-fellows/runtimes#544
Closes paritytech#9075

Adds a `supported_version` field to the pallet-xcm genesis config. Which
allows specifying versioned locations at genesis.

* Don't use labels for branch names creation

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: Rodrigo Quelhas <22591718+RomarQ@users.noreply.github.com>
(cherry picked from commit 6e91c9e)
alvicsam pushed a commit that referenced this pull request Oct 17, 2025
…9225)

Relates to: polkadot-fellows/runtimes#544
Closes #9075

Adds a `supported_version` field to the pallet-xcm genesis config. Which
allows specifying versioned locations at genesis.
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

Status: Done

Development

Successfully merging this pull request may close these issues.

[XCM] pallet-xcm's GenesisConfig support for SupportedVersion

6 participants