Skip to content

Conversation

@Bakobiibizo
Copy link
Contributor

Description

This PR fixes an issue with the subnet eviction logic to ensure that protected subnets (those with Linear consensus) are not evicted when the maximum number of subnets is reached.

Changes

  • Updated the test to properly test subnet eviction with protected subnets
  • Set MaxAllowedSubnets in the test setup to ensure consistent behavior
  • Fixed the test to use add_subnet_from_registration instead of add_subnet to properly test the eviction logic
  • Added proper error handling for when no removable subnets are available

Testing

  • All tests are passing, including the new test case that verifies protected subnets are not evicted
  • Manually verified that the eviction behavior works as expected with both protected and removable subnets

Related Issues

None

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings

- Updated test to properly test subnet eviction with protected subnets
- Set MaxAllowedSubnets in test setup
- Fixed test to use add_subnet_from_registration instead of add_subnet
- Added proper error handling for when no removable subnets are available
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.

1 participant