Skip to content

PSM init: skip assets with mismatched decimals instead of panicking#11807

Merged
muharem merged 3 commits intomasterfrom
szegoo-psm-remove-assert
Apr 18, 2026
Merged

PSM init: skip assets with mismatched decimals instead of panicking#11807
muharem merged 3 commits intomasterfrom
szegoo-psm-remove-assert

Conversation

@Szegoo
Copy link
Copy Markdown
Contributor

@Szegoo Szegoo commented Apr 17, 2026

Addresses issue @ggwpez raised in this comment: #11068 (comment)

Summary

Replaces the assert! in the PSM InitializePsm migration with a log + skip when an asset's decimals don't match the stable asset. Panicking in a runtime upgrade bricks the chain. Migrations must be infallible.

Test

Adds initialize_psm_skips_assets_with_wrong_decimals which verifies that assets with mismatched decimals are skipped while correctly-configured assets in the same migration are still added.

@Szegoo Szegoo requested a review from a team as a code owner April 17, 2026 08:13
@Szegoo Szegoo requested a review from ggwpez April 17, 2026 08:14
@Szegoo Szegoo added the T2-pallets This PR/Issue is related to a particular pallet. label Apr 17, 2026
@Szegoo Szegoo requested a review from muharem April 17, 2026 16:13
@muharem muharem added this pull request to the merge queue Apr 18, 2026
Merged via the queue into master with commit 878b158 Apr 18, 2026
262 of 264 checks passed
@muharem muharem deleted the szegoo-psm-remove-assert branch April 18, 2026 18:31
sigurpol pushed a commit that referenced this pull request Apr 20, 2026
…11807)

Addresses issue @ggwpez raised in this comment:
#11068 (comment)

## Summary

Replaces the `assert!` in the PSM `InitializePsm` migration with a log +
skip when an asset's decimals don't match the stable asset. Panicking in
a runtime upgrade bricks the chain. Migrations must be infallible.

### Test

Adds `initialize_psm_skips_assets_with_wrong_decimals` which verifies
that assets with mismatched decimals are skipped while
correctly-configured assets in the same migration are still added.
Copy link
Copy Markdown
Member

@ggwpez ggwpez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay thanks, i was also doing it here 😄 #11804

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T2-pallets This PR/Issue is related to a particular pallet.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants