-
Notifications
You must be signed in to change notification settings - Fork 374
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
XCM native fee reduction #1092
XCM native fee reduction #1092
Conversation
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 direction looks good to me. IMO we need checks on local fork to see how much XCM fees needed for common cross-chain transfers with this solution.
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.
LGTM
Minimum allowed line rate is |
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.
LGTM
Pull Request Summary
Solution suggestion to reduce XCM fees when paid in native.
Overview
With the introduction of fee alignment, native fees have been slightly increased according to the
proposed Tokenomics 2.0 model (here).
A thing that was missed is the impact of this on XCM fees.
The way XCM fees are calculated, in general, is static. We, as the Substrate/Polkadot ecosystem, don't yet have a good mechanism for the fetching of dynamic prices.
To minimize the impact, this PR suggests to reuse the existing
WeightToFee
struct which as the name says, convertsWeight
component into numeric fee (e.g. how much ASTR needs to be paid), but multiplies that fee with the minimum possible allowed value of the adjustment factor (the adjustment factor is used when calculating fees for the native transactions).Fee Overview
At the moment, all our runtimes have hardcoded XCM instruction ref time weight to
1_000_000_000
(picoseconds).Base fee per gas is set to
98_974_000
for all runtimes as well.Using that information we can express price per instruction:
Taking into account an average sequence with fixed weights, the price for execution on
Astar
will be around0.2 ASTR
per sequence.NOTE: This was calculated outside of runtime scope so real numbers might differ on-chain.