-
Notifications
You must be signed in to change notification settings - Fork 699
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
Fix DepositReserveAsset
fees payment
#3340
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f3007a6
fix-deposit-reserve-asset
NachoPal dda79b3
Merge branch 'master' into nacho/fix-deposit-reserve-asset
NachoPal 9e8cc5a
test added
NachoPal 670ab70
Merge branch 'nacho/regression-test-for-deposit-reserve-asset' into n…
NachoPal 03eb542
fmt
NachoPal d26daee
Merge branch 'master' into nacho/fix-deposit-reserve-asset
NachoPal 5b022c6
allow check-runtime-migration-westend failure
NachoPal 1afd30b
Merge branch 'master' into nacho/fix-deposit-reserve-asset
acatangiu 8a14c11
Merge branch 'master' into nacho/fix-deposit-reserve-asset
NachoPal 816bed7
fix test
NachoPal 857e2de
fmt
NachoPal b7a8e32
remove warning
NachoPal 4367f5d
Merge branch 'master' into nacho/fix-deposit-reserve-asset
NachoPal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
Oops, something went wrong.
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.
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.
this new test is failing in CI following merge from master
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.
The previous
PriceForMessageDelivery
was flaky returning different prices.Primarily, it was designed to return the same price for identical messages. However, reanchored messages weren't actually the same.
ReserveAssetDeposited
send()
is done for a message wheretransport_fee
has been deducted from the initial asset amount.It does not explain by itself why the test was flaky. The reason for this flakiness is that the appended
SetTopic(id)
is calculated using the previous block as entropy. This is why any change in the runtime led to changes in the final message which might or might not generate enough transport fees to be paid.All of this made me realise that the current method of setting aside the
transport_fee
forDepositReserveAsset
will never be infallible for any possiblePriceForMessageDelivery
implementation. There is a circular dependency where it is impossible to know the actualDepositReserveAsset
amount that will finally be included in the message from which thetransport_fee
is calculated. @acatangiu @franciscoaguirreI followed a different approach to fix the test.
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.
Can you expand a bit on the transport cost variance?
The actual amount (scalar value) of the asset within the message changes/impacts the message weight? I.e. An instruction containing asset: 2 DOT is more expensive than same instruction with asset: 3 DOT? Did I understand that correctly?
Or is it an issue with
SetTopic(id)
whose transport cost is not correctly calculated during execution ofReserveAssetDeposited
? Looking at the code I'm missing where this cost changes between when we calculate and when it is charged..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.
Not for our
PriceForMessageDelivery
implementation, because it only depends on the message size, that is why it was failing when the asset was not reanchored.I am just saying that potentially, a third party could make use of the
xcm-executor
with a differentPriceForMessageDelivery
implementation, and we can not guarantee that the set asidetransport_fee
approach forDepositReserveAsset
will be infalible. It is just something to be aware of in case the design can be improved, not a big deal, not even probable to ever happen, and something that shouldn't block this PR.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.
I'll proceed to merge it if the new test looks ok to you.