XCM executor keeps track and resolves all imbalances created by XCM operations#10384
Merged
acatangiu merged 79 commits intoparitytech:masterfrom Feb 16, 2026
Merged
XCM executor keeps track and resolves all imbalances created by XCM operations#10384acatangiu merged 79 commits intoparitytech:masterfrom
acatangiu merged 79 commits intoparitytech:masterfrom
Conversation
muharem
reviewed
Nov 26, 2025
Contributor
muharem
left a comment
There was a problem hiding this comment.
thanks, this is a big effort. looks good to me. It does make things even more complex, though, but I don’t have a fundamentally better idea. I left a few suggestions that might make things a bit safer.
this definitely requires us to write new tests for all affected types to verify the correct total issuance.
3f3726e to
f1311eb
Compare
…t of imbalances Helper traits to be used for generic Imbalance, helpful for tracking multiple concrete types of `Imbalance` using dynamic dispatch of these traits.
Change the xcm executor implementation and inner types and adapters so that it keeps track of imbalances across the stack. Previously, XCM operations on fungible assets would break the respective fungibles' total issuance invariants by burning and minting them in different stages of XCM processing pipeline. This commit fixes that by keeping track of the "withdrawn" or "deposited" fungible assets in holding and other XCM registers as imbalances. The imbalances are tied to the underlying pallet managing the asset so that they keep the assets' total issuance correctness throughout the execution of the XCM program. Imbalances in XCM registers are resolved by the underlying pallets managing them whenever they move from XCM registers to other parts of the stack (e.g. deposited to accounts, burned, etc).
7cc28e9 to
ab8e24f
Compare
muharem
reviewed
Jan 15, 2026
Contributor
muharem
left a comment
There was a problem hiding this comment.
looks good. few comments to double check
Contributor
Author
Contributor
|
@acatangiu we don't; (@dhirajs0 might be good to consider for https://github.com/open-web3-stack/polkadot-ecosystem-tests/pull/439/changes) |
Contributor
Author
|
/cmd fmt |
Contributor
Author
|
@muharem all comments are now addressed. ptal |
muharem
approved these changes
Jan 20, 2026
Contributor
Author
|
/cmd fmt |
Merged
via the queue into
paritytech:master
with commit Feb 16, 2026
1323611
242 of 244 checks passed
paritytech-release-backport-bot Bot
pushed a commit
that referenced
this pull request
Mar 10, 2026
…perations (#10384) Introduce "ImbalanceAccounting" traits for dynamic dispatch management of imbalances. These are helper traits to be used for generic Imbalance, helpful for tracking multiple concrete types of `Imbalance` using dynamic dispatch of these traits. `xcm-executor` now tracks imbalances in holding. Change the xcm executor implementation and inner types and adapters so that it keeps track of imbalances across the stack. Previously, XCM operations on fungible assets would break the respective fungibles' total issuance invariants by burning and minting them in different stages of XCM processing pipeline. This commit fixes that by keeping track of the "withdrawn" or "deposited" fungible assets in holding and other XCM registers as imbalances. The imbalances are tied to the underlying pallet managing the asset so that they keep the assets' total issuance correctness throughout the execution of the XCM program. Imbalances in XCM registers are resolved by the underlying pallets managing them whenever they move from XCM registers to other parts of the stack (e.g. deposited to accounts, burned, etc). XCM emulated tests now also verify total issuance before/after transfers, swaps, traps, claims, etc to guarantee implementation correctness. --------- Signed-off-by: Adrian Catangiu <adrian@parity.io> Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Daniel Shiposha <dev@shiposha.com> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: 0xRVE <robertvaneerdewijk@gmail.com> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: Sebastian Kunert <skunert49@gmail.com> Co-authored-by: Paolo La Camera <paolo@parity.io> Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com> Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> Co-authored-by: Manuel Mauro <manuel.mauro@protonmail.com> Co-authored-by: Alexandre R. Baldé <alexandre.balde@parity.io> Co-authored-by: Omar <OmarAbdulla7@hotmail.com> Co-authored-by: BDevParity <bruno.devic@parity.io> Co-authored-by: Egor_P <egor@parity.io> Co-authored-by: Andrei Eres <eresav@me.com> Co-authored-by: Klapeyron <11329616+Klapeyron@users.noreply.github.com> Co-authored-by: Alexander Theißen <alex.theissen@me.com> Co-authored-by: Alexandru Gheorghe <49718502+alexggh@users.noreply.github.com> Co-authored-by: Xavier Lau <x@acg.box> Co-authored-by: Dónal Murray <donal.murray@parity.io> (cherry picked from commit 1323611)
|
Successfully created backport PR for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce "ImbalanceAccounting" traits for dynamic dispatch management of imbalances. These are helper traits to be used for generic Imbalance, helpful for tracking multiple concrete types of
Imbalanceusing dynamic dispatch of these traits.xcm-executornow tracks imbalances in holding.Change the xcm executor implementation and inner types and adapters so that it keeps track of imbalances across the stack.
Previously, XCM operations on fungible assets would break the respective fungibles' total issuance invariants by burning and minting them in different stages of XCM processing pipeline.
This commit fixes that by keeping track of the "withdrawn" or "deposited" fungible assets in holding and other XCM registers as imbalances. The imbalances are tied to the underlying pallet managing the asset so that they keep the assets' total issuance correctness throughout the execution of the XCM program.
Imbalances in XCM registers are resolved by the underlying pallets managing them whenever they move from XCM registers to other parts of the stack (e.g. deposited to accounts, burned, etc).
XCM emulated tests now also verify total issuance before/after transfers, swaps, traps, claims, etc to guarantee implementation correctness.