diff --git a/app/app.go b/app/app.go index 7cab39b1..9d7845bd 100644 --- a/app/app.go +++ b/app/app.go @@ -924,6 +924,11 @@ func (app *App) registerUpgradeHandlers() { return app.mm.RunMigrations(ctx, app.configurator, fromVM) }) + app.UpgradeKeeper.SetUpgradeHandler("v1.6.7", func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + app.Logger().Info("Starting v1.6.7 upgrade") + return app.mm.RunMigrations(ctx, app.configurator, fromVM) + }) + upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() if err != nil { panic(fmt.Sprintf("failed to read upgrade info from disk %s", err)) @@ -1035,4 +1040,9 @@ func (app *App) registerUpgradeHandlers() { storeUpgrades := storetypes.StoreUpgrades{} app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) } + + if upgradeInfo.Name == "v1.6.7" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + storeUpgrades := storetypes.StoreUpgrades{} + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) + } } diff --git a/readme.md b/readme.md index 466aaa6f..c09d8ac1 100644 --- a/readme.md +++ b/readme.md @@ -39,9 +39,21 @@ Please also make sure to have a look to the [contributing guidelines](https://gi Information related to the Lum Network mainnet `lum-network-1` can be found in the [mainnet repository](https://github.com/lum-network/mainnet). -### v1.6.4 - `TODO` - Block `TODO` +### v1.6.7 - 2024-06-03 - Block 13241000 +CosmosMillions: Fix ICQ issues and improve error management. -`TODO` +[Upgrade guide here](https://github.com/lum-network/mainnet/blob/master/upgrades/v1.6.7/guide.md). + +### v1.6.6 - 2024-05-16 - Block 12969000 +Vulnerability patch related to the Cosmos SDk. +CosmosMillions: Unlock HUAHUA Pool drawing procedure. + +[Upgrade guide here](https://github.com/lum-network/mainnet/blob/master/upgrades/v1.6.6/guide.md). + +### v1.6.5 - 2024-03-12 - Block 11992000 +CosmosMillions: Add Close Pool feature and improve deposit retry for ICA operations. + +[Upgrade guide here](https://github.com/lum-network/mainnet/blob/master/upgrades/v1.6.5/guide.md). ### v1.6.4 - 2024-02-01 - Block 11390000 CosmosMillions: Make ICA channel restoration unlock all entities and revamp the fee system to allow for more than one fee taker. diff --git a/tools/.env b/tools/.env index 0d1eec37..21d0c255 100644 --- a/tools/.env +++ b/tools/.env @@ -1,4 +1,4 @@ GAIA_MNEMONIC=fiction inquiry pear evolve choose scatter spring weird cancel exile monster creek focus enforce celery object mistake desk glory broom welcome report car ritual JUNO_MNEMONIC=trim ginger ask swift allow pair wait hollow nephew diet during couple ignore exclude network gentle giant machine deliver iron fall bachelor notice scheme OSMOSIS_MNEMONIC=write away right various pilot tongue lava spray disease false series found shiver bright citizen unable daring fat funny inquiry decide skill fragile yellow -LUM_MNEMONIC=poem accuse sport census donor curious panther mean debris swap wire skin impose gym pretty dinosaur forget output dad steel venture farm gym pill \ No newline at end of file +LUM_MNEMONIC="poem accuse sport census donor curious panther mean debris swap wire skin impose gym pretty dinosaur forget output dad steel venture farm gym pill" \ No newline at end of file diff --git a/tools/config/hermes.toml b/tools/config/hermes.toml index 909eba7a..2d975d0c 100644 --- a/tools/config/hermes.toml +++ b/tools/config/hermes.toml @@ -30,7 +30,7 @@ port = 3001 id = 'gaia-devnet' rpc_addr = 'http://gaia-local-net:26657' grpc_addr = 'http://gaia-local-net:9090' -websocket_addr = 'ws://gaia-local-net:26657/websocket' +event_source = { mode = 'push', url = 'ws://gaia-local-net:26657/websocket', batch_delay = '500ms' } rpc_timeout = '10s' account_prefix = 'cosmos' key_name = 'hrly1' @@ -51,7 +51,7 @@ address_type = { derivation = 'cosmos' } id = 'juno-devnet' rpc_addr = 'http://juno-local-net:26657' grpc_addr = 'http://juno-local-net:9090' -websocket_addr = 'ws://juno-local-net:26657/websocket' +event_source = { mode = 'push', url = 'ws://juno-local-net:26657/websocket', batch_delay = '500ms' } rpc_timeout = '10s' account_prefix = 'juno' key_name = 'hrly2' @@ -72,7 +72,7 @@ address_type = { derivation = 'cosmos' } id = 'osmosis-devnet' rpc_addr = 'http://osmosis-local-net:26657' grpc_addr = 'http://osmosis-local-net:9090' -websocket_addr = 'ws://osmosis-local-net:26657/websocket' +event_source = { mode = 'push', url = 'ws://osmosis-local-net:26657/websocket', batch_delay = '500ms' } rpc_timeout = '10s' account_prefix = 'osmo' key_name = 'hrly3' @@ -90,10 +90,10 @@ trust_threshold = { numerator = '1', denominator = '3' } address_type = { derivation = 'cosmos' } [[chains]] -id = 'lumnetwork-testnet' +id = 'lum-devnet' rpc_addr = 'http://host.docker.internal:26657' grpc_addr = 'http://host.docker.internal:9090' -websocket_addr = 'ws://host.docker.internal:26657/websocket' +event_source = { mode = 'push', url = 'ws://host.docker.internal:26657/websocket', batch_delay = '500ms' } rpc_timeout = '10s' account_prefix = 'lum' key_name = 'hrly4' diff --git a/tools/docker-compose.yml b/tools/docker-compose.yml index 3da7f8b5..1dcdb56f 100644 --- a/tools/docker-compose.yml +++ b/tools/docker-compose.yml @@ -43,7 +43,7 @@ services: sed -i 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "200ms"/g' /home/juno/.juno/config/config.toml sed -i 's/timeout_commit = "5s"/timeout_commit = "2s"/g' /home/juno/.juno/config/config.toml sed -i 's/\("allow_messages": \)\[[^]]*\]/\1["\/cosmos.bank.v1beta1.MsgSend", "\/cosmos.bank.v1beta1.MsgMultiSend", "\/cosmos.staking.v1beta1.MsgDelegate", "\/cosmos.staking.v1beta1.MsgUndelegate", "\/cosmos.staking.v1beta1.MsgBeginRedelegate", "\/cosmos.staking.v1beta1.MsgRedeemTokensforShares", "\/cosmos.staking.v1beta1.MsgTokenizeShares", "\/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", "\/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", "\/ibc.applications.transfer.v1.MsgTransfer"]/' /home/juno/.juno/config/genesis.json - junod start --rpc.laddr tcp://0.0.0.0:26657 --pruning nothing + junod start --rpc.laddr tcp://0.0.0.0:26657 --grpc.address 0.0.0.0:9090 --pruning nothing gaia-local-net: build: @@ -73,10 +73,10 @@ services: gaiad keys add genesis_key --keyring-backend test echo $GAIA_MNEMONIC | gaiad keys add relayer_key --keyring-backend test --recover gaiad init genesis_key --chain-id=gaia-devnet - gaiad add-genesis-account `gaiad keys show genesis_key -a --keyring-backend test` 1000000000000000uatom --keyring-backend test - gaiad add-genesis-account `gaiad keys show relayer_key -a --keyring-backend test` 1000000000000000uatom --keyring-backend test - gaiad gentx genesis_key 1000000uatom --chain-id=gaia-devnet --keyring-backend test - gaiad collect-gentxs + gaiad genesis add-genesis-account `gaiad keys show genesis_key -a --keyring-backend test` 1000000000000000uatom --keyring-backend test + gaiad genesis add-genesis-account `gaiad keys show relayer_key -a --keyring-backend test` 1000000000000000uatom --keyring-backend test + gaiad genesis gentx genesis_key 1000000uatom --chain-id=gaia-devnet --keyring-backend test + gaiad genesis collect-gentxs sed -i 's/"stake"/"uatom"/g' /home/gaia/.gaia/config/genesis.json sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0.001uatom"/g' /home/gaia/.gaia/config/app.toml sed -i 's/timeout_propose = "3s"/timeout_propose = "1s"/g' /home/gaia/.gaia/config/config.toml @@ -87,7 +87,7 @@ services: sed -i 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "200ms"/g' /home/gaia/.gaia/config/config.toml sed -i 's/timeout_commit = "5s"/timeout_commit = "2s"/g' /home/gaia/.gaia/config/config.toml sed -i 's/\("allow_messages": \)\[[^]]*\]/\1["\/cosmos.bank.v1beta1.MsgSend", "\/cosmos.bank.v1beta1.MsgMultiSend", "\/cosmos.staking.v1beta1.MsgDelegate", "\/cosmos.staking.v1beta1.MsgUndelegate", "\/cosmos.staking.v1beta1.MsgBeginRedelegate", "\/cosmos.staking.v1beta1.MsgRedeemTokensforShares", "\/cosmos.staking.v1beta1.MsgTokenizeShares", "\/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", "\/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", "\/ibc.applications.transfer.v1.MsgTransfer"]/' /home/gaia/.gaia/config/genesis.json - gaiad start --rpc.laddr tcp://0.0.0.0:26657 --pruning nothing + gaiad start --rpc.laddr tcp://0.0.0.0:26657 --grpc.address 0.0.0.0:9090 --pruning nothing osmosis-local-net: build: @@ -131,7 +131,7 @@ services: sed -i 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "200ms"/g' /home/osmosis/.osmosisd/config/config.toml sed -i 's/timeout_commit = "5s"/timeout_commit = "2s"/g' /home/osmosis/.osmosisd/config/config.toml sed -i 's/\("allow_messages": \)\[[^]]*\]/\1["\/cosmos.bank.v1beta1.MsgSend", "\/cosmos.bank.v1beta1.MsgMultiSend", "\/cosmos.staking.v1beta1.MsgDelegate", "\/cosmos.staking.v1beta1.MsgUndelegate", "\/cosmos.staking.v1beta1.MsgBeginRedelegate", "\/cosmos.staking.v1beta1.MsgRedeemTokensforShares", "\/cosmos.staking.v1beta1.MsgTokenizeShares", "\/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", "\/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", "\/ibc.applications.transfer.v1.MsgTransfer"]/' /home/osmosis/.osmosisd/config/genesis.json - osmosisd start --rpc.laddr tcp://0.0.0.0:26657 --pruning nothing + osmosisd start --rpc.laddr tcp://0.0.0.0:26657 --grpc.address 0.0.0.0:9090 --pruning nothing relayer-local-net: build: @@ -174,5 +174,5 @@ services: echo $OSMOSIS_MNEMONIC > osmosis.txt hermes keys add --key-name hrly3 --chain osmosis-devnet --mnemonic-file osmosis.txt --overwrite echo $LUM_MNEMONIC > lum.txt - hermes keys add --key-name hrly4 --chain lumnetwork-testnet --mnemonic-file lum.txt --overwrite --hd-path "m/44'/880'/0'/0/0" + hermes keys add --key-name hrly4 --chain lum-devnet --mnemonic-file lum.txt --overwrite --hd-path "m/44'/880'/0'/0/0" hermes start \ No newline at end of file diff --git a/tools/dockerfiles/Dockerfile.gaia b/tools/dockerfiles/Dockerfile.gaia index 2ecd8338..ad7ad150 100644 --- a/tools/dockerfiles/Dockerfile.gaia +++ b/tools/dockerfiles/Dockerfile.gaia @@ -1,10 +1,10 @@ -FROM golang:1.18-alpine3.15 AS builder +FROM golang:1.21.10-alpine AS builder WORKDIR /opt RUN apk add --update curl make git libc-dev bash gcc linux-headers eudev-dev python3 nano -ENV COMMIT_HASH=v9.0.1 +ENV COMMIT_HASH=v16.0.0 RUN git clone https://github.com/cosmos/gaia.git gaia-install \ && cd gaia-install \ diff --git a/tools/dockerfiles/Dockerfile.hermes b/tools/dockerfiles/Dockerfile.hermes index e941ef2f..e76da106 100644 --- a/tools/dockerfiles/Dockerfile.hermes +++ b/tools/dockerfiles/Dockerfile.hermes @@ -1,10 +1,10 @@ -FROM rust:1.65-buster as builder +FROM rust:1.78-buster as builder WORKDIR /opt RUN apt update && apt install git bash curl nano htop -y -ENV COMMIT_HASH=v1.4.1 +ENV COMMIT_HASH=v1.8.3 RUN git clone https://github.com/informalsystems/ibc-rs \ && cd ibc-rs \ && git checkout $COMMIT_HASH \ diff --git a/tools/dockerfiles/Dockerfile.osmosis b/tools/dockerfiles/Dockerfile.osmosis index 01b60c13..6c902121 100644 --- a/tools/dockerfiles/Dockerfile.osmosis +++ b/tools/dockerfiles/Dockerfile.osmosis @@ -1,10 +1,10 @@ -FROM golang:1.19-alpine3.15 AS builder +FROM golang:1.22.3-alpine AS builder WORKDIR /opt/ RUN set -eux; apk add --no-cache ca-certificates build-base; apk add git linux-headers -ENV COMMIT_HASH=v15.0.0 +ENV COMMIT_HASH=v25.0.0 RUN git clone https://github.com/osmosis-labs/osmosis.git \ && cd osmosis \ diff --git a/x/icqueries/keeper/keeper.go b/x/icqueries/keeper/keeper.go index 1c8fd987..f05fcd8e 100644 --- a/x/icqueries/keeper/keeper.go +++ b/x/icqueries/keeper/keeper.go @@ -2,7 +2,6 @@ package keeper import ( "fmt" - "net/url" "sort" "strings" "time" @@ -121,7 +120,7 @@ func (k Keeper) VerifyKeyProof(ctx sdk.Context, msg *types.MsgSubmitQueryRespons height := clienttypes.NewHeight(clienttypes.ParseChainID(query.ChainId), proofHeight+1) // Confirm the query proof height occurred after the submission height - if proofHeight < query.SubmissionHeight { + if proofHeight <= query.SubmissionHeight { return errorsmod.Wrapf(types.ErrInvalidICQProof, "Query proof height (%d) is older than the submission height (%d)", proofHeight, query.SubmissionHeight) } @@ -152,7 +151,7 @@ func (k Keeper) VerifyKeyProof(ctx sdk.Context, msg *types.MsgSubmitQueryRespons var clientStateProof []*ics23.ProofSpec = tendermintClientState.ProofSpecs // Get the merkle path and merkle proof - path := commitmenttypes.NewMerklePath([]string{pathParts[1], url.PathEscape(string(query.Request))}...) + path := commitmenttypes.NewMerklePath([]string{pathParts[1], string(query.Request)}...) merkleProof, err := commitmenttypes.ConvertProofs(msg.ProofOps) if err != nil { return errorsmod.Wrapf(types.ErrInvalidICQProof, "Error converting proofs: %s", err.Error()) diff --git a/x/millions/docs/relayer_setup.md b/x/millions/docs/relayer_setup.md index 5afc4b3e..af6da06b 100644 --- a/x/millions/docs/relayer_setup.md +++ b/x/millions/docs/relayer_setup.md @@ -24,9 +24,9 @@ Once inside, you can type the following to create the links (repeat for each cha ### Create link for Gaia <=> Lum -`hermes create connection --a-chain lum-millions-1 --b-chain gaia-devnet` +`hermes create connection --a-chain lum-devnet --b-chain gaia-devnet` -`hermes create channel --a-chain lum-millions-1 --a-connection connection-0 --a-port transfer --b-port transfer` +`hermes create channel --a-chain lum-devnet --a-connection connection-0 --a-port transfer --b-port transfer` Transactions may fail but will succeed at some point. @@ -54,7 +54,7 @@ Then enter the container (replace ID inside) Then type -`gaiad tx ibc-transfer transfer transfer channel-0 lum16rlynj5wvzwts5lqep0je5q4m3eaepn58hmzu5 1000000uatom --from genesis_key --keyring-backend test --chain-id gaia-devnet --fees 200uatom` +`gaiad tx ibc-transfer transfer transfer channel-0 lum1u33h97evzjpqkl9t8g7cd6wfvt2h9jzlahdzva 1000000uatom --from genesis_key --keyring-backend test --chain-id gaia-devnet --fees 200uatom` If you type diff --git a/x/millions/keeper/keeper_draw.go b/x/millions/keeper/keeper_draw.go index 04016a18..4bc49475 100644 --- a/x/millions/keeper/keeper_draw.go +++ b/x/millions/keeper/keeper_draw.go @@ -203,6 +203,13 @@ func (k Keeper) OnQueryFreshPrizePoolCoinsOnRemoteZoneCompleted(ctx sdk.Context, return nil, err } if draw.State != types.DrawState_IcqBalance { + // W're in the wrong state. If the state is already in error, and we are triggering because of an error, just ignore and don't return the error + // Because it's making the relayer trying to push again and again the same error + if isError && draw.State == types.DrawState_Failure { + return &draw, nil + } + + // Otherwise we just process the error as expected return &draw, errorsmod.Wrapf(types.ErrIllegalStateOperation, "state should be %s but is %s", types.DrawState_IcqBalance.String(), draw.State.String()) }