[v10] SimSwap + Extrinsics Improvement#3091
Merged
Conversation
…l contain all extrinsic parameters.
Closed
ibraheem-abe
reviewed
Oct 9, 2025
ibraheem-abe
approved these changes
Oct 9, 2025
Teri68
approved these changes
Oct 10, 2025
Teri68
approved these changes
Oct 10, 2025
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.
Core Extrinsics Refactor & Fee Simulation Framework
Summary
This PR introduces a major improvement to the
Subtensorextrinsics logic, focusing on fee simulation, parameter validation, and internal API consistency — without breaking any existing external interfaces or E2E tests.The changes make the SDK more predictable, safer to use, and better aligned with on-chain metadata.
Changes include
New class
SimSwapResult:New subpackage
bittensor.core.extrinsics.params:New
Subtensormethods:subtensor.sim_swap: Simulates fees for any staking-related transaction.subtensor.validate_extrinsic_params: Validates and filters extrinsic parameters against on-chain metadata.subtensor.compose_call: Now uses built-in validation viavalidate_extrinsic_paramsbefore composing aGenericCall.subtensor.get_extrinsic_fee: Returns the full fee breakdown for any extrinsic call.Updated
Subtensormethods:get_stake_add_fee: Updated parameter list. now usessim_swapfor fee computation.get_stake_movement_fee: Updated parameter list. now usessim_swapfor fee computation.get_unstake_fee: Updated parameter list. now usessim_swapfor fee computation.get_transfer_fee: Now usesSubtensor.compose_callwith integrated pre-validation.Standardized extrinsic argument order (
wallet, netuid, coldkey_ss58, hotkey_ss58, ...). The following methods now follow a consistent signature pattern across Subtensor's extrinsic related methods:move_stakeset_childrenunstake_allAdditional improvements
ExtrinsicResponseclass:transaction_tao_fee,transaction_alpha_fee.unlock_wallethandling logic for safer cleanup.Critically important function
check_balance_amount:SubtensorApiclass:Notes:
Benefits
More datafiles in MIGRATION file on this PR.