Skip to content

[stable2506] Backport #9179#9304

Merged
acatangiu merged 2 commits intostable2506from
backport-9179-to-stable2506
Jul 30, 2025
Merged

[stable2506] Backport #9179#9304
acatangiu merged 2 commits intostable2506from
backport-9179-to-stable2506

Conversation

@paritytech-release-backport-bot
Copy link
Copy Markdown

Backport #9179 into stable2506 from karolk91.

See the documentation on how to use this bot.

`subsume_assets` fails to correctly subsume two instances of
`AssetsInHolding` under certain conditions which can result in loss of
funds (as assets are overriden rather than summed together)

Eg. consider following test:
```
	#[test]
	fn subsume_assets_different_length_holdings() {
		let mut t1 = AssetsInHolding::new();
		t1.subsume(CFP(400));

		let mut t2 = AssetsInHolding::new();
		t2.subsume(CF(100));
		t2.subsume(CFP(100));

		t1.subsume_assets(t2);
```

current result (without this PR change):
```
		let mut iter = t1.into_assets_iter();
		assert_eq!(Some(CF(100)), iter.next());
		assert_eq!(Some(CFP(100)), iter.next());
```

expected result:
```
		let mut iter = t1.into_assets_iter();
		assert_eq!(Some(CF(100)), iter.next());
		assert_eq!(Some(CFP(500)), iter.next());
```

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Branislav Kontur <[email protected]>
(cherry picked from commit 069b7b5)
@paritytech-release-backport-bot paritytech-release-backport-bot bot requested a review from a team as a code owner July 24, 2025 06:30
@github-actions github-actions bot added the A3-backport Pull request is already reviewed well in another branch. label Jul 24, 2025
@github-actions github-actions bot requested a review from karolk91 July 24, 2025 06:30
@github-actions
Copy link
Copy Markdown
Contributor

This pull request is amending an existing release. Please proceed with extreme caution,
as to not impact downstream teams that rely on the stability of it. Some things to consider:

  • Backports are only for 'patch' or 'minor' changes. No 'major' or other breaking change.
  • Should be a legit fix for some bug, not adding tons of new features.
  • Must either be already audited or not need an audit.
Emergency Bypass

If you really need to bypass this check: add validate: false to each crate
in the Prdoc where a breaking change is introduced. This will release a new major
version of that crate and all its reverse dependencies and basically break the release.

@acatangiu acatangiu enabled auto-merge (squash) July 28, 2025 09:40
@paritytech-workflow-stopper
Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/16574179192
Failed job name: test-linux-stable

@acatangiu acatangiu merged commit bcf4010 into stable2506 Jul 30, 2025
352 of 399 checks passed
@acatangiu acatangiu deleted the backport-9179-to-stable2506 branch July 30, 2025 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A3-backport Pull request is already reviewed well in another branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants