Skip to content

Commit ef33993

Browse files
authored
[AHM] Migrate missing stellaswap account (#1036)
The Asset Hub migration translated specific account IDs such that they would stay accessible after the migration. We missed two such accounts that were generated in a specific recursive manner and are fixing this now. ## Changes Add an extrinsic `AhOps::translate_para_sovereign_child_to_sibling_derived` that can be called with the `old` and `new` account and a derivation proof (para-id and derivation-path). This then moves all data from the `old` account to the `new` one. The old and new accounts can be calculated just from the para-id and derivation-path but we still pass them in to ensure correctness of usage. The extrinsic can be called by the fellowship or root. ## What Is Migrated? - Native DOT Balance - Assets: USDC, USDT, DED, TSN - Staked balances (unbonding balances are immediately unbonded and bonded amounts will be rebonded and start earning in the next era) Not migrated would be vested transfers (the accounts have none) or similar. ## Translated Accounts The translated accounts belong to Stellaswap and are derived from the Moonbeam Sovereign child account: - Moonbeam Child 2004: 13YMK2eZbf9AyGhewRs6W6QTJvBSM5bxpnTD8WgeDofbg8Q1 - Index 5: 14vDXpWfcSRPn8eWPKt2Xc8KN57tGNnAo7Z8M2C8kpkJav5q - Index 5/1: 1zAWXSCmRTR9ZkRXZXeHZftj1J6rnDe8BLXV8UJ2S2exCvL (**old 1**) - Index 5/2: 14KQD8dRoT3q2fCbCC49bFjU1diFu1d516tYuGmSUMmEoGNa (**old 2**) - Moonbeam Sibl 2004 - 13cKp89NgPL56sRoVRpBcjkGZPrk4Vf4tS6ePUD96XhAXozG - Index 5: 12gb2DBw5HfpmUyBKCHxJWwGxMyXbUgf6a7bagNduHZC5S9z - Index 5/1: 13GWAfgWAKLGm8AsKLn5pDbDyMHfShFgtMFEqM4TRNhXbSea (**new 1**) - Index 5/2: 123oqim7B24XzwB1hC4Fh7LGwbTas3QmxL6v6sVd95eTD5ee (**new 2**) The two accounts that will be translated are therefore: - 1zAWXSCmRTR9ZkRXZXeHZftj1J6rnDe8BLXV8UJ2S2exCvL to 13GWAfgWAKLGm8AsKLn5pDbDyMHfShFgtMFEqM4TRNhXbSea - 14KQD8dRoT3q2fCbCC49bFjU1diFu1d516tYuGmSUMmEoGNa to 123oqim7B24XzwB1hC4Fh7LGwbTas3QmxL6v6sVd95eTD5ee You can see the snapshot test doing this here https://github.com/polkadot-fellows/runtimes/blob/f254eee1fdb071b3d2f5d8cfe6c909b9e156448e/system-parachains/asset-hubs/asset-hub-polkadot/src/remote_tests.rs#L56-L61 --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]>
1 parent 69ebda6 commit ef33993

File tree

12 files changed

+688
-36
lines changed

12 files changed

+688
-36
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1111
- AH Polkadot - A new stepped curve primitive. Used for the 'Hard Pressure' inflation changes from [Ref 1710](https://polkadot.subsquare.io/referenda/1710) ([#898](https://github.com/polkadot-fellows/runtimes/pull/898)).
1212

1313
### Changed
14+
15+
- AH Polkadot - Inflation now follows the 'Hard Pressure' schedule from [Ref 1710](https://polkadot.subsquare.io/referenda/1710) ([#898](https://github.com/polkadot-fellows/runtimes/pull/898))
1416
- AH Polkadot - Enable Elastic Scaling for Polkadot Hub ([polkadot-fellows/runtimes/pull/1048](https://github.com/polkadot-fellows/runtimes/pull/1048))
1517
- AH Polkadot - Inflation now follows the 'Hard Pressure' schedule from [Ref 1710](https://polkadot.subsquare.io/referenda/1710) ([#898](https://github.com/polkadot-fellows/runtimes/pull/898)).
1618

19+
### Fixed
20+
21+
- [PAH] Migrate missing Stellaswap sovereign accounts ([1036](https://github.com/polkadot-fellows/runtimes/pull/1036))
22+
1723
## [2.0.4] 18.12.2025
1824

1925
### Changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pallets/ah-ops/Cargo.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,41 +23,62 @@ sp-io = { workspace = true }
2323
sp-runtime = { workspace = true }
2424
sp-std = { workspace = true }
2525
frame-benchmarking = { workspace = true, optional = true }
26+
pallet-staking-async = { workspace = true }
27+
28+
[dev-dependencies]
29+
sp-staking = { workspace = true }
30+
pallet-election-provider-multi-block = { workspace = true }
31+
frame-election-provider-support = { workspace = true }
32+
pallet-staking-async-rc-client = { workspace = true }
2633

2734
[features]
2835
default = ["std"]
2936
std = [
3037
"codec/std",
3138
"cumulus-primitives-core/std",
3239
"frame-benchmarking?/std",
40+
"frame-election-provider-support/std",
3341
"frame-support/std",
3442
"frame-system/std",
3543
"log/std",
3644
"pallet-assets/std",
3745
"pallet-balances/std",
46+
"pallet-election-provider-multi-block/std",
47+
"pallet-staking-async-rc-client/std",
48+
"pallet-staking-async/std",
3849
"pallet-timestamp/std",
3950
"scale-info/std",
4051
"sp-application-crypto/std",
4152
"sp-core/std",
4253
"sp-io/std",
4354
"sp-runtime/std",
55+
"sp-staking/std",
4456
"sp-std/std",
4557
]
4658
runtime-benchmarks = [
4759
"cumulus-primitives-core/runtime-benchmarks",
4860
"frame-benchmarking/runtime-benchmarks",
61+
"frame-election-provider-support/runtime-benchmarks",
4962
"frame-support/runtime-benchmarks",
5063
"frame-system/runtime-benchmarks",
5164
"pallet-assets/runtime-benchmarks",
5265
"pallet-balances/runtime-benchmarks",
66+
"pallet-election-provider-multi-block/runtime-benchmarks",
67+
"pallet-staking-async-rc-client/runtime-benchmarks",
68+
"pallet-staking-async/runtime-benchmarks",
5369
"pallet-timestamp/runtime-benchmarks",
5470
"sp-runtime/runtime-benchmarks",
71+
"sp-staking/runtime-benchmarks",
5572
]
5673
try-runtime = [
74+
"frame-election-provider-support/try-runtime",
5775
"frame-support/try-runtime",
5876
"frame-system/try-runtime",
5977
"pallet-assets/try-runtime",
6078
"pallet-balances/try-runtime",
79+
"pallet-election-provider-multi-block/try-runtime",
80+
"pallet-staking-async-rc-client/try-runtime",
81+
"pallet-staking-async/try-runtime",
6182
"pallet-timestamp/try-runtime",
6283
"sp-runtime/try-runtime",
6384
]

pallets/ah-ops/src/benchmarking.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,61 +24,61 @@ pub mod benchmarks {
2424
#[benchmark]
2525
fn unreserve_lease_deposit() {
2626
let sender = account("sender", 0, 0);
27-
let ed = <T::Currency as Currency<_>>::minimum_balance();
28-
let _ = T::Currency::deposit_creating(&sender, ed + ed);
29-
let _ = T::Currency::reserve(&sender, ed);
27+
let ed = <<T as crate::Config>::Currency as Currency<_>>::minimum_balance();
28+
let _ = <T as crate::Config>::Currency::deposit_creating(&sender, ed + ed);
29+
let _ = <T as crate::Config>::Currency::reserve(&sender, ed);
3030
let block = T::RcBlockNumberProvider::current_block_number();
3131
let para_id = ParaId::from(1u32);
3232
RcLeaseReserve::<T>::insert((block, para_id, &sender), ed);
3333

34-
assert_eq!(T::Currency::reserved_balance(&sender), ed);
34+
assert_eq!(<T as crate::Config>::Currency::reserved_balance(&sender), ed);
3535

3636
#[extrinsic_call]
3737
_(RawOrigin::Signed(sender.clone()), block, None, para_id);
3838

39-
assert_eq!(T::Currency::reserved_balance(&sender), 0);
39+
assert_eq!(<T as crate::Config>::Currency::reserved_balance(&sender), 0);
4040
assert_eq!(RcLeaseReserve::<T>::get((block, para_id, &sender)), None);
4141
}
4242

4343
#[benchmark]
4444
fn withdraw_crowdloan_contribution() {
4545
let pot = account("pot", 0, 0);
46-
let ed = <T::Currency as Currency<_>>::minimum_balance();
47-
let _ = T::Currency::deposit_creating(&pot, ed + ed);
48-
let _ = T::Currency::reserve(&pot, ed);
46+
let ed = <<T as crate::Config>::Currency as Currency<_>>::minimum_balance();
47+
let _ = <T as crate::Config>::Currency::deposit_creating(&pot, ed + ed);
48+
let _ = <T as crate::Config>::Currency::reserve(&pot, ed);
4949
let block = T::RcBlockNumberProvider::current_block_number();
5050
let para_id = ParaId::from(1u32);
5151
RcLeaseReserve::<T>::insert((block, para_id, &pot), ed);
5252

5353
let sender = account("sender", 0, 0);
5454
RcCrowdloanContribution::<T>::insert((block, para_id, &sender), (pot.clone(), ed));
5555

56-
assert_eq!(T::Currency::free_balance(&sender), 0);
56+
assert_eq!(<T as crate::Config>::Currency::free_balance(&sender), 0);
5757

5858
#[extrinsic_call]
5959
_(RawOrigin::Signed(sender.clone()), block, None, para_id);
6060

6161
assert_eq!(RcCrowdloanContribution::<T>::get((block, para_id, &sender)), None);
6262
assert_eq!(RcLeaseReserve::<T>::get((block, para_id, &pot)), None);
63-
assert_eq!(T::Currency::free_balance(&pot), ed);
63+
assert_eq!(<T as crate::Config>::Currency::free_balance(&pot), ed);
6464
}
6565

6666
#[benchmark]
6767
fn unreserve_crowdloan_reserve() {
6868
let sender = account("sender", 0, 0);
69-
let ed = <T::Currency as Currency<_>>::minimum_balance();
70-
let _ = T::Currency::deposit_creating(&sender, ed + ed);
71-
let _ = T::Currency::reserve(&sender, ed);
69+
let ed = <<T as crate::Config>::Currency as Currency<_>>::minimum_balance();
70+
let _ = <T as crate::Config>::Currency::deposit_creating(&sender, ed + ed);
71+
let _ = <T as crate::Config>::Currency::reserve(&sender, ed);
7272
let block = T::RcBlockNumberProvider::current_block_number();
7373
let para_id = ParaId::from(1u32);
7474
RcCrowdloanReserve::<T>::insert((block, para_id, &sender), ed);
7575

76-
assert_eq!(T::Currency::reserved_balance(&sender), ed);
76+
assert_eq!(<T as crate::Config>::Currency::reserved_balance(&sender), ed);
7777

7878
#[extrinsic_call]
7979
_(RawOrigin::Signed(sender.clone()), block, None, para_id);
8080

81-
assert_eq!(T::Currency::reserved_balance(&sender), 0);
81+
assert_eq!(<T as crate::Config>::Currency::reserved_balance(&sender), 0);
8282
assert_eq!(RcCrowdloanReserve::<T>::get((block, para_id, &sender)), None);
8383
}
8484

0 commit comments

Comments
 (0)