From 21699a1f8d520ac66ff76892c90138686854d902 Mon Sep 17 00:00:00 2001 From: beer-1 Date: Fri, 4 Oct 2024 15:03:11 +0900 Subject: [PATCH] fix launch tool to specify the ibcfee version at chain link --- contrib/launchtools/README.md | 2 +- contrib/launchtools/config.go | 2 +- contrib/launchtools/steps/ibc.go | 27 ++++++++++++++++++++++++--- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/contrib/launchtools/README.md b/contrib/launchtools/README.md index dabddb6..8d3ee01 100644 --- a/contrib/launchtools/README.md +++ b/contrib/launchtools/README.md @@ -30,7 +30,7 @@ minitiad launch $TARGET_NETWORK --with-config [path-to-config] "l1_config": { "chain_id": "initiation-1", "rpc_url": "https://rpc.initiation-1.initia.xyz:443", - "gas_prices": "0.15uinit" + "gas_prices": "0.015uinit" }, "l2_config": { "chain_id": "minitia-XDzNjd-1", diff --git a/contrib/launchtools/config.go b/contrib/launchtools/config.go index 0b6218f..e2d8847 100644 --- a/contrib/launchtools/config.go +++ b/contrib/launchtools/config.go @@ -260,7 +260,7 @@ func (l1config *L1Config) Finalize(buf *bufio.Reader) error { } if l1config.GasPrices == "" { - l1config.GasPrices = "0.15uinit" + l1config.GasPrices = "0.015uinit" } _, err := sdk.ParseDecCoins(l1config.GasPrices) diff --git a/contrib/launchtools/steps/ibc.go b/contrib/launchtools/steps/ibc.go index 485e5f1..fb65d0a 100644 --- a/contrib/launchtools/steps/ibc.go +++ b/contrib/launchtools/steps/ibc.go @@ -16,6 +16,9 @@ import ( relayertypes "github.com/cosmos/relayer/v2/relayer" relayerconfig "github.com/cosmos/relayer/v2/relayer/chains/cosmos" + ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + "github.com/initia-labs/OPinit/contrib/launchtools" ) @@ -238,18 +241,36 @@ func initializeRelayerKeyring(config *launchtools.Config) func(*Relayer) error { // link creates a default transfer channel between the chains // it does all the heavy lifting of creating the channel, connection, and client func link(r *Relayer) error { - r.logger.Info("linking chains for relayer...") + versionBz, err := json.Marshal(ibcfeetypes.Metadata{ + FeeVersion: ibcfeetypes.Version, + AppVersion: ibctransfertypes.Version, + }) + if err != nil { + return err + } + + r.logger.Info("linking chains for relayer...", "version", string(versionBz)) return r.run([]string{ "tx", "link", RelayerPathName, + "--version", + string(versionBz), }) } // linkWithports is the same as link, however ports are specified func linkWithPorts(srcPort string, dstPort string, version string) func(*Relayer) error { return func(r *Relayer) error { - r.logger.Info("linking chains for relayer...") + versionBz, err := json.Marshal(ibcfeetypes.Metadata{ + FeeVersion: ibcfeetypes.Version, + AppVersion: version, + }) + if err != nil { + return err + } + + r.logger.Info("linking chains for relayer...", "version", string(versionBz)) return r.run([]string{ "tx", "link", @@ -259,7 +280,7 @@ func linkWithPorts(srcPort string, dstPort string, version string) func(*Relayer "--dst-port", dstPort, "--version", - version, + string(versionBz), }) } }