Bugfix for: hotkey_swap on a single subnet wipes all root dividend accumulations#2527
Open
evgeny-s wants to merge 21 commits intodevnet-readyfrom
Open
Bugfix for: hotkey_swap on a single subnet wipes all root dividend accumulations#2527evgeny-s wants to merge 21 commits intodevnet-readyfrom
hotkey_swap on a single subnet wipes all root dividend accumulations#2527evgeny-s wants to merge 21 commits intodevnet-readyfrom
Conversation
hotkey_swap on a single subnet wipes all root dividend accumulations
evgeny-s
commented
Mar 20, 2026
sam0x17
previously approved these changes
Mar 21, 2026
shamil-gadelshin
requested changes
Mar 23, 2026
Collaborator
shamil-gadelshin
left a comment
There was a problem hiding this comment.
The fix makes sense but I have a couple of questions about the migration.
pallets/subtensor/src/migrations/migrate_fix_root_claimed_overclaim.rs
Outdated
Show resolved
Hide resolved
pallets/subtensor/src/migrations/migrate_fix_root_claimed_overclaim.rs
Outdated
Show resolved
Hide resolved
pallets/subtensor/src/migrations/migrate_fix_root_claimed_overclaim.rs
Outdated
Show resolved
Hide resolved
evgeny-s
commented
Mar 31, 2026
evgeny-s
commented
Mar 31, 2026
evgeny-s
commented
Mar 31, 2026
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 | ||
| } |
| hex_literal::hex!("2f0555cc76fc2840a25a6ea3b9637146806f1f44b090c175ffde2a7e5ab36c03"); | ||
| if genesis_bytes == mainnet_genesis { | ||
| // TODO | ||
| } |
Contributor
There was a problem hiding this comment.
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
shamil-gadelshin
requested changes
Apr 1, 2026
Collaborator
shamil-gadelshin
left a comment
There was a problem hiding this comment.
Looks good. I found only a couple of minor issues.
pallets/subtensor/src/migrations/migrate_fix_root_claimed_overclaim.rs
Outdated
Show resolved
Hide resolved
ts-tests/suites/zombienet_staking/02.04-claim-root-hotkey-swap.test.ts
Outdated
Show resolved
Hide resolved
# Conflicts: # runtime/src/lib.rs
gztensor
requested changes
Apr 1, 2026
evgeny-s
added a commit
that referenced
this pull request
Apr 1, 2026
- Enable hotkey swap extrinsic - Bumped runtime version
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.
Description
Fixes #2515
Related Issue(s)
Type of Change
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
./scripts/fix_rust.shto ensure my code is formatted and linted correctlyScreenshots (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.