Skip to content

Commit

Permalink
use cosmos-sdk v0.50.8-scrt.2
Browse files Browse the repository at this point in the history
  • Loading branch information
alexh-scrt committed Sep 15, 2024
1 parent cd10da1 commit 3aa4b10
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 62 deletions.
2 changes: 1 addition & 1 deletion app/upgrades/v1.15/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func createUpgradeHandler(mm *module.Manager, appKeepers *keepers.SecretAppKeepe
return module.VersionMap{}, nil
}
logger.Info(fmt.Sprintf("Running module migrations for %s...", upgradeName))

logger.Debug(fmt.Sprintf("Version map: %v", vm))
m, e := mm.RunMigrations(ctx, configurator, vm)
if e != nil {
logger.Error(fmt.Sprintf("[x] Run migration error: %s", e))
Expand Down
61 changes: 3 additions & 58 deletions docs/upgrades/1.15/test-v1.15-upgrade-handler.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,8 @@ Expected result should be:

Propose a software upgrade on the v1.14 chain:
We request an upgrade to take place at +30blocks (@10block/min)

Let's capture the block height:
```bash
UPGRADE_BLOCK="$(docker exec node bash -c 'secretd status | jq "(.SyncInfo.latest_block_height | tonumber) + 30"')"
```

Let's create a proposal and capture its ID:
```bash
# Propose upgrade
PROPOSAL_ID="$(docker exec node bash -c "secretd tx gov submit-proposal software-upgrade v1.15 --upgrade-height $UPGRADE_BLOCK --title blabla --description yolo --deposit 100000000uscrt --from a -y -b block | jq '.logs[0].events[] | select(.type == \"submit_proposal\") | .attributes[] | select(.key == \"proposal_id\") | .value | tonumber'")"
```

Let's vote for the proposal
```bash
# Vote yes (voting period is 90 seconds)
docker exec node bash -c "secretd tx gov vote ${PROPOSAL_ID} yes --from a -y -b block"
```

Optionally, you can check the proposal ID and the upgrade block height:
```bash
echo "PROPOSAL_ID = ${PROPOSAL_ID}"
echo "UPGRADE_BLOCK = ${UPGRADE_BLOCK}"
./init_proposal.sh
```

## Step 4
Expand Down Expand Up @@ -129,44 +109,9 @@ You will need the following binaries:
* tendermint_enclave.signed.so

If you chose option B, you can access the binaries in the container and copy them to a host dir,
e.g. SecretNetwork/docs/upgrades/1.15/bin by running commands:
```bash
docker exec secret-0.50.x:/usr/bin/secretd ./bin
docker exec secret-0.50.x:/usr/lib/librust_cosmwasm_enclave.signed.so ./bin
docker exec secret-0.50.x:/usr/lib/libgo_cosmwasm.so ./bin
docker exec secret-0.50.x:/usr/lib/librandom_api.so ./bin
docker exec secret-0.50.x:/usr/lib/tendermint_enclave.signed.so ./bin

```

e.g. SecretNetwork/docs/upgrades/1.15/bin by running update_binaries.sh:
```bash
# Copy binaries from host to current v1.14 chain

docker exec bootstrap bash -c 'rm -rf /tmp/upgrade-bin && mkdir -p /tmp/upgrade-bin'
docker exec node bash -c 'rm -rf /tmp/upgrade-bin && mkdir -p /tmp/upgrade-bin'
# update bootstrap
docker cp ./bin/secretd bootstrap:/tmp/upgrade-bin
docker cp ./bin/librust_cosmwasm_enclave.signed.so bootstrap:/tmp/upgrade-bin
docker cp ./bin/libgo_cosmwasm.so bootstrap:/tmp/upgrade-bin
# update node
docker cp ./bin/secretd node:/tmp/upgrade-bin
docker cp ./bin/librust_cosmwasm_enclave.signed.so node:/tmp/upgrade-bin
docker cp ./bin/libgo_cosmwasm.so node:/tmp/upgrade-bin
docker cp ./bin/librandom_api.so node:/tmp/upgrade-bin
docker cp ./bin/tendermint_enclave.signed.so node:/tmp/upgrade-bin
# stop node's secretd
docker exec node bash -c 'pkill -9 secretd'
# copy over updated binaries
docker exec bootstrap bash -c 'cp /tmp/upgrade-bin/librust_cosmwasm_enclave.signed.so /usr/lib/'
docker exec bootstrap bash -c 'cp /tmp/upgrade-bin/libgo_cosmwasm.so /usr/lib/'
docker exec node bash -c 'cp /tmp/upgrade-bin/secretd /usr/bin/'
docker exec node bash -c 'cp /tmp/upgrade-bin/librust_cosmwasm_enclave.signed.so /usr/lib/'
docker exec node bash -c 'cp /tmp/upgrade-bin/libgo_cosmwasm.so /usr/lib/'

# prepare a tmp dir to store validator's private key
rm -rf /tmp/upgrade-bin && mkdir -p /tmp/upgrade-bin
docker cp bootstrap:/root/.secretd/config/priv_validator_key.json /tmp/upgrade-bin/.
docker cp /tmp/upgrade-bin/priv_validator_key.json node:/root/.secretd/config/priv_validator_key.json
./update_binaries.sh
```

Restart node:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ replace (
cosmossdk.io/api => github.com/scrtlabs/cosmos-sdk-api v0.7.5-secret.1
cosmossdk.io/store => github.com/scrtlabs/cosmos-sdk-store v1.1.0-secret.1
github.com/cometbft/cometbft => github.com/scrtlabs/tendermint v0.38.9-secret.3
github.com/cosmos/cosmos-sdk => github.com/scrtlabs/cosmos-sdk v0.50.8-secret.4
github.com/cosmos/cosmos-sdk => github.com/scrtlabs/cosmos-sdk v0.50.8-scrt.2
github.com/cosmos/iavl => github.com/scrtlabs/iavl v1.1.2-secret.1
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -954,8 +954,8 @@ github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWR
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0=
github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM=
github.com/scrtlabs/cosmos-sdk v0.50.8-secret.4 h1:WAb++XyqSbHghCc26eRG3uG/vKkpHxOV14jEcw38PzU=
github.com/scrtlabs/cosmos-sdk v0.50.8-secret.4/go.mod h1:9oxg/QW7VVnOzIip9DRJNAmSnzjSFwX3b350xv94D1I=
github.com/scrtlabs/cosmos-sdk v0.50.8-scrt.2 h1:w2mwAs3C0454+/rcxwPZ4QcKJHPu4+eDXhgeQ9nZve0=
github.com/scrtlabs/cosmos-sdk v0.50.8-scrt.2/go.mod h1:9oxg/QW7VVnOzIip9DRJNAmSnzjSFwX3b350xv94D1I=
github.com/scrtlabs/cosmos-sdk-api v0.7.5-secret.1 h1:4GLC5nv9pkCEUD4HpSpsnuDMYPT5Bly+IKPi/7H/ylk=
github.com/scrtlabs/cosmos-sdk-api v0.7.5-secret.1/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
github.com/scrtlabs/cosmos-sdk-store v1.1.0-secret.1 h1:ZpCTh28SXGD2V6rjkU8Qz4Dol/tMQOYUvAMoN2d5Jic=
Expand Down

0 comments on commit 3aa4b10

Please sign in to comment.