From 16d01d21eb7d22872b2896417786a97917a4c138 Mon Sep 17 00:00:00 2001 From: Inon Man <121477599+inon-man@users.noreply.github.com> Date: Wed, 13 Sep 2023 17:17:43 +0900 Subject: [PATCH 1/3] use tm-db(goleveldb) with 32768 max open file option add "prune" and "snapshots" command --- cmd/terrad/root.go | 8 +++++--- go.mod | 5 +++-- go.sum | 12 ++++++------ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/cmd/terrad/root.go b/cmd/terrad/root.go index 9bfbf999f..9a7f3835a 100644 --- a/cmd/terrad/root.go +++ b/cmd/terrad/root.go @@ -18,7 +18,9 @@ import ( "github.com/cosmos/cosmos-sdk/client/debug" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/keys" + "github.com/cosmos/cosmos-sdk/client/pruning" "github.com/cosmos/cosmos-sdk/client/rpc" + "github.com/cosmos/cosmos-sdk/client/snapshot" "github.com/cosmos/cosmos-sdk/server" servertypes "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/snapshots" @@ -113,8 +115,7 @@ func initTendermintConfig() *tmcfg.Config { } func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { - // TODO check gaia before make release candidate - // authclient.Codec = encodingConfig.Marshaler + a := appCreator{encodingConfig} rootCmd.AddCommand( genutilcli.InitCmd(terraapp.ModuleBasics, terraapp.DefaultNodeHome), @@ -126,9 +127,10 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { tmcli.NewCompletionCmd(rootCmd, true), testnetCmd(terraapp.ModuleBasics, banktypes.GenesisBalancesIterator{}), debug.Cmd(), + pruning.Cmd(a.newApp, terraapp.DefaultNodeHome), + snapshot.Cmd(a.newApp), ) - a := appCreator{encodingConfig} server.AddCommands(rootCmd, terraapp.DefaultNodeHome, a.newApp, a.appExport, addModuleInitFlags) // add keybase, auxiliary RPC, query, and tx child commands diff --git a/go.mod b/go.mod index be506023b..ecb77769b 100644 --- a/go.mod +++ b/go.mod @@ -58,7 +58,7 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-alpha8 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect - github.com/cosmos/iavl v0.19.6 // indirect + github.com/cosmos/iavl v0.19.7 // indirect github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect github.com/cosmos/ledger-go v0.9.2 // indirect github.com/creachadair/taskgroup v0.3.2 // indirect @@ -187,6 +187,7 @@ replace ( replace ( github.com/CosmWasm/wasmd => github.com/classic-terra/wasmd v0.30.0-terra.3 github.com/CosmWasm/wasmvm => github.com/classic-terra/wasmvm v1.1.1-terra.1 - github.com/cosmos/cosmos-sdk => github.com/classic-terra/cosmos-sdk v0.46.14-terra.2 + github.com/cosmos/cosmos-sdk => github.com/classic-terra/cosmos-sdk v0.46.15-0.20230913080045-7da3cc5fd2e9 github.com/cosmos/ledger-cosmos-go => github.com/terra-money/ledger-terra-go v0.11.2 + github.com/tendermint/tm-db => github.com/terra-money/tm-db v0.6.7-performance.3 ) diff --git a/go.sum b/go.sum index 52e968c75..ab6a73b0a 100644 --- a/go.sum +++ b/go.sum @@ -333,8 +333,8 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/classic-terra/cometbft v0.34.29-terra.0 h1:HnRGt7tijI2n5zSVrg/xh1mYYm4Gb4QFlknq+dRP8Jw= github.com/classic-terra/cometbft v0.34.29-terra.0/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= -github.com/classic-terra/cosmos-sdk v0.46.14-terra.2 h1:TRuTbrbBMYOFg59G0WHjvIGu9Daf3gO6PoghlLAFQd0= -github.com/classic-terra/cosmos-sdk v0.46.14-terra.2/go.mod h1:tx+Rr8Fob/HQ8iErtht7Rddu1FrMg2KBQl9anicuxsQ= +github.com/classic-terra/cosmos-sdk v0.46.15-0.20230913080045-7da3cc5fd2e9 h1:ZqJ59QwUKe27qjjtwVWBEy94fAAGxw+pVdHxi7ey3ao= +github.com/classic-terra/cosmos-sdk v0.46.15-0.20230913080045-7da3cc5fd2e9/go.mod h1:3VKRzlOtvuqZA29wRqdx6rPsJmYhvxjJyc3tvQWpjf4= github.com/classic-terra/wasmd v0.30.0-terra.3 h1:qruhiaAIRl14UVtHzfh81pr0YmW94QE4+hqivIi9AYg= github.com/classic-terra/wasmd v0.30.0-terra.3/go.mod h1:Ug607EsX+EkW3/xOFaP56kZA7WklN+ZrwUEsaJ22xH0= github.com/classic-terra/wasmvm v1.1.1-terra.1 h1:qGozlXFlM/3ossnlABwODJr7bEHUdF/nug8Z3c1Dr84= @@ -384,8 +384,8 @@ github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= -github.com/cosmos/iavl v0.19.6 h1:XY78yEeNPrEYyNCKlqr9chrwoeSDJ0bV2VjocTk//OU= -github.com/cosmos/iavl v0.19.6/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= +github.com/cosmos/iavl v0.19.7 h1:ij32FaEnwxfEurtK0QKDNhTWFnz6NUmrI5gky/WnoY0= +github.com/cosmos/iavl v0.19.7/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= github.com/cosmos/ibc-go/v6 v6.2.0 h1:HKS5WNxQrlmjowHb73J9LqlNJfvTnvkbhXZ9QzNTU7Q= github.com/cosmos/ibc-go/v6 v6.2.0/go.mod h1:+S3sxcNwOhgraYDJAhIFDg5ipXHaUnJrg7tOQqGyWlc= github.com/cosmos/interchain-accounts v0.4.3 h1:WedxEa/Hj/2GY7AF6CafkEPJ/Z9rhl3rT1mRwNHsdts= @@ -1108,10 +1108,10 @@ github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzH 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/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= -github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= github.com/terra-money/ledger-terra-go v0.11.2 h1:BVXZl+OhJOri6vFNjjVaTabRLApw9MuG7mxWL4V718c= github.com/terra-money/ledger-terra-go v0.11.2/go.mod h1:ClJ2XMj1ptcnONzKH+GhVPi7Y8pXIT+UzJ0TNt0tfZE= +github.com/terra-money/tm-db v0.6.7-performance.3 h1:7d2lsU67QNwIPcsqaEzGJe1jpQEFIWpXdH3yCRwdx38= +github.com/terra-money/tm-db v0.6.7-performance.3/go.mod h1:K6twQf1PGDxC6K6V+G2l0nrYsQAxsypb4PpbJnyzwJw= github.com/tidwall/btree v1.5.0 h1:iV0yVY/frd7r6qGBXfEYs7DH0gTDgrKTrDjS7xt/IyQ= github.com/tidwall/btree v1.5.0/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE= github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= From ae1bdac29b867b0fb678d34ae66eff4c09e415c9 Mon Sep 17 00:00:00 2001 From: Inon Man <121477599+inon-man@users.noreply.github.com> Date: Fri, 15 Sep 2023 07:40:07 +0900 Subject: [PATCH 2/3] dep: replace goleveldb to optimized one --- go.mod | 8 ++++---- go.sum | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index ecb77769b..b519f2715 100644 --- a/go.mod +++ b/go.mod @@ -178,10 +178,6 @@ replace ( github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/jhump/protoreflect => github.com/jhump/protoreflect v1.9.0 - // replace broken goleveldb. - github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - // use cometbft - github.com/tendermint/tendermint => github.com/classic-terra/cometbft v0.34.29-terra.0 ) replace ( @@ -189,5 +185,9 @@ replace ( github.com/CosmWasm/wasmvm => github.com/classic-terra/wasmvm v1.1.1-terra.1 github.com/cosmos/cosmos-sdk => github.com/classic-terra/cosmos-sdk v0.46.15-0.20230913080045-7da3cc5fd2e9 github.com/cosmos/ledger-cosmos-go => github.com/terra-money/ledger-terra-go v0.11.2 + // replace goleveldb to optimized one + github.com/syndtr/goleveldb => github.com/classic-terra/goleveldb v0.0.0-20230914223247-2b28f6655121 + // use cometbft + github.com/tendermint/tendermint => github.com/classic-terra/cometbft v0.34.29-terra.0 github.com/tendermint/tm-db => github.com/terra-money/tm-db v0.6.7-performance.3 ) diff --git a/go.sum b/go.sum index ab6a73b0a..26b828d43 100644 --- a/go.sum +++ b/go.sum @@ -335,6 +335,8 @@ github.com/classic-terra/cometbft v0.34.29-terra.0 h1:HnRGt7tijI2n5zSVrg/xh1mYYm github.com/classic-terra/cometbft v0.34.29-terra.0/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= github.com/classic-terra/cosmos-sdk v0.46.15-0.20230913080045-7da3cc5fd2e9 h1:ZqJ59QwUKe27qjjtwVWBEy94fAAGxw+pVdHxi7ey3ao= github.com/classic-terra/cosmos-sdk v0.46.15-0.20230913080045-7da3cc5fd2e9/go.mod h1:3VKRzlOtvuqZA29wRqdx6rPsJmYhvxjJyc3tvQWpjf4= +github.com/classic-terra/goleveldb v0.0.0-20230914223247-2b28f6655121 h1:fjpWDB0hm225wYg9vunyDyTH8ftd5xEUgINJKidj+Tw= +github.com/classic-terra/goleveldb v0.0.0-20230914223247-2b28f6655121/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/classic-terra/wasmd v0.30.0-terra.3 h1:qruhiaAIRl14UVtHzfh81pr0YmW94QE4+hqivIi9AYg= github.com/classic-terra/wasmd v0.30.0-terra.3/go.mod h1:Ug607EsX+EkW3/xOFaP56kZA7WklN+ZrwUEsaJ22xH0= github.com/classic-terra/wasmvm v1.1.1-terra.1 h1:qGozlXFlM/3ossnlABwODJr7bEHUdF/nug8Z3c1Dr84= @@ -1102,8 +1104,6 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= 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= From 5daf01de6f721a1f06443792f64b901eb966f721 Mon Sep 17 00:00:00 2001 From: Inon Man <121477599+inon-man@users.noreply.github.com> Date: Fri, 15 Sep 2023 09:40:20 +0900 Subject: [PATCH 3/3] update cosmos-sdk --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b519f2715..c1063b284 100644 --- a/go.mod +++ b/go.mod @@ -183,7 +183,7 @@ replace ( replace ( github.com/CosmWasm/wasmd => github.com/classic-terra/wasmd v0.30.0-terra.3 github.com/CosmWasm/wasmvm => github.com/classic-terra/wasmvm v1.1.1-terra.1 - github.com/cosmos/cosmos-sdk => github.com/classic-terra/cosmos-sdk v0.46.15-0.20230913080045-7da3cc5fd2e9 + github.com/cosmos/cosmos-sdk => github.com/classic-terra/cosmos-sdk v0.46.15-0.20230915003402-dee6498fe95d github.com/cosmos/ledger-cosmos-go => github.com/terra-money/ledger-terra-go v0.11.2 // replace goleveldb to optimized one github.com/syndtr/goleveldb => github.com/classic-terra/goleveldb v0.0.0-20230914223247-2b28f6655121 diff --git a/go.sum b/go.sum index 26b828d43..c4ef6ba49 100644 --- a/go.sum +++ b/go.sum @@ -333,8 +333,8 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/classic-terra/cometbft v0.34.29-terra.0 h1:HnRGt7tijI2n5zSVrg/xh1mYYm4Gb4QFlknq+dRP8Jw= github.com/classic-terra/cometbft v0.34.29-terra.0/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= -github.com/classic-terra/cosmos-sdk v0.46.15-0.20230913080045-7da3cc5fd2e9 h1:ZqJ59QwUKe27qjjtwVWBEy94fAAGxw+pVdHxi7ey3ao= -github.com/classic-terra/cosmos-sdk v0.46.15-0.20230913080045-7da3cc5fd2e9/go.mod h1:3VKRzlOtvuqZA29wRqdx6rPsJmYhvxjJyc3tvQWpjf4= +github.com/classic-terra/cosmos-sdk v0.46.15-0.20230915003402-dee6498fe95d h1:zUeCxkg1PHQdeaKZXnSlIIzon0Bxs7vE5KAdINapC8U= +github.com/classic-terra/cosmos-sdk v0.46.15-0.20230915003402-dee6498fe95d/go.mod h1:3VKRzlOtvuqZA29wRqdx6rPsJmYhvxjJyc3tvQWpjf4= github.com/classic-terra/goleveldb v0.0.0-20230914223247-2b28f6655121 h1:fjpWDB0hm225wYg9vunyDyTH8ftd5xEUgINJKidj+Tw= github.com/classic-terra/goleveldb v0.0.0-20230914223247-2b28f6655121/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/classic-terra/wasmd v0.30.0-terra.3 h1:qruhiaAIRl14UVtHzfh81pr0YmW94QE4+hqivIi9AYg=