Skip to content
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

xcm: Change TypeInfo::path to not include staging #1948

Merged
merged 4 commits into from
Oct 20, 2023

Conversation

bkchr
Copy link
Member

@bkchr bkchr commented Oct 19, 2023

The xcm crate was renamed to staging-xcm to be able to publish it to crates.io as someone as squatted xcm. The problem with this rename is that the TypeInfo includes the crate name which ultimately lands in the metadata. The metadata is consumed by downstream users like polkadot-js or people building on top of polkadot-js. These people are using the entire path to find the type in the type registry. Thus, their code would break as the type path would now be [staging_xcm, VersionedXcm] instead of [xcm, VersionedXcm]. This pull request fixes this by renaming the path segment staging_xcm to xcm.

This requires: paritytech/scale-info#197

The `xcm` crate was renamed to `staging-xcm` to be able to publish it to
crates.io as someone as squatted `xcm`. The problem with this rename is
that the `TypeInfo` includes the crate name which ultimately lands in
the metadata. The metadata is consumed by downstream users like
`polkadot-js` or people building on top of `polkadot-js`. These people
are using the entire `path` to find the type in the type registry. Thus,
their code would break as the type path would now be [`staging_xcm`,
`VersionedXcm`] instead of [`xcm`, `VersionedXcm`]. This pull request
fixes this by renaming the path segment `staging_xcm` to `xcm`.

This requires: paritytech/scale-info#197
@bkchr bkchr added the R0-silent Changes should not be mentioned in any release notes label Oct 19, 2023
@bkchr bkchr requested a review from a team as a code owner October 19, 2023 21:25
polkadot/xcm/src/tests.rs Outdated Show resolved Hide resolved
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Copy link
Contributor

@KiChjang KiChjang left a comment

Choose a reason for hiding this comment

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

Bit unfortunate that we have to scatter this attribute everywhere where we drive TypeInfo, but I don't see much alternatives that are less intrusive.

@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-clippy
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/4023915

@bkchr bkchr requested review from a team October 20, 2023 08:30
@bkchr bkchr requested a review from a team October 20, 2023 08:30
@franciscoaguirre franciscoaguirre enabled auto-merge (squash) October 20, 2023 08:47
@xlc
Copy link
Contributor

xlc commented Oct 20, 2023

does this means we should avoid using polkadot-sdk until this is merged?

@bkchr
Copy link
Member Author

bkchr commented Oct 20, 2023

does this means we should avoid using polkadot-sdk until this is merged?

It will be merged in some minutes and we will backport it.

@franciscoaguirre franciscoaguirre merged commit f3bf5c1 into master Oct 20, 2023
109 of 111 checks passed
@franciscoaguirre franciscoaguirre deleted the bkchr-xcm-rename-type-info-path branch October 20, 2023 09:21
acatangiu pushed a commit to acatangiu/polkadot-sdk that referenced this pull request Oct 30, 2023
)

The `xcm` crate was renamed to `staging-xcm` to be able to publish it to
crates.io as someone as squatted `xcm`. The problem with this rename is
that the `TypeInfo` includes the crate name which ultimately lands in
the metadata. The metadata is consumed by downstream users like
`polkadot-js` or people building on top of `polkadot-js`. These people
are using the entire `path` to find the type in the type registry. Thus,
their code would break as the type path would now be [`staging_xcm`,
`VersionedXcm`] instead of [`xcm`, `VersionedXcm`]. This pull request
fixes this by renaming the path segment `staging_xcm` to `xcm`.

This requires: paritytech/scale-info#197

---------

Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Morganamilo pushed a commit that referenced this pull request Nov 14, 2023
The `xcm` crate was renamed to `staging-xcm` to be able to publish it to
crates.io as someone as squatted `xcm`. The problem with this rename is
that the `TypeInfo` includes the crate name which ultimately lands in
the metadata. The metadata is consumed by downstream users like
`polkadot-js` or people building on top of `polkadot-js`. These people
are using the entire `path` to find the type in the type registry. Thus,
their code would break as the type path would now be [`staging_xcm`,
`VersionedXcm`] instead of [`xcm`, `VersionedXcm`]. This pull request
fixes this by renaming the path segment `staging_xcm` to `xcm`.

This requires: paritytech/scale-info#197

---------

Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this pull request Mar 25, 2024
)

The `xcm` crate was renamed to `staging-xcm` to be able to publish it to
crates.io as someone as squatted `xcm`. The problem with this rename is
that the `TypeInfo` includes the crate name which ultimately lands in
the metadata. The metadata is consumed by downstream users like
`polkadot-js` or people building on top of `polkadot-js`. These people
are using the entire `path` to find the type in the type registry. Thus,
their code would break as the type path would now be [`staging_xcm`,
`VersionedXcm`] instead of [`xcm`, `VersionedXcm`]. This pull request
fixes this by renaming the path segment `staging_xcm` to `xcm`.

This requires: paritytech/scale-info#197

---------

Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants