Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

[xcm] GlobalConsensusConvertsFor for remote relay chain (based on pevious GlobalConsensusParachainConvertsFor) #7517

Merged
merged 18 commits into from
Aug 3, 2023

Conversation

bkontur
Copy link
Contributor

@bkontur bkontur commented Jul 19, 2023

Relates to: paritytech/parity-bridges-common#2401

Will be used to generate accountId as sovereign account of remote relaychain, e.g. for setting pallet_assets::ForeignAssets owner/issuer/freezer/admin for wrappedDOT/wrappedKSM

e.g.: on AssetHubKusama for foreign asset with MultiLocation { parents: 2, X1(GlobalConsensus(Polkadot)) } owner accountId will be

GlobalConsensusConvertsFor::<UniversalLocation, [u8; 32]>::conver_location(
    MultiLocation { parents: 2, X1(GlobalConsensus(Polkadot)) }
)

and also this GlobalConsensusConvertsFor could be added to the LocationToAccountId on AssetHubs, which will allow to process xcm::Transact(pallet_assets::set_team/...) over bridge from remote relay chain as owner of its wrapped representation of native asset

…revious GlobalConsensusParachainConvertsFor)
@bkontur bkontur added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. labels Jul 19, 2023
@bkontur bkontur requested a review from gavofyork July 19, 2023 09:09
xcm/xcm-builder/src/location_conversion.rs Show resolved Hide resolved
xcm/xcm-builder/src/location_conversion.rs Outdated Show resolved Hide resolved
xcm/xcm-builder/src/location_conversion.rs Outdated Show resolved Hide resolved
xcm/xcm-builder/src/location_conversion.rs Outdated Show resolved Hide resolved
@bkontur
Copy link
Contributor Author

bkontur commented Jul 26, 2023

bot rebase

@paritytech-processbot
Copy link

Rebased

xcm/src/v3/multiasset.rs Outdated Show resolved Hide resolved
xcm/xcm-builder/src/location_conversion.rs Outdated Show resolved Hide resolved
Comment on lines 356 to 360
/// WARNING: This results in the same `AccountId` value being generated regardless
/// of the relative security of the local chain and the Relay-chain of the input
/// location. This may not have any immediate security risks, however since it creates
/// commonalities between chains with different security characteristics, it could
/// possibly form part of a more sophisticated attack scenario.
Copy link
Contributor

Choose a reason for hiding this comment

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

Edited for clarity, however I don't particularly agree with this comment. It does not create commonalities between chains; actually it says that one chain will have the same 32-byte AccountId in other consensus systems (that use 32-byte account IDs). If this chain has a security incident, that would have effects in many other chains, but it does not put anything in common between the local chain and the "global" chain.

Unless I am missing something, I would delete this comment.

Suggested change
/// WARNING: This results in the same `AccountId` value being generated regardless
/// of the relative security of the local chain and the Relay-chain of the input
/// location. This may not have any immediate security risks, however since it creates
/// commonalities between chains with different security characteristics, it could
/// possibly form part of a more sophisticated attack scenario.
/// WARNING: This results in the same `AccountId` value being generated regardless of the relative
/// security of the local chain and the security of the input location. This may not have any
/// immediate security risks; however, because it creates commonalities between chains with
/// different security characteristics, it could possibly form part of a more sophisticated attack
/// scenario.

xcm/xcm-builder/src/location_conversion.rs Outdated Show resolved Hide resolved
xcm/xcm-builder/src/location_conversion.rs Show resolved Hide resolved
Copy link
Contributor

@svyatonik svyatonik left a comment

Choose a reason for hiding this comment

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

LGTM

xcm/xcm-builder/src/location_conversion.rs Show resolved Hide resolved
xcm/xcm-builder/src/location_conversion.rs Show resolved Hide resolved
xcm/xcm-builder/src/location_conversion.rs Outdated Show resolved Hide resolved
xcm/xcm-builder/src/location_conversion.rs Show resolved Hide resolved
bkontur and others added 6 commits July 28, 2023 14:16
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
…nverter' into bko-global-consensus-location-converter
@bkontur
Copy link
Contributor Author

bkontur commented Aug 1, 2023

bot rebase

@paritytech-processbot
Copy link

Rebased

@bkontur
Copy link
Contributor Author

bkontur commented Aug 1, 2023

bot rebase

@paritytech-processbot
Copy link

Rebased

@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: test-linux-stable
Logs: https://gitlab.parity.io/parity/mirrors/polkadot/-/jobs/3309519

@bkontur
Copy link
Contributor Author

bkontur commented Aug 3, 2023

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 407e158 into master Aug 3, 2023
8 checks passed
@paritytech-processbot paritytech-processbot bot deleted the bko-global-consensus-location-converter branch August 3, 2023 08:32
s0me0ne-unkn0wn pushed a commit that referenced this pull request Aug 15, 2023
…evious GlobalConsensusParachainConvertsFor) (#7517)

* [xcm] `GlobalConsensusConvertsFor` for remote relay chain (based on previous GlobalConsensusParachainConvertsFor)

* Typo

* PR fix (constants in test)

* Re-export of `GlobalConsensusConvertsFor`

* assert to panic

* Update xcm/src/v3/multiasset.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update xcm/xcm-builder/src/location_conversion.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update xcm/xcm-builder/src/location_conversion.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Review fixes

---------

Co-authored-by: parity-processbot <>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants