Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

* [#851](https://github.com/allora-network/allora-chain/pull/851) Enforce recommended settings
* [#835](https://github.com/allora-network/allora-chain/pull/835): Introduce the `x/scheduler` module to manage tasks scheduling
* [#835](https://github.com/allora-network/allora-chain/pull/835) Introduce the `x/scheduler` module to manage tasks scheduling
* [#897](https://github.com/allora-network/allora-chain/pull/897) Turn math cache into its own object + use in closing reputer window

### Changed

Expand Down
12 changes: 12 additions & 0 deletions x/emissions/keeper/actor_utils/losses.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ func CloseReputerNonce(
) (err error) {
blockHeight := ctx.BlockHeight()

// Create and enable math helper cache for this function's scope
cache := synth.NewMathHelperCache()
cache.Enable()

// Disable math helper cache and clear cache when function exits
defer func() {
cache.Disable()
cache.Clear()
ctx.Logger().Debug("Math helper cache cleared after CloseReputerNonce")
}()

// All filters should be done in order of increasing computational complexity
// Check if the worker nonce is unfulfilled
workerNonceUnfulfilled, err := k.IsWorkerNonceUnfulfilled(ctx, topic.Id, &nonce)
Expand Down Expand Up @@ -250,6 +261,7 @@ func CloseReputerNonce(
PNorm: topic.PNorm,
CNorm: params.CNorm,
StdDevPlusEpsilon: stdDevPlusEpsilon,
Cache: cache,
},
)
if err != nil {
Expand Down
Loading
Loading