You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
x/cellarfees/keeper: remove unnecessary iterations predicated on an AND condition that could be checked immediately that an auction interval occured
#300
Open
odeke-em opened this issue
Mar 15, 2024
· 0 comments
we see that in the condition to reset the counters, modulus MUST BE == 0!
This means that if modulus != 0 regardless of how many times that we iterate, we can't be performing a counter reset and this means that that loop is needlessly burning CPU cycles whenever it isn't an auction interval
Suggestion
Simply firstly check that the auction interval occured and even better rename to a much better variable so
Summary of Bug
If we look at this code
sommelier/x/cellarfees/keeper/abci.go
Lines 19 to 28 in 3157d97
we see that in the condition to reset the counters, modulus MUST BE == 0!
This means that if
modulus != 0
regardless of how many times that we iterate, we can't be performing a counter reset and this means that that loop is needlessly burning CPU cycles whenever it isn't an auction intervalSuggestion
Simply firstly check that the auction interval occured and even better rename to a much better variable so
The text was updated successfully, but these errors were encountered: