-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
Add a runtime test calculate the delivery cost:
As result above shows |
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.
Hey Ron, excuse the tardy response on this, I was mostly OOTO last week.
Yeah, I was initially aware that XCM sends could have a send cost, but when I looked at the runtime config these costs seemed to be zero, so I avoided having to implement it.
Do you know how these send costs are configured and calculated in the xcm executor?
Lets add a linear ticket for this, so we can track it when scheduling priorities. |
For sending xcm to sibling chains the cost is calculated with
Add a ticket for tracing in https://linear.app/snowfork/issue/SNO-980 |
Reopening this, even though its low priority. Otherwise we may delete the branch by mistake. |
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 catch!
@@ -141,6 +141,9 @@ pub mod pallet { | |||
|
|||
/// To withdraw and deposit an asset. | |||
type AssetTransactor: TransactAsset; | |||
|
|||
/// The most expensive xcm here only used to estimate send cost | |||
type MaxSendCostXcm: Get<Xcm<()>>; |
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.
Instead of configuring an XCM here to set the fee, I would prefer we use a constant fee and then in a test assert that the const equates to the xcm so we know if when the fee diviates.
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.
<Runtime as snowbridge_pallet_inbound_queue::Config>::MaxMessageSize::get(), | ||
); | ||
let inbound_send_cost = | ||
<Runtime as snowbridge_pallet_inbound_queue::Config>::MaxSendCost::get(); |
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.
We should probably assert that the configured cost is greater than or equal to the xcm cost using the same method you used here:
8ad87ba#diff-832917c2fd6302a9f175210f7d9941ea82a1a7c5a35aa35e662380074d405203L370-L377
Probably not important for this test. But may be very important for the fellowship runtime.
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.
Context
This PR tries to fix the issue that send cost on BH is not taken into account, should be included and match the deliveryCost on Ethereum.
Resolves: https://linear.app/snowfork/issue/SNO-980
Resolves: https://linear.app/snowfork/issue/SNO-1115