Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V4.0.0 rc7 to production #454

Merged
merged 6 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@ name: "Release"
on:
release:
types: [published]
jobs:
draft-release:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Copy Binary
run: |
Expand All @@ -25,7 +24,7 @@ jobs:
run: ls -R

- name: Draft Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
draft: true
files: |
Expand Down
80 changes: 49 additions & 31 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,18 @@ package app
import (
"context"
"fmt"
"time"

cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/types/module"

storetypes "cosmossdk.io/store/types"
circuittypes "cosmossdk.io/x/circuit/types"
ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"

nft "cosmossdk.io/x/nft"
storetypes "cosmossdk.io/store/types"

circuittypes "cosmossdk.io/x/circuit/types"
"cosmossdk.io/x/nft"
upgradetypes "cosmossdk.io/x/upgrade/types"

// Fix Consensus Params
"github.com/cosmos/cosmos-sdk/runtime"
consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"

// WASM upgrade/addition
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
)
Expand All @@ -38,45 +35,66 @@ func (app *App) StickyFingers(_ upgradetypes.Plan) {
app.UpgradeKeeper.SetUpgradeHandler(
planName,
func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
app.Logger().Info("Cosmos-SDK v0.50 and WASM is here...")
app.Logger().Info("Cosmos-SDK v0.50 and WASM are here...")
// Print the modules with their respective ver.
for moduleName, version := range fromVM {
app.Logger().Info(fmt.Sprintf("Module: %s, Version: %d", moduleName, version))

}
// New consensus params keeper using the wrong key again and move the data into the consensus params keeper with the right key
storesvc := runtime.NewKVStoreService(app.GetKey("upgrade"))
consensuskeeper := consensuskeeper.NewKeeper(
app.appCodec,
storesvc,
app.AccountKeeper.GetAuthority(),
runtime.EventService{},
)

params, err := consensuskeeper.ParamsStore.Get(ctx)
app.Logger().Info("Getting the params into the Consensus params keeper...")
if err != nil {
app.Logger().Error("Error getting the params into the Consensus params keeper...")
return nil, err
// Set Consensus Params to avoid err messages
consensusParams := cmtproto.ConsensusParams{}
block := cmtproto.BlockParams{
MaxBytes: 1048576,
MaxGas: -1,
}
consensusParams.Block = &block
evidence := cmtproto.EvidenceParams{
MaxAgeNumBlocks: 100000,
MaxAgeDuration: 48 * time.Hour,
MaxBytes: 1048576,
}
consensusParams.Evidence = &evidence

validator := cmtproto.ValidatorParams{
PubKeyTypes: []string{"ed25519"},
}
err = app.ConsensusParamsKeeper.ParamsStore.Set(ctx, params)
consensusParams.Validator = &validator

consensusParams.Version = &cmtproto.VersionParams{}

err := app.ConsensusParamsKeeper.ParamsStore.Set(ctx, consensusParams)
app.Logger().Info("Setting the params into the Consensus params keeper...")
if err != nil {
app.Logger().Error("Error setting the params into the Consensus params keeper...")
return nil, err
app.Logger().Error("Error setting Consensus Params: " + err.Error())
}

versionMap, err := app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM)

app.Logger().Info(fmt.Sprintf("post migrate version map: %v", versionMap))

// Set CosmWasm params
wasmParams := wasmtypes.DefaultParams()
wasmParams.CodeUploadAccess = wasmtypes.AllowEverybody //AllowNobody for MainNET
wasmParams.InstantiateDefaultPermission = wasmtypes.AccessTypeAnyOfAddresses
// Allowed addresses
allowedAddresses := []string{
"bcna1tqywev6xmvrnagfq57c0h5susdy3l789rumufz", // Team 1
"bcna1csyzlg52g2kd8e0xd6f6elckydhr93ukc3wmqt", // Team 2
"bcna13jawsn574rf3f0u5rhu7e8n6sayx5gkwgusz73", // Team 3
}

// Set CodeUploadAccess to allow Team addresses
wasmParams.CodeUploadAccess = wasmtypes.AccessConfig{
Permission: wasmtypes.AccessTypeAnyOfAddresses,
Addresses: allowedAddresses,
}

// Set InstantiateDefaultPermission to allow Team addresse
wasmParams.InstantiateDefaultPermission = wasmtypes.AccessTypeEverybody
err = app.WasmKeeper.SetParams(ctx, wasmParams)
app.Logger().Info("Setting the params into the Wasm params keeper...")
if err != nil {
app.Logger().Error("Error setting the params into the Wasm params keeper...")
return nil, err
}
versionMap, err := app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM)
app.Logger().Info(fmt.Sprintf("post migrate version map: %v", versionMap))
// return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM)
return versionMap, err
},
Expand All @@ -92,7 +110,7 @@ func (app *App) StickyFingers(_ upgradetypes.Plan) {
circuittypes.ModuleName, // commented at v0.50>v0.50 uncomment for v0.47>v0.50
ibcfeetypes.ModuleName, // commented at v0.50>v0.50 uncomment for v0.47>v0.50
nft.ModuleName, // commented at v0.50>v0.50 uncomment for v0.47>v0.50
wasmtypes.ModuleName,
wasmtypes.ModuleName, // commented at v0.50>v0.50 uncomment for v0.47>v0.50
},
Deleted: []string{
"burn", // commented at v0.50>v0.50 uncomment for v0.47>v0.50
Expand Down
2 changes: 1 addition & 1 deletion docs/static/openapi.yml

Large diffs are not rendered by default.

67 changes: 36 additions & 31 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ require (
cosmossdk.io/client/v2 v2.0.0-beta.4
cosmossdk.io/core v0.11.1
cosmossdk.io/depinject v1.0.0
cosmossdk.io/log v1.4.1
cosmossdk.io/math v1.3.0
cosmossdk.io/log v1.5.0
cosmossdk.io/math v1.4.0
cosmossdk.io/store v1.1.1
cosmossdk.io/tools/confix v0.1.2
cosmossdk.io/x/circuit v0.1.1
Expand All @@ -25,13 +25,13 @@ require (
cosmossdk.io/x/upgrade v0.1.4
github.com/CosmWasm/wasmd v0.53.0
github.com/bufbuild/buf v1.32.1
github.com/cometbft/cometbft v0.38.12
github.com/cometbft/cometbft v0.38.15
github.com/cosmos/cosmos-db v1.0.2
github.com/cosmos/cosmos-proto v1.0.0-beta.5
github.com/cosmos/cosmos-sdk v0.50.10
github.com/cosmos/gogoproto v1.7.0
github.com/cosmos/ibc-go/modules/capability v1.0.1
github.com/cosmos/ibc-go/v8 v8.5.1
github.com/cosmos/ibc-go/v8 v8.5.2
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0
Expand All @@ -42,7 +42,7 @@ require (
github.com/stretchr/testify v1.9.0
golang.org/x/tools v0.22.0
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0
google.golang.org/protobuf v1.34.2
google.golang.org/protobuf v1.35.1
)

require (
Expand All @@ -52,7 +52,7 @@ require (
cloud.google.com/go v0.115.0 // indirect
cloud.google.com/go/auth v0.6.0 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect
cloud.google.com/go/compute/metadata v0.3.0 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
cloud.google.com/go/iam v1.1.9 // indirect
cloud.google.com/go/storage v1.41.0 // indirect
connectrpc.com/connect v1.16.1 // indirect
Expand All @@ -74,23 +74,25 @@ require (
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
github.com/bits-and-blooms/bitset v1.8.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/bufbuild/protocompile v0.13.1-0.20240510201809-752249dfc37f // indirect
github.com/bufbuild/protoplugin v0.0.0-20240323223605-e2735f6c31ee // indirect
github.com/bufbuild/protovalidate-go v0.6.2 // indirect
github.com/bufbuild/protoyaml-go v0.1.9 // indirect
github.com/bytedance/sonic v1.12.3 // indirect
github.com/bytedance/sonic/loader v0.2.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v1.1.1 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft-db v0.11.0 // indirect
github.com/cometbft/cometbft-db v0.14.1 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
Expand All @@ -103,11 +105,10 @@ require (
github.com/creachadair/tomledit v0.0.24 // indirect
github.com/danieljoos/wincred v1.2.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/badger/v4 v4.2.0 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/cli v26.1.2+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
Expand All @@ -125,7 +126,7 @@ require (
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-chi/chi/v5 v5.0.12 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/kit v0.13.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
Expand All @@ -134,13 +135,14 @@ require (
github.com/gofrs/uuid/v5 v5.2.0 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.2.0 // indirect
github.com/golang/glog v1.2.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/cel-go v0.20.1 // indirect
github.com/google/flatbuffers v1.12.1 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-containerregistry v0.19.1 // indirect
github.com/google/gofuzz v1.2.0 // indirect
Expand Down Expand Up @@ -175,16 +177,17 @@ require (
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/linxGnu/grocksdb v1.8.14 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
github.com/minio/highwayhash v1.0.3 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
Expand All @@ -198,14 +201,14 @@ require (
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/profile v1.7.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.20.1 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/common v0.60.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
Expand All @@ -214,7 +217,7 @@ require (
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/sasha-s/go-deadlock v0.3.5 // indirect
github.com/shamaton/msgpack/v2 v2.2.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
Expand All @@ -224,11 +227,12 @@ require (
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tidwall/btree v1.7.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.3.10 // indirect
go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
Expand All @@ -241,21 +245,22 @@ require (
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/api v0.186.0 // indirect
google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect
google.golang.org/grpc v1.64.1 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/grpc v1.67.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading