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

Snowbridge - Tests refactor #8014

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

claravanstaden
Copy link
Contributor

  • Moves Weth and Chain ID constants to a common module
  • Changes Ether on Rococo's owner to Westend AH, to simulate double bridging
  • Removes Rococo integration tests, since Snowbridge is now only deployed to Westend and will support double bridging to Rococo only

Resolves: SNO-1427
Closes: #7977

@claravanstaden claravanstaden marked this pull request as ready for review March 25, 2025 09:04
@@ -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
Copy link
Contributor

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?

Copy link
Contributor Author

@claravanstaden claravanstaden Mar 25, 2025

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.

Copy link
Contributor Author

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:

I set the min_balance back to 1_000, which lowered the required weight fee again.

Copy link
Contributor Author

@claravanstaden claravanstaden Mar 26, 2025

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

Copy link
Contributor

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.

@claravanstaden claravanstaden changed the title Snowbridge tests refactor Snowbridge - Tests refactor Mar 26, 2025
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.

[Snowbridge v2] Rationalize constants for emulated tests
3 participants