-
Notifications
You must be signed in to change notification settings - Fork 104
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
Add max destination fee #1168
Add max destination fee #1168
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1168 +/- ##
==========================================
- Coverage 77.83% 77.75% -0.09%
==========================================
Files 14 16 +2
Lines 415 418 +3
Branches 76 75 -1
==========================================
+ Hits 323 325 +2
Misses 75 75
- Partials 17 18 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
+1
contracts/src/Assets.sol
Outdated
|
||
// Destination fee cannot be zero. MultiAssets are not allowed to be zero in xcm v4. | ||
if (destinationChainFee == 0 || destinationChainFee > $.destinationMaxTransferFee) { | ||
revert InvalidDestinationFee(); | ||
} |
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.
Why not move this up above the costs.foreign
assignment?
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.
addressed in ddbdd58
ddbdd58
to
a8a2e58
Compare
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.
Nice!
contracts/src/Gateway.sol
Outdated
// The maximum fee that can be sent to a destination parachain to pay for execution (DOT) | ||
uint128 internal immutable MAX_DESTINATION_TRANSFER_FEE; | ||
|
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.
Just curious why not make it a storage value like other fee params?
snowbridge/contracts/src/storage/AssetsStorage.sol
Lines 13 to 17 in bc62ad1
uint128 assetHubCreateAssetFee; | |
// XCM fee charged by AssetHub for receiving a token from the Gateway (DOT) | |
uint128 assetHubReserveTransferFee; | |
// Extra fee for registering a token, to discourage spamming (Ether) | |
uint256 registerTokenFee; |
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.
So originally I did have it as a storage params. But we did not want the functionality of it being able to be updated via the set_fee_params
extrinsic from the control pallet. Since we didn't need it to be changed at runtime, I decided on just using an immutable for now so that we do not need to have a migration of AssetsStorage.
23fe816
to
5aaef50
Compare
Resolves: SNO-951