Skip to content

Commit

Permalink
bump cosmos and tendermint dependencies; add v0.46 ica callback handl…
Browse files Browse the repository at this point in the history
…ers; add receipt completion time; add v1.2.4 upgrade handler; add adjacent block verification
  • Loading branch information
Joe Bowman committed Mar 1, 2023
1 parent aa898c9 commit 8be21c6
Show file tree
Hide file tree
Showing 16 changed files with 977 additions and 266 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ format:
### Protobuf ###
###############################################################################

containerProtoVer=v0.7
containerProtoImage=tendermintdev/sdk-proto-gen:$(containerProtoVer)
containerProtoVer=0.9.0
containerProtoImage=ghcr.io/cosmos/proto-builder:$(containerProtoVer)
containerProtoGen=cosmos-sdk-proto-gen-$(containerProtoVer)
containerProtoGenSwagger=cosmos-sdk-proto-gen-swagger-$(containerProtoVer)
containerProtoFmt=cosmos-sdk-proto-fmt-$(containerProtoVer)
Expand Down Expand Up @@ -438,11 +438,11 @@ proto-check-breaking:
@$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main


TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.21/proto/tendermint
TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.26/proto/tendermint
GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
CONFIO_URL = https://raw.githubusercontent.com/confio/ics23/v0.7.1
SDK_PROTO_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/v0.46.1/proto/cosmos
IBC_PROTO_URL = https://raw.githubusercontent.com/cosmos/ibc-go/v5.0.0-rc2/proto
CONFIO_URL = https://raw.githubusercontent.com/confio/ics23/v0.8.0
SDK_PROTO_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/v0.46.10/proto/cosmos
IBC_PROTO_URL = https://raw.githubusercontent.com/cosmos/ibc-go/v5.2.0/proto

TM_CRYPTO_TYPES = third_party/proto/tendermint/crypto
TM_ABCI_TYPES = third_party/proto/tendermint/abci
Expand Down
40 changes: 36 additions & 4 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,24 @@ import (
"fmt"

storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

// upgrade name consts: vMMmmppUpgradeName (M=Major, m=minor, p=patch)
const (
ProductionChainID = "quicksilver-1"
InnuendoChainID = "innuendo-3"
Innuendo2ChainID = "innuendo-4"
ProductionChainID = "quicksilver-2"
InnuendoChainID = "innuendo-5"
DevnetChainID = "quicktest-1"

v010204UpgradeName = "v1.2.4"
v010300UpgradeName = "v1.3.0" // retained for testy
)

func setUpgradeHandlers(app *Quicksilver) {
// app.UpgradeKeeper.SetUpgradeHandler(v001000UpgradeName, getv001000Upgrade(app))
app.UpgradeKeeper.SetUpgradeHandler(v010300UpgradeName, noOpUpgradeHandler(app)) // retained for testy
app.UpgradeKeeper.SetUpgradeHandler(v010204UpgradeName, v010204UpgradeHandler(app))

// When a planned update height is reached, the old binary will panic
// writing on disk the height and name of the update that triggered it
Expand Down Expand Up @@ -46,3 +51,30 @@ func setUpgradeHandlers(app *Quicksilver) {
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, storeUpgrades))
}
}

func noOpUpgradeHandler(app *Quicksilver) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
}
}

func v010204UpgradeHandler(app *Quicksilver) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// upgrade receipts
time := ctx.BlockTime()
for _, r := range app.InterchainstakingKeeper.AllReceipts(ctx) {
r.FirstSeen = &time
r.Completed = &time
app.InterchainstakingKeeper.SetReceipt(ctx, r)
}

// remove failed redelegation records
for _, r := range app.InterchainstakingKeeper.AllRedelegationRecords(ctx) {
if r.CompletionTime.IsZero() {
app.InterchainstakingKeeper.DeleteRedelegationRecord(ctx, r.ChainId, r.Source, r.Destination, r.EpochNumber)
}
}

return app.mm.RunMigrations(ctx, app.configurator, fromVM)
}
}
36 changes: 19 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ require (
cosmossdk.io/math v1.0.0-beta.4
github.com/CosmWasm/wasmd v0.29.2
github.com/cosmos/cosmos-proto v1.0.0-alpha8
github.com/cosmos/cosmos-sdk v0.46.7
github.com/cosmos/cosmos-sdk v0.46.10
github.com/cosmos/ibc-go/v5 v5.2.0
github.com/gogo/protobuf v1.3.3
github.com/golang/protobuf v1.5.2
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/iqlusioninc/liquidity-staking-module v1.0.0
github.com/prometheus/client_golang v1.13.0
github.com/prometheus/client_golang v1.14.0
github.com/rakyll/statik v0.1.7
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.6.0
github.com/spf13/cobra v1.6.1
github.com/spf13/viper v1.13.0
github.com/stretchr/testify v1.8.1
github.com/tendermint/tendermint v0.34.24
github.com/tendermint/tendermint v0.34.26
github.com/tendermint/tm-db v0.6.8-0.20220506192307-f628bb5dc95b
go.opencensus.io v0.23.0
golang.org/x/exp v0.0.0-20220914170420-dc92f8653013
Expand All @@ -29,7 +29,12 @@ require (
gopkg.in/yaml.v2 v2.4.0
)

require github.com/zondax/ledger-go v0.14.0 // indirect
require (
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/tidwall/btree v1.5.0 // indirect
github.com/zondax/ledger-go v0.14.1 // indirect
)

require (
cloud.google.com/go v0.105.0 // indirect
Expand All @@ -51,7 +56,6 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/btcsuite/btcd v0.22.1 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
Expand All @@ -68,8 +72,8 @@ require (
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogoproto v1.4.2 // indirect
github.com/cosmos/gorocksdb v1.2.0 // indirect
github.com/cosmos/iavl v0.19.4 // indirect
github.com/cosmos/ledger-cosmos-go v0.12.1 // indirect
github.com/cosmos/iavl v0.19.5 // indirect
github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect
github.com/creachadair/taskgroup v0.3.2 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand Down Expand Up @@ -135,7 +139,7 @@ require (
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
Expand All @@ -149,18 +153,16 @@ require (
github.com/spf13/pflag v1.0.5
github.com/subosito/gotenv v1.4.1 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
github.com/tendermint/btcd v0.1.1 // indirect
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/ulikunitz/xz v0.5.8 // indirect
github.com/zondax/hid v0.9.1 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
golang.org/x/crypto v0.2.0 // indirect
golang.org/x/net v0.2.0 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/term v0.2.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/term v0.4.0 // indirect
golang.org/x/text v0.6.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.102.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand All @@ -178,7 +180,7 @@ replace (
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/iqlusioninc/liquidity-staking-module => github.com/notional-labs/liquidity-staking-module v0.0.3-0.20220914043211-d4675d9af6ae
github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.26
// pebbledb - https://gist.github.com/faddat/673107b72eccdd869b242338dd17e9d9
github.com/tendermint/tm-db => github.com/notional-labs/tm-db v0.6.7-0.20220731185452-136c7b65fb62

)
Loading

0 comments on commit 8be21c6

Please sign in to comment.