Skip to content

Commit

Permalink
Merge pull request #1172 from public-awesome/jhernandezb/upgrade-params
Browse files Browse the repository at this point in the history
update upgrade params
  • Loading branch information
jhernandezb authored Jan 6, 2025
2 parents c33c999 + e345aea commit 76ee4d2
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ steps:
event:
- push
branch:
- jhernandezb/fix-migration
- jhernandezb/upgrade-params
- main
- name: docker_release
image: plugins/docker
Expand Down Expand Up @@ -411,7 +411,7 @@ steps:
trigger:
branch:
- main
- jhernandezb/fix-migration
- jhernandezb/upgrade-params
event:
- pull_request
- push
Expand All @@ -424,6 +424,6 @@ volumes:

---
kind: signature
hmac: 96ed0e338ac7808aa42bdaae8e19f2fc75693763951efa5f8d9c9cca3afb3d9e
hmac: 6fa113240c7eeed870eef11e63633911cae346e1b0286c8a4afc0c3677050b2b

...
16 changes: 14 additions & 2 deletions app/upgrades/mainnet/v15/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package v15

import (
"context"
"time"

storetypes "cosmossdk.io/store/types"
upgradetypes "cosmossdk.io/x/upgrade/types"
Expand All @@ -21,12 +22,14 @@ var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: func(mm *module.Manager, cfg module.Configurator, keepers keepers.StargazeKeepers) upgradetypes.UpgradeHandler {
return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
startTime := time.Now()
wctx := sdk.UnwrapSDKContext(ctx)
wctx.Logger().Info("upgrade started", "upgrade_name", UpgradeName)
migrations, err := mm.RunMigrations(ctx, cfg, fromVM)
if err != nil {
return nil, err
}

wctx := sdk.UnwrapSDKContext(ctx)
// Adding the wasm light client to allowed clients
params := keepers.IBCKeeper.ClientKeeper.GetParams(wctx)
params.AllowedClients = append(params.AllowedClients, wasmlctypes.Wasm)
Expand All @@ -42,7 +45,7 @@ var Upgrade = upgrades.Upgrade{

blockParams := consensusParams.Params.Block
blockParams.MaxBytes = 4_190_208 // 4MB
blockParams.MaxGas = 200_000_000 // 200M
blockParams.MaxGas = 225_000_000 // 225M
_, err = keepers.ConsensusParamsKeeper.UpdateParams(ctx, &consensustypes.MsgUpdateParams{
Authority: keepers.ConsensusParamsKeeper.GetAuthority(),
Block: blockParams,
Expand All @@ -54,6 +57,15 @@ var Upgrade = upgrades.Upgrade{
return nil, err
}

// Increase the tx size cost per byte to 15
accountParams := keepers.AccountKeeper.GetParams(ctx)
accountParams.TxSizeCostPerByte = 15
err = keepers.AccountKeeper.Params.Set(ctx, accountParams)
if err != nil {
return nil, err
}

wctx.Logger().Info("upgrade completed", "duration_ms", time.Since(startTime).Milliseconds())
return migrations, nil
}
},
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/setup-stargaze.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ sed -i "s/\"stake\"/\"$DENOM\"/g" $STARGAZE_HOME/config/genesis.json
sed -i 's/pruning = "syncable"/pruning = "nothing"/g' $STARGAZE_HOME/config/app.toml
sed -i 's/enable = false/enable = true/g' $STARGAZE_HOME/config/app.toml
sed -i 's/localhost:9090/0.0.0.0:9090/g' $STARGAZE_HOME/config/app.toml
sed -i 's/localhost:1317/0.0.0.0:1317/g' $STARGAZE_HOME/config/app.toml
sed -i -e 's/timeout_commit = "5s"/timeout_commit = "100ms"/g' $STARGAZE_HOME/config/config.toml
sed -i -e 's/timeout_propose = "3s"/timeout_propose = "100ms"/g' $STARGAZE_HOME/config/config.toml
# sed -i -e 's/\"allow_messages\":.*/\"allow_messages\": [\"\/cosmos.bank.v1beta1.MsgSend\", \"\/cosmos.staking.v1beta1.MsgDelegate\"]/g' ~/.starsd/config/genesis.json
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/transfer-relayer-v1.7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ export GAIA_ADDRESS=cosmos1wt3khka7cmn5zd592x430ph4zmlhf5gfztgha6
export STARGAZE_ADDRESS=stars12g0xe2ld0k5ws3h7lmxc39d4rpl3fyxp5qys69
export OSMOSIS_ADDRESS=osmo1qk2rqkk28z8v3d7npupz33zqc6dae6n9a2x5v4
curl -s http://gaia:1317/bank/balances/$GAIA_ADDRESS | jq '.'
curl -s http://stargaze:1317/bank/balances/$STARGAZE_ADDRESS | jq '.'
curl -s http://stargaze:1317/cosmos/bank/v1beta1/balances/$STARGAZE_ADDRESS | jq '.'
curl -s http://osmosis:1317/bank/balances/$OSMOSIS_ADDRESS | jq '.'
2 changes: 1 addition & 1 deletion scripts/ci/transfer-relayer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export GAIA_ADDRESS=cosmos1wt3khka7cmn5zd592x430ph4zmlhf5gfztgha6
export STARGAZE_ADDRESS=stars12g0xe2ld0k5ws3h7lmxc39d4rpl3fyxp5qys69
export OSMOSIS_ADDRESS=osmo1qk2rqkk28z8v3d7npupz33zqc6dae6n9a2x5v4
curl -s http://gaia:1317/bank/balances/$GAIA_ADDRESS | jq '.'
curl -s http://stargaze:1317/bank/balances/$STARGAZE_ADDRESS | jq '.'
curl -s http://stargaze:1317/cosmos/bank/v1beta1/balances/$STARGAZE_ADDRESS | jq '.'
curl -s http://osmosis:1317/bank/balances/$OSMOSIS_ADDRESS | jq '.'
5 changes: 4 additions & 1 deletion scripts/ci/upgrade/run-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ apk add -U --no-cache jq tree curl wget
STARGAZE_HOME=/stargaze/starsd
curl -s -v http://stargaze:8090/kill || echo "done"
sleep 10

sed -i 's/enable = false/enable = true/g' $STARGAZE_HOME/config/app.toml
sed -i 's/localhost:9090/0.0.0.0:9090/g' $STARGAZE_HOME/config/app.toml
sed -i 's/localhost:1317/0.0.0.0:1317/g' $STARGAZE_HOME/config/app.toml
cat $STARGAZE_HOME/config/app.toml | grep -A 10 grpc
cat $STARGAZE_HOME/config/app.toml | grep -A 10 api
starsd start --pruning nothing --home $STARGAZE_HOME --grpc.address 0.0.0.0:9090 --rpc.laddr tcp://0.0.0.0:26657
1 change: 1 addition & 0 deletions scripts/ci/upgrade/setup-preinstalled-stargaze.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ sed -i "s/\"stake\"/\"$DENOM\"/g" $STARGAZE_HOME/config/genesis.json
sed -i 's/pruning = "syncable"/pruning = "nothing"/g' $STARGAZE_HOME/config/app.toml
sed -i 's/enable = false/enable = true/g' $STARGAZE_HOME/config/app.toml
sed -i 's/localhost:9090/0.0.0.0:9090/g' $STARGAZE_HOME/config/app.toml
sed -i 's/localhost:1317/0.0.0.0:1317/g' $STARGAZE_HOME/config/app.toml
sed -i 's/172800s/60s/g' $STARGAZE_HOME/config/genesis.json
sed -i -e 's/timeout_commit = "5s"/timeout_commit = "100ms"/g' $STARGAZE_HOME/config/config.toml
sed -i -e 's/timeout_propose = "3s"/timeout_propose = "100ms"/g' $STARGAZE_HOME/config/config.toml
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/upgrade/transfer-relayer-v1.7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ export GAIA_ADDRESS=cosmos1wt3khka7cmn5zd592x430ph4zmlhf5gfztgha6
export STARGAZE_ADDRESS=stars12g0xe2ld0k5ws3h7lmxc39d4rpl3fyxp5qys69
export OSMOSIS_ADDRESS=osmo1qk2rqkk28z8v3d7npupz33zqc6dae6n9a2x5v4
curl -s http://gaia:1317/bank/balances/$GAIA_ADDRESS | jq '.'
curl -s http://stargaze:1317/bank/balances/$STARGAZE_ADDRESS | jq '.'
curl -s http://stargaze-upgraded:1317/cosmos/bank/v1beta1/balances/$STARGAZE_ADDRESS | jq '.'
curl -s http://osmosis:1317/bank/balances/$OSMOSIS_ADDRESS | jq '.'
2 changes: 1 addition & 1 deletion scripts/ci/upgrade/transfer-relayer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export GAIA_ADDRESS=cosmos1wt3khka7cmn5zd592x430ph4zmlhf5gfztgha6
export STARGAZE_ADDRESS=stars12g0xe2ld0k5ws3h7lmxc39d4rpl3fyxp5qys69
export OSMOSIS_ADDRESS=osmo1qk2rqkk28z8v3d7npupz33zqc6dae6n9a2x5v4
curl -s http://gaia:1317/bank/balances/$GAIA_ADDRESS | jq '.'
curl -s http://stargaze-upgraded:1317/bank/balances/$STARGAZE_ADDRESS | jq '.'
curl -s http://stargaze-upgraded:1317/cosmos/bank/v1beta1/balances/$STARGAZE_ADDRESS | jq '.'
curl -s http://osmosis:1317/bank/balances/$OSMOSIS_ADDRESS | jq '.'

0 comments on commit 76ee4d2

Please sign in to comment.