Skip to content

Child hotkeys handle excess normalization#2229

Merged
opendansor merged 2 commits intostagingfrom
feature/opendansor/improve_child_hotkeys
Aug 13, 2024
Merged

Child hotkeys handle excess normalization#2229
opendansor merged 2 commits intostagingfrom
feature/opendansor/improve_child_hotkeys

Conversation

@opendansor
Copy link

In staking.py, introduced the floor function for normalized proportions and added logic to handle excess sums. Updated formatting.py to use floor for float-to-u64 conversion, ensuring values stay within bounds.

opendansor added 2 commits August 13, 2024 12:01
In staking.py, introduced the floor function for normalized proportions and added logic to handle excess sums. Updated formatting.py to use floor for float-to-u64 conversion, ensuring values stay within bounds.
Comment on lines +664 to +666
normalized_children[0] = (
normalized_children[0][0] - (sum_norm - (u64_max - 1)),
normalized_children[0][1],
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be useful to understand what such indexes mean. Pls add a comment.

Copy link
Author

Choose a reason for hiding this comment

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

There is a comment on line 658.
It adjusts the first child +- 10 to make sure we dont go over u64 max.

@opendansor opendansor merged commit a28963d into staging Aug 13, 2024
@opendansor opendansor deleted the feature/opendansor/improve_child_hotkeys branch August 13, 2024 19:14
@ibraheem-abe ibraheem-abe mentioned this pull request Aug 23, 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.

2 participants