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

Deposit xcm fees to treasury #1036

Merged
merged 13 commits into from
Dec 2, 2021
Merged

Conversation

girazoki
Copy link
Collaborator

@girazoki girazoki commented Nov 29, 2021

What does it do?

Deposits the xcm fees in the paid asset to Treasury::account_id()

We dont burn any of the xcm fees as we want to match exactly what the sovereign account has

Before this PR, we were burning these.

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?

@@ -114,7 +114,7 @@ describeParachain(

// check asset in storage
const registeredAsset = await parachainOne.query.assets.asset(assetId);
expect((registeredAsset.toHuman() as { owner: string }).owner).to.eq(palletId.toLowerCase());
expect((registeredAsset.toHuman() as { owner: string }).owner).to.eq(palletId);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a change that was not fixed when we merged the Account20 PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also get rid of toHuman? I remember Jaco discouraged our using that in tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure, will try

@girazoki girazoki added B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes C3-medium Elevates a release containing this PR to "medium priority". labels Nov 30, 2021
@girazoki girazoki marked this pull request as ready for review November 30, 2021 10:04
@librelois
Copy link
Collaborator

Wouldn't it be more relevant to apply the same ratio as for transaction fees? (20% for treasury and 80% burned)

@girazoki
Copy link
Collaborator Author

girazoki commented Dec 1, 2021

I think we want to mimic exactly what the sovereign account has as our total supply. If we burn, then we loose that ratio.

@girazoki
Copy link
Collaborator Author

girazoki commented Dec 1, 2021

Mainly because any difference on this might be an indicator of an attack going on

@JoshOrndorff
Copy link
Contributor

I think we want to mimic exactly what the sovereign account has as our total supply. If we burn, then we loose that ratio.

Great point. That should for sure be mentioned in the description and maybe even in the code.

Copy link
Collaborator

@librelois librelois left a comment

Choose a reason for hiding this comment

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

Overall good, just some remarks to rename some types without including the term "Treasury". Indeed, one can very well decide in the future to place these xcm fees on another account with another piece of code that then use the money on that other account for any purpose.

runtime/moonbase/src/lib.rs Outdated Show resolved Hide resolved
runtime/moonbase/src/lib.rs Outdated Show resolved Hide resolved
runtime/moonbase/src/lib.rs Outdated Show resolved Hide resolved
runtime/moonbase/src/lib.rs Outdated Show resolved Hide resolved
@librelois librelois mentioned this pull request Dec 2, 2021
15 tasks
@librelois
Copy link
Collaborator

@girazoki think about resolving conflicts, otherwise the CI will not be triggered.

primitives/xcm/src/lib.rs Outdated Show resolved Hide resolved
@librelois
Copy link
Collaborator

@girazoki I merged master for the CI to be triggered

@girazoki
Copy link
Collaborator Author

girazoki commented Dec 2, 2021

Cool, busy with other stuff but I will take care of this shortly

@librelois librelois merged commit d6e6c1d into master Dec 2, 2021
@librelois librelois deleted the girazoki-xcm-fees-to-treasury branch December 2, 2021 20:29
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 C3-medium Elevates a release containing this PR to "medium priority".
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants