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

Add max destination fee #1168

Merged
merged 18 commits into from
Apr 14, 2024
Merged

Add max destination fee #1168

merged 18 commits into from
Apr 14, 2024

Conversation

alistair-singh
Copy link
Contributor

@alistair-singh alistair-singh commented Apr 1, 2024

Resolves: SNO-951

Copy link

codecov bot commented Apr 1, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 77.75%. Comparing base (24b9d31) to head (dd4ca4b).
Report is 6 commits behind head on main.

❗ Current head dd4ca4b differs from pull request most recent head 1a2e80d. Consider uploading reports for the commit 1a2e80d to get more accurate results

Files Patch % Lines
contracts/src/DeployGatewayLogic.sol 0.00% 2 Missing ⚠️
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     
Flag Coverage Δ
solidity 77.75% <50.00%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

contracts/src/Assets.sol Outdated Show resolved Hide resolved
Copy link
Contributor

@yrong yrong left a comment

Choose a reason for hiding this comment

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

+1

Comment on lines 71 to 79

// Destination fee cannot be zero. MultiAssets are not allowed to be zero in xcm v4.
if (destinationChainFee == 0 || destinationChainFee > $.destinationMaxTransferFee) {
revert InvalidDestinationFee();
}
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in ddbdd58

contracts/src/storage/AssetsStorage.sol Outdated Show resolved Hide resolved
contracts/src/upgrades/rococo/GatewayV2.sol Outdated Show resolved Hide resolved
contracts/test/Gateway.t.sol Show resolved Hide resolved
contracts/test/Gateway.t.sol Outdated Show resolved Hide resolved
contracts/test/Gateway.t.sol Outdated Show resolved Hide resolved
web/packages/test/.gitignore Show resolved Hide resolved
@alistair-singh alistair-singh force-pushed the alistair/add-max-destination-fee branch from ddbdd58 to a8a2e58 Compare April 8, 2024 20:08
Copy link
Contributor

@claravanstaden claravanstaden left a comment

Choose a reason for hiding this comment

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

Nice!

contracts/test/Gateway.t.sol Outdated Show resolved Hide resolved
contracts/test/Gateway.t.sol Outdated Show resolved Hide resolved
Comment on lines 72 to 74
// The maximum fee that can be sent to a destination parachain to pay for execution (DOT)
uint128 internal immutable MAX_DESTINATION_TRANSFER_FEE;

Copy link
Contributor

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?

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;

Copy link
Contributor Author

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.

@alistair-singh alistair-singh force-pushed the alistair/add-max-destination-fee branch from 23fe816 to 5aaef50 Compare April 12, 2024 11:03
@vgeddes vgeddes merged commit 2a66b9f into main Apr 14, 2024
1 check passed
@vgeddes vgeddes deleted the alistair/add-max-destination-fee branch April 14, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants