From fc6c44239336e67832a38a17273a541fad5f435a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Nov 2023 18:40:33 +0100 Subject: [PATCH 1/6] update go mod --- go.mod | 2 ++ go.sum | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index c0b06a12..d11d1b22 100644 --- a/go.mod +++ b/go.mod @@ -303,6 +303,8 @@ require ( replace ( // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 + + github.com/cosmos/cosmos-sdk => ../cosmos-sdk-faulty github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 // use cosmos-compatible protobufs diff --git a/go.sum b/go.sum index 8e57bd85..9370e49f 100644 --- a/go.sum +++ b/go.sum @@ -412,8 +412,6 @@ 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.1 h1:iDL5qh++NoXxG8hSy93FdYJut4XfgbShIocllGaXx/0= github.com/cosmos/cosmos-proto v1.0.0-beta.1/go.mod h1:8k2GNZghi5sDRFw/scPL8gMSowT1vDA+5ouxL8GjaUE= -github.com/cosmos/cosmos-sdk v0.46.14 h1:xlrUaMZT6QACdtWputs+ZxbAMWGYktWK+zlc8J4tKoE= -github.com/cosmos/cosmos-sdk v0.46.14/go.mod h1:9MRixWsgoJ2UmVsCRRePtENFPP3cM+gTC5azEpxgllo= 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= From c7ee57a390211eb4eaa044dcb563e6766738c7b7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Nov 2023 20:01:15 +0100 Subject: [PATCH 2/6] add update handler --- app/upgrades/v3/consts.go | 23 +++++++++++++++++++++++ app/upgrades/v3/upgrades.go | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 app/upgrades/v3/consts.go create mode 100644 app/upgrades/v3/upgrades.go diff --git a/app/upgrades/v3/consts.go b/app/upgrades/v3/consts.go new file mode 100644 index 00000000..e2134b10 --- /dev/null +++ b/app/upgrades/v3/consts.go @@ -0,0 +1,23 @@ +package v3 + +import ( + store "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/x/group" + ibcfeetypes "github.com/cosmos/ibc-go/v5/modules/apps/29-fee/types" + "github.com/sge-network/sge/app/upgrades" +) + +// UpgradeName defines the on-chain upgrade name for the v1.1.2 upgrade. +const UpgradeName = "v1.1.2" + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{ + group.ModuleName, + ibcfeetypes.StoreKey, + }, + Deleted: []string{}, + }, +} diff --git a/app/upgrades/v3/upgrades.go b/app/upgrades/v3/upgrades.go new file mode 100644 index 00000000..4cdd6323 --- /dev/null +++ b/app/upgrades/v3/upgrades.go @@ -0,0 +1,33 @@ +package v3 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + "github.com/sge-network/sge/app/keepers" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + depositParams := keepers.GovKeeper.GetDepositParams(ctx) + depositParams.MinExpeditedDeposit = sdk.NewCoins(sdk.NewCoin("sge", v1.DefaultMinExpeditedDepositTokens)) + keepers.GovKeeper.SetDepositParams(ctx, depositParams) + + tallyParams := keepers.GovKeeper.GetTallyParams(ctx) + tallyParams.ExpeditedThreshold = v1.DefaultExpeditedThreshold.String() + tallyParams.ExpeditedQuorum = v1.DefaultExpeditedQuorum.String() + keepers.GovKeeper.SetTallyParams(ctx, tallyParams) + + votingParams := keepers.GovKeeper.GetVotingParams(ctx) + expeditedPeriod := v1.DefaultExpeditedPeriod + votingParams.ExpeditedVotingPeriod = &expeditedPeriod + keepers.GovKeeper.SetVotingParams(ctx, votingParams) + + return mm.RunMigrations(ctx, configurator, fromVM) + } +} From a2813dc2b3e76b2e693b8e3fac01b3f3a83f5c59 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Nov 2023 20:16:09 +0100 Subject: [PATCH 3/6] add upgrade into app --- app/app.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/app.go b/app/app.go index 2c8f98a3..3591f6f2 100644 --- a/app/app.go +++ b/app/app.go @@ -2,6 +2,7 @@ package app import ( "fmt" + v3 "github.com/sge-network/sge/app/upgrades/v3" "io" "net/http" "os" @@ -70,6 +71,7 @@ var ( Upgrades = []upgrades.Upgrade{ v1.Upgrade, v2.Upgrade, + v3.Upgrade, } ) From a11dc65dcb6d6f0918532b4b2053198d6ce9bb08 Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Tue, 14 Nov 2023 16:26:46 +0100 Subject: [PATCH 4/6] adjust upgrade and rely on the fork --- app/upgrades/v3/consts.go | 10 ---------- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/app/upgrades/v3/consts.go b/app/upgrades/v3/consts.go index e2134b10..6430c5e8 100644 --- a/app/upgrades/v3/consts.go +++ b/app/upgrades/v3/consts.go @@ -1,9 +1,6 @@ package v3 import ( - store "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/cosmos-sdk/x/group" - ibcfeetypes "github.com/cosmos/ibc-go/v5/modules/apps/29-fee/types" "github.com/sge-network/sge/app/upgrades" ) @@ -13,11 +10,4 @@ const UpgradeName = "v1.1.2" var Upgrade = upgrades.Upgrade{ UpgradeName: UpgradeName, CreateUpgradeHandler: CreateUpgradeHandler, - StoreUpgrades: store.StoreUpgrades{ - Added: []string{ - group.ModuleName, - ibcfeetypes.StoreKey, - }, - Deleted: []string{}, - }, } diff --git a/go.mod b/go.mod index 22155958..e61bbca9 100644 --- a/go.mod +++ b/go.mod @@ -304,7 +304,7 @@ replace ( // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - github.com/cosmos/cosmos-sdk => ../cosmos-sdk-faulty + github.com/cosmos/cosmos-sdk => github.com/faultytolly/cosmos-sdk v0.0.0-20231113122743-330e571713e8 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 // use cosmos-compatible protobufs diff --git a/go.sum b/go.sum index d9330fee..e1ed2e65 100644 --- a/go.sum +++ b/go.sum @@ -514,6 +514,8 @@ github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= +github.com/faultytolly/cosmos-sdk v0.0.0-20231113122743-330e571713e8 h1:EzSXqwZyZUiGYF9lXRweLsNZ23oO75G8uC1gKaFueII= +github.com/faultytolly/cosmos-sdk v0.0.0-20231113122743-330e571713e8/go.mod h1:9MRixWsgoJ2UmVsCRRePtENFPP3cM+gTC5azEpxgllo= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= From 3bf00df2254fb350a3a89314fa0b867d14f650d6 Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Tue, 14 Nov 2023 20:10:51 +0100 Subject: [PATCH 5/6] use official fork --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index e61bbca9..ac0224eb 100644 --- a/go.mod +++ b/go.mod @@ -101,7 +101,7 @@ require ( github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.1 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect + github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect github.com/daixiang0/gci v0.8.1 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -269,8 +269,8 @@ require ( github.com/uudashr/gocognit v1.0.6 // indirect github.com/yagipy/maintidx v1.0.0 // indirect github.com/yeya24/promlinter v0.2.0 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect gitlab.com/bosi/decorder v0.2.3 // indirect go.etcd.io/bbolt v1.3.6 // indirect go.opencensus.io v0.24.0 // indirect @@ -304,7 +304,7 @@ replace ( // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - github.com/cosmos/cosmos-sdk => github.com/faultytolly/cosmos-sdk v0.0.0-20231113122743-330e571713e8 + github.com/cosmos/cosmos-sdk => github.com/sge-network/cosmos-sdk v0.46.17-0.20231114190313-b9164dd660b6 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 // use cosmos-compatible protobufs diff --git a/go.sum b/go.sum index e1ed2e65..c21eaebe 100644 --- a/go.sum +++ b/go.sum @@ -425,8 +425,8 @@ github.com/cosmos/ibc-go/v5 v5.3.1 h1:zuaIWMEoXM9egWmmAqzBPYLvEjYgB6xy6wZoc8xsZ5 github.com/cosmos/ibc-go/v5 v5.3.1/go.mod h1:Q2W1rjtwR738fqFQhE66dZ0frsLlr+Wiezlwei0TMGo= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= -github.com/cosmos/ledger-cosmos-go v0.12.2/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= +github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= +github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -514,8 +514,6 @@ github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= -github.com/faultytolly/cosmos-sdk v0.0.0-20231113122743-330e571713e8 h1:EzSXqwZyZUiGYF9lXRweLsNZ23oO75G8uC1gKaFueII= -github.com/faultytolly/cosmos-sdk v0.0.0-20231113122743-330e571713e8/go.mod h1:9MRixWsgoJ2UmVsCRRePtENFPP3cM+gTC5azEpxgllo= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= @@ -1277,6 +1275,8 @@ github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KR github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sge-network/cosmos-sdk v0.46.17-0.20231114190313-b9164dd660b6 h1:vDdL0lT+0UZx6cRHDTBqvv+5iVaj20S3Zad6B4NiqZ0= +github.com/sge-network/cosmos-sdk v0.46.17-0.20231114190313-b9164dd660b6/go.mod h1:05U50tAsOzQ8JOAePshJCbJQw5ib1YJR6IXcqyVI1Xg= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= @@ -1431,10 +1431,10 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= gitlab.com/bosi/decorder v0.2.3 h1:gX4/RgK16ijY8V+BRQHAySfQAb354T7/xQpDB2n10P0= gitlab.com/bosi/decorder v0.2.3/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzChSdGE= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= From 04c5427d54318e799b52f41abed8b85f2719b70a Mon Sep 17 00:00:00 2001 From: unknown unknown Date: Fri, 17 Nov 2023 13:24:24 +0100 Subject: [PATCH 6/6] update upgrade denom --- app/upgrades/v3/upgrades.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/upgrades/v3/upgrades.go b/app/upgrades/v3/upgrades.go index 4cdd6323..f12e9620 100644 --- a/app/upgrades/v3/upgrades.go +++ b/app/upgrades/v3/upgrades.go @@ -15,7 +15,7 @@ func CreateUpgradeHandler( ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { depositParams := keepers.GovKeeper.GetDepositParams(ctx) - depositParams.MinExpeditedDeposit = sdk.NewCoins(sdk.NewCoin("sge", v1.DefaultMinExpeditedDepositTokens)) + depositParams.MinExpeditedDeposit = sdk.NewCoins(sdk.NewCoin("usge", v1.DefaultMinExpeditedDepositTokens)) keepers.GovKeeper.SetDepositParams(ctx, depositParams) tallyParams := keepers.GovKeeper.GetTallyParams(ctx)