score robustness + validations#923
Merged
xmariachi merged 1 commit intoalek/restructure-emissions-keeperfrom Mar 3, 2026
Merged
score robustness + validations#923xmariachi merged 1 commit intoalek/restructure-emissions-keeperfrom
xmariachi merged 1 commit intoalek/restructure-emissions-keeperfrom
Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
f003ea5 to
e9fb4d3
Compare
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. -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?
Unreleasedsection ofCHANGELOG.md? -- no need, no func changeSummary by cubic
Improves score handling and validation in the emissions keeper. Fixes first‑submission EMA setup and guards against missing scores and invalid weights.
Written for commit e9fb4d3. Summary will update on new commits.