Skip to content

Commit 7c5d49e

Browse files
authored
Do not run NCalcEMA if already at same value (#737)
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺ 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 Efficiency: do not run NCalcEMA if already at same value ## Are these changes tested and documented? - [x] If tested, please describe how. If not, why tests are not needed. -- unit tests - [x] If documented, please describe where. If not, describe why docs are not needed. -- no need, just optim - [x] Added to `Unreleased` section of `CHANGELOG.md`?
1 parent 9bbe718 commit 7c5d49e

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8080
* [#764](https://github.com/allora-network/allora-chain/pull/764) TopicRewardAlpha using weekly cadence
8181
* [#769](https://github.com/allora-network/allora-chain/pull/769) Stored NetworkInferences instead of query-time. Removal of `GetLatestAvailableNetworkInferences`
8282
* [#794](https://github.com/allora-network/allora-chain/pull/794) Optimize topic weights fetch and update flow
83+
* [#737](https://github.com/allora-network/allora-chain/pull/737) Do not run NCalcEMA if already at same value
8384

8485
### Deprecated
8586

x/emissions/keeper/actor_penalties.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ func ApplyLivenessPenaltyToActor(
9090
return types.Score{}, err
9191
}
9292

93+
if emaScore.Score.Equal(penalty) {
94+
return emaScore, nil
95+
}
96+
9397
beforePenalty := emaScore
9498
emaScore.Score, err = applyPenalty(topic, penalty, emaScore.Score, missedEpochs)
9599
if err != nil {

0 commit comments

Comments
 (0)