Skip to content

Bugfix for: hotkey_swap on a single subnet wipes all root dividend accumulations#2527

Open
evgeny-s wants to merge 21 commits intodevnet-readyfrom
fix-hotkey-swap-root-claimable
Open

Bugfix for: hotkey_swap on a single subnet wipes all root dividend accumulations#2527
evgeny-s wants to merge 21 commits intodevnet-readyfrom
fix-hotkey-swap-root-claimable

Conversation

@evgeny-s
Copy link
Copy Markdown
Collaborator

Description

Fixes #2515

Related Issue(s)

  • Closes #[issue number]

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Breaking Change

If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run ./scripts/fix_rust.sh to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Screenshots (if applicable)

Please include any relevant screenshots or GIFs that demonstrate the changes made.

Additional Notes

Please provide any additional information or context that may be helpful for reviewers.

@evgeny-s evgeny-s changed the title - Fixes the issue for hotkey swap for the single subnet Fixes the issue for hotkey swap for the single subnet Mar 20, 2026
@evgeny-s evgeny-s changed the title Fixes the issue for hotkey swap for the single subnet Bugfix for: hotkey_swap on a single subnet wipes all root dividend accumulations Mar 20, 2026
@evgeny-s evgeny-s changed the base branch from e2e-tests-moonwall to devnet-ready March 20, 2026 14:59
@evgeny-s evgeny-s added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Mar 20, 2026
sam0x17
sam0x17 previously approved these changes Mar 21, 2026
@sam0x17 sam0x17 self-requested a review March 21, 2026 17:31
Copy link
Copy Markdown
Collaborator

@shamil-gadelshin shamil-gadelshin left a comment

Choose a reason for hiding this comment

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

The fix makes sense but I have a couple of questions about the migration.

Comment on lines +41 to +47
let genesis_hash = frame_system::Pallet::<T>::block_hash(BlockNumberFor::<T>::zero());
let genesis_bytes = genesis_hash.as_ref();
let mainnet_genesis =
hex_literal::hex!("2f0555cc76fc2840a25a6ea3b9637146806f1f44b090c175ffde2a7e5ab36c03");
if genesis_bytes == mainnet_genesis {
// TODO
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would be a nice macro @sam0x17

hex_literal::hex!("2f0555cc76fc2840a25a6ea3b9637146806f1f44b090c175ffde2a7e5ab36c03");
if genesis_bytes == mainnet_genesis {
// TODO
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

make sure to only clear the RootClaim- able/ed maps if the root stake is still == 0. Otherwise we can just leave it on the old one.

- non-root subnet
- root subnet
- all subnets
Copy link
Copy Markdown
Collaborator

@shamil-gadelshin shamil-gadelshin left a comment

Choose a reason for hiding this comment

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

Looks good. I found only a couple of minor issues.

evgeny-s added a commit that referenced this pull request Apr 1, 2026
- Enable hotkey swap extrinsic
- Bumped runtime version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants