Skip to content

Conversation

@DanielDerefaka
Copy link
Contributor

@DanielDerefaka DanielDerefaka commented Dec 25, 2025

Summary

  • Standardizes mechanism identifier naming across the codebase
  • Renames sub_id parameter to mecid in public API functions to match the MechId type
  • Renames get_netuid_and_subid function to get_netuid_and_mecid
  • Updates internal variable names from sub_id_* to mecid_*
  • Updates comments to use mecid terminology

Changes

Files modified:

  • pallets/subtensor/src/subnets/mechanism.rs - Core naming changes
  • pallets/subtensor/src/epoch/run_epoch.rs - Updated function calls
  • pallets/subtensor/src/subnets/weights.rs - Updated function calls
  • pallets/subtensor/src/migrations/migrate_crv3_commits_add_block.rs - Updated function calls
  • pallets/subtensor/src/tests/mechanism.rs - Updated test calls

Test plan

  • Verified cargo check --lib passes
  • Verified cargo check --tests passes
  • All changes are internal naming refactors with no behavioral changes

Fixes #2101

Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=101010297

Addresses inconsistent naming of mechanism identifiers across the codebase.
Changes:
- Rename `sub_id` parameter to `mecid` in public API functions
- Rename `get_netuid_and_subid` to `get_netuid_and_mecid`
- Update variable names from `sub_id_*` to `mecid_*` in mechanism.rs
- Update comments to use `mecid` terminology instead of `sub_id`
- Rename `sub_weight`/`sub_emission` to `mech_weight`/`mech_emission`

This aligns internal implementation with the public-facing API which
already uses `mecid` and `MechId` consistently.

Fixes opentensor#2101
@DanielDerefaka
Copy link
Contributor Author

@sam0x17 would you review this PR?

@sam0x17
Copy link
Contributor

sam0x17 commented Dec 29, 2025

should be mechid and not mecid I think

@DanielDerefaka
Copy link
Contributor Author

Thanks for the review @sam0x17 You're right I'll update mecidmechid throughout. Will push the fix shortly.

Renamed all occurrences of 'mecid' to 'mechid' (mechanism ID) for
clarity and consistency as requested by @sam0x17.
@DanielDerefaka
Copy link
Contributor Author

Hey @sam0x17, thanks again for catching that naming issue I pushed the fix.

@DanielDerefaka
Copy link
Contributor Author

Closing to focus on other contributions. Will revisit later.

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.

MechId naming inconsistency

2 participants