Skip to content

[v10] Remove _do* extrinsic calls and combine them with extrinsic logic.#3042

Merged
basfroman merged 24 commits intoSDKv10from
feat/roman/extrinsics-part-1
Sep 3, 2025
Merged

[v10] Remove _do* extrinsic calls and combine them with extrinsic logic.#3042
basfroman merged 24 commits intoSDKv10from
feat/roman/extrinsics-part-1

Conversation

@basfroman
Copy link
Collaborator

@basfroman basfroman commented Sep 3, 2025

Context:

  • greatly reduced and at the same time increased code base quality and readability
  • increased code coverage

Includes:

  • ._do_commit_reveal_v3 logic is included in the main code .commit_reveal_v3_extrinsic
  • .commit_reveal_v3_extrinsic renamed to .commit_reveal_extrinsic
  • revecommit_reveal_version parameter with default value 4 added to revecommit_reveal_version
  • ._do_commit_weights logic is included in the main code .commit_weights_extrinsic
  • ._do_reveal_weights logic is included in the main code .reveal_weights_extrinsic
  • ._do_set_weights logic is included in the main code .set_weights_extrinsic
  • set_weights_extrinsic moved to bittensor/core/extrinsics/commit_weights.py
  • bittensor/core/extrinsics/commit_weights.py module renamed to bittensor/core/extrinsics/weights.py (consistent naming with async module)
  • _do_burned_register logic is included in the main code .burned_register_extrinsic
  • _do_pow_register logic is included in the main code .register_extrinsic
  • ._do_set_root_weights logic is included in the main code .set_root_weights_extrinsic
  • ._do_transfer logic is included in the main code .transfer_extrinsic
  • dest parameter has been renamed to destination in transfer_extrinsic function and subtensor.transfer method.

Adds:

  • some new tests added
  • module bittensor/core/extrinsics/transfer.py covered (used to it was 0%)

@basfroman basfroman self-assigned this Sep 3, 2025
@basfroman basfroman mentioned this pull request Sep 3, 2025
@basfroman basfroman changed the title [WIP] Remove _do* extrinsic calls and combine them with extrinsic logic. [v10] Remove _do* extrinsic calls and combine them with extrinsic logic. Sep 3, 2025
@basfroman basfroman requested a review from a team September 3, 2025 19:54
Copy link
Contributor

@ibraheem-abe ibraheem-abe left a comment

Choose a reason for hiding this comment

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

Overall lgtm.
Just wanted to confirm the root_set_weights call is relavant

Comment on lines +115 to +116
# TODO: It is worth deleting everything below and simply returning the result without additional verification. This
# should be the responsibility of the user. We will also reduce the number of calls to the chain.
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically yes we should return the result. Remnants of old design.

From the other perspective, its useful to know additional stats in subnets with uid pressure

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought about it. Maybe it's worth implementing an additional flag, something like extended_info. If it's passed to True, then calculate. If not, then just silently skip. But I'm still thinking about it. Let's leave it as is in this PR, I'm not deleting anything anyway. I'll come back to this at the TODO processing step.
Does it make sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good!

… subtensor calls `subtensor.set_root_weights_extrinsic` removed too.
@basfroman basfroman merged commit d66e53e into SDKv10 Sep 3, 2025
332 checks passed
@basfroman basfroman deleted the feat/roman/extrinsics-part-1 branch September 3, 2025 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants