Skip to content

Commit

Permalink
bump deps1
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgao001 committed Jan 2, 2025
1 parent 1afdf23 commit f916f77
Show file tree
Hide file tree
Showing 7 changed files with 326 additions and 1,189 deletions.
41 changes: 21 additions & 20 deletions client/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ import (
"strings"
"time"

"google.golang.org/grpc"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/rs/zerolog/log"
"google.golang.org/grpc"

hashlib "github.com/bnb-chain/greenfield-common/go/hash"
httplib "github.com/bnb-chain/greenfield-common/go/http"
Expand Down Expand Up @@ -211,25 +212,25 @@ func New(chainID string, endpoint string, option Option) (IClient, error) {
}
}
// register off-chain-auth pubkey to all sps
if option.OffChainAuthOption != nil {
if option.ForceToUseSpecifiedSpEndpointForDownloadOnly != "" {
return nil, errors.New("forceToUseSpecifiedSpEndpointForDownloadOnly option does not support OffChainAuthOption, please adjust option inputs and try again")
}
if option.OffChainAuthOption.Seed == "" || option.OffChainAuthOption.Domain == "" {
return nil, errors.New("seed and domain can't be empty in OffChainAuthOption")
}
c.offChainAuthOption = option.OffChainAuthOption
if option.OffChainAuthOption.ShouldRegisterPubKey {
for _, sp := range c.storageProviders {
registerResult, err := c.RegisterEDDSAPublicKey(sp.OperatorAddress.String(), sp.EndPoint.Scheme+"://"+sp.EndPoint.Host)
if err != nil {
log.Error().Msg(fmt.Sprintf("Fail to RegisterEDDSAPublicKey for sp : %s", sp.EndPoint))
}
log.Info().Msg(fmt.Sprintf("registerResult: %s", registerResult))

}
}
}
//if option.OffChainAuthOption != nil {
// if option.ForceToUseSpecifiedSpEndpointForDownloadOnly != "" {
// return nil, errors.New("forceToUseSpecifiedSpEndpointForDownloadOnly option does not support OffChainAuthOption, please adjust option inputs and try again")
// }
// if option.OffChainAuthOption.Seed == "" || option.OffChainAuthOption.Domain == "" {
// return nil, errors.New("seed and domain can't be empty in OffChainAuthOption")
// }
// c.offChainAuthOption = option.OffChainAuthOption
// if option.OffChainAuthOption.ShouldRegisterPubKey {
// for _, sp := range c.storageProviders {
// registerResult, err := c.RegisterEDDSAPublicKey(sp.OperatorAddress.String(), sp.EndPoint.Scheme+"://"+sp.EndPoint.Host)
// if err != nil {
// log.Error().Msg(fmt.Sprintf("Fail to RegisterEDDSAPublicKey for sp : %s", sp.EndPoint))
// }
// log.Info().Msg(fmt.Sprintf("registerResult: %s", registerResult))
//
// }
// }
//}

// register off-chain-auth-v2 pubkey to all sps
if option.OffChainAuthOptionV2 != nil {
Expand Down
8 changes: 4 additions & 4 deletions client/api_off_chain_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import (
"strings"
"time"

"golang.org/x/crypto/blake2b"

"github.com/consensys/gnark-crypto/ecc/bn254/fr"
"github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc"
"github.com/consensys/gnark-crypto/ecc/bn254/twistededwards"
"github.com/consensys/gnark-crypto/ecc/bn254/twistededwards/eddsa"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/rs/zerolog/log"
"golang.org/x/crypto/blake2b"

httplib "github.com/bnb-chain/greenfield-common/go/http"
"github.com/bnb-chain/greenfield-go-sdk/types"
Expand Down Expand Up @@ -398,7 +398,7 @@ const (
)

func generateKey(r io.Reader) (*eddsa.PrivateKey, error) {
c := twistededwards.GetEdwardsCurve()
//c := twistededwards.GetEdwardsCurve()

var (
randSrc = make([]byte, 32)
Expand Down Expand Up @@ -444,7 +444,7 @@ func generateKey(r io.Reader) (*eddsa.PrivateKey, error) {

var bscalar big.Int
bscalar.SetBytes(scalar[:])
pub.A.ScalarMul(&c.Base, &bscalar)
//pub.A.ScalarMul(&c.Base, &bscalar)

var res [sizeFr * 3]byte
pubkBin := pub.A.Bytes()
Expand Down
2 changes: 1 addition & 1 deletion client/api_sp.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"

"github.com/cosmos/cosmos-sdk/types/query"
"github.com/prysmaticlabs/prysm/crypto/bls"
"github.com/prysmaticlabs/prysm/v5/crypto/bls"

"cosmossdk.io/math"
"github.com/bnb-chain/greenfield-go-sdk/pkg/utils"
Expand Down
2 changes: 1 addition & 1 deletion e2e/e2e_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/cometbft/cometbft/crypto/tmhash"
"github.com/prysmaticlabs/prysm/crypto/bls/blst"
"github.com/prysmaticlabs/prysm/v5/crypto/bls/blst"

"cosmossdk.io/math"
"github.com/bnb-chain/greenfield-go-sdk/e2e/basesuite"
Expand Down
112 changes: 63 additions & 49 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
module github.com/bnb-chain/greenfield-go-sdk

go 1.20
go 1.22.0

toolchain go1.22.6

require (
cosmossdk.io/errors v1.0.0-beta.7
cosmossdk.io/math v1.0.1
github.com/bnb-chain/greenfield v1.9.1
github.com/bnb-chain/greenfield-common/go v0.0.0-20240410092538-5e3891943cbb
github.com/cometbft/cometbft v0.38.6
github.com/consensys/gnark-crypto v0.7.0
github.com/consensys/gnark-crypto v0.12.1
github.com/cosmos/cosmos-sdk v0.47.10
github.com/cosmos/gogoproto v1.4.10
github.com/ethereum/go-ethereum v1.10.26
github.com/prysmaticlabs/prysm v0.0.0-20220124113610-e26cde5e091b
github.com/cosmos/gogoproto v1.5.0
github.com/ethereum/go-ethereum v1.14.12
github.com/prysmaticlabs/prysm/v5 v5.2.0
//github.com/prysmaticlabs/prysm v0.0.0-20220124113610-e26cde5e091b
github.com/rs/zerolog v1.29.1
github.com/stretchr/testify v1.8.4
golang.org/x/crypto v0.21.0
google.golang.org/grpc v1.59.0
github.com/stretchr/testify v1.10.0
golang.org/x/crypto v0.31.0
google.golang.org/grpc v1.65.0
)

require (
Expand All @@ -27,137 +30,148 @@ require (
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/btcsuite/btcd v0.23.3 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/btcutil v1.1.2 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cometbft/cometbft-db v0.7.0 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/iavl v0.20.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
github.com/ferranbt/fastssz v0.0.0-20210905181407-59cf6761a7d5 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 // indirect
github.com/ferranbt/fastssz v0.1.3 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.1.2 // indirect
github.com/golang/glog v1.2.1 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hdevalence/ed25519consensus v0.1.0 // indirect
github.com/herumi/bls-eth-go-binary v0.0.0-20210917013441-d37c07cfda4e // indirect
github.com/herumi/bls-eth-go-binary v1.31.0 // indirect
github.com/holiman/uint256 v1.3.1 // indirect
github.com/huandu/skiplist v1.2.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/klauspost/reedsolomon v1.11.8 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/linxGnu/grocksdb v1.7.16 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prysmaticlabs/eth2-types v0.0.0-20210303084904-c9735a06829d // indirect
github.com/prometheus/client_golang v1.20.4 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.61.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/prysmaticlabs/fastssz v0.0.0-20241008181541-518c4ce73516 // indirect
github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e // indirect
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.15.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/supranational/blst v0.3.13 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e // indirect
github.com/tidwall/btree v1.6.0 // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.4.0 // indirect
github.com/urfave/cli/v2 v2.25.7 // indirect
github.com/tklauser/go-sysconf v0.3.13 // indirect
github.com/tklauser/numcpus v0.7.0 // indirect
github.com/wealdtech/go-bytesutil v1.1.1 // indirect
github.com/wealdtech/go-eth2-types/v2 v2.5.2 // indirect
github.com/wealdtech/go-eth2-util v1.6.3 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
github.com/zondax/hid v0.9.1 // indirect
github.com/zondax/ledger-go v0.14.1 // indirect
go.etcd.io/bbolt v1.3.9 // indirect
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/protobuf v1.33.0 // indirect
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/protobuf v1.35.2 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
pgregory.net/rapid v0.5.5 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace (
cosmossdk.io/api => github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20231129013257-1e407f209b02
cosmossdk.io/math => github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20231129013257-1e407f209b02
github.com/bnb-chain/greenfield => github.com/bnb-chain/greenfield v1.10.1-0.20250102024635-929b7b2317b2
github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.23.0
github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v1.2.1-0.20240408033601-a6b682aa870e
github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v1.3.2-0.20250102023521-f4907033f92f
github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-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 v1.9.2
github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v1.10.1-0.20250102023935-3fc962800521
github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
github.com/wealdtech/go-eth2-types/v2 v2.5.2 => github.com/wealdtech/go-eth2-types/v2 v2.8.2

)
Loading

0 comments on commit f916f77

Please sign in to comment.