diff --git a/.gitmodules b/.gitmodules index 034f7b2ec..adb290966 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,7 +8,7 @@ [submodule ".github/scripts/IBC-Integration"] path = .github/scripts/IBC-Integration - url = https://github.com/icon-project/IBC-Integration.git + url = https://github.com/icon-project/ibc-integration.git [submodule ".github/scripts/archway"] path = .github/scripts/archway url = https://github.com/archway-network/archway.git diff --git a/cmd/flags.go b/cmd/flags.go index 1f8396899..8c70ab2ee 100644 --- a/cmd/flags.go +++ b/cmd/flags.go @@ -55,6 +55,8 @@ const ( flagSrcConnID = "src-connection-id" flagDstConnID = "dst-connection-id" flagBtpBlockHeight = "btp-block-height" + flagSrcWasmCodeID = "src-wasm-code-id" + flagDstWasmCodeID = "dst-wasm-code-id" ) const ( @@ -286,6 +288,8 @@ func clientParameterFlags(v *viper.Viper, cmd *cobra.Command) *cobra.Command { cmd.Flags().BoolP(flagUpdateAfterMisbehaviour, "m", true, "allow governance to update the client if misbehaviour freezing occurs") cmd.Flags().Duration(flagClientTrustingPeriod, 0, "custom light client trusting period ex. 24h (default: 85% of chains reported unbonding time)") + cmd.Flags().String(flagSrcWasmCodeID, "", "src chain's wasm code id for clients (default: empty / not used)") + cmd.Flags().String(flagDstWasmCodeID, "", "dst chain's wasm code id for clients (default: empty / not used)") if err := v.BindPFlag(flagUpdateAfterExpiry, cmd.Flags().Lookup(flagUpdateAfterExpiry)); err != nil { panic(err) } diff --git a/cmd/paths.go b/cmd/paths.go index 640414fa5..be5dd3549 100644 --- a/cmd/paths.go +++ b/cmd/paths.go @@ -408,7 +408,6 @@ $ %s pth fch`, appName, defaultHome, appName)), client, _, err := client.Repositories.DownloadContents(cmd.Context(), "cosmos", "chain-registry", regPath, nil) if err != nil { if errors.As(err, new(*github.RateLimitError)) { - fmt.Println("some paths failed: ", err) break } fmt.Fprintf(cmd.ErrOrStderr(), "failure retrieving: %s: consider adding to cosmos/chain-registry: ERR: %v\n", pthName, err) diff --git a/cmd/start.go b/cmd/start.go index c2cdf9406..f506d3bb1 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -45,42 +45,52 @@ $ %s start demo-path --max-msgs 3 $ %s start demo-path2 --max-tx-size 10`, appName, appName, appName, appName)), RunE: func(cmd *cobra.Command, args []string) error { chains := make(map[string]*relayer.Chain) - paths := make([]relayer.NamedPath, len(args)) + + var paths []relayer.NamedPath if len(args) > 0 { - for i, pathName := range args { + for _, pathName := range args { path := a.config.Paths.MustGet(pathName) - paths[i] = relayer.NamedPath{ - Name: pathName, - Path: path, + if err := path.IsInvalid(); err != nil { + a.log.Warn(fmt.Sprintf("Skipping invalid path: [%s] : %s", pathName, err.Error())) + } else { + paths = append(paths, relayer.NamedPath{ + Name: pathName, + Path: path, + }) } - - // collect unique chain IDs - chains[path.Src.ChainID] = nil - chains[path.Dst.ChainID] = nil } } else { for n, path := range a.config.Paths { - paths = append(paths, relayer.NamedPath{ - Name: n, - Path: path, - }) - - // collect unique chain IDs - chains[path.Src.ChainID] = nil - chains[path.Dst.ChainID] = nil + if err := path.IsInvalid(); err != nil { + a.log.Warn(fmt.Sprintf("Skipping invalid path: [%s] : %s", n, err.Error())) + } else { + paths = append(paths, relayer.NamedPath{ + Name: n, + Path: path, + }) + } } } - chainIDs := make([]string, 0, len(chains)) - for chainID := range chains { - chainIDs = append(chainIDs, chainID) - } + for _, p := range paths { + srcChainID := p.Path.Src.ChainID + if _, ok := chains[srcChainID]; !ok { + chain, err := a.config.Chains.Get(srcChainID) + if err != nil { + return err + } + chains[srcChainID] = chain + } - // get chain configurations - chains, err := a.config.Chains.Gets(chainIDs...) - if err != nil { - return err + dstChainID := p.Path.Dst.ChainID + if _, ok := chains[dstChainID]; !ok { + chain, err := a.config.Chains.Get(dstChainID) + if err != nil { + return err + } + chains[dstChainID] = chain + } } if err := ensureKeysExist(chains); err != nil { diff --git a/cmd/tx.go b/cmd/tx.go index 49fdf09e9..6b6dbee6a 100644 --- a/cmd/tx.go +++ b/cmd/tx.go @@ -94,6 +94,16 @@ func createClientsCmd(a *appState) *cobra.Command { return err } + srcWasmCodeID, err := cmd.Flags().GetString(flagSrcWasmCodeID) + if err != nil { + return err + } + + dstWasmCodeID, err := cmd.Flags().GetString(flagDstWasmCodeID) + if err != nil { + return err + } + path := args[0] c, src, dst, err := a.config.ChainsFromPath(path) @@ -111,7 +121,7 @@ func createClientsCmd(a *appState) *cobra.Command { // TODO: make iconStartHeight compulsory // if iconStartHeight is not given it can create confusion as starting relay at any time could miss number of btp block update_client - clientSrc, clientDst, err := c[src].CreateClients(cmd.Context(), c[dst], allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, a.config.memo(cmd), iconStartHeight) + clientSrc, clientDst, err := c[src].CreateClients(cmd.Context(), c[dst], allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, a.config.memo(cmd), iconStartHeight, srcWasmCodeID, dstWasmCodeID) if err != nil { return err } @@ -166,6 +176,11 @@ func createClientCmd(a *appState) *cobra.Command { return err } + srcWasmCodeID, err := cmd.Flags().GetString(flagSrcWasmCodeID) + if err != nil { + return err + } + src, ok := a.config.Chains[args[0]] if !ok { return errChainNotFound(args[0]) @@ -242,7 +257,7 @@ func createClientCmd(a *appState) *cobra.Command { return err } - clientID, err := relayer.CreateClient(cmd.Context(), src, dst, srcUpdateHeader, dstUpdateHeader, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, a.config.memo(cmd), iconStartHeight) + clientID, err := relayer.CreateClient(cmd.Context(), src, dst, srcUpdateHeader, dstUpdateHeader, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, a.config.memo(cmd), iconStartHeight, srcWasmCodeID) if err != nil { return err } @@ -441,6 +456,16 @@ $ %s tx conn demo-path --timeout 5s`, return err } + srcWasmCodeID, err := cmd.Flags().GetString(flagSrcWasmCodeID) + if err != nil { + return err + } + + dstWasmCodeID, err := cmd.Flags().GetString(flagDstWasmCodeID) + if err != nil { + return err + } + // ensure that keys exist if exists := c[src].ChainProvider.KeyExists(c[src].ChainProvider.Key()); !exists { return fmt.Errorf("key %s not found on src chain %s", c[src].ChainProvider.Key(), c[src].ChainID()) @@ -462,7 +487,7 @@ $ %s tx conn demo-path --timeout 5s`, } // ensure that the clients exist - clientSrc, clientDst, err := c[src].CreateClients(cmd.Context(), c[dst], allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, memo, iconStartHeight) + clientSrc, clientDst, err := c[src].CreateClients(cmd.Context(), c[dst], allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, memo, iconStartHeight, srcWasmCodeID, dstWasmCodeID) if err != nil { return err } @@ -726,6 +751,16 @@ $ %s tx connect demo-path --src-port mock --dst-port mock --order unordered --ve return err } + srcWasmCodeID, err := cmd.Flags().GetString(flagSrcWasmCodeID) + if err != nil { + return err + } + + dstWasmCodeID, err := cmd.Flags().GetString(flagDstWasmCodeID) + if err != nil { + return err + } + // ensure that keys exist if exists := c[src].ChainProvider.KeyExists(c[src].ChainProvider.Key()); !exists { return fmt.Errorf("key %s not found on src chain %s", c[src].ChainProvider.Key(), c[src].ChainID()) @@ -747,7 +782,7 @@ $ %s tx connect demo-path --src-port mock --dst-port mock --order unordered --ve } // create clients if they aren't already created - clientSrc, clientDst, err := c[src].CreateClients(cmd.Context(), c[dst], allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, memo, iconStartHeight) + clientSrc, clientDst, err := c[src].CreateClients(cmd.Context(), c[dst], allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, memo, iconStartHeight, srcWasmCodeID, dstWasmCodeID) if err != nil { return fmt.Errorf("error creating clients: %w", err) } diff --git a/go.mod b/go.mod index adb88b77d..fe06757eb 100644 --- a/go.mod +++ b/go.mod @@ -4,18 +4,18 @@ go 1.19 require ( cosmossdk.io/api v0.3.1 - cosmossdk.io/errors v1.0.0-beta.7 + cosmossdk.io/errors v1.0.0 cosmossdk.io/math v1.0.1 - github.com/CosmWasm/wasmd v0.0.0-00010101000000-000000000000 - github.com/avast/retry-go/v4 v4.3.3 + github.com/CosmWasm/wasmd v0.40.0-rc.1 + github.com/avast/retry-go/v4 v4.3.4 github.com/btcsuite/btcd v0.23.4 github.com/btcsuite/btcd/btcutil v1.1.3 - github.com/cometbft/cometbft v0.37.1 + github.com/cometbft/cometbft v0.37.2 github.com/cosmos/cosmos-proto v1.0.0-beta.2 - github.com/cosmos/cosmos-sdk v0.47.3 + github.com/cosmos/cosmos-sdk v0.47.4 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-go/v7 v7.1.0-rc0 + github.com/cosmos/ibc-go/v7 v7.2.0 github.com/cosmos/ics23/go v0.10.0 github.com/ethereum/go-ethereum v1.10.26 github.com/gofrs/flock v0.8.1 @@ -24,22 +24,22 @@ require ( github.com/google/go-github/v43 v43.0.0 github.com/gorilla/websocket v1.5.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/icon-project/IBC-Integration v0.0.0-20230416064536-48d70570734d github.com/icon-project/goloop v1.3.4 + github.com/icon-project/ibc-integration v1.1.2 github.com/jsternberg/zap-logfmt v1.3.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.15.0 github.com/spf13/cobra v1.7.0 - github.com/spf13/viper v1.15.0 - github.com/stretchr/testify v1.8.2 + github.com/spf13/viper v1.16.0 + github.com/stretchr/testify v1.8.4 github.com/tyler-smith/go-bip39 v1.1.0 - go.uber.org/multierr v1.8.0 + go.uber.org/multierr v1.11.0 go.uber.org/zap v1.24.0 - golang.org/x/crypto v0.8.0 - golang.org/x/mod v0.10.0 - golang.org/x/sync v0.1.0 - golang.org/x/text v0.9.0 - google.golang.org/grpc v1.55.0 + golang.org/x/crypto v0.11.0 + golang.org/x/mod v0.12.0 + golang.org/x/sync v0.3.0 + golang.org/x/text v0.11.0 + google.golang.org/grpc v1.56.2 gopkg.in/natefinch/lumberjack.v2 v2.0.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 @@ -47,15 +47,15 @@ require ( ) require ( - cloud.google.com/go v0.110.0 // indirect - cloud.google.com/go/compute v1.18.0 // indirect + cloud.google.com/go v0.110.4 // indirect + cloud.google.com/go/compute v1.20.1 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v0.12.0 // indirect - cloud.google.com/go/storage v1.29.0 // indirect + cloud.google.com/go/iam v1.1.0 // indirect + cloud.google.com/go/storage v1.30.1 // indirect contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/log v1.1.0 // indirect + cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca // indirect cosmossdk.io/tools/rosetta v0.2.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -77,7 +77,7 @@ require ( github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect + github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/confio/ics23/go v0.9.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect @@ -92,7 +92,7 @@ require ( 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/docker/distribution v2.8.1+incompatible // indirect + github.com/docker/distribution v2.8.2+incompatible // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/evalphobia/logrus_fluent v0.5.4 // indirect @@ -102,6 +102,7 @@ require ( 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-playground/locales v0.14.0 // indirect github.com/go-playground/universal-translator v0.18.0 // indirect github.com/go-stack/stack v1.8.1 // indirect @@ -118,9 +119,10 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/orderedcode v0.0.1 // indirect + github.com/google/s2a-go v0.1.4 // indirect github.com/google/uuid v1.3.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.7.0 // indirect + github.com/googleapis/gax-go/v2 v2.11.0 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect @@ -141,16 +143,17 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.3 // indirect + github.com/klauspost/compress v1.16.4 // indirect github.com/labstack/echo/v4 v4.9.0 // indirect github.com/labstack/gommon v0.3.1 // indirect github.com/leodido/go-urn v1.2.1 // indirect github.com/lib/pq v1.10.7 // 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/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20220103164710-9a04d6ca976b // indirect github.com/minio/highwayhash v1.0.2 // indirect @@ -159,7 +162,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.7 // indirect + github.com/pelletier/go-toml/v2 v2.0.9 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/philhofer/fwd v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -173,16 +176,16 @@ require ( github.com/rs/zerolog v1.29.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sirupsen/logrus v1.9.0 // indirect - github.com/spf13/afero v1.9.3 // indirect - github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/afero v1.9.5 // indirect + github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.2 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/tidwall/btree v1.6.0 // indirect github.com/tinylib/msgp v1.1.2 // indirect + github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.1 // indirect @@ -194,19 +197,21 @@ require ( go.opencensus.io v0.24.0 // indirect go.uber.org/atomic v1.10.0 // indirect golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect - golang.org/x/net v0.9.0 // indirect - golang.org/x/oauth2 v0.6.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/term v0.7.0 // indirect + golang.org/x/net v0.12.0 // indirect + golang.org/x/oauth2 v0.8.0 // indirect + golang.org/x/sys v0.10.0 // indirect + golang.org/x/term v0.10.0 // indirect golang.org/x/time v0.1.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.110.0 // indirect + google.golang.org/api v0.126.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect - google.golang.org/protobuf v1.30.0 // indirect + google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect + google.golang.org/protobuf v1.31.0 // indirect gopkg.in/go-playground/validator.v9 v9.28.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - nhooyr.io/websocket v1.8.6 // indirect + nhooyr.io/websocket v1.8.7 // indirect pgregory.net/rapid v0.5.5 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) @@ -214,6 +219,8 @@ require ( replace ( github.com/ChainSafe/go-schnorrkel => github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d github.com/CosmWasm/wasmd => github.com/cosmwasm/wasmd v0.40.0-rc.1.0.20230424144037-55647a1fd1f9 + github.com/cosmos/ibc-go/v7 => github.com/notional-labs/ibc-go/v7 v7.0.1-wasm-client.0.20230724144435-2b77d4a1ce70 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/icon-project/IBC-Integration => github.com/icon-project/ibc-integration v0.0.0-20230717083940-67949d73b622 + ) diff --git a/go.sum b/go.sum index de89e513e..c0e0643e0 100644 --- a/go.sum +++ b/go.sum @@ -32,8 +32,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= -cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go v0.110.4 h1:1JYyxKMN9hd5dR2MYTPWkGUgcoxVVhg0LKNKEo0qvmk= +cloud.google.com/go v0.110.4/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -70,8 +70,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.18.0 h1:FEigFqoDbys2cvFkZ9Fjq4gnHBP55anJ0yQyau2f9oY= -cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= +cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg= +cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= @@ -111,13 +111,12 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v0.12.0 h1:DRtTY29b75ciH6Ov1PHb4/iat2CLCvrOm40Q0a6DFpE= -cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= +cloud.google.com/go/iam v1.1.0 h1:67gSqaPukx7O8WLLHMa0PNs3EBGd2eE4d+psbO/CO94= +cloud.google.com/go/iam v1.1.0/go.mod h1:nxdHjaKfCr7fNYx/HJMM8LgiMugmveWlkatear5gVyk= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= @@ -175,8 +174,8 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.29.0 h1:6weCgzRvMg7lzuUurI4697AqIRPU1SvzHhynwpW31jI= -cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= +cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM= +cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -196,10 +195,10 @@ cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= -cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= +cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= +cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca h1:msenprh2BLLRwNT7zN56TbBHOGk/7ARQckXHxXyvjoQ= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= @@ -213,7 +212,7 @@ github.com/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XB github.com/99designs/keyring v1.2.2/go.mod h1:wes/FrByc8j7lFOAGLGSNEg8f/PaI3cgTBqhFkHUrPk= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= +github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= @@ -251,8 +250,8 @@ github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJ github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/avast/retry-go/v4 v4.3.3 h1:G56Bp6mU0b5HE1SkaoVjscZjlQb0oy4mezwY/cGH19w= -github.com/avast/retry-go/v4 v4.3.3/go.mod h1:rg6XFaiuFYII0Xu3RDbZQkxCofFwruZKW8oEF1jpWiU= +github.com/avast/retry-go/v4 v4.3.4 h1:pHLkL7jvCvP317I8Ge+Km2Yhntv3SdkJm7uekkqbKhM= +github.com/avast/retry-go/v4 v4.3.4/go.mod h1:rv+Nla6Vk3/ilU0H51VHddWHiwimzX66yZ0JT6T+UvE= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= @@ -298,7 +297,7 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -342,10 +341,10 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:z github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= -github.com/cometbft/cometbft v0.37.1 h1:KLxkQTK2hICXYq21U2hn1W5hOVYUdQgDQ1uB+90xPIg= -github.com/cometbft/cometbft v0.37.1/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= +github.com/cometbft/cometbft v0.37.2 h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc= +github.com/cometbft/cometbft v0.37.2/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= +github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= +github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -359,8 +358,8 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.47.3 h1:r0hGmZoAzP2D+MaPaFGHwAaTdFQq3pNpHaUp1BsffbM= -github.com/cosmos/cosmos-sdk v0.47.3/go.mod h1:c4OfLdAykA9zsj1CqrxBRqXzVz48I++JSvIMPSPcEmk= +github.com/cosmos/cosmos-sdk v0.47.4 h1:FVUpEprm58nMmBX4xkRdMDaIG5Nr4yy92HZAfGAw9bg= +github.com/cosmos/cosmos-sdk v0.47.4/go.mod h1:R5n+uM7vguVPFap4pgkdvQCT1nVo/OtPwrlAU40rvok= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -371,8 +370,6 @@ github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoK github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-go/v7 v7.1.0-rc0 h1:b78+/74AJDp0Sc7utMO1l4nI/u4ERnyta1nqooqQrGI= -github.com/cosmos/ibc-go/v7 v7.1.0-rc0/go.mod h1:7MptlWeIyqmDiuJeRAFqBvXKY8Hybd+rF8vMSmGd2zg= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.12.1 h1:sMBxza5p/rNK/06nBSNmsI/WDqI0pVJFVNihy1Y984w= @@ -412,8 +409,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= -github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -441,9 +438,6 @@ github.com/ethereum/go-ethereum v1.10.26 h1:i/7d9RBBwiXCEuyduBQzJw/mKmnvzsN14jqB github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= github.com/evalphobia/logrus_fluent v0.5.4 h1:G4BSBTm7+L+oanWfFtA/A5Y3pvL2OMxviczyZPYO5xc= github.com/evalphobia/logrus_fluent v0.5.4/go.mod h1:hasyj+CXm3BDP1YhFk/rnTcjlegyqvkokV9A25cQsaA= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= @@ -453,7 +447,7 @@ github.com/fluent/fluent-logger-golang v1.4.0/go.mod h1:2/HCT/jTy78yGyeNGQLGQsjF github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= @@ -462,8 +456,8 @@ github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbS github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -483,6 +477,7 @@ github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= @@ -490,8 +485,8 @@ github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= @@ -503,6 +498,7 @@ github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -612,6 +608,8 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= +github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= @@ -630,8 +628,8 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.7.0 h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1YupQSSQ= -github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= +github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= +github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -682,8 +680,8 @@ github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoD github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -713,8 +711,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/icon-project/goloop v1.3.4 h1:82x8x+zY2XLVPEuWKHvnTj4bkeC5EYlNaaiePDqdMjk= github.com/icon-project/goloop v1.3.4/go.mod h1:9PoWRb5kowidc9jYy0RLuLpay1zT5FXgEKijx7rDQjE= -github.com/icon-project/ibc-integration v0.0.0-20230717083940-67949d73b622 h1:RHutSdyBRURe7MHx/838gVEw6Iu+tYMF/x2cx9hZSxY= -github.com/icon-project/ibc-integration v0.0.0-20230717083940-67949d73b622/go.mod h1:lYQTcVqXxpUhhdz/cU2xsX1rPGoIkeWalIAjiEt0K+0= +github.com/icon-project/ibc-integration v1.1.2 h1:ev1Rwqyrvkkm/weLS5D8ecu9GShznYfSHeG/gSxBE+A= +github.com/icon-project/ibc-integration v1.1.2/go.mod h1:GcfjRAcIS19mr/tXPiqM/GOwJkRCHtknSezYy8VHiKY= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -756,8 +754,8 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= -github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.4 h1:91KN02FnsOYhuunwU4ssRe8lc2JosWmizWa91B5v1PU= +github.com/klauspost/compress v1.16.4/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -780,6 +778,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/linxGnu/grocksdb v1.7.16 h1:Q2co1xrpdkr5Hx3Fp+f+f7fRGhQFQhvi/+226dtLmA8= +github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -796,8 +796,8 @@ github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= @@ -844,6 +844,8 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/notional-labs/ibc-go/v7 v7.0.1-wasm-client.0.20230724144435-2b77d4a1ce70 h1:oZTUDZzUBp8D2h3uZfPQmZGVksrROqubHDASvFB/+u0= +github.com/notional-labs/ibc-go/v7 v7.0.1-wasm-client.0.20230724144435-2b77d4a1ce70/go.mod h1:ISHo/Qitjtvj2svGmttaZv03zVXmS+uqvUyF9kFqlI0= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -865,7 +867,7 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -886,8 +888,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us= -github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= +github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= @@ -994,11 +996,11 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= -github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= +github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= @@ -1011,8 +1013,8 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -1031,16 +1033,15 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807/go.mod h1:7jxmlfBCDBXRzr0eAQJ48XC1hBu1np4CS5+cHEYfwpc= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= @@ -1048,7 +1049,9 @@ github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EU github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= -github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= +github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= +github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= +github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= @@ -1056,8 +1059,8 @@ github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3C github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= @@ -1102,14 +1105,13 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= @@ -1129,9 +1131,10 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1171,8 +1174,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= -golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1224,6 +1227,7 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1236,8 +1240,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1263,8 +1267,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= -golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= +golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= +golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1279,8 +1283,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1303,6 +1307,7 @@ golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1386,13 +1391,13 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= +golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1402,9 +1407,10 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1472,7 +1478,7 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y= +golang.org/x/tools v0.11.0 h1:EMCa6U9S2LtZXLAMoWiR/R8dAQFRqbAitmbJ2UKhoi8= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1531,8 +1537,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.110.0 h1:l+rh0KYUooe9JGbGVx71tbFo4SMbMTXK3I3ia2QSEeU= -google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= +google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= +google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1651,8 +1657,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 h1:DdoeryqhaXp1LtT/emMP1BRJPHHKFi5akj/nbx/zNTA= -google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 h1:Au6te5hbKUV8pIYWHqOUZ1pva5qK/rwbIhoXEUB9Lu8= +google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:O9kGHb51iE/nOGvQaDUuadVYqovW56s5emA88lQnj6Y= +google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529 h1:s5YSX+ZH5b5vS9rnpGymvIyMpLRJizowqDlOuyjXnTk= +google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1694,8 +1704,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI= +google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1712,8 +1722,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1751,7 +1761,7 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1760,8 +1770,9 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= +nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= +nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/relayer/chains/cosmos/codec.go b/relayer/chains/cosmos/codec.go index bfeb42425..04847ff7c 100644 --- a/relayer/chains/cosmos/codec.go +++ b/relayer/chains/cosmos/codec.go @@ -27,6 +27,7 @@ import ( cosmosmodule "github.com/cosmos/relayer/v2/relayer/chains/cosmos/module" "github.com/cosmos/relayer/v2/relayer/chains/cosmos/stride" + icon_module "github.com/cosmos/relayer/v2/relayer/chains/icon/module" ethermintcodecs "github.com/cosmos/relayer/v2/relayer/codecs/ethermint" injectivecodecs "github.com/cosmos/relayer/v2/relayer/codecs/injective" ) @@ -58,6 +59,7 @@ var ModuleBasics = []module.AppModuleBasic{ cosmosmodule.AppModuleBasic{}, stride.AppModuleBasic{}, ibcfee.AppModuleBasic{}, + icon_module.AppModuleBasic{}, } type Codec struct { diff --git a/relayer/chains/cosmos/cosmos_chain_processor.go b/relayer/chains/cosmos/cosmos_chain_processor.go index f02f4d243..427e09ca8 100644 --- a/relayer/chains/cosmos/cosmos_chain_processor.go +++ b/relayer/chains/cosmos/cosmos_chain_processor.go @@ -9,7 +9,6 @@ import ( "github.com/avast/retry-go/v4" sdk "github.com/cosmos/cosmos-sdk/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" "github.com/cosmos/relayer/v2/relayer/processor" @@ -94,7 +93,7 @@ func (l latestClientState) update(ctx context.Context, clientInfo clientInfo, cc trustingPeriod = existingClientInfo.TrustingPeriod } if trustingPeriod == 0 { - cs, err := ccp.chainProvider.queryTMClientState(ctx, 0, clientInfo.clientID) + cs, err := ccp.chainProvider.queryProviderClientState(ctx, 0, clientInfo.clientID) if err != nil { ccp.log.Error( "Failed to query client state to get trusting period", @@ -166,17 +165,12 @@ func (ccp *CosmosChainProcessor) clientState(ctx context.Context, clientID strin if state, ok := ccp.latestClientState[clientID]; ok && state.TrustingPeriod > 0 { return state, nil } - cs, err := ccp.chainProvider.queryTMClientState(ctx, int64(ccp.latestBlock.Height), clientID) + cs, err := ccp.chainProvider.queryProviderClientState(ctx, int64(ccp.latestBlock.Height), clientID) if err != nil { return provider.ClientState{}, err } - clientState := provider.ClientState{ - ClientID: clientID, - ConsensusHeight: cs.GetLatestHeight().(clienttypes.Height), - TrustingPeriod: cs.TrustingPeriod, - } - ccp.latestClientState[clientID] = clientState - return clientState, nil + ccp.latestClientState[clientID] = cs + return cs, nil } // queryCyclePersistence hold the variables that should be retained across queryCycles. @@ -447,6 +441,7 @@ func (ccp *CosmosChainProcessor) queryCycle(ctx context.Context, persistence *qu messages := ibcMessagesFromEvents(ccp.log, tx.Events, chainID, heightUint64, base64Encoded) for _, m := range messages { + ccp.log.Info("Detected eventlog", zap.String("eventlog", m.eventType), zap.Uint64("height", heightUint64)) ccp.handleMessage(ctx, m, ibcMessagesCache) } } diff --git a/relayer/chains/cosmos/module/app_module.go b/relayer/chains/cosmos/module/app_module.go index 6a2d45f15..7e9e88cb6 100644 --- a/relayer/chains/cosmos/module/app_module.go +++ b/relayer/chains/cosmos/module/app_module.go @@ -5,10 +5,12 @@ import ( "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" solomachine "github.com/cosmos/ibc-go/v7/modules/light-clients/06-solomachine" + localhost "github.com/cosmos/ibc-go/v7/modules/light-clients/09-localhost" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" tmlightclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + wasm "github.com/cosmos/ibc-go/v7/modules/light-clients/08-wasm/types" ) // AppModuleBasic defines the basic application module used by the module. @@ -26,6 +28,9 @@ func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino) {} func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { tmlightclient.RegisterInterfaces(registry) solomachine.RegisterInterfaces(registry) + wasm.RegisterInterfaces(registry) + localhost.RegisterInterfaces(registry) + // TODO: add the localhost light client when ibc-go v7.1.0 is available } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the ibc module. diff --git a/relayer/chains/cosmos/provider.go b/relayer/chains/cosmos/provider.go index 37d528a90..4c4891b09 100644 --- a/relayer/chains/cosmos/provider.go +++ b/relayer/chains/cosmos/provider.go @@ -18,6 +18,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/gogoproto/proto" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" "github.com/cosmos/relayer/v2/relayer/codecs/ethermint" "github.com/cosmos/relayer/v2/relayer/processor" @@ -158,7 +159,7 @@ func (cc *CosmosProvider) Timeout() string { } // CommitmentPrefix returns the commitment prefix for Cosmos -func (cc *CosmosProvider) CommitmentPrefix() commitmenttypes.MerklePrefix { +func (cc *CosmosProvider) CommitmentPrefix(clientId string) commitmenttypes.MerklePrefix { return defaultChainPrefix } @@ -318,6 +319,10 @@ func (cc *CosmosProvider) legacyEncodedEvents(log *zap.Logger, version string) b return semver.Compare("v"+version, cometEncodingThreshold) < 0 } +func (cc *CosmosProvider) RevisionNumber() uint64 { + return clienttypes.ParseChainID(cc.ChainId()) +} + // keysDir returns a string representing the path on the local filesystem where the keystore will be initialized. func keysDir(home, chainID string) string { return path.Join(home, "keys", chainID) diff --git a/relayer/chains/cosmos/provider_test.go b/relayer/chains/cosmos/provider_test.go new file mode 100644 index 000000000..ce0f7e622 --- /dev/null +++ b/relayer/chains/cosmos/provider_test.go @@ -0,0 +1,260 @@ +package cosmos + +import ( + "context" + "fmt" + + "go.uber.org/zap" +) + +func GetMockCosmosProvider() (*CosmosProvider, error) { + + pcfg := CosmosProviderConfig{ + AccountPrefix: "centauri", + RPCAddr: "http://localhost:26657", + Timeout: "10h", + KeyringBackend: "test", + ChainID: "centauri-testnet-1", + } + log := zap.NewNop() + prov, err := pcfg.NewProvider(log, "/", false, "centaurid") + if err != nil { + return nil, err + } + + ctx := context.Background() + if err := prov.Init(ctx); err != nil { + return nil, err + } + + provid, ok := prov.(*CosmosProvider) + if !ok { + return nil, fmt.Errorf("failed to convert type ") + } + return provid, nil +} + +// func TestDecodeMerkleProof(t *testing.T) { + +// pro, err := GetMockCosmosProvider() +// assert.NoError(t, err) +// ctx := context.Background() + +// height := 10635 +// connectionId := "connection-13" +// connection, err := pro.QueryConnection(ctx, int64(height), connectionId) +// assert.NoError(t, err) + +// // fromData, _ := hex.DecodeString("0ae0020add020a19636f6e6e656374696f6e732f636f6e6e656374696f6e2d3130124c0a0930382d7761736d2d3212230a0131120d4f524445525f4f524445524544120f4f524445525f554e4f524445524544180122180a0f30372d74656e6465726d696e742d351a050a036962631a0d0801180120012a050002908001222b08011227020490800120abcebf1caa17e720f9981d4d23b934bff8263b961cdd8726fd508399085cab3120222b08011227040892800120804fb31d265f9febe4df8069e8e867634d9728d79865ed173945bd2e9500d45e20222d08011206060e928001201a21202575ba006a05b3e0b4f777bce72154b0807054a5473412807ba1daa14f5555c5222d080112060a20928001201a212072f68ca2f134b05702d0c81481a33d57b03a184896f939bf6fe78059815ab469222b080112270c4292800120c17c6efb37ea9abaffe34e4dc2f1928e8cbdcf221bc5f5927cab5b9d05e90180200afc010af9010a0369626312205e6ab940f7f3e6758c049b0ed9cdfba1f6b92e605d6e8cb5f1a42c6d5a460c3a1a090801180120012a0100222508011221014e1d5c563b0db0ffdcba6fc97dc0c7b13b5b5c9c341357f08827565047d6c6b9222708011201011a20316a36d621713cc96f137fdce34e0b887317e5bc1d400bdbc7d43a3392f3b441222508011221019f05c673d5e30ae4ce84687b527ec6823f0bb48f41a6f7c0359ff576b5faea1822250801122101c169322de4a462eaecada7ca8e80a4ffb299c9dfad87ce9d79b79c43d0593c9f222708011201011a2034d7875e7c32775823aa0a922f7e23dd09cf55f152f5a40b1778b26e191ca855") +// // assert.Equal(t, connection.Proof, fromData, "proof is not equal") +// fmt.Printf("proof %x \n", connection.Proof) + +// var op commitmenttypes.MerkleProof +// err = proto.Unmarshal(connection.Proof, &op) +// assert.NoError(t, err) + +// block, err := pro.LightProvider.LightBlock(ctx, int64(height)) +// assert.NoError(t, err) + +// // consensus state from data +// // csByte, _ := hex.DecodeString("0a0b08ace083aa0610d884c53412220a2031f8b6bfb694c2148c695feeb25834b8ad737a61f1b7883fe7d86b3f6aac1d1d1a209867d31b94e8280141b7cbfd18f675e8cc7066b60932a39404aebcf7e8f6d02d") +// // var cs tmclient.ConsensusState +// // err = proto.Unmarshal(csByte, &cs) +// // assert.NoError(t, err) + +// fmt.Printf("root : %x \n", block.SignedHeader.AppHash) +// root := commitmenttypes.MerkleRoot{Hash: block.SignedHeader.AppHash} + +// key := host.ConnectionKey(connectionId) +// fmt.Println("connection key: ", string(key)) +// merklePath := commitmenttypes.NewMerklePath(string(key)) +// path, err := commitmenttypes.ApplyPrefix(defaultChainPrefix, merklePath) +// assert.NoError(t, err) + +// // value +// value, err := proto.Marshal(connection.Connection) +// assert.NoError(t, err) +// fmt.Printf("value: %x \n ", value) + +// err = op.VerifyMembership([]*ics23.ProofSpec{ics23.IavlSpec, ics23.TendermintSpec}, root, path, value) +// assert.NoError(t, err) + +// } + +// func TestGenerateConnectionHandshakeProof(t *testing.T) { + +// pro, err := GetMockCosmosProvider() +// assert.NoError(t, err) +// ctx := context.Background() + +// height := 10924 +// connectionId := "connection-14" + +// cs, _, _, _, _, err := pro.GenerateConnHandshakeProof(ctx, int64(height), "08-wasm-3", connectionId) +// assert.NoError(t, err) +// anyCs, err := clienttypes.PackClientState(cs) +// assert.NoError(t, err) + +// b, err := proto.Marshal(anyCs) + +// fmt.Printf("client state %x \n", b) + +// } + +// func TestGenerateVal(t *testing.T) { + +// d, _ := hex.DecodeString("0ad8030ad5030a1d636c69656e74732f30382d7761736d2d332f636c69656e7453746174651290010a252f6962632e6c69676874636c69656e74732e7761736d2e76312e436c69656e74537461746512670a3d0a202f69636f6e2e6c69676874636c69656e742e76312e436c69656e745374617465121908c0ba1218901c20c98e072a083078332e69636f6e300338011220dba26dce04b22164b34751ba0e42e60a18e22d179c0d848ad006bd201e7f8bf71a0410c98e071a0d0801180120012a0500028ea601222d080112060204d6aa01201a212003d57c97977de25765fd5ffc14fe57b794d67a665bc3f036d6d15d1635836a82222d080112060408d6aa01201a212050a51e1b4cb7b7b14711ad715ccb4f300f6024a4a98fe4d3d88781fc6d16762b222b080112270610d6aa012025b8312b97b25ee63807b2ecc1592709b283a2b001b5564a69c8f91cbd765c2820222b080112270820d6aa0120047ca7f7a99eb529aa47e5897275f38f5b7f2180f5e6fa4e6fdf6ec3616e3b1920222b080112270a2ed6aa0120c5449ed0890d620585729df614200b9c7630cfa4d9f885ca397173306683158f20222d080112060c56d6aa01201a2120350cea2ecd3e13944b23107b2476e6d1c6accaa99a6c892cbb027f85f66106490afc010af9010a036962631220d497023d6818dfafccb12532875e29df65983eb20b86f7c375875fef2af7ae6d1a090801180120012a0100222508011221014e1d5c563b0db0ffdcba6fc97dc0c7b13b5b5c9c341357f08827565047d6c6b9222708011201011a20316a36d621713cc96f137fdce34e0b887317e5bc1d400bdbc7d43a3392f3b441222508011221019f05c673d5e30ae4ce84687b527ec6823f0bb48f41a6f7c0359ff576b5faea1822250801122101990b5a6d14f4c2ca4ae83341cb992b3a191eb703adfd0b5c538c3986cdda7c6c222708011201011a2004939260c79a0f69a25f2a5a01c8a27286f210729d8c0238e9d59035e768a9e5") +// var c conntypes.ConnectionEnd +// proto.Unmarshal(d, &c) +// fmt.Printf("%s \n", d) + +// var op commitmenttypes.MerkleProof +// err := proto.Unmarshal(d, &op) +// assert.NoError(t, err) + +// for _, v := range op.Proofs { + +// fmt.Printf("key is %x \n", v.GetExist().Key) +// fmt.Printf("value is %x\n", v.GetExist().Value) +// } + +// // d ,_ := hex.DecodeString("0a252f6962632e6c69676874636c69656e74732e7761736d2e76312e436c69656e74537461746512670a3d0a202f69636f6e2e6c69676874636c69656e742e76312e436c69656e745374617465121908c0ba1218901c20c98e072a083078332e69636f6e300338011220dba26dce04b22164b34751ba0e42e60a18e22d179c0d848ad006bd201e7f8bf71a0410c98e07") +// // var op wasmclient.ClientState +// // err := proto.Unmarshal(d, &op) +// // assert.NoError(t, err) +// // fmt.Printf("data is: %s ", op.CodeId) + +// } + +// func TestWasmClientProtoFile(t *testing.T) { + +// // op:= wasmclient.ClientState{ +// // Data: []byte("data"), +// // CodeId: []byte("code-id"), +// // LatestHeight: types.NewHeight(0,20), +// // } + +// // b, err := proto.Marshal(&op) +// // assert.NoError(t, err) +// // fmt.Printf("byte %x \n", b) + +// // clientId := "08-wasm" + +// // lastInd := strings.LastIndex(clientId, "-") +// // fmt.Println(lastInd) + +// pro, err := GetMockCosmosProvider() +// assert.NoError(t, err) +// ctx := context.Background() + +// // height := 10924 +// // connectionId := "connection-14" +// clientId := "08-wasm-0" + +// // height := clienttypes.NewHeight(1, 2201) + +// cs, err := pro.QueryClientState(ctx, 0, clientId) +// assert.NoError(t, err) + +// // data, err := proto.Marshal(cs.ConsensusState) +// // fmt.Printf("data %x\n", data) +// fmt.Println("type", cs.ClientType()) +// fmt.Printf("cs %d \n", cs.GetLatestHeight().GetRevisionHeight()) +// fmt.Printf("cs %d \n", cs.GetLatestHeight().GetRevisionNumber()) + +// } + +// func TestConnectionOpenAck(t *testing.T) { + +// b, _ := hex.DecodeString("0a0c636f6e6e656374696f6e2d31120c636f6e6e656374696f6e2d321a230a0131120d4f524445525f4f524445524544120f4f524445525f554e4f52444552454422b8010a2b2f6962632e6c69676874636c69656e74732e74656e6465726d696e742e76312e436c69656e7453746174651288010a1263656e74617572692d746573746e65742d311204080110031a0408c0ba1222040880df6e2a0308d80432003a040801103542190a090801180120012a0100120c0a02000110211804200c300142190a090801180120012a0100120c0a02000110201801200130014a07757067726164654a1075706772616465644942435374617465500158012a06080110c2a40432280a0208010a22122063128404e5cd488d475fa9f5cb7264fff1cfa3e7a7521148eb28a0e5a87d87113a4c0a2408011220dea1f8b19f170ba89f9bec9cbc608c095f1551f740e7193dc1897ebfe69ff6d00a2408011220d06ed9394fd8737c9639fb57ef2305e9fc0e2f2c73fb87b74bfa0caf9363a410424a0a221220e62fbf1bd5989eb5b07fb67fe58e162bf129471bdb4889ca2e4f659bc72556e20a2408011220d06ed9394fd8737c9639fb57ef2305e9fc0e2f2c73fb87b74bfa0caf9363a4104a0408011035522f63656e74617572693167357232766d6e70366c74613963707374346c7a6334737979336b636a326c6a746533746c68") + +// var m conntypes.MsgConnectionOpenAck +// err := proto.Unmarshal(b, &m) +// assert.NoError(t, err) + +// fmt.Printf("clientState %x \n", m.ClientState.Value) +// // cs, err := clienttypes.UnpackClientState(m.ClientState) +// assert.NoError(t, err) + +// // fmt.Println("connectionOpenAck", cs.GetLatestHeight()) + +// // b, _ := hex.DecodeString("0x0a1263656e74617572692d746573746e65742d311204080110031a0408c0ba1222040880df6e2a0308d80432003a05080110c50342190a090801180120012a0100120c0a02000110211804200c300142190a090801180120012a0100120c0a02000110201801200130014a07757067726164654a107570677261646564494243537461746550015801") +// var tCS tendermint.ClientState + +// err = proto.Unmarshal(m.ClientState.Value, &tCS) +// assert.NoError(t, err) + +// path := common.GetClientStateCommitmentKey("ics08-tendermint-0") +// csByte := common.Sha3keccak256(m.ClientState.Value) + +// fmt.Printf("path : %x \n", path) +// fmt.Printf("clientState keccak: %x \n ", csByte) + +// fmt.Println(tCS.GetLatestHeight().GetRevisionHeight()) + +// } + +// func TestProtoBufDecode(t *testing.T) { +// // b, _ := hex.DecodeString("0a1263656e74617572692d746573746e65742d311204080110031a0408c0ba1222040880df6e2a0308d80432003a05080110fd0242180a090801180120012a0100120b0a010110211804200c300142180a090801180120012a0100120b0a010110201801200130014a07757067726164654a107570677261646564494243537461746550015801") + +// b2Equal, _ := hex.DecodeString("0a1263656e74617572692d746573746e65742d311204080110031a0408c0ba1222040880df6e2a0308d80432003a05080110cb0742190a090801180120012a0100120c0a02000110211804200c300142190a090801180120012a0100120c0a02000110201801200130014a07757067726164654a107570677261646564494243537461746550015801") + +// var cs tendermint.ClientState + +// err := proto.Unmarshal(b2Equal, &cs) +// assert.NoError(t, err) + +// specs := commitmenttypes.GetSDKSpecs() +// assert.Equal(t, specs, cs.ProofSpecs) +// } + +// func TestKecca(t *testing.T) { + +// d, err := hex.DecodeString("080612087472616e736665721a096368616e6e656c2d3322087472616e736665722a096368616e6e656c2d3132a3017b22616d6f756e74223a22393530303030303030303030222c2264656e6f6d223a22767370222c227265636569766572223a22617263687761793164787979787968797035686b7a676c3372776b6a666b63773530333032636137676539647072222c2273656e646572223a22687862366235373931626530623565663637303633623363313062383430666238313531346462326664222c226d656d6f223a22227d3a06080110a0c21e") +// assert.NoError(t, err) + +// var recvPacket chantypes.Packet + +// err = proto.Unmarshal(d, &recvPacket) +// assert.NoError(t, err) + +// pkt := recvPacket + +// fmt.Println("pkt is ", pkt) + +// key := host.PacketCommitmentKey(pkt.SourcePort, pkt.SourceChannel, pkt.Sequence) + +// fmt.Printf("packet commitment key: %x \n", common.Sha3keccak256(key)) + +// cdc := MakeCodec(ModuleBasics, []string{}) + +// commitment := chantypes.CommitPacket(cdc.Marshaler, pkt) + +// fmt.Printf("commitment: %x \n", commitment) + +// k := common.Sha3keccak256(commitment) + +// fmt.Printf("keccak hash: %x \n", k) + +// // 174c5d4caf630a3177179384fcb937b32ff2b9c9aa1b75baf9d001ca44c8ba1c8abf0ea23d6df15e019beb89069adde801d0b416ad7313dda3b8918dffcee648 +// } + +// func TestCheck(t *testing.T) { + +// d, _ := hex.DecodeString("0a0d636f6e6e656374696f6e2d3139120c636f6e6e656374696f6e2d301a230a0131120d4f524445525f4f524445524544120f4f524445525f554e4f52444552454422b9010a2b2f6962632e6c69676874636c69656e74732e74656e6465726d696e742e76312e436c69656e7453746174651289010a1263656e74617572692d746573746e65742d311204080110031a0408c0ba1222040880df6e2a0308d80432003a05080110ed5f42190a090801180120012a0100120c0a02000110211804200c300142190a090801180120012a0100120c0a02000110201801200130014a07757067726164654a1075706772616465644942435374617465500158012a06080110e18d0432280a0208010a2212208a2aa818cbcbf23a39ab8b89ad6e919f63c9a73086c47cb5f42b020c5238f4923a4c0a2408011220a11c2fe63965c80acf540f3641b8a2ab29f4b08e00cfedea6fc08a4ac18c29c00a2408011220199f72f4420d2e29ffe56cbb27858e3b8b2cffacfa0eb1dec3c1add51c2c089e424a0a221220b5f7c49ba32adeb09a4067f59a0140204179a5753700ab778c3ef1d5e05d9f270a2408011220199f72f4420d2e29ffe56cbb27858e3b8b2cffacfa0eb1dec3c1add51c2c089e4a05080110ed5f522f63656e74617572693167357232766d6e70366c74613963707374346c7a6334737979336b636a326c6a746533746c68") + +// var msgUpdateClient clienttypes.MsgUpdateClient + +// err := proto.Unmarshal(d, &msgUpdateClient) +// assert.NoError(t, err) + +// fmt.Println(msgUpdateClient.ClientMessage.Value) + +// var d2 tmclient.Header +// err = proto.Unmarshal(msgUpdateClient.ClientMessage.Value, &d2) + +// assert.NoError(t, err) + +// fmt.Println(d2.SignedHeader.Header.Height) + +// } diff --git a/relayer/chains/cosmos/tx.go b/relayer/chains/cosmos/tx.go index 146592c9b..7a7a4f83a 100644 --- a/relayer/chains/cosmos/tx.go +++ b/relayer/chains/cosmos/tx.go @@ -2,11 +2,12 @@ package cosmos import ( "context" - "errors" + "encoding/hex" "fmt" "math" "math/big" "regexp" + "runtime/debug" "strconv" "strings" "sync" @@ -35,10 +36,14 @@ import ( chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + "github.com/cosmos/ibc-go/v7/modules/core/exported" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + wasmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/08-wasm/types" strideicqtypes "github.com/cosmos/relayer/v2/relayer/chains/cosmos/stride" + "github.com/cosmos/relayer/v2/relayer/common" "github.com/cosmos/relayer/v2/relayer/provider" + "github.com/pkg/errors" "go.uber.org/zap" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -141,6 +146,11 @@ func (cc *CosmosProvider) SendMessagesToMempool( cc.txMu.Lock() defer cc.txMu.Unlock() + for _, m := range msgs { + msgbytes, _ := m.MsgBytes() + cc.log.Info("sending msg to mempool", zap.String("message-type", m.Type()), zap.Binary("message-bytes", msgbytes)) + } + txBytes, sequence, fees, err := cc.buildMessages(ctx, msgs, memo) if err != nil { // Account sequence mismatch errors can happen on the simulated transaction also. @@ -190,13 +200,12 @@ func (cc *CosmosProvider) broadcastTx( asyncCallback func(*provider.RelayerTxResponse, error), // callback for success/fail of the wait for block inclusion ) error { res, err := cc.RPCClient.BroadcastTxSync(ctx, tx) - isErr := err != nil - isFailed := res != nil && res.Code != 0 - if isErr || isFailed { - if isErr && res == nil { - // There are some cases where BroadcastTxSync will return an error but the associated - // ResultBroadcastTx will be nil. - return err + + if res != nil && res.Code != 0 { + if err == nil { + err = errors.New(res.Log) + } else { + err = errors.Wrap(err, res.Log) } rlyResp := &provider.RelayerTxResponse{ TxHash: res.Hash.String(), @@ -204,15 +213,14 @@ func (cc *CosmosProvider) broadcastTx( Code: res.Code, Data: res.Data.String(), } - if isFailed { - err = cc.sdkError(res.Codespace, res.Code) - if err == nil { - err = fmt.Errorf("transaction failed to execute") - } - } cc.LogFailedTx(rlyResp, err, msgs) return err } + + if res == nil { + return err + } + address, err := cc.Address() if err != nil { cc.log.Error( @@ -239,6 +247,12 @@ func (cc *CosmosProvider) waitForTx( waitTimeout time.Duration, callback func(*provider.RelayerTxResponse, error), ) { + defer func() { + if r := recover(); r != nil { + cc.log.Error("Panic occurred", zap.Any("panic", r), zap.Any("trace", string(debug.Stack()))) + } + }() + res, err := cc.waitForBlockInclusion(ctx, txHash, waitTimeout) if err != nil { cc.log.Error("Failed to wait for block inclusion", zap.Error(err)) @@ -435,6 +449,7 @@ func (cc *CosmosProvider) handleAccountSequenceMismatchError(err error) { func (cc *CosmosProvider) MsgCreateClient( clientState ibcexported.ClientState, consensusState ibcexported.ConsensusState, + ) (provider.RelayerMessage, error) { signer, err := cc.Address() if err != nil { @@ -576,7 +591,7 @@ func (cc *CosmosProvider) MsgRecvPacket( } msg := &chantypes.MsgRecvPacket{ Packet: msgTransfer.Packet(), - ProofCommitment: proof.Proof, + ProofCommitment: common.EnsureNonEmptyProof(proof.Proof), ProofHeight: proof.ProofHeight, Signer: signer, } @@ -614,7 +629,7 @@ func (cc *CosmosProvider) MsgAcknowledgement( msg := &chantypes.MsgAcknowledgement{ Packet: msgRecvPacket.Packet(), Acknowledgement: msgRecvPacket.Ack, - ProofAcked: proof.Proof, + ProofAcked: common.EnsureNonEmptyProof(proof.Proof), ProofHeight: proof.ProofHeight, Signer: signer, } @@ -666,7 +681,7 @@ func (cc *CosmosProvider) MsgTimeout(msgTransfer provider.PacketInfo, proof prov } assembled := &chantypes.MsgTimeout{ Packet: msgTransfer.Packet(), - ProofUnreceived: proof.Proof, + ProofUnreceived: common.EnsureNonEmptyProof(proof.Proof), ProofHeight: proof.ProofHeight, NextSequenceRecv: msgTransfer.Sequence, Signer: signer, @@ -686,7 +701,7 @@ func (cc *CosmosProvider) MsgTimeoutOnClose(msgTransfer provider.PacketInfo, pro } assembled := &chantypes.MsgTimeoutOnClose{ Packet: msgTransfer.Packet(), - ProofUnreceived: proof.Proof, + ProofUnreceived: common.EnsureNonEmptyProof(proof.Proof), ProofHeight: proof.ProofHeight, NextSequenceRecv: msgTransfer.Sequence, Signer: signer, @@ -696,6 +711,7 @@ func (cc *CosmosProvider) MsgTimeoutOnClose(msgTransfer provider.PacketInfo, pro } func (cc *CosmosProvider) MsgConnectionOpenInit(info provider.ConnectionInfo, proof provider.ConnectionProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() if err != nil { return nil, err @@ -743,6 +759,7 @@ func (cc *CosmosProvider) ConnectionHandshakeProof( } func (cc *CosmosProvider) MsgConnectionOpenTry(msgOpenInit provider.ConnectionInfo, proof provider.ConnectionProof) (provider.RelayerMessage, error) { + signer, err := cc.Address() if err != nil { return nil, err @@ -788,6 +805,7 @@ func (cc *CosmosProvider) MsgConnectionOpenAck(msgOpenTry provider.ConnectionInf return nil, err } + //TODO if msgOpenTry client is wasm client then we need to incorporate it msg := &conntypes.MsgConnectionOpenAck{ ConnectionId: msgOpenTry.CounterpartyConnID, CounterpartyConnectionId: msgOpenTry.ConnID, @@ -797,11 +815,14 @@ func (cc *CosmosProvider) MsgConnectionOpenAck(msgOpenTry provider.ConnectionInf RevisionNumber: proof.ProofHeight.GetRevisionNumber(), RevisionHeight: proof.ProofHeight.GetRevisionHeight(), }, - ProofTry: proof.ConnectionStateProof, - ProofClient: proof.ClientStateProof, - ProofConsensus: proof.ConsensusStateProof, - ConsensusHeight: proof.ClientState.GetLatestHeight().(clienttypes.Height), - Signer: signer, + ProofTry: proof.ConnectionStateProof, + ProofClient: proof.ClientStateProof, + ProofConsensus: proof.ConsensusStateProof, + ConsensusHeight: clienttypes.Height{ + RevisionNumber: proof.ClientState.GetLatestHeight().GetRevisionNumber(), + RevisionHeight: proof.ClientState.GetLatestHeight().GetRevisionHeight(), + }, + Signer: signer, } return NewCosmosMessage(msg), nil @@ -830,7 +851,7 @@ func (cc *CosmosProvider) MsgConnectionOpenConfirm(msgOpenAck provider.Connectio } msg := &conntypes.MsgConnectionOpenConfirm{ ConnectionId: msgOpenAck.CounterpartyConnID, - ProofAck: proof.ConnectionStateProof, + ProofAck: common.EnsureNonEmptyProof(proof.ConnectionStateProof), ProofHeight: proof.ProofHeight, Signer: signer, } @@ -900,7 +921,7 @@ func (cc *CosmosProvider) MsgChannelOpenTry(msgOpenInit provider.ChannelInfo, pr Version: proof.Version, }, CounterpartyVersion: proof.Version, - ProofInit: proof.Proof, + ProofInit: common.EnsureNonEmptyProof(proof.Proof), ProofHeight: proof.ProofHeight, Signer: signer, } @@ -918,7 +939,7 @@ func (cc *CosmosProvider) MsgChannelOpenAck(msgOpenTry provider.ChannelInfo, pro ChannelId: msgOpenTry.CounterpartyChannelID, CounterpartyChannelId: msgOpenTry.ChannelID, CounterpartyVersion: proof.Version, - ProofTry: proof.Proof, + ProofTry: common.EnsureNonEmptyProof(proof.Proof), ProofHeight: proof.ProofHeight, Signer: signer, } @@ -934,7 +955,7 @@ func (cc *CosmosProvider) MsgChannelOpenConfirm(msgOpenAck provider.ChannelInfo, msg := &chantypes.MsgChannelOpenConfirm{ PortId: msgOpenAck.CounterpartyPortID, ChannelId: msgOpenAck.CounterpartyChannelID, - ProofAck: proof.Proof, + ProofAck: common.EnsureNonEmptyProof(proof.Proof), ProofHeight: proof.ProofHeight, Signer: signer, } @@ -964,7 +985,7 @@ func (cc *CosmosProvider) MsgChannelCloseConfirm(msgCloseInit provider.ChannelIn msg := &chantypes.MsgChannelCloseConfirm{ PortId: msgCloseInit.CounterpartyPortID, ChannelId: msgCloseInit.CounterpartyChannelID, - ProofInit: proof.Proof, + ProofInit: common.EnsureNonEmptyProof(proof.Proof), ProofHeight: proof.ProofHeight, Signer: signer, } @@ -972,7 +993,8 @@ func (cc *CosmosProvider) MsgChannelCloseConfirm(msgCloseInit provider.ChannelIn return NewCosmosMessage(msg), nil } -func (cc *CosmosProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeader, trustedHeight clienttypes.Height, trustedHeader provider.IBCHeader) (ibcexported.ClientMessage, error) { +func (cc *CosmosProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeader, trustedHeight clienttypes.Height, trustedHeader provider.IBCHeader, clientType string) (ibcexported.ClientMessage, error) { + trustedCosmosHeader, ok := trustedHeader.(provider.TendermintIBCHeader) if !ok { return nil, fmt.Errorf("unsupported IBC trusted header type, expected: TendermintIBCHeader, actual: %T", trustedHeader) @@ -987,6 +1009,7 @@ func (cc *CosmosProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeader, if err != nil { return nil, fmt.Errorf("error converting trusted validators to proto object: %w", err) } + trustedValidatorsProto.TotalVotingPower = trustedCosmosHeader.ValidatorSet.TotalVotingPower() signedHeaderProto := latestCosmosHeader.SignedHeader.ToProto() @@ -994,13 +1017,36 @@ func (cc *CosmosProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeader, if err != nil { return nil, fmt.Errorf("error converting validator set to proto object: %w", err) } + validatorSetProto.TotalVotingPower = latestCosmosHeader.ValidatorSet.TotalVotingPower() + + var clientHeader ibcexported.ClientMessage - return &tmclient.Header{ + tmClientHeader := tmclient.Header{ SignedHeader: signedHeaderProto, ValidatorSet: validatorSetProto, TrustedValidators: trustedValidatorsProto, TrustedHeight: trustedHeight, - }, nil + } + + clientHeader = &tmClientHeader + + if clientType == exported.Wasm { + + clientHeaderData, err := cc.Cdc.Marshaler.MarshalInterface(clientHeader) + if err != nil { + return &wasmclient.Header{}, nil + } + height, ok := tmClientHeader.GetHeight().(clienttypes.Height) + if !ok { + return &wasmclient.Header{}, fmt.Errorf("error converting tm client header height") + } + clientHeader = &wasmclient.Header{ + Data: clientHeaderData, + Height: height, + } + } + + return clientHeader, nil } func (cc *CosmosProvider) QueryICQWithProof(ctx context.Context, path string, request []byte, height uint64) (provider.ICQProof, error) { @@ -1041,6 +1087,16 @@ func (cc *CosmosProvider) MsgSubmitQueryResponse(chainID string, queryID provide } func (cc *CosmosProvider) MsgSubmitMisbehaviour(clientID string, misbehaviour ibcexported.ClientMessage) (provider.RelayerMessage, error) { + if strings.Contains(clientID, exported.Wasm) { // TODO: replace with ibcexported.Wasm at v7.2 + wasmData, err := cc.Cdc.Marshaler.MarshalInterface(misbehaviour) + if err != nil { + return nil, err + } + misbehaviour = &wasmclient.Misbehaviour{ + Data: wasmData, + } + } + signer, err := cc.Address() if err != nil { return nil, err @@ -1220,26 +1276,51 @@ func (cc *CosmosProvider) InjectTrustedFields(ctx context.Context, header ibcexp return h, nil } -// queryTMClientState retrieves the latest consensus state for a client in state at a given height -// and unpacks/cast it to tendermint clientstate -func (cc *CosmosProvider) queryTMClientState(ctx context.Context, srch int64, srcClientId string) (*tmclient.ClientState, error) { +// queryProviderClientState retrieves the clientState of cosmos chain +func (cc *CosmosProvider) queryProviderClientState(ctx context.Context, srch int64, srcClientId string) (provider.ClientState, error) { clientStateRes, err := cc.QueryClientStateResponse(ctx, srch, srcClientId) if err != nil { - return &tmclient.ClientState{}, err + return provider.ClientState{}, err } clientStateExported, err := clienttypes.UnpackClientState(clientStateRes.ClientState) if err != nil { - return &tmclient.ClientState{}, err + return provider.ClientState{}, err } - clientState, ok := clientStateExported.(*tmclient.ClientState) + switch cs := clientStateExported.(type) { + case *wasmclient.ClientState: + var clientState ibcexported.ClientState + err = cc.Cdc.Marshaler.UnmarshalInterface(cs.Data, &clientState) + if err != nil { + return provider.ClientState{}, fmt.Errorf("error unmarshaling tm client state, %w", err) + } + clientStateExported = clientState + + } + + tmClientState, ok := clientStateExported.(*tmclient.ClientState) if !ok { - return &tmclient.ClientState{}, + // icon client doesn't have real trusting period so setting large value as trusting period + if strings.Contains(clientStateExported.ClientType(), common.IconModule) { + return provider.ClientState{ + ClientID: srcClientId, + ConsensusHeight: clientStateExported.GetLatestHeight().(clienttypes.Height), + // using 1 month as the trusting period constant + TrustingPeriod: time.Hour * 24 * 7 * 4, + }, nil + } + + return provider.ClientState{}, fmt.Errorf("error when casting exported clientstate to tendermint type") } - return clientState, nil + return provider.ClientState{ + ClientID: srcClientId, + ConsensusHeight: clientStateExported.GetLatestHeight().(clienttypes.Height), + TrustingPeriod: tmClientState.TrustingPeriod, + }, nil + } // DefaultUpgradePath is the default IBC upgrade path set for an on-chain light client @@ -1253,11 +1334,15 @@ func (cc *CosmosProvider) NewClientState( dstUbdPeriod time.Duration, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour bool, + srcWasmCodeID string, + srcChainType string, ) (ibcexported.ClientState, error) { revisionNumber := clienttypes.ParseChainID(dstChainID) + var clientState ibcexported.ClientState + // Create the ClientState we want on 'c' tracking 'dst' - return &tmclient.ClientState{ + tmClientState := tmclient.ClientState{ ChainId: dstChainID, TrustLevel: tmclient.NewFractionFromTm(light.DefaultTrustLevel), TrustingPeriod: dstTrustingPeriod, @@ -1272,7 +1357,27 @@ func (cc *CosmosProvider) NewClientState( UpgradePath: defaultUpgradePath, AllowUpdateAfterExpiry: allowUpdateAfterExpiry, AllowUpdateAfterMisbehaviour: allowUpdateAfterMisbehaviour, - }, nil + } + + clientState = &tmClientState + + if srcWasmCodeID != "" { + tmClientStateBz, err := cc.Cdc.Marshaler.MarshalInterface(clientState) + if err != nil { + return &wasmclient.ClientState{}, err + } + codeID, err := hex.DecodeString(srcWasmCodeID) + if err != nil { + return &wasmclient.ClientState{}, err + } + clientState = &wasmclient.ClientState{ + Data: tmClientStateBz, + CodeId: codeID, + LatestHeight: tmClientState.LatestHeight, + } + } + + return clientState, nil } func (cc *CosmosProvider) UpdateFeesSpent(chain, key, address string, fees sdk.Coins) { diff --git a/relayer/chains/icon/client_test.go b/relayer/chains/icon/client_test.go index fe925683a..7b031721f 100644 --- a/relayer/chains/icon/client_test.go +++ b/relayer/chains/icon/client_test.go @@ -8,10 +8,10 @@ import ( "time" "github.com/cosmos/relayer/v2/relayer/chains/icon/types" - "github.com/icon-project/IBC-Integration/libraries/go/common/icon" "github.com/icon-project/goloop/common/codec" "github.com/icon-project/goloop/common/wallet" "github.com/icon-project/goloop/module" + "github.com/icon-project/ibc-integration/libraries/go/common/icon" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/zap" diff --git a/relayer/chains/icon/codec_test.go b/relayer/chains/icon/codec_test.go index 4f923c589..5790d905d 100644 --- a/relayer/chains/icon/codec_test.go +++ b/relayer/chains/icon/codec_test.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/gogoproto/proto" "github.com/cosmos/ibc-go/v7/modules/core/exported" tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - "github.com/icon-project/IBC-Integration/libraries/go/common/icon" - tendermint_client "github.com/icon-project/IBC-Integration/libraries/go/common/tendermint" + "github.com/icon-project/ibc-integration/libraries/go/common/icon" + tendermint_client "github.com/icon-project/ibc-integration/libraries/go/common/tendermint" "github.com/stretchr/testify/assert" ) diff --git a/relayer/chains/icon/cryptoutils/merkle_proof.go b/relayer/chains/icon/cryptoutils/merkle_proof.go index 7424dce8b..d57f5d4c4 100644 --- a/relayer/chains/icon/cryptoutils/merkle_proof.go +++ b/relayer/chains/icon/cryptoutils/merkle_proof.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/relayer/v2/relayer/chains/icon/types" "github.com/cosmos/relayer/v2/relayer/common" - "github.com/icon-project/IBC-Integration/libraries/go/common/icon" + "github.com/icon-project/ibc-integration/libraries/go/common/icon" ) const hashLen = 32 diff --git a/relayer/chains/icon/cryptoutils/merkle_test.go b/relayer/chains/icon/cryptoutils/merkle_test.go index 3a6470c98..30abfb913 100644 --- a/relayer/chains/icon/cryptoutils/merkle_test.go +++ b/relayer/chains/icon/cryptoutils/merkle_test.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/relayer/v2/relayer/chains/icon/types" "github.com/cosmos/relayer/v2/relayer/common" - "github.com/icon-project/IBC-Integration/libraries/go/common/icon" + "github.com/icon-project/ibc-integration/libraries/go/common/icon" "github.com/stretchr/testify/assert" ) diff --git a/relayer/chains/icon/event_parser.go b/relayer/chains/icon/event_parser.go index 05642f887..ba0f11b58 100644 --- a/relayer/chains/icon/event_parser.go +++ b/relayer/chains/icon/event_parser.go @@ -7,7 +7,7 @@ import ( clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" "github.com/cosmos/relayer/v2/relayer/chains/icon/types" "github.com/cosmos/relayer/v2/relayer/provider" - "github.com/icon-project/IBC-Integration/libraries/go/common/icon" + "github.com/icon-project/ibc-integration/libraries/go/common/icon" "go.uber.org/zap" ) diff --git a/relayer/chains/icon/event_parser_test.go b/relayer/chains/icon/event_parser_test.go index bdb4e31a2..58da19f60 100644 --- a/relayer/chains/icon/event_parser_test.go +++ b/relayer/chains/icon/event_parser_test.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/gogoproto/proto" "github.com/cosmos/relayer/v2/relayer/chains/icon/types" - "github.com/icon-project/IBC-Integration/libraries/go/common/icon" + "github.com/icon-project/ibc-integration/libraries/go/common/icon" "github.com/stretchr/testify/assert" "go.uber.org/zap" ) diff --git a/relayer/chains/icon/icon_chain_processor.go b/relayer/chains/icon/icon_chain_processor.go index a650c2296..fd234a5d0 100644 --- a/relayer/chains/icon/icon_chain_processor.go +++ b/relayer/chains/icon/icon_chain_processor.go @@ -712,9 +712,14 @@ func (icp *IconChainProcessor) clientState(ctx context.Context, clientID string) return provider.ClientState{}, err } + //clientState should be of icon + clientState := provider.ClientState{ - ClientID: clientID, - ConsensusHeight: cs.GetLatestHeight().(clienttypes.Height), + ClientID: clientID, + ConsensusHeight: clienttypes.Height{ + RevisionNumber: cs.GetLatestHeight().GetRevisionNumber(), + RevisionHeight: cs.GetLatestHeight().GetRevisionHeight(), + }, } icp.latestClientState[clientID] = clientState return clientState, nil diff --git a/relayer/chains/icon/module/app_module.go b/relayer/chains/icon/module/app_module.go index 02690d1ab..91ef210c2 100644 --- a/relayer/chains/icon/module/app_module.go +++ b/relayer/chains/icon/module/app_module.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/gogoproto/proto" "github.com/cosmos/ibc-go/v7/modules/core/exported" "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/icon-project/IBC-Integration/libraries/go/common/icon" - "github.com/icon-project/IBC-Integration/libraries/go/common/tendermint" + "github.com/icon-project/ibc-integration/libraries/go/common/icon" + "github.com/icon-project/ibc-integration/libraries/go/common/tendermint" "github.com/spf13/cobra" ) diff --git a/relayer/chains/icon/provider.go b/relayer/chains/icon/provider.go index b98583a0d..401d62b2b 100644 --- a/relayer/chains/icon/provider.go +++ b/relayer/chains/icon/provider.go @@ -3,7 +3,9 @@ package icon import ( "context" "encoding/base64" + "encoding/hex" "fmt" + "strings" "sync" "time" @@ -12,8 +14,8 @@ import ( "github.com/cosmos/relayer/v2/relayer/common" "github.com/cosmos/relayer/v2/relayer/processor" "github.com/cosmos/relayer/v2/relayer/provider" - "github.com/icon-project/IBC-Integration/libraries/go/common/icon" "github.com/icon-project/goloop/module" + "github.com/icon-project/ibc-integration/libraries/go/common/icon" "go.uber.org/zap" @@ -23,7 +25,7 @@ import ( chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - // integration_types "github.com/icon-project/IBC-Integration/libraries/go/common/icon" + wasmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/08-wasm/types" ) var ( @@ -65,6 +67,7 @@ type IconProviderConfig struct { IbcHandlerAddress string `json:"ibc-handler-address" yaml:"ibc-handler-address"` FirstRetryBlockAfter uint64 `json:"first-retry-block-after" yaml:"first-retry-block-after"` BlockInterval uint64 `json:"block-interval" yaml:"block-interval"` + RevisionNumber uint64 `json:"revision-number" yaml:"revision-number"` } func (pp *IconProviderConfig) Validate() error { @@ -216,8 +219,12 @@ func (icp *IconProvider) NewClientState( dstUbdPeriod time.Duration, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour bool, + srcWasmCodeID string, + srcChainId string, ) (ibcexported.ClientState, error) { + var clientState ibcexported.ClientState + if !dstUpdateHeader.IsCompleteBlock() { return nil, fmt.Errorf("Not complete block at height:%d", dstUpdateHeader.Height()) } @@ -228,8 +235,7 @@ func (icp *IconProvider) NewClientState( trustingBlockPeriod := uint64(dstTrustingPeriod) / (icp.PCfg.BlockInterval * uint64(common.NanoToMilliRatio)) - return &icon.ClientState{ - // In case of Icon: Trusting Period is block Difference // see: light.proto in ibc-integration + clientState = &icon.ClientState{ TrustingPeriod: trustingBlockPeriod, FrozenHeight: 0, MaxClockDrift: 3600, @@ -237,7 +243,27 @@ func (icp *IconProvider) NewClientState( SrcNetworkId: getSrcNetworkId(icp.PCfg.ICONNetworkID), NetworkId: uint64(icp.PCfg.BTPNetworkID), NetworkTypeId: uint64(icp.PCfg.BTPNetworkTypeID), - }, nil + } + + latestHeight := clienttypes.NewHeight(icp.RevisionNumber(), dstUpdateHeader.Height()) + + if srcWasmCodeID != "" { + tmClientStateBz, err := icp.codec.Marshaler.MarshalInterface(clientState) + if err != nil { + return &wasmclient.ClientState{}, err + } + codeID, err := hex.DecodeString(srcWasmCodeID) + if err != nil { + return &wasmclient.ClientState{}, err + } + clientState = &wasmclient.ClientState{ + Data: tmClientStateBz, + CodeId: codeID, + LatestHeight: latestHeight, + } + } + + return clientState, nil } @@ -295,7 +321,7 @@ func (icp *IconProvider) ValidatePacket(msgTransfer provider.PacketInfo, latestB return fmt.Errorf("refuse to relay packet with empty data") } // This should not be possible, as it violates IBC spec - if msgTransfer.TimeoutHeight.IsZero() { + if msgTransfer.TimeoutHeight.IsZero() && msgTransfer.TimeoutTimestamp == 0 { return fmt.Errorf("refusing to relay packet without a timeout (height or timestamp must be set)") } @@ -432,7 +458,10 @@ func (icp *IconProvider) ProviderConfig() provider.ProviderConfig { return icp.PCfg } -func (icp *IconProvider) CommitmentPrefix() commitmenttypes.MerklePrefix { +func (icp *IconProvider) CommitmentPrefix(clientId string) commitmenttypes.MerklePrefix { + if strings.Contains(clientId, common.WasmLightClient) { + return commitmenttypes.NewMerklePrefix([]byte("ibc")) + } return commitmenttypes.NewMerklePrefix(nil) } @@ -549,3 +578,10 @@ func (icp *IconProvider) GetCurrentBtpNetworkStartHeight() (int64, error) { func (icp *IconProvider) MsgRegisterCounterpartyPayee(portID, channelID, relayerAddr, counterpartyPayeeAddr string) (provider.RelayerMessage, error) { panic(fmt.Sprintf("%s%s", icp.ChainName(), NOT_IMPLEMENTED)) } + +func (icp *IconProvider) RevisionNumber() uint64 { + if icp.PCfg.RevisionNumber != 0 { + return icp.PCfg.RevisionNumber + } + return 1 +} diff --git a/relayer/chains/icon/provider_helper.go b/relayer/chains/icon/provider_helper.go index 0648e6879..d965b2c96 100644 --- a/relayer/chains/icon/provider_helper.go +++ b/relayer/chains/icon/provider_helper.go @@ -7,9 +7,11 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" "github.com/cosmos/relayer/v2/relayer/common" - "github.com/icon-project/IBC-Integration/libraries/go/common/icon" - itm "github.com/icon-project/IBC-Integration/libraries/go/common/tendermint" + "github.com/gogo/protobuf/proto" + "github.com/icon-project/ibc-integration/libraries/go/common/icon" + itm "github.com/icon-project/ibc-integration/libraries/go/common/tendermint" ) // Implement when a new chain is added to ICON IBC Contract @@ -22,9 +24,22 @@ func (icp *IconProvider) ClientToAny(clientId string, clientStateB []byte) (*cod } return clienttypes.PackClientState(&clientState) } + + // 07-tendermint decode if strings.Contains(clientId, common.TendermintLightClient) { var clientState itm.ClientState - err := icp.codec.Marshaler.Unmarshal(clientStateB, &clientState) + err := proto.Unmarshal(clientStateB, &clientState) + if err != nil { + return nil, err + } + + return clienttypes.PackClientState(&clientState) + } + + // wasm ics08 tendermint lightClient + if strings.Contains(clientId, common.TendermintWasmLightClient) { + var clientState tendermint.ClientState + err := proto.Unmarshal(clientStateB, &clientState) if err != nil { return nil, err } @@ -52,6 +67,16 @@ func (icp *IconProvider) ConsensusToAny(clientId string, cb []byte) (*codectypes return clienttypes.PackConsensusState(&consensusState) } + + if strings.Contains(clientId, common.TendermintWasmLightClient) { + var consensusState tendermint.ConsensusState + err := icp.codec.Marshaler.Unmarshal(cb, &consensusState) + if err != nil { + return nil, err + } + + return clienttypes.PackConsensusState(&consensusState) + } return nil, fmt.Errorf("unknown consensus type") } diff --git a/relayer/chains/icon/provider_test.go b/relayer/chains/icon/provider_test.go index c52e7e83a..d14048851 100644 --- a/relayer/chains/icon/provider_test.go +++ b/relayer/chains/icon/provider_test.go @@ -12,8 +12,8 @@ import ( "github.com/cosmos/relayer/v2/relayer/chains/icon/types" "github.com/cosmos/relayer/v2/relayer/common" - "github.com/icon-project/IBC-Integration/libraries/go/common/icon" - icn "github.com/icon-project/IBC-Integration/libraries/go/common/icon" + "github.com/icon-project/ibc-integration/libraries/go/common/icon" + icn "github.com/icon-project/ibc-integration/libraries/go/common/icon" "github.com/stretchr/testify/assert" "go.uber.org/zap" @@ -477,3 +477,34 @@ func TestHash(t *testing.T) { // assert.True(t, isValid) // } + +// func TestGetBala(t *testing.T) { + +// prov := GetMockIconProvider(2, "cx4f79451103e51baba633e10e4d355f28ceda3103") + +// // ctx := context.Background() +// // bal, err := prov.QueryBalanceWithAddress(ctx, "hxb6b5791be0b5ef67063b3c10b840fb81514db2fd") +// // assert.NoError(t, err) +// // fmt.Println("balance ", bal) +// b, _ := hex.DecodeString("0a1063656e74617572692d746573746e65741204080110031a0408c0ba1222040880df6e32003a0310cb0240014801") + +// data, err := prov.ClientToAny("07-tendermint-4", b) +// assert.NoError(t, err) + +// fmt.Println("data is ", data.Value) +// } + +// func TestIconConsensusState(t *testing.T) { +// consensusState := icon.ConsensusState{} +// fmt.Println(consensusState.GetTimestamp()) + +// } + +// func TestMarhsal(t *testing.T) { + +// h := clienttypes.NewHeight(1, 14758) + +// b, _ := proto.Marshal(&h) +// fmt.Printf("encoded heiht %x \n", b) + +// } diff --git a/relayer/chains/icon/query.go b/relayer/chains/icon/query.go index 1804ac8ce..64294d340 100644 --- a/relayer/chains/icon/query.go +++ b/relayer/chains/icon/query.go @@ -23,8 +23,8 @@ import ( "github.com/cosmos/relayer/v2/relayer/chains/icon/types" "github.com/cosmos/relayer/v2/relayer/common" "github.com/cosmos/relayer/v2/relayer/provider" - "github.com/icon-project/IBC-Integration/libraries/go/common/icon" - itm "github.com/icon-project/IBC-Integration/libraries/go/common/tendermint" + "github.com/icon-project/ibc-integration/libraries/go/common/icon" + itm "github.com/icon-project/ibc-integration/libraries/go/common/tendermint" transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" @@ -151,6 +151,7 @@ func (icp *IconProvider) QueryBalanceWithAddress(ctx context.Context, addr strin if err != nil { return nil, err } + return sdk.Coins{sdk.Coin{ Denom: "ICX", Amount: math.NewIntFromBigInt(balance), @@ -203,7 +204,7 @@ func (icp *IconProvider) QueryClientStateWithoutProof(ctx context.Context, heigh return nil, err } - clientStateRes := clienttypes.NewQueryClientStateResponse(any, nil, clienttypes.NewHeight(0, uint64(height))) + clientStateRes := clienttypes.NewQueryClientStateResponse(any, nil, clienttypes.NewHeight(icp.RevisionNumber(), uint64(height))) clientStateExported, err := clienttypes.UnpackClientState(clientStateRes.ClientState) if err != nil { return nil, err @@ -242,15 +243,12 @@ func (icp *IconProvider) QueryClientStateResponse(ctx context.Context, height in return nil, err } - return clienttypes.NewQueryClientStateResponse(any, proof, clienttypes.NewHeight(0, uint64(height))), nil + return clienttypes.NewQueryClientStateResponse(any, proof, clienttypes.NewHeight(icp.RevisionNumber(), uint64(height))), nil } func (icp *IconProvider) QueryClientConsensusState(ctx context.Context, chainHeight int64, clientid string, clientHeight ibcexported.Height) (*clienttypes.QueryConsensusStateResponse, error) { - h, ok := clientHeight.(clienttypes.Height) - if !ok { - return nil, fmt.Errorf("clientHeight type mismatched ") - } + h := clienttypes.NewHeight(clientHeight.GetRevisionNumber(), clientHeight.GetRevisionHeight()) heightBytes, err := icp.codec.Marshaler.Marshal(&h) if err != nil { @@ -277,7 +275,7 @@ func (icp *IconProvider) QueryClientConsensusState(ctx context.Context, chainHei return nil, err } - key := common.GetConsensusStateCommitmentKey(clientid, big.NewInt(0), big.NewInt(int64(h.RevisionHeight))) + key := common.GetConsensusStateCommitmentKey(clientid, big.NewInt(int64(h.RevisionNumber)), big.NewInt(int64(h.RevisionHeight))) commitmentHash := getCommitmentHash(key, cnsStateByte) proof, err := icp.QueryIconProof(ctx, chainHeight, commitmentHash) @@ -288,7 +286,7 @@ func (icp *IconProvider) QueryClientConsensusState(ctx context.Context, chainHei return &clienttypes.QueryConsensusStateResponse{ ConsensusState: any, Proof: proof, - ProofHeight: clienttypes.NewHeight(0, uint64(chainHeight)), + ProofHeight: clienttypes.NewHeight(icp.RevisionNumber(), uint64(chainHeight)), }, nil } @@ -375,7 +373,7 @@ func (icp *IconProvider) QueryConnection(ctx context.Context, height int64, conn return emptyConnRes, err } - return conntypes.NewQueryConnectionResponse(conn, proof, clienttypes.NewHeight(0, uint64(height))), nil + return conntypes.NewQueryConnectionResponse(conn, proof, clienttypes.NewHeight(icp.RevisionNumber(), uint64(height))), nil } @@ -507,7 +505,7 @@ func (icp *IconProvider) GenerateConnHandshakeProof(ctx context.Context, height return nil, nil, nil, nil, clienttypes.Height{}, err } - return clientState_, clientResponse.Proof, consensusRes.Proof, connResponse.Proof, clienttypes.NewHeight(0, uint64(height)), nil + return clientState_, clientResponse.Proof, consensusRes.Proof, connResponse.Proof, clienttypes.NewHeight(icp.RevisionNumber(), uint64(height)), nil } // ics 04 - channel @@ -552,7 +550,7 @@ func (icp *IconProvider) QueryChannel(ctx context.Context, height int64, channel channel.Version, ) - return chantypes.NewQueryChannelResponse(cosmosChan, proof, clienttypes.NewHeight(0, uint64(height))), nil + return chantypes.NewQueryChannelResponse(cosmosChan, proof, clienttypes.NewHeight(icp.RevisionNumber(), uint64(height))), nil } var emptyChannelRes = chantypes.NewQueryChannelResponse( @@ -693,7 +691,7 @@ func (icp *IconProvider) QueryNextSeqRecv(ctx context.Context, height int64, cha return &chantypes.QueryNextSequenceReceiveResponse{ NextSequenceReceive: uint64(nextSeq), Proof: proof, - ProofHeight: clienttypes.NewHeight(0, uint64(height)), + ProofHeight: clienttypes.NewHeight(icp.RevisionNumber(), uint64(height)), }, nil } @@ -725,7 +723,7 @@ func (icp *IconProvider) QueryPacketCommitment(ctx context.Context, height int64 return &chantypes.QueryPacketCommitmentResponse{ Commitment: packetCommitmentBytes, Proof: proof, - ProofHeight: clienttypes.NewHeight(0, uint64(height)), + ProofHeight: clienttypes.NewHeight(icp.RevisionNumber(), uint64(height)), }, nil } @@ -759,7 +757,7 @@ func (icp *IconProvider) QueryPacketAcknowledgement(ctx context.Context, height return &chantypes.QueryPacketAcknowledgementResponse{ Acknowledgement: packetAckBytes, Proof: proof, - ProofHeight: clienttypes.NewHeight(0, uint64(height)), + ProofHeight: clienttypes.NewHeight(icp.RevisionNumber(), uint64(height)), }, nil } @@ -788,7 +786,7 @@ func (icp *IconProvider) QueryPacketReceipt(ctx context.Context, height int64, c return &chantypes.QueryPacketReceiptResponse{ Received: packetReceipt == 1, Proof: proof, - ProofHeight: clienttypes.NewHeight(0, uint64(height)), + ProofHeight: clienttypes.NewHeight(icp.RevisionNumber(), uint64(height)), }, nil } diff --git a/relayer/chains/icon/query_test.go b/relayer/chains/icon/query_test.go index 67d2e76f1..19caff51a 100644 --- a/relayer/chains/icon/query_test.go +++ b/relayer/chains/icon/query_test.go @@ -8,7 +8,7 @@ import ( clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" "github.com/gogo/protobuf/proto" - itm "github.com/icon-project/IBC-Integration/libraries/go/common/tendermint" + itm "github.com/icon-project/ibc-integration/libraries/go/common/tendermint" "github.com/stretchr/testify/assert" ) diff --git a/relayer/chains/icon/tx.go b/relayer/chains/icon/tx.go index 6a7f11776..950cba506 100644 --- a/relayer/chains/icon/tx.go +++ b/relayer/chains/icon/tx.go @@ -13,14 +13,17 @@ import ( clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + "github.com/cosmos/ibc-go/v7/modules/core/exported" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + wasmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/08-wasm/types" - // tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - itm "github.com/icon-project/IBC-Integration/libraries/go/common/tendermint" + // itm "github.com/icon-project/ibc-integration/libraries/go/common/tendermint" "github.com/cosmos/relayer/v2/relayer/chains/icon/types" + "github.com/cosmos/relayer/v2/relayer/common" "github.com/cosmos/relayer/v2/relayer/provider" - "github.com/icon-project/IBC-Integration/libraries/go/common/icon" + "github.com/icon-project/ibc-integration/libraries/go/common/icon" "go.uber.org/zap" ) @@ -45,11 +48,19 @@ func (icp *IconProvider) MsgCreateClient(clientState ibcexported.ClientState, co return nil, err } + clientType := clientState.ClientType() + + _, ok := clientState.(*tendermint.ClientState) + //hack: done to seperately handle ics08-tendermint client + if ok { + clientType = common.TendermintWasmLightClient + } + clS := &types.GenericClientParams[types.MsgCreateClient]{ Msg: types.MsgCreateClient{ ClientState: types.NewHexBytes(clientStateBytes), ConsensusState: types.NewHexBytes(consensusStateBytes), - ClientType: clientState.ClientType(), + ClientType: clientType, BtpNetworkId: types.NewHexInt(icp.PCfg.BTPNetworkID), }, } @@ -226,11 +237,30 @@ func (icp *IconProvider) MsgConnectionOpenTry(msgOpenInit provider.ConnectionInf if err != nil { return nil, err } + clientStateEncode, err := proto.Marshal(proof.ClientState) if err != nil { return nil, err } + // client is 08-wasm then + // then the client state that could be proved is any type byte + splitClientId := strings.Split(msgOpenInit.ClientID, "-") + clientType := strings.Join(splitClientId[:len(splitClientId)-1], "-") + + if clientType == exported.Wasm { + anyCs, err := clienttypes.PackClientState(proof.ClientState) + if err != nil { + return nil, err + } + anyCsByte, err := proto.Marshal(anyCs) + if err != nil { + return nil, err + } + + clientStateEncode = anyCsByte + } + ht := &icon.Height{ RevisionNumber: proof.ProofHeight.RevisionNumber, RevisionHeight: proof.ProofHeight.RevisionHeight, @@ -241,7 +271,7 @@ func (icp *IconProvider) MsgConnectionOpenTry(msgOpenInit provider.ConnectionInf } consHt := &icon.Height{ - RevisionNumber: 0, + RevisionNumber: proof.ClientState.GetLatestHeight().GetRevisionNumber(), RevisionHeight: proof.ClientState.GetLatestHeight().GetRevisionHeight(), } consHtEncode, err := proto.Marshal(consHt) @@ -276,15 +306,25 @@ func (icp *IconProvider) MsgConnectionOpenTry(msgOpenInit provider.ConnectionInf func (icp *IconProvider) MsgConnectionOpenAck(msgOpenTry provider.ConnectionInfo, proof provider.ConnectionProof) (provider.RelayerMessage, error) { - // proof from chainB should return clientState of chainB tracking chainA - iconClientState, err := icp.MustReturnIconClientState(proof.ClientState) + clientStateEncode, err := proto.Marshal(proof.ClientState) if err != nil { return nil, err } - clientStateEncode, err := icp.codec.Marshaler.Marshal(iconClientState) - if err != nil { - return nil, err + splitClientId := strings.Split(msgOpenTry.ClientID, "-") + clientType := strings.Join(splitClientId[:len(splitClientId)-1], "-") + // then the client state that could be proved is any type byte + if clientType == exported.Wasm { + anyCs, err := clienttypes.PackClientState(proof.ClientState) + if err != nil { + return nil, err + } + anyCsByte, err := proto.Marshal(anyCs) + if err != nil { + return nil, err + } + + clientStateEncode = anyCsByte } ht := &icon.Height{ @@ -488,21 +528,21 @@ func (icp *IconProvider) MsgChannelCloseConfirm(msgCloseInit provider.ChannelInf return icp.NewIconMessage(channelCloseConfirmMsg, MethodChannelCloseConfirm), nil } -func (icp *IconProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeader, trustedHeight clienttypes.Height, trustedHeader provider.IBCHeader) (ibcexported.ClientMessage, error) { +func (icp *IconProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeader, trustedHeight clienttypes.Height, trustedHeader provider.IBCHeader, clientType string) (ibcexported.ClientMessage, error) { latestIconHeader, ok := latestHeader.(IconIBCHeader) if !ok { return nil, fmt.Errorf("Unsupported IBC Header type. Expected: IconIBCHeader,actual: %T", latestHeader) } - btp_proof, err := icp.GetBTPProof(int64(latestIconHeader.Header.MainHeight)) + btp_proof, err := icp.GetBTPProof(int64(latestIconHeader.Height())) if err != nil { return nil, err } var currentValidatorList types.ValidatorList // subtract 1 because it is a current validator not last validator - info, err := icp.client.GetNetworkTypeInfo(int64(latestIconHeader.Header.MainHeight-1), icp.PCfg.BTPNetworkTypeID) + info, err := icp.client.GetNetworkTypeInfo(int64(latestIconHeader.Height()-1), icp.PCfg.BTPNetworkTypeID) if err != nil { return nil, err } @@ -514,7 +554,7 @@ func (icp *IconProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeader, var nextValidators types.ValidatorList // subtract 1 because it is a current validator not last validator - next_info, err := icp.client.GetNetworkTypeInfo(int64(latestIconHeader.Header.MainHeight), icp.PCfg.BTPNetworkTypeID) + next_info, err := icp.client.GetNetworkTypeInfo(int64(latestIconHeader.Height()), icp.PCfg.BTPNetworkTypeID) if err != nil { return nil, err } @@ -542,14 +582,28 @@ func (icp *IconProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeader, CurrentValidators: currentValidatorList.Validators, } + // wrap with wasm client + if clientType == exported.Wasm { + + tmClientHeaderBz, err := icp.codec.Marshaler.MarshalInterface(signedHeader) + if err != nil { + return &wasmclient.Header{}, nil + } + return &wasmclient.Header{ + Data: tmClientHeaderBz, + // TODO: forcefully set 1 + Height: clienttypes.NewHeight(icp.RevisionNumber(), latestIconHeader.Header.MainHeight), + }, nil + + } + return signedHeader, nil } func (icp *IconProvider) MsgUpdateClient(clientID string, counterpartyHeader ibcexported.ClientMessage) (provider.RelayerMessage, error) { - cs := counterpartyHeader.(*itm.TmHeader) - clientMsg, err := proto.Marshal(cs) + clientMsg, err := proto.Marshal(counterpartyHeader) if err != nil { return nil, err } @@ -779,27 +833,11 @@ func (icp *IconProvider) SendIconTransaction( return err } - txParamEst := &types.TransactionParamForEstimate{ - Version: types.NewHexInt(types.JsonrpcApiVersion), - FromAddress: types.Address(wallet.Address().String()), - ToAddress: contract, - NetworkID: types.NewHexInt(icp.PCfg.ICONNetworkID), - DataType: "call", - Data: types.CallData{ - Method: m.Method, - Params: m.Params, - }, - } + msgByte, _ := msg.MsgBytes() - step, err := icp.client.EstimateStep(txParamEst) - if err != nil { - return fmt.Errorf("failed estimating step: %w", err) - } - stepVal, err := step.Int() - if err != nil { - return err - } - stepLimit := types.NewHexInt(int64(stepVal + 200_000)) + icp.log.Info("sending msg to icon", zap.Binary("message-bytes", msgByte)) + + stepLimit := types.NewHexInt(int64(20_000_000)) txParam := &types.TransactionParam{ Version: types.NewHexInt(types.JsonrpcApiVersion), diff --git a/relayer/chains/icon/types/types.go b/relayer/chains/icon/types/types.go index 9c801a0b0..6960b4bb1 100644 --- a/relayer/chains/icon/types/types.go +++ b/relayer/chains/icon/types/types.go @@ -25,9 +25,9 @@ import ( "strings" "github.com/gorilla/websocket" - "github.com/icon-project/IBC-Integration/libraries/go/common/icon" "github.com/icon-project/goloop/common" "github.com/icon-project/goloop/common/codec" + "github.com/icon-project/ibc-integration/libraries/go/common/icon" relayer_common "github.com/cosmos/relayer/v2/relayer/common" "github.com/icon-project/goloop/server/jsonrpc" diff --git a/relayer/chains/icon/utils.go b/relayer/chains/icon/utils.go index 4afa9e369..d6256481c 100644 --- a/relayer/chains/icon/utils.go +++ b/relayer/chains/icon/utils.go @@ -15,12 +15,12 @@ import ( "github.com/cosmos/gogoproto/proto" - "github.com/icon-project/IBC-Integration/libraries/go/common/icon" - icn "github.com/icon-project/IBC-Integration/libraries/go/common/icon" "github.com/icon-project/goloop/common/codec" "github.com/icon-project/goloop/common/crypto" "github.com/icon-project/goloop/common/db" "github.com/icon-project/goloop/common/trie/ompt" + "github.com/icon-project/ibc-integration/libraries/go/common/icon" + icn "github.com/icon-project/ibc-integration/libraries/go/common/icon" ) var ( diff --git a/relayer/chains/penumbra/msg.go b/relayer/chains/penumbra/msg.go index 689a3267d..eaca6b993 100644 --- a/relayer/chains/penumbra/msg.go +++ b/relayer/chains/penumbra/msg.go @@ -1,8 +1,6 @@ package penumbra import ( - "fmt" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" @@ -24,7 +22,6 @@ func NewPenumbraMessage(msg sdk.Msg) provider.RelayerMessage { func PenumbraMsg(rm provider.RelayerMessage) sdk.Msg { if val, ok := rm.(PenumbraMessage); !ok { - fmt.Printf("got data of type %T but wanted PenumbraMessage \n", val) return nil } else { return val.Msg @@ -52,7 +49,6 @@ func PenumbraMsgs(rm ...provider.RelayerMessage) []sdk.Msg { case cosmos.CosmosMessage: sdkMsgs = append(sdkMsgs, rMsg.(cosmos.CosmosMessage).Msg) default: - fmt.Printf("got data of type %T but wanted PenumbraMessage \n", rMsg) return nil } } diff --git a/relayer/chains/penumbra/provider.go b/relayer/chains/penumbra/provider.go index 0546c8473..76da9211a 100644 --- a/relayer/chains/penumbra/provider.go +++ b/relayer/chains/penumbra/provider.go @@ -18,6 +18,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/gogoproto/proto" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" @@ -187,7 +188,7 @@ func (cc *PenumbraProvider) Timeout() string { return cc.PCfg.Timeout } -func (cc *PenumbraProvider) CommitmentPrefix() commitmenttypes.MerklePrefix { +func (cc *PenumbraProvider) CommitmentPrefix(clientId string) commitmenttypes.MerklePrefix { return commitmenttypes.NewMerklePrefix([]byte("PenumbraAppHash")) } @@ -343,6 +344,10 @@ func (cc *PenumbraProvider) FirstRetryBlockAfter() uint64 { return 1 } +func (cc *PenumbraProvider) RevisionNumber() uint64 { + return clienttypes.ParseChainID(cc.ChainId()) +} + // keysDir returns a string representing the path on the local filesystem where the keystore will be initialized. func keysDir(home, chainID string) string { return path.Join(home, "keys", chainID) diff --git a/relayer/chains/penumbra/query.go b/relayer/chains/penumbra/query.go index e20a64889..45e83fab3 100644 --- a/relayer/chains/penumbra/query.go +++ b/relayer/chains/penumbra/query.go @@ -490,7 +490,7 @@ func (cc *PenumbraProvider) QueryConnectionsUsingClient(ctx context.Context, hei // GenerateConnHandshakeProof generates all the proofs needed to prove the existence of the // connection state on this chain. A counterparty should use these generated proofs. -func (cc *PenumbraProvider) GenerateConnHandshakeProof(ctx context.Context, height int64, clientId, connId string) (clientState ibcexported.ClientState, clientStateProof []byte, consensusProof []byte, connectionProof []byte, connectionProofHeight ibcexported.Height, err error) { +func (cc *PenumbraProvider) GenerateConnHandshakeProof(ctx context.Context, height int64, clientId, connId string ) (clientState ibcexported.ClientState, clientStateProof []byte, consensusProof []byte, connectionProof []byte, connectionProofHeight ibcexported.Height, err error) { var ( clientStateRes *clienttypes.QueryClientStateResponse consensusStateRes *clienttypes.QueryConsensusStateResponse diff --git a/relayer/chains/penumbra/tx.go b/relayer/chains/penumbra/tx.go index 5f0e01f8c..786d8b163 100644 --- a/relayer/chains/penumbra/tx.go +++ b/relayer/chains/penumbra/tx.go @@ -3,6 +3,7 @@ package penumbra import ( "context" "encoding/base64" + "encoding/hex" "errors" "fmt" "math/rand" @@ -30,8 +31,10 @@ import ( chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" host "github.com/cosmos/ibc-go/v7/modules/core/24-host" + "github.com/cosmos/ibc-go/v7/modules/core/exported" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + wasmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/08-wasm/types" ics23 "github.com/cosmos/ics23/go" "github.com/cosmos/relayer/v2/relayer/chains/cosmos" penumbracrypto "github.com/cosmos/relayer/v2/relayer/chains/penumbra/core/crypto/v1alpha1" @@ -902,6 +905,16 @@ func (cc *PenumbraProvider) MsgUpgradeClient(srcClientId string, consRes *client } func (cc *PenumbraProvider) MsgSubmitMisbehaviour(clientID string, misbehaviour ibcexported.ClientMessage) (provider.RelayerMessage, error) { + if strings.Contains(clientID, exported.Wasm) { // TODO: replace with ibcexported.Wasm at v7.2 + wasmData, err := cc.Codec.Marshaler.MarshalInterface(misbehaviour) + if err != nil { + return nil, err + } + misbehaviour = &wasmclient.Misbehaviour{ + Data: wasmData, + } + } + signer, err := cc.Address() if err != nil { return nil, err @@ -1567,7 +1580,7 @@ func (cc *PenumbraProvider) MsgChannelCloseConfirm(msgCloseInit provider.Channel return cosmos.NewCosmosMessage(msg), nil } -func (cc *PenumbraProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeader, trustedHeight clienttypes.Height, trustedHeader provider.IBCHeader) (ibcexported.ClientMessage, error) { +func (cc *PenumbraProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeader, trustedHeight clienttypes.Height, trustedHeader provider.IBCHeader, clientType string) (ibcexported.ClientMessage, error) { trustedCosmosHeader, ok := trustedHeader.(PenumbraIBCHeader) if !ok { return nil, fmt.Errorf("unsupported IBC trusted header type, expected: PenumbraIBCHeader, actual: %T", trustedHeader) @@ -1582,6 +1595,7 @@ func (cc *PenumbraProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeade if err != nil { return nil, fmt.Errorf("error converting trusted validators to proto object: %w", err) } + trustedValidatorsProto.TotalVotingPower = trustedCosmosHeader.ValidatorSet.TotalVotingPower() signedHeaderProto := latestCosmosHeader.SignedHeader.ToProto() @@ -1589,13 +1603,35 @@ func (cc *PenumbraProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeade if err != nil { return nil, fmt.Errorf("error converting validator set to proto object: %w", err) } + validatorSetProto.TotalVotingPower = latestCosmosHeader.ValidatorSet.TotalVotingPower() - return &tmclient.Header{ + var clientHeader ibcexported.ClientMessage + + tmClientHeader := tmclient.Header{ SignedHeader: signedHeaderProto, ValidatorSet: validatorSetProto, TrustedValidators: trustedValidatorsProto, TrustedHeight: trustedHeight, - }, nil + } + + clientHeader = &tmClientHeader + + if clientType == exported.Wasm { + tmClientHeaderBz, err := cc.Codec.Marshaler.MarshalInterface(clientHeader) + if err != nil { + return &wasmclient.Header{}, nil + } + height, ok := tmClientHeader.GetHeight().(clienttypes.Height) + if !ok { + return &wasmclient.Header{}, fmt.Errorf("error converting tm client header height") + } + clientHeader = &wasmclient.Header{ + Data: tmClientHeaderBz, + Height: height, + } + } + + return clientHeader, nil } // RelayPacketFromSequence relays a packet with a given seq on src and returns recvPacket msgs, timeoutPacketmsgs and error @@ -1914,24 +1950,29 @@ func (cc *PenumbraProvider) queryTMClientState(ctx context.Context, srch int64, return &tmclient.ClientState{}, err } - return castClientStateToTMType(clientStateRes.ClientState) -} - -// castClientStateToTMType casts client state to tendermint type -func castClientStateToTMType(cs *codectypes.Any) (*tmclient.ClientState, error) { - clientStateExported, err := clienttypes.UnpackClientState(cs) + clientStateExported, err := clienttypes.UnpackClientState(clientStateRes.ClientState) if err != nil { return &tmclient.ClientState{}, err } + switch cs := clientStateExported.(type) { + case *wasmclient.ClientState: + var clientState ibcexported.ClientState + err = cc.Codec.Marshaler.UnmarshalInterface(cs.Data, &clientState) + if err != nil { + return &tmclient.ClientState{}, fmt.Errorf("error unmarshaling tm client state, %w", err) + } + clientStateExported = clientState + } + // cast from interface to concrete type - clientState, ok := clientStateExported.(*tmclient.ClientState) + tmClientState, ok := clientStateExported.(*tmclient.ClientState) if !ok { return &tmclient.ClientState{}, fmt.Errorf("error when casting exported clientstate to tendermint type") } - return clientState, nil + return tmClientState, nil } // DefaultUpgradePath is the default IBC upgrade path set for an on-chain light client @@ -1987,11 +2028,15 @@ func (cc *PenumbraProvider) NewClientState( dstUbdPeriod time.Duration, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour bool, + srcWasmCodeID string, + srcChainId string, ) (ibcexported.ClientState, error) { revisionNumber := clienttypes.ParseChainID(dstChainID) + var clientState ibcexported.ClientState + // Create the ClientState we want on 'c' tracking 'dst' - return &tmclient.ClientState{ + tmClientState := tmclient.ClientState{ ChainId: dstChainID, TrustLevel: tmclient.NewFractionFromTm(light.DefaultTrustLevel), TrustingPeriod: dstTrustingPeriod, @@ -2006,7 +2051,27 @@ func (cc *PenumbraProvider) NewClientState( UpgradePath: defaultUpgradePath, AllowUpdateAfterExpiry: allowUpdateAfterExpiry, AllowUpdateAfterMisbehaviour: allowUpdateAfterMisbehaviour, - }, nil + } + + clientState = &tmClientState + + if srcWasmCodeID != "" { + tmClientStateBz, err := cc.Codec.Marshaler.MarshalInterface(clientState) + if err != nil { + return &wasmclient.ClientState{}, err + } + codeID, err := hex.DecodeString(srcWasmCodeID) + if err != nil { + return &wasmclient.ClientState{}, err + } + clientState = &wasmclient.ClientState{ + Data: tmClientStateBz, + CodeId: codeID, + LatestHeight: tmClientState.LatestHeight, + } + } + + return clientState, nil } // QueryIBCHeader returns the IBC compatible block header (CosmosIBCHeader) at a specific height. diff --git a/relayer/chains/wasm/helper_debug_msg.go b/relayer/chains/wasm/helper_debug_msg.go index 5ab3f0b8d..8636a334a 100644 --- a/relayer/chains/wasm/helper_debug_msg.go +++ b/relayer/chains/wasm/helper_debug_msg.go @@ -18,14 +18,12 @@ func jsonDumpDataFile(filename string, bufs interface{}) { // Marshal the slice of structs to JSON format jsonData, err := json.MarshalIndent(bufs, "", " ") if err != nil { - fmt.Println("Error marshaling slice of structs to JSON:", err) os.Exit(1) } // Write JSON data to file err = ioutil.WriteFile(filename, jsonData, 0644) if err != nil { - fmt.Println("Error writing JSON to file:", err) os.Exit(1) } @@ -68,7 +66,6 @@ func SaveMsgToFile(filename string, msgs []provider.RelayerMessage) { var d []DataFormat err := readExistingData(filename, &d) if err != nil { - fmt.Println("error savingtoFile ", err) return } diff --git a/relayer/chains/wasm/module/app_module.go b/relayer/chains/wasm/module/app_module.go index 375e20b8c..22e981782 100644 --- a/relayer/chains/wasm/module/app_module.go +++ b/relayer/chains/wasm/module/app_module.go @@ -6,7 +6,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/ibc-go/v7/modules/core/exported" "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/icon-project/IBC-Integration/libraries/go/common/tendermint" + "github.com/icon-project/ibc-integration/libraries/go/common/tendermint" "github.com/spf13/cobra" ) diff --git a/relayer/chains/wasm/provider.go b/relayer/chains/wasm/provider.go index 0fae2a4bd..1b4e1c19c 100644 --- a/relayer/chains/wasm/provider.go +++ b/relayer/chains/wasm/provider.go @@ -11,11 +11,9 @@ import ( "github.com/CosmWasm/wasmd/app" provtypes "github.com/cometbft/cometbft/light/provider" - comettypes "github.com/cometbft/cometbft/types" "golang.org/x/mod/semver" "github.com/cosmos/cosmos-sdk/client" - itm "github.com/icon-project/IBC-Integration/libraries/go/common/tendermint" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -27,7 +25,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/gogoproto/proto" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" "github.com/cosmos/relayer/v2/relayer/codecs/ethermint" "github.com/cosmos/relayer/v2/relayer/processor" "github.com/cosmos/relayer/v2/relayer/provider" @@ -73,122 +70,6 @@ type WasmProviderConfig struct { BlockInterval uint64 `json:"block-interval" yaml:"block-interval"` } -type WasmIBCHeader struct { - SignedHeader *itm.SignedHeader - ValidatorSet *itm.ValidatorSet -} - -func NewWasmIBCHeader(header *itm.SignedHeader, validators *itm.ValidatorSet) WasmIBCHeader { - return WasmIBCHeader{ - SignedHeader: header, - ValidatorSet: validators, - } -} - -func NewWasmIBCHeaderFromLightBlock(lightBlock *comettypes.LightBlock) WasmIBCHeader { - vSets := make([]*itm.Validator, 0) - for _, v := range lightBlock.ValidatorSet.Validators { - _v := &itm.Validator{ - Address: v.Address, - PubKey: &itm.PublicKey{ - Sum: itm.GetPubKeyFromTx(v.PubKey.Type(), v.PubKey.Bytes()), - }, - VotingPower: v.VotingPower, - ProposerPriority: v.ProposerPriority, - } - - vSets = append(vSets, _v) - } - - signatures := make([]*itm.CommitSig, 0) - for _, d := range lightBlock.Commit.Signatures { - - _d := &itm.CommitSig{ - BlockIdFlag: itm.BlockIDFlag(d.BlockIDFlag), - ValidatorAddress: d.ValidatorAddress, - Timestamp: &itm.Timestamp{ - Seconds: int64(d.Timestamp.Unix()), - Nanos: int32(d.Timestamp.Nanosecond()), - }, - Signature: d.Signature, - } - signatures = append(signatures, _d) - } - - return WasmIBCHeader{ - SignedHeader: &itm.SignedHeader{ - Header: &itm.LightHeader{ - Version: &itm.Consensus{ - Block: lightBlock.Version.Block, - App: lightBlock.Version.App, - }, - ChainId: lightBlock.ChainID, - - Height: lightBlock.Height, - Time: &itm.Timestamp{ - Seconds: int64(lightBlock.Time.Unix()), - Nanos: int32(lightBlock.Time.Nanosecond()), // this is the offset after the nanosecond - }, - LastBlockId: &itm.BlockID{ - Hash: lightBlock.LastBlockID.Hash, - PartSetHeader: &itm.PartSetHeader{ - Total: lightBlock.LastBlockID.PartSetHeader.Total, - Hash: lightBlock.LastBlockID.PartSetHeader.Hash, - }, - }, - LastCommitHash: lightBlock.LastCommitHash, - DataHash: lightBlock.DataHash, - ValidatorsHash: lightBlock.ValidatorsHash, - NextValidatorsHash: lightBlock.NextValidatorsHash, - ConsensusHash: lightBlock.ConsensusHash, - AppHash: lightBlock.AppHash, - LastResultsHash: lightBlock.LastResultsHash, - EvidenceHash: lightBlock.EvidenceHash, - ProposerAddress: lightBlock.ProposerAddress, - }, - Commit: &itm.Commit{ - Height: lightBlock.Commit.Height, - Round: lightBlock.Commit.Round, - BlockId: &itm.BlockID{ - Hash: lightBlock.Commit.BlockID.Hash, - PartSetHeader: &itm.PartSetHeader{ - Total: lightBlock.Commit.BlockID.PartSetHeader.Total, - Hash: lightBlock.Commit.BlockID.PartSetHeader.Hash, - }, - }, - Signatures: signatures, - }, - }, - ValidatorSet: &itm.ValidatorSet{ - Validators: vSets, - }, - } -} - -func (h WasmIBCHeader) ConsensusState() ibcexported.ConsensusState { - return &itm.ConsensusState{ - Timestamp: h.SignedHeader.Header.Time, - Root: &itm.MerkleRoot{Hash: h.SignedHeader.Header.AppHash}, - NextValidatorsHash: h.SignedHeader.Header.NextValidatorsHash, - } -} - -func (a WasmIBCHeader) Height() uint64 { - return uint64(a.SignedHeader.Header.Height) -} - -func (a WasmIBCHeader) IsCompleteBlock() bool { - return true -} - -func (a WasmIBCHeader) NextValidatorsHash() []byte { - return a.SignedHeader.Header.NextValidatorsHash -} - -func (a WasmIBCHeader) ShouldUpdateForProofContextChange() bool { - return false -} - func (pp *WasmProviderConfig) ValidateContractAddress(addr string) bool { prefix, _, err := bech32.DecodeAndConvert(addr) if err != nil { @@ -327,7 +208,7 @@ func (ap *WasmProvider) legacyEncodedEvents(log *zap.Logger, version string) boo } // CommitmentPrefix returns the commitment prefix for Cosmos -func (ap *WasmProvider) CommitmentPrefix() commitmenttypes.MerklePrefix { +func (ap *WasmProvider) CommitmentPrefix(clientId string) commitmenttypes.MerklePrefix { ctx := context.Background() b, _ := ap.GetCommitmentPrefixFromContract(ctx) return commitmenttypes.NewMerklePrefix(b) @@ -511,6 +392,12 @@ func (ap *WasmProvider) MsgRegisterCounterpartyPayee(portID, channelID, relayerA panic(fmt.Sprintf("%s%s", ap.ChainName(), NOT_IMPLEMENTED)) } +func (cc *WasmProvider) RevisionNumber() uint64 { + // note: use zero because prevision javascore version + // didn't use revisionNumber + return 0 +} + // keysDir returns a string representing the path on the local filesystem where the keystore will be initialized. func keysDir(home, chainID string) string { return path.Join(home, "keys", chainID) diff --git a/relayer/chains/wasm/provider_test.go b/relayer/chains/wasm/provider_test.go index 58bd1f74a..75362fc4d 100644 --- a/relayer/chains/wasm/provider_test.go +++ b/relayer/chains/wasm/provider_test.go @@ -10,7 +10,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/gogoproto/proto" - itm "github.com/icon-project/IBC-Integration/libraries/go/common/tendermint" + itm "github.com/icon-project/ibc-integration/libraries/go/common/tendermint" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" @@ -42,7 +42,7 @@ func GetProvider(ctx context.Context, handlerAddr string, local bool) (provider. Key: "testWallet", ChainName: "archway", ChainID: "localnet", - RPCAddr: "http://localhost:26657", + RPCAddr: "http://localhost:13357", AccountPrefix: "archway", KeyringBackend: "test", GasAdjustment: 1.5, @@ -518,7 +518,7 @@ func GetIconProvider(network_id int) *icon.IconProvider { // ctx := context.Background() -// op, err := iconP.QueryClientConsensusState(ctx, 200, "07-tendermint-34", clienttypes.NewHeight(0, 31600)) +// op, err := iconP.QueryClientConsensusState(ctx, 200, "07-tendermint-34", clienttypes.NewHeight(ap.RevisionNumber(), 31600)) // assert.NoError(t, err) // fmt.Println(op) // } @@ -598,26 +598,6 @@ func TestDecodeProto(t *testing.T) { // } -// func TestDecodeMerkleProof(t *testing.T) { - -// v := common.MustHexStrToBytes("0x0ac90612c6060a7b03ade4a5f5803a439835c636395a8d648dee57b2fc90d98dc17fa887159b69638b30303062363336663665366536353633373436393666366537336230326433663334643963373863663565353734396637373131373861386361663034653731303432636366336636396165656430356230383066333336373712f5020a4503ade4a5f5803a439835c636395a8d648dee57b2fc90d98dc17fa887159b69638b0016636c69656e745f696d706c656d656e746174696f6e7369636f6e636c69656e742d3012442261726368776179316e633574617461667636657971376c6c6b7232677635306666396532326d6e66373071676a6c763733376b746d74346573777271676a33336736221a0b0801180120012a03000238222b0801120402043e201a2120a30ef45adecacce36447237e218f8cf3ad48357e82cae6aeea7df465573854cb22290801122504083e20fd6187d3aeb814e2a15d3987fd093b63aae12f9a04ba1c871e8a06c9f85a710b2022290801122508163e2064cfaa6db5902310f5d7255b7e8733f455699291f73d3988a17dc47348d63323202229080112250a2a3e2090d36297ce6f62cdb1110921e2482c20cd630e2817648bb0b95a42ce9fe081a420222b080112040c403e201a2120a8753c7dfe3f41e2bb9936721c8e0547e2c74a46a6d25c3f144d784204ceb86e1ace020a2e03ade4a5f5803a439835c636395a8d648dee57b2fc90d98dc17fa887159b69638b636f6e74726163745f696e666f12367b22636f6e7472616374223a226372617465732e696f3a63772d6962632d636f7265222c2276657273696f6e223a22302e312e30227d1a0b0801180120012a0300021422290801122502043e205a76cca2d1f3103d95080d98bf27abb862829151eb227f6be56d3dc8990d47182022290801122504083e20fd6187d3aeb814e2a15d3987fd093b63aae12f9a04ba1c871e8a06c9f85a710b2022290801122508163e2064cfaa6db5902310f5d7255b7e8733f455699291f73d3988a17dc47348d63323202229080112250a2a3e2090d36297ce6f62cdb1110921e2482c20cd630e2817648bb0b95a42ce9fe081a420222b080112040c403e201a2120a8753c7dfe3f41e2bb9936721c8e0547e2c74a46a6d25c3f144d784204ceb86e0a84010a81010a047761736d122031710a6b9c07bb7f1d7816f5b76f65d48e53ea30ad6d8138322f31374e8733321a090801180120012a0100222508011221011107704879ce264af2b8ca54a7ad461538067d296f22b7de0482e4fdf43314b922250801122101efb0c2cf8ed06dea231b3f0f26942e24623f13012e6297b343e7e1afc3863d6d") - -// var op commitmenttypes.MerkleProof -// err := proto.Unmarshal(v, &op) -// assert.NoError(t, err) - -// for i, v := range op.Proofs { -// fmt.Printf("index %d \n ", i) -// fmt.Printf("existence proof %x : \n ", v.GetExist()) -// fmt.Printf("Non-existence proof %x : \n", v.GetNonexist()) - -// } - -// // err = op.VerifyMembership([]*ics23.ProofSpec{ics23.IavlSpec, ics23.TendermintSpec}, root, path, result.Response.Value) -// assert.NoError(t, err) - -// } - // func TestCommitmentKey(t *testing.T) { // fmt.Printf("%x \n ", common.GetConnectionCommitmentKey("connection-0")) diff --git a/relayer/chains/wasm/query.go b/relayer/chains/wasm/query.go index 546ab61a6..58f6030b0 100644 --- a/relayer/chains/wasm/query.go +++ b/relayer/chains/wasm/query.go @@ -19,7 +19,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/gogoproto/proto" tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - "github.com/icon-project/IBC-Integration/libraries/go/common/icon" + "github.com/icon-project/ibc-integration/libraries/go/common/icon" "go.uber.org/zap" querytypes "github.com/cosmos/cosmos-sdk/types/query" @@ -139,7 +139,7 @@ func (ap *WasmProvider) QueryIBCHeader(ctx context.Context, h int64) (provider.I return nil, err } - return NewWasmIBCHeaderFromLightBlock(lightBlock), nil + return provider.NewWasmIBCHeaderFromLightBlock(lightBlock), nil } func (ap *WasmProvider) QueryLightBlock(ctx context.Context, h int64) (provider.IBCHeader, *tmtypes.LightBlock, error) { @@ -151,7 +151,7 @@ func (ap *WasmProvider) QueryLightBlock(ctx context.Context, h int64) (provider. return nil, nil, err } - return NewWasmIBCHeaderFromLightBlock(lightBlock), lightBlock, nil + return provider.NewWasmIBCHeaderFromLightBlock(lightBlock), lightBlock, nil } // query packet info for sequence @@ -248,7 +248,7 @@ func (ap *WasmProvider) QueryClientStateResponse(ctx context.Context, height int return &clienttypes.QueryClientStateResponse{ ClientState: anyClientState, Proof: proof, - ProofHeight: clienttypes.NewHeight(0, uint64(height)), + ProofHeight: clienttypes.NewHeight(ap.RevisionNumber(), uint64(height)), }, nil } @@ -336,7 +336,7 @@ func (ap *WasmProvider) QueryClientConsensusState(ctx context.Context, chainHeig if err != nil { return nil, err } - return clienttypes.NewQueryConsensusStateResponse(anyConsensusState, nil, clienttypes.NewHeight(0, uint64(chainHeight))), nil + return clienttypes.NewQueryConsensusStateResponse(anyConsensusState, nil, clienttypes.NewHeight(ap.RevisionNumber(), uint64(chainHeight))), nil } func (ap *WasmProvider) QueryIBCHandlerContract(ctx context.Context, param wasmtypes.RawContractMessage) (op *wasmtypes.QuerySmartContractStateResponse, err error) { @@ -526,7 +526,7 @@ func (ap *WasmProvider) QueryConnection(ctx context.Context, height int64, conne return nil, err } - return conntypes.NewQueryConnectionResponse(conn, connProof, clienttypes.NewHeight(0, uint64(height))), nil + return conntypes.NewQueryConnectionResponse(conn, connProof, clienttypes.NewHeight(ap.RevisionNumber(), uint64(height))), nil } func (ap *WasmProvider) QueryWasmProof(ctx context.Context, storageKey []byte, height int64) ([]byte, error) { @@ -641,7 +641,7 @@ func (ap *WasmProvider) GenerateConnHandshakeProof(ctx context.Context, height i if err != nil { return nil, nil, nil, nil, nil, err } - return clientState_, clientResponse.GetProof(), proofConsensusBytes, proofConnBytes, clienttypes.NewHeight(0, uint64(height)), nil + return clientState_, clientResponse.GetProof(), proofConsensusBytes, proofConnBytes, clienttypes.NewHeight(ap.RevisionNumber(), uint64(height)), nil } // ics 04 - channel @@ -671,7 +671,7 @@ func (ap *WasmProvider) QueryChannel(ctx context.Context, height int64, channeli return nil, err } - return chantypes.NewQueryChannelResponse(channelS, proof, clienttypes.NewHeight(0, uint64(height))), nil + return chantypes.NewQueryChannelResponse(channelS, proof, clienttypes.NewHeight(ap.RevisionNumber(), uint64(height))), nil } func (ap *WasmProvider) QueryChannelClient(ctx context.Context, height int64, channelid, portid string) (*clienttypes.IdentifiedClientState, error) { @@ -772,7 +772,7 @@ func (ap *WasmProvider) QueryNextSeqRecv(ctx context.Context, height int64, chan return &chantypes.QueryNextSequenceReceiveResponse{ NextSequenceReceive: seq, Proof: proof, - ProofHeight: clienttypes.NewHeight(0, uint64(height)), + ProofHeight: clienttypes.NewHeight(ap.RevisionNumber(), uint64(height)), }, nil } @@ -794,7 +794,7 @@ func (ap *WasmProvider) QueryPacketCommitment(ctx context.Context, height int64, return &chantypes.QueryPacketCommitmentResponse{ Commitment: pktCommitment.Data.Bytes(), Proof: proof, - ProofHeight: clienttypes.NewHeight(0, uint64(height)), + ProofHeight: clienttypes.NewHeight(ap.RevisionNumber(), uint64(height)), }, nil } @@ -814,7 +814,7 @@ func (ap *WasmProvider) QueryPacketAcknowledgement(ctx context.Context, height i return &chantypes.QueryPacketAcknowledgementResponse{ Acknowledgement: pktAcknowledgement.Data.Bytes(), Proof: proof, - ProofHeight: clienttypes.NewHeight(0, uint64(height)), + ProofHeight: clienttypes.NewHeight(ap.RevisionNumber(), uint64(height)), }, nil } @@ -840,7 +840,7 @@ func (ap *WasmProvider) QueryPacketReceipt(ctx context.Context, height int64, ch return &chantypes.QueryPacketReceiptResponse{ Received: pktReceipt != nil, // TODO: Bytes to boolean Proof: proof, - ProofHeight: clienttypes.NewHeight(0, uint64(height)), + ProofHeight: clienttypes.NewHeight(ap.RevisionNumber(), uint64(height)), }, nil } @@ -908,5 +908,5 @@ func (ap *WasmProvider) QueryClientPrevConsensusStateHeight(ctx context.Context, if len(heights) == 0 { return nil, fmt.Errorf("consensus state of client %s before %d", clientId, clientHeight) } - return clienttypes.Height{RevisionNumber: 0, RevisionHeight: uint64(heights[0])}, nil + return clienttypes.NewHeight(ap.RevisionNumber(), uint64(heights[0])), nil } diff --git a/relayer/chains/wasm/tx.go b/relayer/chains/wasm/tx.go index 3ef31c195..e5254a838 100644 --- a/relayer/chains/wasm/tx.go +++ b/relayer/chains/wasm/tx.go @@ -36,7 +36,7 @@ import ( conntypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" "github.com/cosmos/relayer/v2/relayer/provider" - itm "github.com/icon-project/IBC-Integration/libraries/go/common/tendermint" + itm "github.com/icon-project/ibc-integration/libraries/go/common/tendermint" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/input" @@ -150,8 +150,7 @@ func (pc *WasmProviderConfig) SignMode() signing.SignMode { return signMode } -func (ap *WasmProvider) NewClientState(dstChainID string, dstIBCHeader provider.IBCHeader, dstTrustingPeriod, dstUbdPeriod time.Duration, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour bool) (ibcexported.ClientState, error) { - +func (ap *WasmProvider) NewClientState(dstChainID string, dstIBCHeader provider.IBCHeader, dstTrustingPeriod, dstUbdPeriod time.Duration, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour bool, srcWasmCodeID string, srcChainId string) (ibcexported.ClientState, error) { return &itm.ClientState{ ChainId: dstChainID, TrustLevel: &itm.Fraction{Numerator: light.DefaultTrustLevel.Numerator, Denominator: light.DefaultTrustLevel.Denominator}, @@ -597,13 +596,13 @@ func (ap *WasmProvider) MsgChannelCloseConfirm(msgCloseInit provider.ChannelInfo return ap.NewWasmContractMessage(MethodChannelCloseConfirm, params) } -func (ap *WasmProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeader, trustedHeight clienttypes.Height, trustedHeader provider.IBCHeader) (ibcexported.ClientMessage, error) { - trustedWasmHeader, ok := trustedHeader.(WasmIBCHeader) +func (ap *WasmProvider) MsgUpdateClientHeader(latestHeader provider.IBCHeader, trustedHeight clienttypes.Height, trustedHeader provider.IBCHeader, clientType string) (ibcexported.ClientMessage, error) { + trustedWasmHeader, ok := trustedHeader.(provider.WasmIBCHeader) if !ok { return nil, fmt.Errorf("unsupported IBC trusted header type, expected: TendermintIBCHeader, actual: %T", trustedHeader) } - latestWasmHeader, ok := latestHeader.(WasmIBCHeader) + latestWasmHeader, ok := latestHeader.(provider.WasmIBCHeader) if !ok { return nil, fmt.Errorf("unsupported IBC header type, expected: TendermintIBCHeader, actual: %T", latestHeader) } diff --git a/relayer/client.go b/relayer/client.go index dcd85079f..a53ab88b9 100644 --- a/relayer/client.go +++ b/relayer/client.go @@ -10,6 +10,8 @@ import ( clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + wasmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/08-wasm/types" + "github.com/cosmos/relayer/v2/relayer/chains/cosmos" "github.com/cosmos/relayer/v2/relayer/chains/icon" "github.com/cosmos/relayer/v2/relayer/common" "github.com/cosmos/relayer/v2/relayer/provider" @@ -18,7 +20,7 @@ import ( ) // CreateClients creates clients for src on dst and dst on src if the client ids are unspecified. -func (c *Chain) CreateClients(ctx context.Context, dst *Chain, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override bool, customClientTrustingPeriod time.Duration, memo string, iconStartHeight int64) (string, string, error) { +func (c *Chain) CreateClients(ctx context.Context, dst *Chain, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override bool, customClientTrustingPeriod time.Duration, memo string, iconStartHeight int64, srcWasmCodeID, dstWasmCodeID string) (string, string, error) { // Query the latest heights on src and dst and retry if the query fails var srch, dsth int64 if err := retry.Do(func() error { @@ -62,7 +64,7 @@ func (c *Chain) CreateClients(ctx context.Context, dst *Chain, allowUpdateAfterE eg.Go(func() error { var err error // Create client on src for dst if the client id is unspecified - clientSrc, err = CreateClient(egCtx, c, dst, srcUpdateHeader, dstUpdateHeader, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, memo, iconStartHeight) + clientSrc, err = CreateClient(egCtx, c, dst, srcUpdateHeader, dstUpdateHeader, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, memo, iconStartHeight, srcWasmCodeID) if err != nil { return fmt.Errorf("failed to create client on src chain{%s}: %w", c.ChainID(), err) } @@ -72,7 +74,7 @@ func (c *Chain) CreateClients(ctx context.Context, dst *Chain, allowUpdateAfterE eg.Go(func() error { var err error // Create client on dst for src if the client id is unspecified - clientDst, err = CreateClient(egCtx, dst, c, dstUpdateHeader, srcUpdateHeader, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, memo, iconStartHeight) + clientDst, err = CreateClient(egCtx, dst, c, dstUpdateHeader, srcUpdateHeader, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour, override, customClientTrustingPeriod, memo, iconStartHeight, dstWasmCodeID) if err != nil { return fmt.Errorf("failed to create client on dst chain{%s}: %w", dst.ChainID(), err) } @@ -106,6 +108,7 @@ func CreateClient( customClientTrustingPeriod time.Duration, memo string, iconStartHeight int64, + srcWasmCodeID string, ) (string, error) { var err error // If a client ID was specified in the path and override is not set, ensure the client exists. @@ -188,7 +191,8 @@ func CreateClient( // We want to create a light client on the src chain which tracks the state of the dst chain. // So we build a new client state from dst and attempt to use this for creating the light client on src. - clientState, err := dst.ChainProvider.NewClientState(dst.ChainID(), dstUpdateHeader, tp, ubdPeriod, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour) + clientState, err := dst.ChainProvider.NewClientState(dst.ChainID(), dstUpdateHeader, tp, ubdPeriod, allowUpdateAfterExpiry, + allowUpdateAfterMisbehaviour, srcWasmCodeID, src.ChainProvider.Type()) if err != nil { return "", fmt.Errorf("failed to create new client state for chain{%s}: %w", dst.ChainID(), err) } @@ -226,7 +230,30 @@ func CreateClient( // the dst chains implementation of CreateClient, to ensure the proper client/header // logic is executed, but the message gets submitted on the src chain which means // we need to sign with the address from src. - createMsg, err := src.ChainProvider.MsgCreateClient(clientState, dstUpdateHeader.ConsensusState()) + consensusState := dstUpdateHeader.ConsensusState() + switch clientState.(type) { + case *wasmclient.ClientState: + cp := src.ChainProvider.(*cosmos.CosmosProvider) + consensusStateBz, err := cp.Cdc.Marshaler.MarshalInterface(consensusState) + if err != nil { + return "", fmt.Errorf("failed to marshal consensus state for wasm client: %w", err) + } + + // TODO: the consensus state of Icon dont have timestamp + // this is dont to escape validation in Icon side escape validation + // find a better way for icon + timeStamp := consensusState.GetTimestamp() + if consensusState.ClientType() == common.IconModule { + timeStamp = 1 + } + + consensusState = &wasmclient.ConsensusState{ + Data: consensusStateBz, + Timestamp: timeStamp, + } + } + + createMsg, err := src.ChainProvider.MsgCreateClient(clientState, consensusState) if err != nil { return "", fmt.Errorf("failed to compose CreateClient msg for chain{%s} tracking the state of chain{%s}: %w", src.ChainID(), dst.ChainID(), err) @@ -339,7 +366,8 @@ func MsgUpdateClient( var updateHeader ibcexported.ClientMessage if err := retry.Do(func() error { var err error - updateHeader, err = src.ChainProvider.MsgUpdateClientHeader(srcHeader, dstClientState.GetLatestHeight().(clienttypes.Height), dstTrustedHeader) + clientType := dstClientState.ClientType() + updateHeader, err = src.ChainProvider.MsgUpdateClientHeader(srcHeader, dstClientState.GetLatestHeight().(clienttypes.Height), dstTrustedHeader, clientType) return err }, retry.Context(ctx), RtyAtt, RtyDel, RtyErr, retry.OnRetry(func(n uint, err error) { src.log.Info( @@ -388,7 +416,7 @@ func msgUpdateClientOneWay(ctx context.Context, src, dst *Chain, height int64) ( RevisionHeight: trustedHdr.Height(), } - updateHeader, err = src.ChainProvider.MsgUpdateClientHeader(latestHdr, trustedHeight, trustedHdr) + updateHeader, err = src.ChainProvider.MsgUpdateClientHeader(latestHdr, trustedHeight, trustedHdr, dstClientState.ClientType()) return err }, retry.Context(ctx), RtyAtt, RtyDel, RtyErr, retry.OnRetry(func(n uint, err error) { dst.log.Info( diff --git a/relayer/common/const.go b/relayer/common/const.go index 55dee1afc..cf04bae20 100644 --- a/relayer/common/const.go +++ b/relayer/common/const.go @@ -6,16 +6,20 @@ import ( ) var ( - EventTimeoutRequest = "TimeoutRequest(bytes)" - IconModule = "icon" - WasmModule = "wasm" - ArchwayModule = "archway" - TendermintLightClient = "07-tendermint" - IconLightClient = "iconclient" - ConnectionKey = "connection" - ChannelKey = "channel" - ONE_HOUR = 60 * 60 * 1000 - NanoToMilliRatio = 1000_000 + EventTimeoutRequest = "TimeoutRequest(bytes)" + IconModule = "icon" + WasmModule = "wasm" + ArchwayModule = "archway" + + TendermintLightClient = "07-tendermint" + TendermintWasmLightClient = "ics08-tendermint" + IconLightClient = "iconclient" + WasmLightClient = "08-wasm" + ConnectionKey = "connection" + ChannelKey = "channel" + ONE_HOUR = 60 * 60 * 1000 + NanoToMilliRatio = 1000_000 + EmptyProofConst = []byte("empty") ) var ( diff --git a/relayer/common/utils.go b/relayer/common/utils.go index 47b4ee60c..d3478dd4c 100644 --- a/relayer/common/utils.go +++ b/relayer/common/utils.go @@ -58,3 +58,10 @@ func LoadSnapshotHeight(chain_id string) (int64, error) { } return strconv.ParseInt(strings.TrimSuffix(string(content), "\n"), 10, 64) } + +func EnsureNonEmptyProof(proof []byte) []byte { + if proof == nil { + return EmptyProofConst + } + return proof +} diff --git a/relayer/connection.go b/relayer/connection.go index 9c64619cc..bd9535fe4 100644 --- a/relayer/connection.go +++ b/relayer/connection.go @@ -73,7 +73,7 @@ func (c *Chain) CreateOpenConnections( Info: provider.ConnectionInfo{ ClientID: c.PathEnd.ClientID, CounterpartyClientID: dst.PathEnd.ClientID, - CounterpartyCommitmentPrefix: dst.ChainProvider.CommitmentPrefix(), + CounterpartyCommitmentPrefix: dst.ChainProvider.CommitmentPrefix(dst.PathEnd.ClientID), }, }, Termination: &processor.ConnectionMessage{ @@ -82,7 +82,7 @@ func (c *Chain) CreateOpenConnections( Info: provider.ConnectionInfo{ ClientID: dst.PathEnd.ClientID, CounterpartyClientID: c.PathEnd.ClientID, - CounterpartyCommitmentPrefix: c.ChainProvider.CommitmentPrefix(), + CounterpartyCommitmentPrefix: c.ChainProvider.CommitmentPrefix(c.PathEnd.ClientID), }, }, }). diff --git a/relayer/path.go b/relayer/path.go index 228544c4b..bd81c88a4 100644 --- a/relayer/path.go +++ b/relayer/path.go @@ -173,6 +173,13 @@ func (p *Path) String() string { return fmt.Sprintf("%s -> %s", p.Src.String(), p.Dst.String()) } +func (p *Path) IsInvalid() error { + if p.Src.ChainID == "" || p.Src.ClientID == "" || p.Src.ConnectionID == "" || p.Dst.ChainID == "" || p.Dst.ClientID == "" || p.Dst.ConnectionID == "" { + return fmt.Errorf("chain-id, client-id and connection-id for src and dst cannot be empty for path") + } + return nil +} + // GenPath generates a path with unspecified client, connection and channel identifiers // given chainIDs and portIDs. func GenPath(srcChainID, dstChainID string) *Path { diff --git a/relayer/processor/message_processor.go b/relayer/processor/message_processor.go index 645eee8c3..a6ce463bf 100644 --- a/relayer/processor/message_processor.go +++ b/relayer/processor/message_processor.go @@ -5,6 +5,7 @@ import ( "context" "errors" "fmt" + "strings" "sync" "time" @@ -284,10 +285,12 @@ func (mp *messageProcessor) assembleMsgUpdateClient(ctx context.Context, src, ds trustedConsensusHeight.RevisionHeight) } + lastInd := strings.LastIndex(clientID, "-") msgUpdateClientHeader, err := src.chainProvider.MsgUpdateClientHeader( src.latestHeader, trustedConsensusHeight, dst.clientTrustedState.IBCHeader, + clientID[:lastInd], ) if err != nil { return fmt.Errorf("error assembling new client header: %w", err) @@ -346,10 +349,12 @@ func (mp *messageProcessor) handleMsgUpdateClientForBTPClient(ctx context.Contex } } + lastInd := strings.LastIndex(clientID, "-") msgUpdateClientHeader, err := src.chainProvider.MsgUpdateClientHeader( header, latestConsensusHeight, nil, + clientID[:lastInd], ) if err != nil { return fmt.Errorf("error assembling new client header: %w", err) diff --git a/relayer/processor/path_end_runtime.go b/relayer/processor/path_end_runtime.go index aa48f414e..e5b6fb3d9 100644 --- a/relayer/processor/path_end_runtime.go +++ b/relayer/processor/path_end_runtime.go @@ -391,14 +391,17 @@ func (pathEnd *pathEndRuntime) mergeCacheData(ctx context.Context, cancel func() pathEnd.latestHeader = d.LatestHeader pathEnd.clientState = d.ClientState - terminate, err := pathEnd.checkForMisbehaviour(ctx, pathEnd.clientState, counterParty) - if err != nil { - pathEnd.log.Error( - "Failed to check for misbehaviour", - zap.String("client_id", pathEnd.info.ClientID), - zap.Error(err), - ) - } + // TODO: find a better way if any + // Centaurid dont have registered icon header and clientType + // so, misbehaviour cannot find those type + // terminate, err := pathEnd.checkForMisbehaviour(ctx, pathEnd.clientState, counterParty) + // if err != nil { + // pathEnd.log.Error( + // "Failed to check for misbehaviour", + // zap.String("client_id", pathEnd.info.ClientID), + // zap.Error(err), + // ) + // } if d.ClientState.ConsensusHeight != pathEnd.clientState.ConsensusHeight { pathEnd.clientState = d.ClientState @@ -410,7 +413,9 @@ func (pathEnd *pathEndRuntime) mergeCacheData(ctx context.Context, cancel func() pathEnd.handleCallbacks(d.IBCMessagesCache) - if pathEnd.shouldTerminate(d.IBCMessagesCache, messageLifecycle) || terminate { + // TODO: cannot check for misbehaviour because of Icon ClientTypeHeader and all not registered on centauri chain + // if pathEnd.shouldTerminate(d.IBCMessagesCache, messageLifecycle) || terminate { + if pathEnd.shouldTerminate(d.IBCMessagesCache, messageLifecycle) { cancel() return } diff --git a/relayer/processor/path_processor_internal.go b/relayer/processor/path_processor_internal.go index 8dd0c7f2f..008839560 100644 --- a/relayer/processor/path_processor_internal.go +++ b/relayer/processor/path_processor_internal.go @@ -14,6 +14,7 @@ import ( "github.com/cosmos/relayer/v2/relayer/common" "github.com/cosmos/relayer/v2/relayer/provider" + "go.uber.org/zap" "golang.org/x/sync/errgroup" ) @@ -1550,23 +1551,15 @@ func (pp *PathProcessor) shouldTerminateForFlushComplete() bool { func (pp *PathProcessor) UpdateBTPHeight(ctx context.Context, src *pathEndRuntime, dst *pathEndRuntime) { srcIsIcon := src.chainProvider.Type() == common.IconModule - dstIsBtpClient := IsBTPLightClient(dst.clientState) - - if !srcIsIcon && !dstIsBtpClient { - return - } - if srcIsIcon && !dstIsBtpClient || !srcIsIcon && dstIsBtpClient { - pp.log.Error("Src Icon module mismatch with dst btp client", - zap.String("Src Chain Type ", src.chainProvider.Type()), - zap.String("Dst client Id", dst.clientState.ClientID), - ) + if !srcIsIcon { return } if src.BTPHeightQueue.Size() == 0 { return } + size := src.BTPHeightQueue.Size() for i := 0; i < size; i++ { btpHeightInfo, err := src.BTPHeightQueue.GetQueue() @@ -1581,7 +1574,7 @@ func (pp *PathProcessor) UpdateBTPHeight(ctx context.Context, src *pathEndRuntim continue } if dst.clientState.ConsensusHeight.RevisionHeight > uint64(btpHeightInfo.Height) { - cs, err := dst.chainProvider.QueryClientConsensusState(ctx, int64(dst.latestBlock.Height), dst.clientState.ClientID, clienttypes.NewHeight(0, uint64(btpHeightInfo.Height))) + cs, err := dst.chainProvider.QueryClientConsensusState(ctx, int64(dst.latestBlock.Height), dst.clientState.ClientID, clienttypes.NewHeight(src.chainProvider.RevisionNumber(), uint64(btpHeightInfo.Height))) if err == nil && cs != nil { // removing latest height element src.BTPHeightQueue.Dequeue() diff --git a/relayer/processor/types_internal.go b/relayer/processor/types_internal.go index 54ab3ada8..c4eb11e64 100644 --- a/relayer/processor/types_internal.go +++ b/relayer/processor/types_internal.go @@ -240,10 +240,10 @@ func (msg connectionIBCMessage) assemble( switch msg.eventType { case conntypes.EventTypeConnectionOpenInit: // don't need proof for this message - msg.info.CounterpartyCommitmentPrefix = src.chainProvider.CommitmentPrefix() + msg.info.CounterpartyCommitmentPrefix = src.chainProvider.CommitmentPrefix(msg.info.ClientID) assembleMessage = dst.chainProvider.MsgConnectionOpenInit case conntypes.EventTypeConnectionOpenTry: - msg.info.CommitmentPrefix = src.chainProvider.CommitmentPrefix() + msg.info.CommitmentPrefix = src.chainProvider.CommitmentPrefix(msg.info.ClientID) connProof = src.chainProvider.ConnectionHandshakeProof assembleMessage = dst.chainProvider.MsgConnectionOpenTry case conntypes.EventTypeConnectionOpenAck: diff --git a/relayer/processor/utils.go b/relayer/processor/utils.go index 1837546f9..14d795f67 100644 --- a/relayer/processor/utils.go +++ b/relayer/processor/utils.go @@ -12,6 +12,10 @@ func IsBTPLightClient(cs provider.ClientState) bool { if strings.Contains(cs.ClientID, common.IconLightClient) { return true } + + if strings.Contains(cs.ClientID, "wasm") { + return true + } return false } diff --git a/relayer/provider/matcher.go b/relayer/provider/matcher.go index 72088b0d3..364e15c5b 100644 --- a/relayer/provider/matcher.go +++ b/relayer/provider/matcher.go @@ -9,8 +9,10 @@ import ( sdkcodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/cosmos/ibc-go/v7/modules/core/exported" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" tmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + wasmclient "github.com/cosmos/ibc-go/v7/modules/light-clients/08-wasm/types" ) var tendermintClientCodec = tmClientCodec() @@ -18,6 +20,7 @@ var tendermintClientCodec = tmClientCodec() func tmClientCodec() *sdkcodec.ProtoCodec { interfaceRegistry := types.NewInterfaceRegistry() tmclient.RegisterInterfaces(interfaceRegistry) + wasmclient.RegisterInterfaces(interfaceRegistry) return sdkcodec.NewProtoCodec(interfaceRegistry) } @@ -30,6 +33,14 @@ func ClientsMatch(ctx context.Context, src, dst ChainProvider, existingClient cl return "", err } + if newClient.ClientType() == exported.Wasm { + wasmClientState := newClient.(*wasmclient.ClientState) + newClient, err = clienttypes.UnmarshalClientState(tendermintClientCodec, wasmClientState.Data) // Does this need to be UnmarshalInterface? + if err != nil { + return "", err + } + } + if existingClientState.ClientType() != newClient.ClientType() { return "", nil } @@ -63,6 +74,14 @@ func CheckForMisbehaviour( return nil, err } + switch wasmHeader := clientMsg.(type) { + case *wasmclient.Header: + clientMsg, err = clienttypes.UnmarshalClientMessage(tendermintClientCodec, wasmHeader.Data) + if err != nil { + return nil, err + } + } + switch header := clientMsg.(type) { case *tmclient.Header: misbehavior, err = checkTendermintMisbehaviour(ctx, clientID, header, cachedHeader, counterparty) diff --git a/relayer/provider/provider.go b/relayer/provider/provider.go index eabf40f3c..b925cc357 100644 --- a/relayer/provider/provider.go +++ b/relayer/provider/provider.go @@ -7,6 +7,8 @@ import ( "github.com/cometbft/cometbft/proto/tendermint/crypto" "github.com/cometbft/cometbft/types" + comettypes "github.com/cometbft/cometbft/types" + tmtypes "github.com/cometbft/cometbft/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/gogoproto/proto" transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" @@ -16,6 +18,8 @@ import ( commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + + itm "github.com/icon-project/ibc-integration/libraries/go/common/tendermint" "go.uber.org/zap" "go.uber.org/zap/zapcore" ) @@ -238,7 +242,7 @@ type ChainProvider interface { MsgClaimFees(dstChainID string, dstAddress string) (RelayerMessage, error) // [Begin] Client IBC message assembly functions - NewClientState(dstChainID string, dstIBCHeader IBCHeader, dstTrustingPeriod, dstUbdPeriod time.Duration, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour bool) (ibcexported.ClientState, error) + NewClientState(dstChainID string, dstIBCHeader IBCHeader, dstTrustingPeriod, dstUbdPeriod time.Duration, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour bool, srcWasmCodeID string, srcChainId string) (ibcexported.ClientState, error) MsgCreateClient(clientState ibcexported.ClientState, consensusState ibcexported.ConsensusState) (RelayerMessage, error) @@ -299,7 +303,7 @@ type ChainProvider interface { MsgTimeoutOnClose(msgTransfer PacketInfo, proofUnreceived PacketProof) (RelayerMessage, error) // Get the commitment prefix of the chain. - CommitmentPrefix() commitmenttypes.MerklePrefix + CommitmentPrefix(clientId string) commitmenttypes.MerklePrefix // [End] Packet flow IBC message assembly @@ -367,7 +371,7 @@ type ChainProvider interface { // MsgUpdateClientHeader takes the latest chain header, in addition to the latest client trusted header // and assembles a new header for updating the light client on the counterparty chain. - MsgUpdateClientHeader(latestHeader IBCHeader, trustedHeight clienttypes.Height, trustedHeader IBCHeader) (ibcexported.ClientMessage, error) + MsgUpdateClientHeader(latestHeader IBCHeader, trustedHeight clienttypes.Height, trustedHeader IBCHeader, clientType string) (ibcexported.ClientMessage, error) // MsgUpdateClient takes an update client header to prove trust for the previous // consensus height and the new height, and assembles a MsgUpdateClient message @@ -416,6 +420,7 @@ type ChainProvider interface { TrustingPeriod(ctx context.Context) (time.Duration, error) WaitForNBlocks(ctx context.Context, n int64) error Sprint(toPrint proto.Message) (string, error) + RevisionNumber() uint64 } // Do we need intermediate types? i.e. can we use the SDK types for both substrate and cosmos? @@ -582,3 +587,130 @@ func (h TendermintIBCHeader) TMHeader() (*tendermint.Header, error) { TrustedValidators: trustedVals, }, nil } + +func (h TendermintIBCHeader) LightBlock() *comettypes.LightBlock { + return &tmtypes.LightBlock{ + SignedHeader: h.SignedHeader, + ValidatorSet: h.ValidatorSet, + } +} + +// ######################for wasm ############## +type WasmIBCHeader struct { + SignedHeader *itm.SignedHeader + ValidatorSet *itm.ValidatorSet +} + +func NewWasmIBCHeader(header *itm.SignedHeader, validators *itm.ValidatorSet) WasmIBCHeader { + return WasmIBCHeader{ + SignedHeader: header, + ValidatorSet: validators, + } +} + +func (h WasmIBCHeader) ConsensusState() ibcexported.ConsensusState { + return &itm.ConsensusState{ + Timestamp: h.SignedHeader.Header.Time, + Root: &itm.MerkleRoot{Hash: h.SignedHeader.Header.AppHash}, + NextValidatorsHash: h.SignedHeader.Header.NextValidatorsHash, + } +} + +func (a WasmIBCHeader) Height() uint64 { + return uint64(a.SignedHeader.Header.Height) +} + +func (a WasmIBCHeader) IsCompleteBlock() bool { + return true +} + +func (a WasmIBCHeader) NextValidatorsHash() []byte { + return a.SignedHeader.Header.NextValidatorsHash +} + +func (a WasmIBCHeader) ShouldUpdateWithZeroMessage() bool { + return false +} +func (a WasmIBCHeader) ShouldUpdateForProofContextChange() bool { + return false +} + +func NewWasmIBCHeaderFromLightBlock(lightBlock *comettypes.LightBlock) WasmIBCHeader { + vSets := make([]*itm.Validator, 0) + for _, v := range lightBlock.ValidatorSet.Validators { + _v := &itm.Validator{ + Address: v.Address, + PubKey: &itm.PublicKey{ + Sum: itm.GetPubKeyFromTx(v.PubKey.Type(), v.PubKey.Bytes()), + }, + VotingPower: v.VotingPower, + ProposerPriority: v.ProposerPriority, + } + + vSets = append(vSets, _v) + } + + signatures := make([]*itm.CommitSig, 0) + for _, d := range lightBlock.Commit.Signatures { + + _d := &itm.CommitSig{ + BlockIdFlag: itm.BlockIDFlag(d.BlockIDFlag), + ValidatorAddress: d.ValidatorAddress, + Timestamp: &itm.Timestamp{ + Seconds: int64(d.Timestamp.Unix()), + Nanos: int32(d.Timestamp.Nanosecond()), + }, + Signature: d.Signature, + } + signatures = append(signatures, _d) + } + + return WasmIBCHeader{ + SignedHeader: &itm.SignedHeader{ + Header: &itm.LightHeader{ + Version: &itm.Consensus{ + Block: lightBlock.Version.Block, + App: lightBlock.Version.App, + }, + ChainId: lightBlock.ChainID, + + Height: lightBlock.Height, + Time: &itm.Timestamp{ + Seconds: int64(lightBlock.Time.Unix()), + Nanos: int32(lightBlock.Time.Nanosecond()), // this is the offset after the nanosecond + }, + LastBlockId: &itm.BlockID{ + Hash: lightBlock.LastBlockID.Hash, + PartSetHeader: &itm.PartSetHeader{ + Total: lightBlock.LastBlockID.PartSetHeader.Total, + Hash: lightBlock.LastBlockID.PartSetHeader.Hash, + }, + }, + LastCommitHash: lightBlock.LastCommitHash, + DataHash: lightBlock.DataHash, + ValidatorsHash: lightBlock.ValidatorsHash, + NextValidatorsHash: lightBlock.NextValidatorsHash, + ConsensusHash: lightBlock.ConsensusHash, + AppHash: lightBlock.AppHash, + LastResultsHash: lightBlock.LastResultsHash, + EvidenceHash: lightBlock.EvidenceHash, + ProposerAddress: lightBlock.ProposerAddress, + }, + Commit: &itm.Commit{ + Height: lightBlock.Commit.Height, + Round: lightBlock.Commit.Round, + BlockId: &itm.BlockID{ + Hash: lightBlock.Commit.BlockID.Hash, + PartSetHeader: &itm.PartSetHeader{ + Total: lightBlock.Commit.BlockID.PartSetHeader.Total, + Hash: lightBlock.Commit.BlockID.PartSetHeader.Hash, + }, + }, + Signatures: signatures, + }, + }, + ValidatorSet: &itm.ValidatorSet{ + Validators: vSets, + }, + } +}