Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitensor version as int supports only minor,patch versions <10 #1982

Closed
mjurbanski-reef opened this issue Jun 5, 2024 · 1 comment · Fixed by #2018 or #1993
Closed

bitensor version as int supports only minor,patch versions <10 #1982

mjurbanski-reef opened this issue Jun 5, 2024 · 1 comment · Fixed by #2018 or #1993
Labels
bug Something isn't working

Comments

@mjurbanski-reef
Copy link
Contributor

mjurbanski-reef commented Jun 5, 2024

Describe the bug

https://github.com/opentensor/bittensor/blob/master/bittensor/__init__.py#L33C1-L37

If bittensor 7.10.1 gets released, it will get encoded as version 801, and break version comparisons.

While releasing 100 of patch releases maybe far fetched (but not impossible), the release of 10+ minor version is quite common (e.g. Python is currently at 3.13 ).

To Reproduce

Expected behavior

I would expect bittensor.__version_as_int__ to be always > than previous version, even if we have more than 10 releases.

A possible solution would be to use *100 multiplier - after all if we used *10 we would still require uint32.
This would be also backwards compatible change - > comparison between new released version and old one would still give the expected results.

Screenshots

No response

Environment

Additional context

subtensor seems to encode bittensor/subnet version as u32 int, so we have plenty of room there

@mjurbanski-reef mjurbanski-reef added the bug Something isn't working label Jun 5, 2024
mjurbanski-reef added a commit to backend-developers-ltd/bittensor that referenced this issue Jun 8, 2024
@mjurbanski-reef
Copy link
Contributor Author

Please note this already happened, I.e.

Current 7.0.1 release is encoded as 701,
while 6.12.2 was encoded as 722.

$ pip install bittensor==6.12.2
$ python -c 'import bittensor; print(bittensor.__version_as_int__)'  2> /dev/null
722

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant