bittensor icon indicating copy to clipboard operation
bittensor copied to clipboard

Fixed a bug in the get_subnets function

Open niljub opened this issue 1 year ago • 3 comments

Bug

The get_subnets function was truncating to max. 100 results due to list comprehensions handling of iterators. The bug has been described in https://github.com/opentensor/bittensor/issues/2208.

Description of the Change

Replaced list comprehension with a manual iteration to ensure all subnet UIDs are retrieved, addressing the issue of truncated results.

Alternate Designs

Considered increasing fetch limits but chose manual iteration for more reliable results.

Possible Drawbacks

No significant drawbacks, just a minor increase in code complexity.

Verification Process

Added a test to check the length of the result list, ensuring all records are processed correctly. Ran all existing tests to confirm no regressions.

Release Notes

Fixed an issue in get_subnets where the result list was being truncated, ensuring complete retrieval of subnets.

niljub avatar Aug 15 '24 22:08 niljub