From 514b99369776419dd9b902df45b1cef11b1f47eb Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Wed, 26 Aug 2026 09:54:00 +0100 Subject: [PATCH 1/2] Remove stale ibc from v6.7 module version map Remove stale IBC from v6.7 module version map and apply minor cleanups that are missed in previous IBC removal. Remove obsolete relayer tests. --- CHANGELOG.md | 1 + README.md | 1 + app/upgrade_test.go | 3 + app/upgrades.go | 2 + docs/ibc_retirement.md | 15 +++ mod_test.go | 12 +- sei-wasmd/contrib/relayer-tests/.gitignore | 3 - sei-wasmd/contrib/relayer-tests/README.md | 13 -- .../configs/wasmd/chains/ibc-0.json | 1 - .../configs/wasmd/chains/ibc-1.json | 1 - .../relayer-tests/init_two_chainz_relayer.sh | 63 ---------- sei-wasmd/contrib/relayer-tests/one_chain.sh | 116 ------------------ sei-wasmd/x/wasm/types/errors.go | 3 - 13 files changed, 28 insertions(+), 206 deletions(-) create mode 100644 docs/ibc_retirement.md delete mode 100644 sei-wasmd/contrib/relayer-tests/.gitignore delete mode 100644 sei-wasmd/contrib/relayer-tests/README.md delete mode 100644 sei-wasmd/contrib/relayer-tests/configs/wasmd/chains/ibc-0.json delete mode 100644 sei-wasmd/contrib/relayer-tests/configs/wasmd/chains/ibc-1.json delete mode 100755 sei-wasmd/contrib/relayer-tests/init_two_chainz_relayer.sh delete mode 100755 sei-wasmd/contrib/relayer-tests/one_chain.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index aa515c42f4..a9db8140f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#3990](https://github.com/sei-protocol/sei-chain/pull/3990) Freeze mode is limited to full nodes and disables transaction and evidence submission, mempool gossip, and state sync from startup while preserving query RPC and mempool-backed reads. Frozen and Autobahn nodes no longer advertise the unused mempool P2P channel. ### Upgrade guide +* **IBC core removal.** Removes the retired IBC core source, protobufs, light clients, CLI, and simulation support. Retired IBC stores remain mounted but are omitted from `export-genesis`; preserve the state database or use v6.6 freeze nodes for historical IBC data. * **IBC transfer removal.** Removes ICS-20 execution, module APIs, CLI commands, CosmWasm transfer messages, transfer codecs, and transfer keeper integration, including the IBC EVM precompile's keeper injection. The transfer store and module account remain materialized for state compatibility. Transfer queries, historical transfer transaction decoding, and pre-v6.7 IBC precompile tracing must be served by v6.6 freeze nodes; v6.7 nodes do not provide them. * **IBC query removal.** Removes the IBC core gRPC, REST, Protobuf, raw ABCI store, and native CosmWasm query APIs, along with CLI query commands. Historical IBC queries must be served by v6.6 freeze nodes. * **Capability removal.** Removes the capability module and its IBC, transfer, and CosmWasm integrations. The capability store remains mounted for historical state access in freeze mode. diff --git a/README.md b/README.md index d3a7af4311..d2dbcfd7d0 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ For the most up to date documentation please visit https://www.docs.sei.io/ Developer reference in this repo: [EVM JSON-RPC explicitly unsupported methods](docs/evm_jsonrpc_unsupported.md) (methods that return `-32000` with a clear message). Starting with v6.7, IBC module source and wiring are removed. IBC queries, historical transfer transaction decoding, and pre-v6.7 IBC precompile tracing are not served by v6.7 nodes. Run a v6.6 freeze node to serve pre-v6.7 IBC history. +See [IBC retirement](docs/ibc_retirement.md) for the retained CosmWasm and state behavior. # Sei Optimizations Sei introduces four major innovations: diff --git a/app/upgrade_test.go b/app/upgrade_test.go index 4d239492e6..08a0c269d7 100644 --- a/app/upgrade_test.go +++ b/app/upgrade_test.go @@ -8,6 +8,7 @@ import ( "github.com/sei-protocol/sei-chain/sei-cosmos/crypto/keys/secp256k1" sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types" "github.com/sei-protocol/sei-chain/sei-cosmos/x/upgrade/types" + storekeys "github.com/sei-protocol/sei-chain/sei-db/common/keys" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types" "github.com/stretchr/testify/require" @@ -38,6 +39,7 @@ func TestV67RemovesRetiredModuleVersions(t *testing.T) { testWrapper.App.RegisterUpgradeHandlers() versionMap := testWrapper.App.UpgradeKeeper.GetModuleVersionMap(testWrapper.Ctx) + versionMap[storekeys.IBCStoreKey] = 1 versionMap["capability"] = 1 versionMap["feegrant"] = 1 versionMap["transfer"] = 2 @@ -49,6 +51,7 @@ func TestV67RemovesRetiredModuleVersions(t *testing.T) { }) versionMap = testWrapper.App.UpgradeKeeper.GetModuleVersionMap(testWrapper.Ctx) + require.NotContains(t, versionMap, storekeys.IBCStoreKey) require.NotContains(t, versionMap, "capability") require.NotContains(t, versionMap, "feegrant") require.NotContains(t, versionMap, "transfer") diff --git a/app/upgrades.go b/app/upgrades.go index 539db301d8..1923f8a69f 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -8,6 +8,7 @@ import ( sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types" "github.com/sei-protocol/sei-chain/sei-cosmos/types/module" upgradetypes "github.com/sei-protocol/sei-chain/sei-cosmos/x/upgrade/types" + storekeys "github.com/sei-protocol/sei-chain/sei-db/common/keys" "golang.org/x/mod/semver" ) @@ -97,6 +98,7 @@ func (app *App) RegisterUpgradeHandlers() { if err != nil { return nil, err } + app.UpgradeKeeper.DeleteModuleVersion(ctx, storekeys.IBCStoreKey) app.UpgradeKeeper.DeleteModuleVersion(ctx, capabilityModuleName) app.UpgradeKeeper.DeleteModuleVersion(ctx, feegrantModuleName) app.UpgradeKeeper.DeleteModuleVersion(ctx, transferModuleName) diff --git a/docs/ibc_retirement.md b/docs/ibc_retirement.md new file mode 100644 index 0000000000..92fe945654 --- /dev/null +++ b/docs/ibc_retirement.md @@ -0,0 +1,15 @@ +# IBC retirement + +IBC core and ICS-20 execution are removed from v6.7 nodes. Pre-v6.7 IBC +history, transaction decoding, queries, and precompile tracing are served by +v6.6 freeze nodes. + +CosmWasm contracts retain their recorded IBC port metadata. During contract +execution, the `PortID` query remains available. Channel and channel-list +queries are unsupported, and every IBC send, transfer, or close message returns +a deterministic unsupported-operation error. ABCI smart queries do not expose +IBC data. + +The `ibc`, `transfer`, and `capability` stores remain mounted for state +compatibility but are excluded from `export-genesis`. Preserve the state +database when those retired stores are required. diff --git a/mod_test.go b/mod_test.go index 044c84b596..4d6bd184e2 100644 --- a/mod_test.go +++ b/mod_test.go @@ -11,8 +11,8 @@ import ( "golang.org/x/mod/module" ) -// bannedUpstream lists original upstream modules that sei has forked into local -// subdirectories. Neither go.mod nor go.sum should reference these. +// bannedUpstream lists upstream modules that Sei does not depend on directly. +// Most have local forks; IBC is retired. var bannedUpstream = []string{ "github.com/tendermint/tendermint", "github.com/cosmos/cosmos-sdk", @@ -37,7 +37,7 @@ func isBannedModule(modPath string) (banned string, ok bool) { } // TestGoMod_NoBannedDependencies ensures that go.mod require directives never -// reference original upstream modules that sei has forked. +// reference banned upstream modules. // // Module paths may carry a major-version suffix (e.g. github.com/cosmos/ibc-go/v6). // The check strips the suffix with module.SplitPathVersion before comparing, @@ -54,13 +54,13 @@ func TestGoMod_NoBannedDependencies(t *testing.T) { for _, req := range f.Require { banned, ok := isBannedModule(req.Mod.Path) - require.Falsef(t, ok, "go.mod must not depend on %s (use local fork instead), but found: %s %s", + require.Falsef(t, ok, "go.mod must not depend on banned module %s, but found: %s %s", banned, req.Mod.Path, req.Mod.Version) } } // TestGoSum_NoBannedDependencies ensures that go.sum never contains checksums -// for original upstream modules that sei has forked. +// for banned upstream modules. func TestGoSum_NoBannedDependencies(t *testing.T) { f, err := os.Open("go.sum") require.NoError(t, err) @@ -75,7 +75,7 @@ func TestGoSum_NoBannedDependencies(t *testing.T) { continue } banned, ok := isBannedModule(modPath) - require.Falsef(t, ok, "go.sum must not reference %s (use local fork instead), but found: %s", + require.Falsef(t, ok, "go.sum must not reference banned module %s, but found: %s", banned, line) } require.NoError(t, scanner.Err()) diff --git a/sei-wasmd/contrib/relayer-tests/.gitignore b/sei-wasmd/contrib/relayer-tests/.gitignore deleted file mode 100644 index d369e35ff8..0000000000 --- a/sei-wasmd/contrib/relayer-tests/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Testing -.relayer -data diff --git a/sei-wasmd/contrib/relayer-tests/README.md b/sei-wasmd/contrib/relayer-tests/README.md deleted file mode 100644 index 1502463d54..0000000000 --- a/sei-wasmd/contrib/relayer-tests/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Relayer tests - -These scripts helps to test go-relayer with two local wasmd chains. \ -Make sure you run below scripts under `wasmd/contrib/relayer-tests` directory. - -- `./init_two_chainz_relayer.sh` spins up two chains and initializes relayer clients. -- `./one_chain.sh` spins up one chain and is used by the script above. - -## Thank you -The setup scripts here are taken from [cosmos/relayer](https://github.com/cosmos/relayer) -Thank your relayer team for these scripts. - - diff --git a/sei-wasmd/contrib/relayer-tests/configs/wasmd/chains/ibc-0.json b/sei-wasmd/contrib/relayer-tests/configs/wasmd/chains/ibc-0.json deleted file mode 100644 index 854f76492e..0000000000 --- a/sei-wasmd/contrib/relayer-tests/configs/wasmd/chains/ibc-0.json +++ /dev/null @@ -1 +0,0 @@ -{"key":"testkey","chain-id":"ibc-0","rpc-addr":"http://localhost:26657","account-prefix":"wasm","gas-adjustment":1.5,"gas-prices":"0.025stake","trusting-period":"336h"} diff --git a/sei-wasmd/contrib/relayer-tests/configs/wasmd/chains/ibc-1.json b/sei-wasmd/contrib/relayer-tests/configs/wasmd/chains/ibc-1.json deleted file mode 100644 index 88696b6f3d..0000000000 --- a/sei-wasmd/contrib/relayer-tests/configs/wasmd/chains/ibc-1.json +++ /dev/null @@ -1 +0,0 @@ -{"key":"testkey","chain-id":"ibc-1","rpc-addr":"http://localhost:26557","account-prefix":"wasm","gas-adjustment":1.5,"gas-prices":"0.025stake", "trusting-period":"336h"} diff --git a/sei-wasmd/contrib/relayer-tests/init_two_chainz_relayer.sh b/sei-wasmd/contrib/relayer-tests/init_two_chainz_relayer.sh deleted file mode 100755 index 7ba3aca181..0000000000 --- a/sei-wasmd/contrib/relayer-tests/init_two_chainz_relayer.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# init_two_chainz_relayer creates two wasmd chains and configures the relayer - -SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -WASMD_DATA="$(pwd)/data" -RELAYER_CONF="$(pwd)/.relayer" - -# Ensure relayer is installed -if ! [ -x "$(which rly)" ]; then - echo "Error: wasmd is not installed. Try running 'make build-wasmd'" >&2 - exit 1 -fi - -# Ensure wasmd is installed -if ! [ -x "$(which wasmd)" ]; then - echo "Error: wasmd is not installed. Try running 'make build-wasmd'" >&2 - exit 1 -fi - -# Display software version for testers -echo "WASMD VERSION INFO:" -wasmd version --long - -# Ensure jq is installed -if [[ ! -x "$(which jq)" ]]; then - echo "jq (a tool for parsing json in the command line) is required..." - echo "https://stedolan.github.io/jq/download/" - exit 1 -fi - -# Delete data from old runs -rm -rf $WASMD_DATA &> /dev/null -rm -rf $RELAYER_CONF &> /dev/null - -# Stop existing wasmd processes -killall wasmd &> /dev/null - -set -e - -chainid0=ibc-0 -chainid1=ibc-1 - -echo "Generating wasmd configurations..." -mkdir -p $WASMD_DATA && cd $WASMD_DATA && cd ../ -./one_chain.sh wasmd $chainid0 ./data 26657 26656 6060 9090 -./one_chain.sh wasmd $chainid1 ./data 26557 26556 6061 9091 - -[ -f $WASMD_DATA/$chainid0.log ] && echo "$chainid0 initialized. Watch file $WASMD_DATA/$chainid0.log to see its execution." -[ -f $WASMD_DATA/$chainid1.log ] && echo "$chainid1 initialized. Watch file $WASMD_DATA/$chainid1.log to see its execution." - - -echo "Generating rly configurations..." -rly config init -rly config add-chains configs/wasmd/chains - -SEED0=$(jq -r '.mnemonic' $WASMD_DATA/ibc-0/key_seed.json) -SEED1=$(jq -r '.mnemonic' $WASMD_DATA/ibc-1/key_seed.json) -echo "Key $(rly keys restore ibc-0 testkey "$SEED0") imported from ibc-0 to relayer..." -echo "Key $(rly keys restore ibc-1 testkey "$SEED1") imported from ibc-1 to relayer..." -echo "Creating light clients..." -sleep 3 -rly light init ibc-0 -f -rly light init ibc-1 -f diff --git a/sei-wasmd/contrib/relayer-tests/one_chain.sh b/sei-wasmd/contrib/relayer-tests/one_chain.sh deleted file mode 100755 index 78b6420506..0000000000 --- a/sei-wasmd/contrib/relayer-tests/one_chain.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh - -set -e - -display_usage() { - echo "\nMissing $1 parameter. Please check if all parameters were specified." - echo "\nUsage: ./one-chain [BINARY] [CHAIN_ID] [CHAIN_DIR] [RPC_PORT] [P2P_PORT] [PROFILING_PORT] [GRPC_PORT]" - echo "\nExample: ./one-chain $BINARY test-chain-id ./data 26657 26656 6060 9090 \n" - exit 1 -} - -KEYRING=--keyring-backend="test" -SILENT=1 - -redirect() { - if [ "$SILENT" -eq 1 ]; then - "$@" > /dev/null 2>&1 - else - "$@" - fi -} - -BINARY=$1 -CHAINID=$2 -CHAINDIR=$3 -RPCPORT=$4 -P2PPORT=$5 -PROFPORT=$6 -GRPCPORT=$7 - -if [ -z "$1" ]; then - display_usage "[BINARY] ($BINARY|akash)" -fi - -if [ -z "$2" ]; then - display_usage "[CHAIN_ID]" -fi - -if [ -z "$3" ]; then - display_usage "[CHAIN_DIR]" -fi - -if [ -z "$4" ]; then - display_usage "[RPC_PORT]" -fi - -if [ -z "$5" ]; then - display_usage "[P2P_PORT]" -fi - -if [ -z "$6" ]; then - display_usage "[PROFILING_PORT]" -fi - -if [ -z "$7" ]; then - display_usage "[GRPC_PORT]" -fi - -echo "Creating $BINARY instance: home=$CHAINDIR | chain-id=$CHAINID | p2p=:$P2PPORT | rpc=:$RPCPORT | profiling=:$PROFPORT | grpc=:$GRPCPORT" - -# Add dir for chain, exit if error -if ! mkdir -p $CHAINDIR/$CHAINID 2>/dev/null; then - echo "Failed to create chain folder. Aborting..." - exit 1 -fi - -# Build genesis file incl account for passed address -chain_one_coins="100000000000stake,100000000000umuon,100000000000test" -chain_two_coins="100000000000stake,100000000000umuon" -delegate="100000000000stake" - -redirect $BINARY --home $CHAINDIR/$CHAINID --chain-id $CHAINID init $CHAINID -sleep 1 -$BINARY --home $CHAINDIR/$CHAINID keys add validator $KEYRING --output json > $CHAINDIR/$CHAINID/validator_seed.json 2> /dev/null -sleep 1 -$BINARY --home $CHAINDIR/$CHAINID keys add user $KEYRING --output json > $CHAINDIR/$CHAINID/key_seed.json 2> /dev/null -sleep 1 -redirect $BINARY --home $CHAINDIR/$CHAINID add-genesis-account $($BINARY --home $CHAINDIR/$CHAINID keys $KEYRING show user -a) $chain_one_coins -sleep 1 -redirect $BINARY --home $CHAINDIR/$CHAINID add-genesis-account $($BINARY --home $CHAINDIR/$CHAINID keys $KEYRING show validator -a) $chain_two_coins -sleep 1 -redirect $BINARY --home $CHAINDIR/$CHAINID gentx validator $delegate $KEYRING --chain-id $CHAINID -sleep 1 -redirect $BINARY --home $CHAINDIR/$CHAINID collect-gentxs -sleep 1 -jq '.consensus_params["timeout"]["commit"]="1000000000"' $CHAINDIR/$CHAINID/config/genesis.json > $CHAINDIR/$CHAINID/config/tmp_genesis.json -mv $CHAINDIR/$CHAINID/config/tmp_genesis.json $CHAINDIR/$CHAINID/config/genesis.json -jq '.consensus_params["timeout"]["propose"]="1000000000"' $CHAINDIR/$CHAINID/config/genesis.json > $CHAINDIR/$CHAINID/config/tmp_genesis.json -mv $CHAINDIR/$CHAINID/config/tmp_genesis.json $CHAINDIR/$CHAINID/config/genesis.json -sleep 1 - -# Check platform -platform='unknown' -unamestr=`uname` -if [ "$unamestr" = 'Linux' ]; then - platform='linux' -fi - -# Set proper defaults and change ports (use a different sed for Mac or Linux) -echo "Change settings in config.toml file..." -if [ $platform = 'linux' ]; then - sed -i 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:'"$RPCPORT"'"#g' $CHAINDIR/$CHAINID/config/config.toml - sed -i 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:'"$P2PPORT"'"#g' $CHAINDIR/$CHAINID/config/config.toml - sed -i 's#"localhost:6060"#"localhost:'"$P2PPORT"'"#g' $CHAINDIR/$CHAINID/config/config.toml - sed -i 's/index_all_keys = false/index_all_keys = true/g' $CHAINDIR/$CHAINID/config/config.toml - # sed -i '' 's#index-events = \[\]#index-events = \["message.action","send_packet.packet_src_channel","send_packet.packet_sequence"\]#g' $CHAINDIR/$CHAINID/config/app.toml -else - sed -i '' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:'"$RPCPORT"'"#g' $CHAINDIR/$CHAINID/config/config.toml - sed -i '' 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:'"$P2PPORT"'"#g' $CHAINDIR/$CHAINID/config/config.toml - sed -i '' 's#"localhost:6060"#"localhost:'"$P2PPORT"'"#g' $CHAINDIR/$CHAINID/config/config.toml - sed -i '' 's/index_all_keys = false/index_all_keys = true/g' $CHAINDIR/$CHAINID/config/config.toml - # sed -i '' 's#index-events = \[\]#index-events = \["message.action","send_packet.packet_src_channel","send_packet.packet_sequence"\]#g' $CHAINDIR/$CHAINID/config/app.toml -fi - -# Start the gaia -redirect $BINARY --home $CHAINDIR/$CHAINID start --pruning=nothing --grpc.address="0.0.0.0:$GRPCPORT" > $CHAINDIR/$CHAINID.log & diff --git a/sei-wasmd/x/wasm/types/errors.go b/sei-wasmd/x/wasm/types/errors.go index bdfd30fc0d..01d4e723cd 100644 --- a/sei-wasmd/x/wasm/types/errors.go +++ b/sei-wasmd/x/wasm/types/errors.go @@ -52,9 +52,6 @@ var ( // ErrDuplicate error for content that exists ErrDuplicate = sdkErrors.Register(DefaultCodespace, 15, "duplicate") - // ErrMaxIBCChannels error for maximum number of ibc channels reached - ErrMaxIBCChannels = sdkErrors.Register(DefaultCodespace, 16, "max transfer channels") - // ErrUnsupportedForContract error when a feature is used that is not supported for/ by this contract ErrUnsupportedForContract = sdkErrors.Register(DefaultCodespace, 17, "unsupported for this contract") From 0fad25121e9df23cb5a423997a94153be9a1beb0 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Wed, 26 Aug 2026 10:06:33 +0100 Subject: [PATCH 2/2] Reflect on AI feedback --- docs/ibc_retirement.md | 4 ++-- sei-wasmd/x/wasm/types/errors.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/ibc_retirement.md b/docs/ibc_retirement.md index 92fe945654..e970984512 100644 --- a/docs/ibc_retirement.md +++ b/docs/ibc_retirement.md @@ -11,5 +11,5 @@ a deterministic unsupported-operation error. ABCI smart queries do not expose IBC data. The `ibc`, `transfer`, and `capability` stores remain mounted for state -compatibility but are excluded from `export-genesis`. Preserve the state -database when those retired stores are required. +compatibility. Preserve the state database when those retired stores are +required. diff --git a/sei-wasmd/x/wasm/types/errors.go b/sei-wasmd/x/wasm/types/errors.go index 01d4e723cd..27fbaa9fb1 100644 --- a/sei-wasmd/x/wasm/types/errors.go +++ b/sei-wasmd/x/wasm/types/errors.go @@ -52,6 +52,10 @@ var ( // ErrDuplicate error for content that exists ErrDuplicate = sdkErrors.Register(DefaultCodespace, 15, "duplicate") + // Error for maximum number of ibc channels reached is no longer supported since + // IBC is removed. This variable is kept for reserving the code registration. + _ = sdkErrors.Register(DefaultCodespace, 16, "max transfer channels") + // ErrUnsupportedForContract error when a feature is used that is not supported for/ by this contract ErrUnsupportedForContract = sdkErrors.Register(DefaultCodespace, 17, "unsupported for this contract")