From 882ae5e9dcf9f57664f0cab9d101d4536a78d723 Mon Sep 17 00:00:00 2001 From: Michael Tsitrin Date: Wed, 28 Jun 2023 11:10:04 +0300 Subject: [PATCH 1/9] added algo field to keys struct --- cmd/config/init/consts.go | 9 +++++---- cmd/config/init/flags.go | 25 +++++-------------------- cmd/config/init/genesis.go | 10 ++++++++-- cmd/config/init/init.go | 34 ++++++++++++++++++++++++++++++---- cmd/config/init/keys.go | 16 ++++++++-------- cmd/config/init/rollapp.go | 4 +++- cmd/consts/consts.go | 8 ++++++++ cmd/sequencer/start/start.go | 7 ++++++- cmd/utils/keys.go | 4 +++- 9 files changed, 76 insertions(+), 41 deletions(-) diff --git a/cmd/config/init/consts.go b/cmd/config/init/consts.go index 7fa1b546..eb585c45 100644 --- a/cmd/config/init/consts.go +++ b/cmd/config/init/consts.go @@ -3,20 +3,21 @@ package initconfig import "github.com/dymensionxyz/roller/cmd/utils" var FlagNames = struct { - Home string TokenSupply string RollappBinary string HubID string }{ - Home: "home", TokenSupply: "token-supply", RollappBinary: "rollapp-binary", HubID: "hub", } -const StagingHubID = "internal-devnet" -const LocalHubID = "local" +const ( + StagingHubID = "internal-devnet" + LocalHubID = "local" +) +// TODO: The avaialble hub networks should be read from YAML file var Hubs = map[string]utils.HubData{ StagingHubID: { API_URL: "https://rest-hub-devnet.dymension.xyz", diff --git a/cmd/config/init/flags.go b/cmd/config/init/flags.go index beb6c560..21d597d7 100644 --- a/cmd/config/init/flags.go +++ b/cmd/config/init/flags.go @@ -4,32 +4,17 @@ import ( "fmt" "regexp" + "math/big" + "github.com/dymensionxyz/roller/cmd/consts" "github.com/dymensionxyz/roller/cmd/utils" "github.com/spf13/cobra" - "math/big" ) func addFlags(cmd *cobra.Command) { cmd.Flags().StringP(FlagNames.HubID, "", StagingHubID, fmt.Sprintf("The ID of the Dymension hub. %s", getAvailableHubsMessage())) cmd.Flags().StringP(FlagNames.RollappBinary, "", "", "The rollapp binary. Should be passed only if you built a custom rollapp") cmd.Flags().StringP(FlagNames.TokenSupply, "", "1000000000", "The total token supply of the RollApp") - - cmd.PreRunE = func(cmd *cobra.Command, args []string) error { - err := verifyHubID(cmd) - if err != nil { - return err - } - err = verifyTokenSupply(cmd) - if err != nil { - return err - } - rollappID := args[0] - if !validateRollAppID(rollappID) { - return fmt.Errorf("invalid RollApp ID '%s'. %s", rollappID, getValidRollappIdMessage()) - } - return nil - } } func getRollappBinaryPath(cmd *cobra.Command) string { @@ -61,9 +46,9 @@ func GetInitConfig(initCmd *cobra.Command, args []string) (utils.RollappConfig, }, nil } func getValidRollappIdMessage() string { - return "A valid RollApp ID should follow the format 'name_EIP155-version', where 'name' is made up of" + - " lowercase English letters, 'EIP155_version' is a 1 to 5 digit number representing the EIP155 rollapp ID, and '" + - "version' is a 1 to 5 digit number representing the version. For example: 'mars_9721_1'" + return "A valid RollApp ID should follow the format 'rollapp-name_EIP155-revision', where 'rollapp-name' is made up of" + + " lowercase English letters, 'EIP155-revision' is a 1 to 5 digit number representing the EIP155 rollapp ID, and '" + + "revision' is a 1 to 5 digit number representing the revision. For example: 'mars_9721-1'" } func getAvailableHubsMessage() string { diff --git a/cmd/config/init/genesis.go b/cmd/config/init/genesis.go index 940d6e4b..3a945ee1 100644 --- a/cmd/config/init/genesis.go +++ b/cmd/config/init/genesis.go @@ -2,17 +2,22 @@ package initconfig import ( "fmt" - "github.com/dymensionxyz/roller/cmd/consts" - "github.com/dymensionxyz/roller/cmd/utils" "io/ioutil" "math/big" + "github.com/dymensionxyz/roller/cmd/consts" + "github.com/dymensionxyz/roller/cmd/utils" + "os/exec" "path/filepath" "github.com/tidwall/sjson" ) +const ( + genesisTokenAmount = 1000000000 // 1 billion +) + func initializeRollappGenesis(initConfig utils.RollappConfig) error { totalTokenSupply, success := new(big.Int).SetString(initConfig.TokenSupply, 10) if !success { @@ -55,6 +60,7 @@ type PathValue struct { Value interface{} } +// FIXME: fix to support epochs func getDefaultGenesisParams(denom string) []PathValue { return []PathValue{ {"app_state.mint.params.mint_denom", denom}, diff --git a/cmd/config/init/init.go b/cmd/config/init/init.go index 045c031d..a5167488 100644 --- a/cmd/config/init/init.go +++ b/cmd/config/init/init.go @@ -1,16 +1,32 @@ package initconfig import ( + "fmt" + "os" + "github.com/dymensionxyz/roller/cmd/consts" "github.com/dymensionxyz/roller/cmd/utils" "github.com/spf13/cobra" - "os" ) func InitCmd() *cobra.Command { initCmd := &cobra.Command{ Use: "init ", Short: "Initialize a RollApp configuration on your local machine.", + PreRunE: func(cmd *cobra.Command, args []string) error { + hubID, err := cmd.Flags().GetString(FlagNames.HubID) + if err != nil { + return err + } + if _, ok := Hubs[hubID]; !ok { + return fmt.Errorf("invalid hub ID: %s. %s", hubID, getAvailableHubsMessage()) + } + rollappID := args[0] + if !validateRollAppID(rollappID) { + return fmt.Errorf("invalid RollApp ID '%s'. %s", rollappID, getValidRollappIdMessage()) + } + return nil + }, Run: func(cmd *cobra.Command, args []string) { initConfig, err := GetInitConfig(cmd, args) utils.PrettifyErrorIfExists(err) @@ -22,13 +38,15 @@ func InitCmd() *cobra.Command { utils.PrettifyErrorIfExists(err) if shouldOverwrite { utils.PrettifyErrorIfExists(os.RemoveAll(initConfig.Home)) - utils.PrettifyErrorIfExists(os.MkdirAll(initConfig.Home, 0755)) } else { os.Exit(0) } - } else { - utils.PrettifyErrorIfExists(os.MkdirAll(initConfig.Home, 0755)) } + utils.PrettifyErrorIfExists(os.MkdirAll(initConfig.Home, 0755)) + + //TODO: create all dirs here + + /* ---------------------------- Initilize relayer --------------------------- */ utils.PrettifyErrorIfExists(initializeRelayerConfig(ChainConfig{ ID: initConfig.RollappID, RPC: consts.DefaultRollappRPC, @@ -40,15 +58,23 @@ func InitCmd() *cobra.Command { Denom: consts.Denoms.Hub, AddressPrefix: consts.AddressPrefixes.Hub, }, initConfig)) + + /* ------------------------------ Generate keys ----------------------------- */ addresses, err := generateKeys(initConfig) utils.PrettifyErrorIfExists(err) + + /* ------------------------ Initialize DA light node ------------------------ */ utils.PrettifyErrorIfExists(initializeLightNodeConfig(initConfig)) daAddress, err := utils.GetCelestiaAddress(initConfig.Home) utils.PrettifyErrorIfExists(err) addresses[consts.KeyNames.DALightNode] = daAddress + + /* --------------------------- Initiailize Rollapp -------------------------- */ utils.PrettifyErrorIfExists(initializeRollappConfig(initConfig)) utils.PrettifyErrorIfExists(initializeRollappGenesis(initConfig)) utils.PrettifyErrorIfExists(utils.WriteConfigToTOML(initConfig)) + + /* ------------------------------ Print output ------------------------------ */ printInitOutput(addresses, initConfig.RollappID) }, Args: cobra.ExactArgs(2), diff --git a/cmd/config/init/keys.go b/cmd/config/init/keys.go index c9d25186..df956df4 100644 --- a/cmd/config/init/keys.go +++ b/cmd/config/init/keys.go @@ -46,13 +46,15 @@ func getSequencerKeysConfig() []utils.CreateKeyConfig { { Dir: consts.ConfigDirName.HubKeys, ID: consts.KeyNames.HubSequencer, - CoinType: consts.CoinTypes.Cosmos, + CoinType: consts.CoinTypes.EVM, + Algo: consts.AlgoTypes.Secp256k1, Prefix: consts.AddressPrefixes.Hub, }, { Dir: consts.ConfigDirName.Rollapp, ID: consts.KeyNames.RollappSequencer, CoinType: consts.CoinTypes.EVM, + Algo: consts.AlgoTypes.Ethsecp256k1, Prefix: consts.AddressPrefixes.Rollapp, }, } @@ -64,24 +66,22 @@ func getRelayerKeysConfig(rollappConfig utils.RollappConfig) map[string]utils.Cr Dir: path.Join(rollappConfig.Home, consts.ConfigDirName.Relayer), ID: consts.KeyNames.RollappRelayer, CoinType: consts.CoinTypes.EVM, + Algo: consts.AlgoTypes.Ethsecp256k1, Prefix: consts.AddressPrefixes.Rollapp, }, consts.KeyNames.HubRelayer: { Dir: path.Join(rollappConfig.Home, consts.ConfigDirName.Relayer), ID: consts.KeyNames.HubRelayer, - CoinType: consts.CoinTypes.Cosmos, + CoinType: consts.CoinTypes.EVM, + Algo: consts.AlgoTypes.Secp256k1, Prefix: consts.AddressPrefixes.Hub, }, } } func createAddressBinary(keyConfig utils.CreateKeyConfig, binaryPath string, home string) (string, error) { - args := []string{"keys", "add", keyConfig.ID, "--keyring-backend", "test", - "--keyring-dir", filepath.Join(home, keyConfig.Dir), "--output", "json"} - if binaryPath == consts.Executables.Dymension { - args = append(args, "--algo", "secp256k1") - } - createKeyCommand := exec.Command(binaryPath, args...) + createKeyCommand := exec.Command(binaryPath, "keys", "add", keyConfig.ID, "--keyring-backend", "test", + "--keyring-dir", filepath.Join(home, keyConfig.Dir), "--algo", keyConfig.Algo, "--output", "json") out, err := utils.ExecBashCommand(createKeyCommand) if err != nil { return "", err diff --git a/cmd/config/init/rollapp.go b/cmd/config/init/rollapp.go index 62a2b18a..ba9debab 100644 --- a/cmd/config/init/rollapp.go +++ b/cmd/config/init/rollapp.go @@ -1,11 +1,12 @@ package initconfig import ( - "github.com/dymensionxyz/roller/cmd/utils" "os" "os/exec" "path/filepath" + "github.com/dymensionxyz/roller/cmd/utils" + "github.com/dymensionxyz/roller/cmd/consts" toml "github.com/pelletier/go-toml" ) @@ -26,6 +27,7 @@ func initializeRollappConfig(initConfig utils.RollappConfig) error { } func setRollappAppConfig(appConfigFilePath string, denom string) error { + //FIXME: why error not checked? config, _ := toml.LoadFile(appConfigFilePath) config.Set("minimum-gas-prices", "0"+denom) config.Set("api.enable", "true") diff --git a/cmd/consts/consts.go b/cmd/consts/consts.go index d7cc6b70..d5594d12 100644 --- a/cmd/consts/consts.go +++ b/cmd/consts/consts.go @@ -66,6 +66,14 @@ var CoinTypes = struct { EVM: 60, } +var AlgoTypes = struct { + Secp256k1 string + Ethsecp256k1 string +}{ + Secp256k1: "secp256k1", + Ethsecp256k1: "ethsecp256k1", +} + var Denoms = struct { Hub string Celestia string diff --git a/cmd/sequencer/start/start.go b/cmd/sequencer/start/start.go index 85615040..97a746c1 100644 --- a/cmd/sequencer/start/start.go +++ b/cmd/sequencer/start/start.go @@ -47,9 +47,14 @@ var FlagNames = struct { func printOutput() { fmt.Println("💈 The Rollapp sequencer is running on your local machine!") + + //TODO: either mark the ports as default, or read from configuration file + fmt.Println("💈 EVM RPC: http://0.0.0.0:8545") fmt.Println("💈 Node RPC: http://0.0.0.0:26657") fmt.Println("💈 Rest API: http://0.0.0.0:1317") + + //TODO: print the log file path } func parseError(errMsg string) string { @@ -79,7 +84,7 @@ func GetStartRollappCmd(rollappConfig utils.RollappConfig, lightNodeEndpoint str "--dymint.namespace_id", "000000000000ffff", "--dymint.block_time", "0.2s", "--home", rollappConfigDir, - "--log_level", "debug", + "--log_level", "info", "--log-file", filepath.Join(rollappConfigDir, "rollapp.log"), "--max-log-size", "2000", "--module-log-level-override", "", diff --git a/cmd/utils/keys.go b/cmd/utils/keys.go index b673539b..6934c168 100644 --- a/cmd/utils/keys.go +++ b/cmd/utils/keys.go @@ -4,12 +4,13 @@ import ( "bytes" "encoding/json" "fmt" - "github.com/olekukonko/tablewriter" "os" "os/exec" "path/filepath" "strings" + "github.com/olekukonko/tablewriter" + "github.com/dymensionxyz/roller/cmd/consts" ) @@ -49,6 +50,7 @@ type CreateKeyConfig struct { Dir string ID string CoinType uint32 + Algo string Prefix string } From a55a9fd9a028317f57a5d520a02eda5c19e2a839 Mon Sep 17 00:00:00 2001 From: Michael Tsitrin Date: Wed, 28 Jun 2023 10:41:04 +0300 Subject: [PATCH 2/9] fixed chainID validation. fixed keys algo --- cmd/consts/consts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/consts/consts.go b/cmd/consts/consts.go index d5594d12..21e2d371 100644 --- a/cmd/consts/consts.go +++ b/cmd/consts/consts.go @@ -71,7 +71,7 @@ var AlgoTypes = struct { Ethsecp256k1 string }{ Secp256k1: "secp256k1", - Ethsecp256k1: "ethsecp256k1", + Ethsecp256k1: "eth_secp256k1", } var Denoms = struct { From 561a4af68dd9452472e7a32d68b787ed02a10942 Mon Sep 17 00:00:00 2001 From: Michael Tsitrin Date: Wed, 28 Jun 2023 11:16:22 +0300 Subject: [PATCH 3/9] fixed merge --- cmd/config/init/flags.go | 6 +++++- cmd/config/init/init.go | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cmd/config/init/flags.go b/cmd/config/init/flags.go index 21d597d7..7f1a174e 100644 --- a/cmd/config/init/flags.go +++ b/cmd/config/init/flags.go @@ -11,10 +11,14 @@ import ( "github.com/spf13/cobra" ) +const ( + defaultTokenSupply = "1000000000" +) + func addFlags(cmd *cobra.Command) { cmd.Flags().StringP(FlagNames.HubID, "", StagingHubID, fmt.Sprintf("The ID of the Dymension hub. %s", getAvailableHubsMessage())) cmd.Flags().StringP(FlagNames.RollappBinary, "", "", "The rollapp binary. Should be passed only if you built a custom rollapp") - cmd.Flags().StringP(FlagNames.TokenSupply, "", "1000000000", "The total token supply of the RollApp") + cmd.Flags().StringP(FlagNames.TokenSupply, "", defaultTokenSupply, "The total token supply of the RollApp") } func getRollappBinaryPath(cmd *cobra.Command) string { diff --git a/cmd/config/init/init.go b/cmd/config/init/init.go index a5167488..7077d469 100644 --- a/cmd/config/init/init.go +++ b/cmd/config/init/init.go @@ -14,12 +14,13 @@ func InitCmd() *cobra.Command { Use: "init ", Short: "Initialize a RollApp configuration on your local machine.", PreRunE: func(cmd *cobra.Command, args []string) error { - hubID, err := cmd.Flags().GetString(FlagNames.HubID) + err := verifyHubID(cmd) if err != nil { return err } - if _, ok := Hubs[hubID]; !ok { - return fmt.Errorf("invalid hub ID: %s. %s", hubID, getAvailableHubsMessage()) + err = verifyTokenSupply(cmd) + if err != nil { + return err } rollappID := args[0] if !validateRollAppID(rollappID) { From 35e0b811098f9a8f452ebd7aeadcf1027c574edb Mon Sep 17 00:00:00 2001 From: Michael Tsitrin Date: Wed, 28 Jun 2023 13:20:34 +0300 Subject: [PATCH 4/9] fixes in relayer start --- cmd/config/init/keys.go | 4 ++-- cmd/relayer/start/create_ibc_channel.go | 9 +++++---- cmd/sequencer/start/start.go | 27 +++++++++++-------------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/cmd/config/init/keys.go b/cmd/config/init/keys.go index df956df4..79d650ab 100644 --- a/cmd/config/init/keys.go +++ b/cmd/config/init/keys.go @@ -72,7 +72,7 @@ func getRelayerKeysConfig(rollappConfig utils.RollappConfig) map[string]utils.Cr consts.KeyNames.HubRelayer: { Dir: path.Join(rollappConfig.Home, consts.ConfigDirName.Relayer), ID: consts.KeyNames.HubRelayer, - CoinType: consts.CoinTypes.EVM, + CoinType: consts.CoinTypes.Cosmos, Algo: consts.AlgoTypes.Secp256k1, Prefix: consts.AddressPrefixes.Hub, }, @@ -118,7 +118,7 @@ func generateRelayerKeys(rollappConfig utils.RollappConfig) (map[string]string, func getAddRlyKeyCmd(keyConfig utils.CreateKeyConfig, chainID string) *exec.Cmd { return exec.Command( consts.Executables.Relayer, - consts.KeysDirName, + "keys", "add", chainID, keyConfig.ID, diff --git a/cmd/relayer/start/create_ibc_channel.go b/cmd/relayer/start/create_ibc_channel.go index 05578712..f07d7624 100644 --- a/cmd/relayer/start/create_ibc_channel.go +++ b/cmd/relayer/start/create_ibc_channel.go @@ -2,10 +2,11 @@ package start import ( "fmt" - "github.com/dymensionxyz/roller/cmd/consts" - "github.com/dymensionxyz/roller/cmd/utils" "os/exec" "path/filepath" + + "github.com/dymensionxyz/roller/cmd/consts" + "github.com/dymensionxyz/roller/cmd/utils" ) // Creates an IBC channel between the hub and the client, and return the source channel ID. @@ -47,7 +48,7 @@ func createIBCChannelIfNeeded(rollappConfig utils.RollappConfig, logFileOption u func getCreateChannelCmd(config utils.RollappConfig) *exec.Cmd { defaultRlyArgs := getRelayerDefaultArgs(config) - args := []string{"tx", "channel", "--override"} + args := []string{"tx", "channel"} args = append(args, defaultRlyArgs...) return exec.Command(consts.Executables.Relayer, args...) } @@ -65,7 +66,7 @@ func getRelayerDefaultArgs(config utils.RollappConfig) []string { func getCreateConnectionCmd(config utils.RollappConfig) *exec.Cmd { defaultRlyArgs := getRelayerDefaultArgs(config) - args := []string{"tx", "connection"} + args := []string{"tx", "connection", "-t", "300s"} args = append(args, defaultRlyArgs...) return exec.Command(consts.Executables.Relayer, args...) } diff --git a/cmd/sequencer/start/start.go b/cmd/sequencer/start/start.go index 97a746c1..67019992 100644 --- a/cmd/sequencer/start/start.go +++ b/cmd/sequencer/start/start.go @@ -66,33 +66,30 @@ func parseError(errMsg string) string { } func GetStartRollappCmd(rollappConfig utils.RollappConfig, lightNodeEndpoint string) *exec.Cmd { - daConfig := fmt.Sprintf(`{"base_url": "%s", "timeout": 60000000000, "fee":20000, "gas_limit": 20000000, "namespace_id":[0,0,0,0,0,0,255,255]}`, - lightNodeEndpoint) + // daConfig := fmt.Sprintf(`{"base_url": "%s", "timeout": 60000000000, "fee":20000, "gas_limit": 20000000, "namespace_id":"000000000000ffff"}`, + // lightNodeEndpoint) rollappConfigDir := filepath.Join(rollappConfig.Home, consts.ConfigDirName.Rollapp) hubKeysDir := filepath.Join(rollappConfig.Home, consts.ConfigDirName.HubKeys) cmd := exec.Command( rollappConfig.RollappBinary, "start", - "--dymint.aggregator", - "--json-rpc.enable", - "--json-rpc.api", "eth,txpool,personal,net,debug,web3,miner", - "--dymint.da_layer", "celestia", - "--dymint.da_config", daConfig, + "--dymint.da_layer", "mock", "--dymint.settlement_layer", "dymension", - // TODO: 600 - "--dymint.block_batch_size", "50", + "--dymint.block_batch_size", "500", "--dymint.namespace_id", "000000000000ffff", "--dymint.block_time", "0.2s", - "--home", rollappConfigDir, - "--log_level", "info", - "--log-file", filepath.Join(rollappConfigDir, "rollapp.log"), - "--max-log-size", "2000", - "--module-log-level-override", "", + "--dymint.batch_submit_max_time", "15s", + "--dymint.empty_blocks_max_time", "5s", + "--dymint.settlement_config.rollapp_id", rollappConfig.RollappID, "--dymint.settlement_config.node_address", rollappConfig.HubData.RPC_URL, "--dymint.settlement_config.dym_account_name", consts.KeyNames.HubSequencer, "--dymint.settlement_config.keyring_home_dir", hubKeysDir, - "--dymint.settlement_config.gas_fees", "0udym", "--dymint.settlement_config.gas_prices", "0udym", + "--home", rollappConfigDir, + "--log_level", "debug", + "--max-log-size", "2000", ) + + fmt.Println(cmd.String()) return cmd } From 458696d87082568c150009b6093c2f5fe753da5b Mon Sep 17 00:00:00 2001 From: Michael Tsitrin Date: Wed, 28 Jun 2023 13:44:58 +0300 Subject: [PATCH 5/9] added reference to roller github issues --- cmd/config/init/consts.go | 2 +- cmd/config/init/genesis.go | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cmd/config/init/consts.go b/cmd/config/init/consts.go index eb585c45..974cd871 100644 --- a/cmd/config/init/consts.go +++ b/cmd/config/init/consts.go @@ -17,7 +17,7 @@ const ( LocalHubID = "local" ) -// TODO: The avaialble hub networks should be read from YAML file +// TODO(#112): The avaialble hub networks should be read from YAML file var Hubs = map[string]utils.HubData{ StagingHubID: { API_URL: "https://rest-hub-devnet.dymension.xyz", diff --git a/cmd/config/init/genesis.go b/cmd/config/init/genesis.go index 3a945ee1..18ab689b 100644 --- a/cmd/config/init/genesis.go +++ b/cmd/config/init/genesis.go @@ -14,10 +14,6 @@ import ( "github.com/tidwall/sjson" ) -const ( - genesisTokenAmount = 1000000000 // 1 billion -) - func initializeRollappGenesis(initConfig utils.RollappConfig) error { totalTokenSupply, success := new(big.Int).SetString(initConfig.TokenSupply, 10) if !success { @@ -60,7 +56,7 @@ type PathValue struct { Value interface{} } -// FIXME: fix to support epochs +// TODO(#130): fix to support epochs func getDefaultGenesisParams(denom string) []PathValue { return []PathValue{ {"app_state.mint.params.mint_denom", denom}, From 4839f2590ae2087c447d35a76439cff78d10aa98 Mon Sep 17 00:00:00 2001 From: Michael Tsitrin Date: Wed, 28 Jun 2023 14:57:14 +0300 Subject: [PATCH 6/9] using celestia --- cmd/sequencer/start/start.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/sequencer/start/start.go b/cmd/sequencer/start/start.go index 2e799fd8..d5fc67a4 100644 --- a/cmd/sequencer/start/start.go +++ b/cmd/sequencer/start/start.go @@ -66,14 +66,15 @@ func parseError(errMsg string) string { } func GetStartRollappCmd(rollappConfig utils.RollappConfig, lightNodeEndpoint string) *exec.Cmd { - // daConfig := fmt.Sprintf(`{"base_url": "%s", "timeout": 60000000000, "fee":20000, "gas_limit": 20000000, "namespace_id":"000000000000ffff"}`, - // lightNodeEndpoint) + daConfig := fmt.Sprintf(`{"base_url": "%s", "timeout": 60000000000, "fee":20000, "gas_limit": 20000000, "namespace_id":"000000000000ffff"}`, + lightNodeEndpoint) rollappConfigDir := filepath.Join(rollappConfig.Home, consts.ConfigDirName.Rollapp) hubKeysDir := filepath.Join(rollappConfig.Home, consts.ConfigDirName.HubKeys) cmd := exec.Command( rollappConfig.RollappBinary, "start", - "--dymint.da_layer", "mock", + "--dymint.da_layer", "celestia", + "--dymint.da_config", daConfig, "--dymint.settlement_layer", "dymension", "--dymint.block_batch_size", "500", "--dymint.namespace_id", "000000000000ffff", From d324b1dace3e8d2a1494d0fa400eda8d2172921a Mon Sep 17 00:00:00 2001 From: Michael Tsitrin Date: Wed, 28 Jun 2023 15:52:45 +0300 Subject: [PATCH 7/9] modified start values: --- cmd/sequencer/start/start.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/sequencer/start/start.go b/cmd/sequencer/start/start.go index d5fc67a4..c6a87bdb 100644 --- a/cmd/sequencer/start/start.go +++ b/cmd/sequencer/start/start.go @@ -79,15 +79,15 @@ func GetStartRollappCmd(rollappConfig utils.RollappConfig, lightNodeEndpoint str "--dymint.block_batch_size", "500", "--dymint.namespace_id", "000000000000ffff", "--dymint.block_time", "0.2s", - "--dymint.batch_submit_max_time", "15s", - "--dymint.empty_blocks_max_time", "5s", + "--dymint.batch_submit_max_time", "100s", + "--dymint.empty_blocks_max_time", "10s", "--dymint.settlement_config.rollapp_id", rollappConfig.RollappID, "--dymint.settlement_config.node_address", rollappConfig.HubData.RPC_URL, "--dymint.settlement_config.dym_account_name", consts.KeysIds.HubSequencer, "--dymint.settlement_config.keyring_home_dir", hubKeysDir, "--dymint.settlement_config.gas_prices", "0udym", "--home", rollappConfigDir, - "--log_level", "debug", + "--log_level", "info", "--max-log-size", "2000", ) From 2c1164e18bc1fc4f24ca73b0d74d531c4286ffcb Mon Sep 17 00:00:00 2001 From: Michael Tsitrin Date: Wed, 28 Jun 2023 16:34:35 +0300 Subject: [PATCH 8/9] added back the override flag by default --- cmd/relayer/start/create_ibc_channel.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/relayer/start/create_ibc_channel.go b/cmd/relayer/start/create_ibc_channel.go index f07d7624..a53de417 100644 --- a/cmd/relayer/start/create_ibc_channel.go +++ b/cmd/relayer/start/create_ibc_channel.go @@ -48,7 +48,7 @@ func createIBCChannelIfNeeded(rollappConfig utils.RollappConfig, logFileOption u func getCreateChannelCmd(config utils.RollappConfig) *exec.Cmd { defaultRlyArgs := getRelayerDefaultArgs(config) - args := []string{"tx", "channel"} + args := []string{"tx", "channel", "--override"} args = append(args, defaultRlyArgs...) return exec.Command(consts.Executables.Relayer, args...) } From ece0174ce2da1cdc200b5af4b2165ec9aa8dc956 Mon Sep 17 00:00:00 2001 From: Michael Tsitrin Date: Wed, 28 Jun 2023 17:00:45 +0300 Subject: [PATCH 9/9] increased timout for IBC channel creation --- cmd/relayer/start/create_ibc_channel.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/relayer/start/create_ibc_channel.go b/cmd/relayer/start/create_ibc_channel.go index a53de417..2aa02fe4 100644 --- a/cmd/relayer/start/create_ibc_channel.go +++ b/cmd/relayer/start/create_ibc_channel.go @@ -48,7 +48,7 @@ func createIBCChannelIfNeeded(rollappConfig utils.RollappConfig, logFileOption u func getCreateChannelCmd(config utils.RollappConfig) *exec.Cmd { defaultRlyArgs := getRelayerDefaultArgs(config) - args := []string{"tx", "channel", "--override"} + args := []string{"tx", "channel", "-t", "300s", "--override"} args = append(args, defaultRlyArgs...) return exec.Command(consts.Executables.Relayer, args...) }