Skip to content

Fix #2411: finalize_all_subnet_root_dividends has unbounded iteration over all hotkeys#2425

Open
0xRozier wants to merge 1 commit intoopentensor:mainfrom
0xRozier:fix/issue-2411-unbounded-root-claimable-iteration
Open

Fix #2411: finalize_all_subnet_root_dividends has unbounded iteration over all hotkeys#2425
0xRozier wants to merge 1 commit intoopentensor:mainfrom
0xRozier:fix/issue-2411-unbounded-root-claimable-iteration

Conversation

@0xRozier
Copy link

Closes #2411

Changes

00f2a07ae fix: remove unbounded memory allocation in finalize_all_subnet_root_dividends

Testing

  • Tests pass
  • Code follows project conventions
  • No linting errors

Issue: #2411

…ividends

Replace `iter_keys().collect::<Vec<_>>()` + mutate loop with
`StorageMap::translate()` which processes entries one at a time without
collecting all hotkey keys into memory.

This also removes empty RootClaimable entries (returning None from
translate) instead of leaving behind empty BTreeMaps.

Closes opentensor#2411

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

finalize_all_subnet_root_dividends has unbounded iteration over all hotkeys

1 participant