Skip to content

Conversation

@shibshib
Copy link
Contributor

This will ensure that when subnets are deregistered, its weights are automagically set to 0.

@shibshib shibshib force-pushed the subnet_dereg_automatic_weighing branch from dd5e2e8 to 441eeb9 Compare February 23, 2024 19:32
@shibshib shibshib marked this pull request as ready for review February 26, 2024 16:22
@shibshib shibshib requested review from unconst and removed request for Rubberbandits and welikethestock February 29, 2024 00:04
@shibshib shibshib requested a review from sam0x17 March 4, 2024 19:42
Copy link
Contributor

@sam0x17 sam0x17 left a comment

Choose a reason for hiding this comment

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

Looks good in general, one loop I think could be improved significantly

Updated weight setting to directly use .clone() for much faster copying than the old loop style.

Co-authored-by: Sam Johnson <sam@durosoft.com>
@shibshib
Copy link
Contributor Author

shibshib commented Mar 5, 2024

Thanks @sam0x17 this was super helpful, updated the loop after testing.

@sam0x17
Copy link
Contributor

sam0x17 commented Mar 5, 2024

@shibshib did you have any thoughts regarding what I was saying about "is there anything we can do to avoid looping over the whole vec" -- I don't have enough context to know the topology of the weights_i vec but I'm curious what the details are here, like can an id be repeated, is the order random, etc

@shibshib
Copy link
Contributor Author

shibshib commented Mar 6, 2024

@shibshib did you have any thoughts regarding what I was saying about "is there anything we can do to avoid looping over the whole vec" -- I don't have enough context to know the topology of the weights_i vec but I'm curious what the details are here, like can an id be repeated, is the order random, etc

We unfortunately have to loop through the whole vec. The vector itself contains the weights set by validators for all subnets. If a subnet's weight must be reset to 0, it has to be reset by every validator as well. Hence, it's hard to optimize that further, I don't think. Open to suggestions though!

@sam0x17
Copy link
Contributor

sam0x17 commented Mar 6, 2024

should be good as-is then 👍🏻

Copy link
Contributor

@unconst unconst left a comment

Choose a reason for hiding this comment

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

LGTM

@shibshib shibshib merged commit 42d020c into main Mar 11, 2024
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.

4 participants