-
Notifications
You must be signed in to change notification settings - Fork 349
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
Adapts XCM remote account derivation to match Polkadot suggestions #2344
Merged
Conversation
This file contains 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
librelois
added
B7-runtimenoteworthy
Changes should be noted in any runtime-upgrade release notes
D5-nicetohaveaudit⚠️
PR contains trivial changes to logic that should be properly reviewed.
breaking
Needs to be mentioned in breaking changes
labels
Jun 12, 2023
librelois
changed the title
Elois xcm derive describe
XCM: Derive remote accounts in the same way as Jun 12, 2023
HashedDescription<AccountId, DescribeFamily<DescribeAllTerminal>>
Coverage generated "Tue Jun 13 19:35:08 UTC 2023": Master coverage: 71.22% |
fgamundi
approved these changes
Jun 13, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
crystalin
approved these changes
Jun 13, 2023
This reverts commit d03852f.
crystalin
changed the title
XCM: Derive remote accounts in the same way as
Adapt XCM remote account derivation to match Polkadot suggestions
Jun 15, 2023
HashedDescription<AccountId, DescribeFamily<DescribeAllTerminal>>
crystalin
changed the title
Adapt XCM remote account derivation to match Polkadot suggestions
Adapts XCM remote account derivation to match Polkadot suggestions
Jun 15, 2023
notlesh
added
D1-audited👍
PR contains changes to fund-managing logic that has been properly reviewed and externally audited
and removed
D5-nicetohaveaudit⚠️
PR contains trivial changes to logic that should be properly reviewed.
labels
Aug 16, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
B7-runtimenoteworthy
Changes should be noted in any runtime-upgrade release notes
breaking
Needs to be mentioned in breaking changes
D1-audited👍
PR contains changes to fund-managing logic that has been properly reviewed and externally audited
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
HashedDescriptionDescribeFamilyAllTerminal
that 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
DescendOrigin
instruction 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?