Skip to content

score robustness + validations#923

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

score robustness + validations#923
xmariachi merged 1 commit intoalek/restructure-emissions-keeperfrom
fix/pr919-scoring-weights

Conversation

@xmariachi
Copy link
Copy Markdown
Contributor

@xmariachi xmariachi commented Mar 3, 2026

Purpose of Changes and their Description

Includes: first-submission previousEmaScore fix, lowest-score helper robustness, dec validation in weights setters, getter consistency/default handling.

Are these changes tested and documented?

  • If tested, please describe how. If not, why tests are not needed. -- unit tests passing
  • 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

Improves score handling and validation in the emissions keeper. Fixes first‑submission EMA setup and guards against missing scores and invalid weights.

  • Bug Fixes
    • Set previousEmaScore on a reputer’s first submission using the initial EMA.
    • Harden lowest-score helpers for reputers/inferers/forecasters: skip missing scores and return ErrNotFound; update calls ignore ErrNotFound.
    • Make getters consistent: GetReputerScoreEma returns an error on storage failures; GetPreviousPercentageRewardToStakedReputers returns zero when unset.
    • Validate decimals in SetLatestInfererWeight and SetLatestForecasterWeight; return clear errors on invalid values.

Written for commit e9fb4d3. Summary will update on new commits.

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Copy Markdown

@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 4 files

@xmariachi xmariachi force-pushed the fix/pr919-scoring-weights branch from f003ea5 to e9fb4d3 Compare March 3, 2026 18:34
@xmariachi xmariachi merged commit 04158f0 into alek/restructure-emissions-keeper Mar 3, 2026
11 checks passed
@xmariachi xmariachi deleted the fix/pr919-scoring-weights branch March 3, 2026 19:04
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: first-submission previousEmaScore fix, lowest-score helper
robustness, dec validation in weights setters, getter
consistency/default handling.

## Are these changes tested and documented?

- [x] If tested, please describe how. If not, why tests are not needed.
-- unit tests passing
- [ ] 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
Improves score handling and validation in the emissions keeper. Fixes
first‑submission EMA setup and guards against missing scores and invalid
weights.

- **Bug Fixes**
- Set previousEmaScore on a reputer’s first submission using the initial
EMA.
- Harden lowest-score helpers for reputers/inferers/forecasters: skip
missing scores and return ErrNotFound; update calls ignore ErrNotFound.
- Make getters consistent: GetReputerScoreEma returns an error on
storage failures; GetPreviousPercentageRewardToStakedReputers returns
zero when unset.
- Validate decimals in SetLatestInfererWeight and
SetLatestForecasterWeight; return clear errors on invalid values.

<sup>Written for commit e9fb4d3.
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: first-submission previousEmaScore fix, lowest-score helper
robustness, dec validation in weights setters, getter
consistency/default handling.

## Are these changes tested and documented?

- [x] If tested, please describe how. If not, why tests are not needed.
-- unit tests passing
- [ ] 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
Improves score handling and validation in the emissions keeper. Fixes
first‑submission EMA setup and guards against missing scores and invalid
weights.

- **Bug Fixes**
- Set previousEmaScore on a reputer’s first submission using the initial
EMA.
- Harden lowest-score helpers for reputers/inferers/forecasters: skip
missing scores and return ErrNotFound; update calls ignore ErrNotFound.
- Make getters consistent: GetReputerScoreEma returns an error on
storage failures; GetPreviousPercentageRewardToStakedReputers returns
zero when unset.
- Validate decimals in SetLatestInfererWeight and
SetLatestForecasterWeight; return clear errors on invalid values.

<sup>Written for commit e9fb4d3.
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