Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 383a3e8

Browse files
colin-axnerAdityaSripal
andcommittedJul 6, 2021
bump SDK dependency to v0.43.0-rc0 (#229)
Co-authored-by: Aditya <adityasripal@gmail.com>
1 parent 5cc1816 commit 383a3e8

File tree

4 files changed

+375
-77
lines changed

4 files changed

+375
-77
lines changed
 

‎go.mod

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ module github.com/cosmos/ibc-go
55
replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
66

77
require (
8-
github.com/armon/go-metrics v0.3.8
8+
github.com/armon/go-metrics v0.3.9
99
github.com/confio/ics23/go v0.6.6
10-
github.com/cosmos/cosmos-sdk v0.43.0-beta1
10+
github.com/cosmos/cosmos-sdk v0.43.0-rc0
1111
github.com/gogo/protobuf v1.3.3
1212
github.com/golang/protobuf v1.5.2
1313
github.com/gorilla/mux v1.8.0
@@ -16,11 +16,11 @@ require (
1616
github.com/rakyll/statik v0.1.7
1717
github.com/spf13/cast v1.3.1
1818
github.com/spf13/cobra v1.1.3
19-
github.com/spf13/viper v1.7.1
19+
github.com/spf13/viper v1.8.0
2020
github.com/stretchr/testify v1.7.0
21-
github.com/tendermint/tendermint v0.34.10
21+
github.com/tendermint/tendermint v0.34.11
2222
github.com/tendermint/tm-db v0.6.4
23-
google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f
24-
google.golang.org/grpc v1.37.0
23+
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c
24+
google.golang.org/grpc v1.38.0
2525
google.golang.org/protobuf v1.26.0
2626
)

‎go.sum

+296-55
Large diffs are not rendered by default.

‎modules/core/02-client/types/proposal_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func (suite *TypesTestSuite) TestUpgradeString() {
212212
proposal, err := types.NewUpgradeProposal(ibctesting.Title, ibctesting.Description, plan, &ibctmtypes.ClientState{})
213213
suite.Require().NoError(err)
214214

215-
expect := fmt.Sprintf("IBC Upgrade Proposal\n Title: title\n Description: description\n Upgrade Plan\n Name: ibc upgrade\n Height: 1000\n Info: https://foo.bar/baz.\n Upgraded IBC Client: %s", &ibctmtypes.ClientState{})
215+
expect := fmt.Sprintf("IBC Upgrade Proposal\n Title: title\n Description: description\n Upgrade Plan\n Name: ibc upgrade\n height: 1000\n Info: https://foo.bar/baz.\n Upgraded IBC Client: %s", &ibctmtypes.ClientState{})
216216

217217
suite.Require().Equal(expect, proposal.String())
218218
}

‎testing/simapp/simd/cmd/root.go

+72-15
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@ import (
66
"os"
77
"path/filepath"
88

9-
"github.com/spf13/cast"
10-
"github.com/spf13/cobra"
11-
tmcli "github.com/tendermint/tendermint/libs/cli"
12-
"github.com/tendermint/tendermint/libs/log"
13-
dbm "github.com/tendermint/tm-db"
14-
159
"github.com/cosmos/cosmos-sdk/baseapp"
1610
"github.com/cosmos/cosmos-sdk/client"
17-
config "github.com/cosmos/cosmos-sdk/client/config"
11+
"github.com/cosmos/cosmos-sdk/client/config"
1812
"github.com/cosmos/cosmos-sdk/client/debug"
1913
"github.com/cosmos/cosmos-sdk/client/flags"
2014
"github.com/cosmos/cosmos-sdk/client/keys"
2115
"github.com/cosmos/cosmos-sdk/client/rpc"
2216
"github.com/cosmos/cosmos-sdk/server"
17+
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
2318
servertypes "github.com/cosmos/cosmos-sdk/server/types"
2419
"github.com/cosmos/cosmos-sdk/snapshots"
2520
"github.com/cosmos/cosmos-sdk/store"
2621
sdk "github.com/cosmos/cosmos-sdk/types"
2722
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
2823
"github.com/cosmos/cosmos-sdk/x/auth/types"
29-
vestingcli "github.com/cosmos/cosmos-sdk/x/auth/vesting/client/cli"
3024
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
3125
"github.com/cosmos/cosmos-sdk/x/crisis"
3226
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
27+
"github.com/spf13/cast"
28+
"github.com/spf13/cobra"
29+
tmcli "github.com/tendermint/tendermint/libs/cli"
30+
"github.com/tendermint/tendermint/libs/log"
31+
dbm "github.com/tendermint/tm-db"
32+
3333
"github.com/cosmos/ibc-go/testing/simapp"
3434
"github.com/cosmos/ibc-go/testing/simapp/params"
3535
)
@@ -39,13 +39,12 @@ import (
3939
func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
4040
encodingConfig := simapp.MakeTestEncodingConfig()
4141
initClientCtx := client.Context{}.
42-
WithJSONCodec(encodingConfig.Marshaler).
42+
WithCodec(encodingConfig.Marshaler).
4343
WithInterfaceRegistry(encodingConfig.InterfaceRegistry).
4444
WithTxConfig(encodingConfig.TxConfig).
4545
WithLegacyAmino(encodingConfig.Amino).
4646
WithInput(os.Stdin).
4747
WithAccountRetriever(types.AccountRetriever{}).
48-
WithBroadcastMode(flags.BroadcastBlock).
4948
WithHomeDir(simapp.DefaultNodeHome).
5049
WithViper("") // In simapp, we don't use any prefix for env variables.
5150

@@ -68,7 +67,9 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
6867
return err
6968
}
7069

71-
return server.InterceptConfigsPreRunHandler(cmd)
70+
customAppTemplate, customAppConfig := initAppConfig()
71+
72+
return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig)
7273
},
7374
}
7475

@@ -77,7 +78,66 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
7778
return rootCmd, encodingConfig
7879
}
7980

81+
// initAppConfig helps to override default appConfig template and configs.
82+
// return "", nil if no custom configuration is required for the application.
83+
func initAppConfig() (string, interface{}) {
84+
// The following code snippet is just for reference.
85+
86+
// WASMConfig defines configuration for the wasm module.
87+
type WASMConfig struct {
88+
// This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries
89+
QueryGasLimit uint64 `mapstructure:"query_gas_limit"`
90+
91+
// Address defines the gRPC-web server to listen on
92+
LruSize uint64 `mapstructure:"lru_size"`
93+
}
94+
95+
type CustomAppConfig struct {
96+
serverconfig.Config
97+
98+
WASM WASMConfig `mapstructure:"wasm"`
99+
}
100+
101+
// Optionally allow the chain developer to overwrite the SDK's default
102+
// server config.
103+
srvCfg := serverconfig.DefaultConfig()
104+
// The SDK's default minimum gas price is set to "" (empty value) inside
105+
// app.toml. If left empty by validators, the node will halt on startup.
106+
// However, the chain developer can set a default app.toml value for their
107+
// validators here.
108+
//
109+
// In summary:
110+
// - if you leave srvCfg.MinGasPrices = "", all validators MUST tweak their
111+
// own app.toml config,
112+
// - if you set srvCfg.MinGasPrices non-empty, validators CAN tweak their
113+
// own app.toml to override, or use this default value.
114+
//
115+
// In simapp, we set the min gas prices to 0.
116+
srvCfg.MinGasPrices = "0stake"
117+
118+
customAppConfig := CustomAppConfig{
119+
Config: *srvCfg,
120+
WASM: WASMConfig{
121+
LruSize: 1,
122+
QueryGasLimit: 300000,
123+
},
124+
}
125+
126+
customAppTemplate := serverconfig.DefaultConfigTemplate + `
127+
[wasm]
128+
# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries
129+
query_gas_limit = 300000
130+
# This is the number of wasm vm instances we keep cached in memory for speed-up
131+
# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally
132+
lru_size = 0`
133+
134+
return customAppTemplate, customAppConfig
135+
}
136+
80137
func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
138+
cfg := sdk.GetConfig()
139+
cfg.Seal()
140+
81141
rootCmd.AddCommand(
82142
genutilcli.InitCmd(simapp.ModuleBasics, simapp.DefaultNodeHome),
83143
genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, simapp.DefaultNodeHome),
@@ -149,12 +209,9 @@ func txCommand() *cobra.Command {
149209
authcmd.GetMultiSignCommand(),
150210
authcmd.GetMultiSignBatchCmd(),
151211
authcmd.GetValidateSignaturesCommand(),
152-
flags.LineBreak,
153212
authcmd.GetBroadcastCommand(),
154213
authcmd.GetEncodeCommand(),
155214
authcmd.GetDecodeCommand(),
156-
flags.LineBreak,
157-
vestingcli.GetTxCmd(),
158215
)
159216

160217
simapp.ModuleBasics.AddTxCommands(cmd)
@@ -167,7 +224,7 @@ type appCreator struct {
167224
encCfg params.EncodingConfig
168225
}
169226

170-
// newApp is an AppCreator
227+
// newApp is an appCreator
171228
func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application {
172229
var cache sdk.MultiStorePersistentCache
173230

0 commit comments

Comments
 (0)
Please sign in to comment.