-
Notifications
You must be signed in to change notification settings - Fork 871
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
Snowbridge - Tests refactor #8014
base: master
Are you sure you want to change the base?
Snowbridge - Tests refactor #8014
Conversation
@@ -44,7 +44,7 @@ fn transfer_and_transact_in_same_xcm( | |||
let asset_hub_location = BridgeHubWestend::sibling_location_of(AssetHubWestend::para_id()); | |||
|
|||
// TODO(https://github.com/paritytech/polkadot-sdk/issues/6197): dry-run to get local fees, for now use hardcoded value. | |||
let ah_fees_amount = 90_000_000_000u128; // current exact value 79_948_099_299 | |||
let ah_fees_amount = 700_000_000_000u128; // TODO not sure why this increased so much |
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.
Hmm, I don't like the uncertainty with this TODO
. We should try understand what is happening here.
Was this test not failing in #7402?
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.
Extracting the Weth to a common place had some side effects. Some tests used a different weth address, with an asset owner that was not Snowbridge sovereign. Using the same Weth address (that is registered in the emulated tests genesis config), resulted in having to make some changes to the test setup and asset owner. The fee increase doesn't make sense though, will investigate.
The test was passing in #7402.
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 was an interesting one. The root cause is the min_balance
of the registered Weth asset. In the original version of this test, the min_balance
of Weth was 1_000
. In the updated test, the min_balance
was 1_000_000_000
. The weight purchased should be at least the minimum balance of the asset provided:
- https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/primitives/utility/src/lib.rs#L178-L182
- https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/parachains/common/src/xcm_config.rs#L61
- https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/assets/src/types.rs#L346-L360
I set the min_balance
back to 1_000
, which lowered the required weight fee again.
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 need to think about the impact on mainnet for using Ether and Weth to pay fees. Both their min_balance
are 15_000_000_000_000
. Maybe this is not a problem, just thinking about it explicitly. It means the min amount provided to buy weight needs to be at least 15_000_000_000_000
. I am not sure if the PayFees
instruction works the same way.
Added internal issue to track this: SNO-1440
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'd assume on mainnet we will create a liquidity pool (ETH, DOT) and rely on SwapFirstAssetTrader
as the primary trader. IIUC, TakeFirstAssetTrader
here is just a fallback without a liquidity pool, in this case, ED
acts as a simplified version of the swap rate.
Resolves: SNO-1427
Closes: #7977