Skip to content

Commit

Permalink
feat: pass in chainid when calculating event hash (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
randyahx authored Jul 31, 2023
1 parent 66a6ebc commit 67035d7
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 60 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewApp(cfg *config.Config) *App {
db, err := gorm.Open(mysql.Open(dbPath), &gorm.Config{})

//only for debug purpose
//db = db.Debug()
db = db.Debug()

if err != nil {
panic(fmt.Sprintf("open db error, err=%+v", err.Error()))
Expand Down
4 changes: 2 additions & 2 deletions common/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
)

var (
RtyAttemNum = uint(5)
RtyAttemNum = uint(2)
RtyAttem = retry.Attempts(RtyAttemNum)
RtyDelay = retry.Delay(time.Millisecond * 400)
RtyDelay = retry.Delay(time.Millisecond * 500)
RtyErr = retry.LastErrorOnly(true)
RetryInterval = 1 * time.Second
CacheClearIterations = 100
Expand Down
2 changes: 1 addition & 1 deletion executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func (e *Executor) GetObjectInfoChecksums(objectId string) ([][]byte, error) {
logging.Logger.Errorf("executor failed to query storage client for objectId %s, err=%+v", objectId, err.Error())
return nil, err
}
return res.GetChecksums(), nil
return res.ObjectInfo.GetChecksums(), nil
}

func (e *Executor) GetChallengeResultFromSp(objectId, endpoint string, segmentIndex, redundancyIndex int) (*types.ChallengeResult, error) {
Expand Down
31 changes: 17 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ require (
cosmossdk.io/math v1.0.1
github.com/avast/retry-go/v4 v4.3.1
github.com/aws/aws-sdk-go v1.40.45
github.com/bnb-chain/greenfield v0.2.3-alpha.1
github.com/bnb-chain/greenfield v0.2.3-alpha.5
github.com/bnb-chain/greenfield-common/go v0.0.0-20230512062756-5d7790d0ccbf
github.com/bnb-chain/greenfield-go-sdk v0.2.3-alpha.1
github.com/bnb-chain/greenfield-go-sdk v0.2.3-alpha.4
github.com/cometbft/cometbft v0.37.1
github.com/cosmos/cosmos-sdk v0.47.2
github.com/ethereum/go-ethereum v1.10.26
Expand All @@ -20,8 +20,9 @@ require (
github.com/prysmaticlabs/prysm v0.0.0-20220124113610-e26cde5e091b
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.2
github.com/stretchr/testify v1.8.4
github.com/willf/bitset v1.1.11
golang.org/x/sync v0.2.0
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gorm.io/driver/mysql v1.4.5
gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11
Expand Down Expand Up @@ -51,6 +52,7 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cometbft/cometbft-db v0.7.0 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
github.com/consensys/gnark-crypto v0.7.0 // indirect
github.com/containerd/continuity v0.3.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect
Expand Down Expand Up @@ -127,7 +129,7 @@ require (
github.com/rs/zerolog v1.29.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.7.0 // indirect
Expand All @@ -147,16 +149,16 @@ require (
github.com/zondax/hid v0.9.1 // indirect
github.com/zondax/ledger-go v0.14.1 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
golang.org/x/crypto v0.8.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/term v0.7.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20230320184635-7606e756e683 // indirect
google.golang.org/grpc v1.55.0 // indirect
golang.org/x/tools v0.9.3 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.56.1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand All @@ -169,9 +171,10 @@ replace (
cosmossdk.io/api => github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230425074444-eb5869b05fe9
cosmossdk.io/math => github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230425074444-eb5869b05fe9
github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.23.0
github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.1
github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.2-alpha.1
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.1
github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3
github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1-alpha.1
github.com/ferranbt/fastssz => github.com/prysmaticlabs/fastssz v0.0.0-20220110145812-fafb696cae88
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/grpc-ecosystem/grpc-gateway/v2 => github.com/prysmaticlabs/grpc-gateway/v2 v2.3.1-0.20210702154020-550e1cd83ec1
Expand Down
Loading

0 comments on commit 67035d7

Please sign in to comment.