Skip to content

nonce staking guards, iter close#922

Merged
xmariachi merged 1 commit intoalek/restructure-emissions-keeperfrom
fix/pr919-nonce-staking
Mar 3, 2026
Merged

nonce staking guards, iter close#922
xmariachi merged 1 commit intoalek/restructure-emissions-keeperfrom
fix/pr919-nonce-staking

Conversation

@xmariachi
Copy link
Contributor

@xmariachi xmariachi commented Mar 3, 2026

Purpose of Changes and their Description

Includes: nil guards in nonce paths, safer reputer nonce deref, prune-worker no-op consistency, missing iter.Close().

Are these changes tested and documented?

  • If tested, please describe how. If not, why tests are not needed. -- unit tests modified accordingly
  • If documented, please describe where. If not, describe why docs are not needed. -- no need, no func change
  • Added to Unreleased section of CHANGELOG.md? -- no need , no func change

Summary by cubic

Modularized the emissions keeper into focused sub-keepers and added robust nonce/staking guards to prevent nil derefs and window inconsistencies. No external message or query API changes; improves safety, clarity, and testability.

  • Refactors

    • Split monolithic Keeper into sub-keepers: Params, Topic, Staking, Scores, Nonce, Regrets, ReputerLoss, Weights, Banking, and ActorPenalties.
    • Rewired Msg/Query servers and tests to use injected sub-keepers and simple getters (e.g., GetParamsKeeper()).
    • Moved EMA score logic, weights, staking, topics, regrets, and nonce management into dedicated files with constructor funcs.
  • Bug Fixes

    • Added nil input checks and nil-safe iteration across nonce methods (Fulfill/Add/Is*/Prune) to prevent panics; PruneWorkerNonces now no-ops when empty.
    • Closed a missing iterator in staking (GetDelegateStakeRemovalForDelegatorReputerAndTopicId).

Written for commit 903d5df. Summary will update on new commits.

@greptile-apps
Copy link

greptile-apps bot commented Mar 3, 2026

Too many files changed for review. (131 files found, 100 file limit)

@xmariachi xmariachi changed the base branch from dev to alek/restructure-emissions-keeper March 3, 2026 12:15
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

@xmariachi xmariachi changed the title Fix/pr919 nonce staking nonce staking guards, iter close Mar 3, 2026
@xmariachi xmariachi force-pushed the fix/pr919-nonce-staking branch from ba66a11 to 903d5df Compare March 3, 2026 18:30
@xmariachi xmariachi merged commit 7780595 into alek/restructure-emissions-keeper Mar 3, 2026
11 checks passed
@xmariachi xmariachi deleted the fix/pr919-nonce-staking branch March 3, 2026 19:01
xmariachi added a commit that referenced this pull request Mar 9, 2026
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v           ✰  Thanks for creating a PR! You're awesome! ✰
v Please note that maintainers will only review those PRs with a
completed PR template.
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->

## Purpose of Changes and their Description
Includes: nil guards in nonce paths, safer reputer nonce deref,
prune-worker no-op consistency, missing iter.Close().

## Are these changes tested and documented?

- [x] If tested, please describe how. If not, why tests are not needed.
-- unit tests modified accordingly
- [ ] If documented, please describe where. If not, describe why docs
are not needed. -- no need, no func change
- [ ] Added to `Unreleased` section of `CHANGELOG.md`? -- no need , no
func change


<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Modularized the emissions keeper into focused sub-keepers and added
robust nonce/staking guards to prevent nil derefs and window
inconsistencies. No external message or query API changes; improves
safety, clarity, and testability.

- **Refactors**
- Split monolithic Keeper into sub-keepers: Params, Topic, Staking,
Scores, Nonce, Regrets, ReputerLoss, Weights, Banking, and
ActorPenalties.
- Rewired Msg/Query servers and tests to use injected sub-keepers and
simple getters (e.g., GetParamsKeeper()).
- Moved EMA score logic, weights, staking, topics, regrets, and nonce
management into dedicated files with constructor funcs.

- **Bug Fixes**
- Added nil input checks and nil-safe iteration across nonce methods
(Fulfill/Add/Is*/Prune) to prevent panics; PruneWorkerNonces now no-ops
when empty.
- Closed a missing iterator in staking
(GetDelegateStakeRemovalForDelegatorReputerAndTopicId).

<sup>Written for commit 903d5df.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
xmariachi added a commit that referenced this pull request Mar 9, 2026
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v           ✰  Thanks for creating a PR! You're awesome! ✰
v Please note that maintainers will only review those PRs with a
completed PR template.
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->

## Purpose of Changes and their Description
Includes: nil guards in nonce paths, safer reputer nonce deref,
prune-worker no-op consistency, missing iter.Close().

## Are these changes tested and documented?

- [x] If tested, please describe how. If not, why tests are not needed.
-- unit tests modified accordingly
- [ ] If documented, please describe where. If not, describe why docs
are not needed. -- no need, no func change
- [ ] Added to `Unreleased` section of `CHANGELOG.md`? -- no need , no
func change


<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Modularized the emissions keeper into focused sub-keepers and added
robust nonce/staking guards to prevent nil derefs and window
inconsistencies. No external message or query API changes; improves
safety, clarity, and testability.

- **Refactors**
- Split monolithic Keeper into sub-keepers: Params, Topic, Staking,
Scores, Nonce, Regrets, ReputerLoss, Weights, Banking, and
ActorPenalties.
- Rewired Msg/Query servers and tests to use injected sub-keepers and
simple getters (e.g., GetParamsKeeper()).
- Moved EMA score logic, weights, staking, topics, regrets, and nonce
management into dedicated files with constructor funcs.

- **Bug Fixes**
- Added nil input checks and nil-safe iteration across nonce methods
(Fulfill/Add/Is*/Prune) to prevent panics; PruneWorkerNonces now no-ops
when empty.
- Closed a missing iterator in staking
(GetDelegateStakeRemovalForDelegatorReputerAndTopicId).

<sup>Written for commit 903d5df.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
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