Skip to content

Commit 89619e2

Browse files
authored
fix oracle map iteration (#263)
* fix(oracle): ensure map iteration is deteministic * update price-feeder to v0.1.13 * go mod tidy
1 parent 27a99e2 commit 89619e2

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
cosmossdk.io/math v1.2.0
88
cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d
99
cosmossdk.io/tools/rosetta v0.2.1
10-
github.com/ExocoreNetwork/price-feeder v0.1.12
10+
github.com/ExocoreNetwork/price-feeder v0.1.13
1111
github.com/agiledragon/gomonkey/v2 v2.11.0
1212
github.com/armon/go-metrics v0.4.1
1313
github.com/cometbft/cometbft v0.37.4

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,8 @@ github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z
547547
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
548548
github.com/ExocoreNetwork/evmos/v16 v16.0.3-0.20240828081344-d5cfcd34a812 h1:4P/4GZ89DOy9uNPDlEwebPytKltbimq8wn9XiuX96vw=
549549
github.com/ExocoreNetwork/evmos/v16 v16.0.3-0.20240828081344-d5cfcd34a812/go.mod h1:w0vtRYI4I0/O8eihq6ZuDvlca4ZiYCKN6vpakG9zHcc=
550-
github.com/ExocoreNetwork/price-feeder v0.1.12 h1:6UcDhWL/pILGSOLgdM5aUwxv963ORBn8nNk7X3Wg9Dw=
551-
github.com/ExocoreNetwork/price-feeder v0.1.12/go.mod h1:CgVrnt5K1Yp8/y7Dz/UFU0g3B86Hx9DjJHHiQz2z0rY=
550+
github.com/ExocoreNetwork/price-feeder v0.1.13 h1:3YllJX1QAx4MR1v/FkAJbFwrLLX4yFWJvhJKpIc5bTQ=
551+
github.com/ExocoreNetwork/price-feeder v0.1.13/go.mod h1:CgVrnt5K1Yp8/y7Dz/UFU0g3B86Hx9DjJHHiQz2z0rY=
552552
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk=
553553
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
554554
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=

x/oracle/module.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/json"
66
"fmt"
77
"math/big"
8+
"sort"
89
"strings"
910

1011
// this line is used by starport scaffolding # 1
@@ -204,7 +205,13 @@ func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Val
204205
}()
205206
// update&check slashing info
206207
validatorPowers := agc.GetValidatorPowers()
207-
for validator, power := range validatorPowers {
208+
validators := make([]string, 0, len(validatorPowers))
209+
for validator := range validatorPowers {
210+
validators = append(validators, validator)
211+
}
212+
sort.Strings(validators)
213+
for _, validator := range validators {
214+
power := validatorPowers[validator]
208215
reportedInfo, found := am.keeper.GetValidatorReportInfo(ctx, validator)
209216
if !found {
210217
logger.Error(fmt.Sprintf("Expected report info for validator %s but not found", validator))

0 commit comments

Comments
 (0)