-
Notifications
You must be signed in to change notification settings - Fork 346
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
Optional ERC20-XCM gas limit override and tests #2422
Conversation
Coverage generated "Fri Aug 25 07:55:46 UTC 2023": Master coverage: 87.39% |
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.
Looks good so far, I left a couple comments.
Another more general one: GeneralIndex
seems very general-purpose for this. Maybe we should create a special AssetId
to represent gas instead?
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 PR is incomplete, you should also modify the XCM Weigher to apply the gas limit to the message weight and then the XCM fees.
Co-authored-by: Stephen Shelton <steve@brewcraft.org>
@@ -67,6 +67,28 @@ impl<Erc20MultilocationPrefix: Get<MultiLocation>> Erc20Matcher<Erc20Multilocati | |||
_ => Err(()), | |||
} | |||
} | |||
pub(crate) fn matches_gas_limit(multiasset: &MultiAsset) -> Option<u64> { |
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 function is useless and increase the call stack for nothing, please remove it and move it's body inside weight_of_erc20_transfer
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 think you could use if let
to write this concisely instead of having a helper fn
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.
@fgamundi next time, please notify the reviewers again via github, otherwise I won't come back until I've reviewed all the open PRs (which is not often). |
Hey @librelois. Thanks for the review! I didn't request rereview because I still wanted to make more changes (partially addressing what you commented), but didn't get time before my time off |
Accept an additional optional Junction for incoming ERC20-XCM transfers to override the default gas limit
Erc20XcmBridgeTransferGasLimit
in the asset multilocation.