diff --git a/CHANGELOG.md b/CHANGELOG.md index b4a2816c3bc..b64d68e7803 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,6 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#7768](https://github.com/osmosis-labs/osmosis/pull/7768) Allow governance module account to transfer any CL position * [#7746](https://github.com/osmosis-labs/osmosis/pull/7746) Make forfeited incentives redeposit into the pool instead of sending to community pool * [#7785](https://github.com/osmosis-labs/osmosis/pull/7785) Remove reward claiming during position transfers +* [#7833](https://github.com/osmosis-labs/osmosis/pull/7883) Bump max gas wanted per tx to 6 mil * [#7839](https://github.com/osmosis-labs/osmosis/pull/7839) Add ICA controller * [#7527](https://github.com/osmosis-labs/osmosis/pull/7527) Add 30M gas limit to CW pool contract calls diff --git a/cmd/osmosisd/cmd/root.go b/cmd/osmosisd/cmd/root.go index c6316517c91..8bdbed86ed2 100644 --- a/cmd/osmosisd/cmd/root.go +++ b/cmd/osmosisd/cmd/root.go @@ -100,10 +100,13 @@ type DenomUnitMap struct { } const ( - mempoolConfigName = "osmosis-mempool" - arbitrageMinGasFeeConfigName = "arbitrage-min-gas-fee" - oldArbitrageMinGasFeeValue = ".005" - newArbitrageMinGasFeeValue = "0.1" + mempoolConfigName = "osmosis-mempool" + + arbitrageMinGasFeeConfigName = "arbitrage-min-gas-fee" + recommendedNewArbitrageMinGasFeeValue = "0.1" + + maxGasWantedPerTxName = "max-gas-wanted-per-tx" + recommendedNewMaxGasWantedPerTxValue = "60000000" consensusConfigName = "consensus" timeoutCommitConfigName = "timeout_commit" @@ -504,55 +507,50 @@ func overwriteAppTomlValues(serverCtx *server.Context) error { } else { // app.toml exists - // Get setting - currentArbitrageMinGasFeeValue := serverCtx.Viper.Get(mempoolConfigName + "." + arbitrageMinGasFeeConfigName) + // Set new values in viper + serverCtx.Viper.Set(mempoolConfigName+"."+maxGasWantedPerTxName, recommendedNewMaxGasWantedPerTxValue) + serverCtx.Viper.Set(mempoolConfigName+"."+arbitrageMinGasFeeConfigName, recommendedNewArbitrageMinGasFeeValue) - // .x format at 0.x format are both valid. - if currentArbitrageMinGasFeeValue == oldArbitrageMinGasFeeValue || currentArbitrageMinGasFeeValue == "0"+oldArbitrageMinGasFeeValue { - // Set new value in viper - serverCtx.Viper.Set(mempoolConfigName+"."+arbitrageMinGasFeeConfigName, newArbitrageMinGasFeeValue) + defer func() { + if err := recover(); err != nil { + fmt.Printf("failed to write to %s: %s\n", configFilePath, err) + } + }() - defer func() { - if err := recover(); err != nil { - fmt.Printf("failed to write to %s: %s\n", configFilePath, err) - } - }() - - // Check if the file is writable - if fileInfo.Mode()&os.FileMode(0200) != 0 { - // Read the entire content of the file - content, err := os.ReadFile(configFilePath) - if err != nil { - return err - } + // Check if the file is writable + if fileInfo.Mode()&os.FileMode(0200) != 0 { + // Read the entire content of the file + content, err := os.ReadFile(configFilePath) + if err != nil { + return err + } - // Convert the content to a string - fileContent := string(content) + // Convert the content to a string + fileContent := string(content) - // Find the index of the search line - index := strings.Index(fileContent, arbitrageMinGasFeeConfigName) - if index == -1 { - return fmt.Errorf("search line not found in the file") - } + // Find the index of the search line + index := strings.Index(fileContent, arbitrageMinGasFeeConfigName) + if index == -1 { + return fmt.Errorf("search line not found in the file") + } - // Find the opening and closing quotes - openQuoteIndex := strings.Index(fileContent[index:], "\"") - openQuoteIndex += index + // Find the opening and closing quotes + openQuoteIndex := strings.Index(fileContent[index:], "\"") + openQuoteIndex += index - closingQuoteIndex := strings.Index(fileContent[openQuoteIndex+1:], "\"") - closingQuoteIndex += openQuoteIndex + 1 + closingQuoteIndex := strings.Index(fileContent[openQuoteIndex+1:], "\"") + closingQuoteIndex += openQuoteIndex + 1 - // Replace the old value with the new value - newFileContent := fileContent[:openQuoteIndex+1] + newArbitrageMinGasFeeValue + fileContent[closingQuoteIndex:] + // Replace the old value with the new value + newFileContent := fileContent[:openQuoteIndex+1] + recommendedNewArbitrageMinGasFeeValue + fileContent[closingQuoteIndex:] - // Write the modified content back to the file - err = os.WriteFile(configFilePath, []byte(newFileContent), 0644) - if err != nil { - return err - } - } else { - fmt.Println("app.toml is not writable. Cannot apply update. Please consder manually changing arbitrage-min-gas-fee to " + newArbitrageMinGasFeeValue) + // Write the modified content back to the file + err = os.WriteFile(configFilePath, []byte(newFileContent), 0644) + if err != nil { + return err } + } else { + fmt.Println("app.toml is not writable. Cannot apply update. Please consder manually changing arbitrage-min-gas-fee to " + recommendedNewArbitrageMinGasFeeValue + "and max-gas-wanted-per-tx to " + recommendedNewMaxGasWantedPerTxValue) } } return nil @@ -614,7 +612,7 @@ func initAppConfig() (string, interface{}) { [osmosis-mempool] # This is the max allowed gas any tx. # This is only for local mempool purposes, and thus is only ran on check tx. -max-gas-wanted-per-tx = "25000000" +max-gas-wanted-per-tx = "60000000" # This is the minimum gas fee any arbitrage tx should have, denominated in uosmo per gas # Default value of ".1" then means that a tx with 1 million gas costs (.1 uosmo/gas) * 1_000_000 gas = .1 osmo