Adapts XCM remote account derivation to match Polkadot suggestions#2344
Merged
Adapts XCM remote account derivation to match Polkadot suggestions#2344
Conversation
HashedDescription<AccountId, DescribeFamily<DescribeAllTerminal>>
Contributor
|
Coverage generated "Tue Jun 13 19:35:08 UTC 2023": Master coverage: 71.22% |
crystalin
approved these changes
Jun 13, 2023
This reverts commit d03852f.
HashedDescription<AccountId, DescribeFamily<DescribeAllTerminal>>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does it do?
The intial goal of this PR was to cherry pick paritytech/polkadot#7329 on our polkadot fork and replace our custom non-standard hash derivation by the new type
HashedDescription<AccountId, DescribeFamily<DescribeAllTerminal>>.The problem is that it's not possible to cherry-pick paritytech/polkadot#7329 directly without performing a complete dependency upgrade. To get around this problem, I've manually rewritten just the part we're interested in: I've created a new type named
HashedDescriptionDescribeFamilyAllTerminalthat converts xcm multilocations into local accountId in the same way asHashedDescription<AccountId, DescribeFamily<DescribeAllTerminal>>does with the new traits.To guarantee this equivalence, I wrote a rust test on our polkadot fork based on the master upstream branch: paritytech/polkadot@0679f2b.
Then I copied this test to our polkadot branch
moonbeam-polkadot-v0.9.40: paritytech/polkadot@89fd916#diff-b210cb75f8786021ba64cb7a2377778668ce90a2c306f6a1a1b822a2bba61cfaR590The
DescendOrigininstruction now derives accounts in a different way:new behavior:
blake2_256("SiblingChain" | paraId | "AccountKey20" | address)old behavior:
blake2_256("multiloc" | multilocation)What important points reviewers should know?
Is there something left for follow-up PRs?
What alternative implementations were considered?
Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?
What value does it bring to the blockchain users?