Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [#3818](https://github.com/sei-protocol/sei-chain/pull/3818) feat(evmrpc): extend HTTP admission control (`max_request_body_bytes`, `max_concurrent_request_bytes`, `ws_admission_timeout`) to the WebSocket plane (:8546). WS oversize frames close with WebSocket close code 1009; budget-wait timeouts return JSON-RPC error `-32005` before the connection closes. `evmrpc_requests_rejected_total` gains a `protocol` label (`http` / `ws`).

### Upgrade guide
* **IBC transfer removal.** Removes ICS-20 execution, module APIs, CLI commands, CosmWasm transfer messages, and live execution of the IBC EVM precompile. The transfer store and historical codecs remain available for historical state and transaction decoding; pre-v6.7 EVM precompile implementations remain available for historical tracing.
* [#3958](https://github.com/sei-protocol/sei-chain/pull/3958) **Feegrant removal.** Removes feegrant execution, module APIs, and the unreleased feegrant EVM precompile. The feegrant store remains mounted for historical state access. Transactions with a fee granter different from the payer are rejected.
* **WebSocket frame size default drops from 10 MiB to 5 MiB.** Before this release, :8546 used a hardcoded 10 MiB frame cap. Both HTTP and WebSocket now share `[evm].max_request_body_bytes`, whose default is 5 MiB (`5242880`). WS clients that send frames in the 5-10 MiB range (large `eth_sendRawTransaction` batches, wide filter payloads, etc.) will be disconnected after upgrade unless the limit is raised. **Operators who relied on the old 10 MiB WS cap should set `max_request_body_bytes = 10485760` in `app.toml` before upgrading.** This also raises the HTTP body limit to 10 MiB. The exported `DefaultWebsocketMaxMessageSize` constant was removed; use the config knob instead.
* [#3927](https://github.com/sei-protocol/sei-chain/pull/3927) **Legacy Sei JSON-RPC and CLI removal.** Removes `sei_associate`, `sei_getBlockByHash`, `sei_getBlockByHashExcludeTraceFail`, `sei_getBlockTransactionCountByHash`, `sei_getBlockTransactionCountByNumber`, `sei_getEvmTx`, `sei_getFilterChanges`, `sei_getFilterLogs`, `sei_getLogs`, `sei_getTransactionByBlockHashAndIndex`, `sei_getTransactionByBlockNumberAndIndex`, `sei_getTransactionByHash`, `sei_getTransactionCount`, `sei_getTransactionErrorByHash`, `sei_getTransactionReceiptExcludeTraceFail`, `sei_getVMError`, `sei_newBlockFilter`, `sei_newFilter`, `sei_sign`, and `sei_uninstallFilter`. Use standard `eth_*` methods for EVM-originated data and `seid tx evm native-associate <custom-message> -y` for address association. There is no block- or filter-level replacement for discovering Cosmos-originated synthetic logs; clients that know the synthetic transaction hash can enable `sei_getTransactionReceipt`.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Sei is the fastest general purpose L1 blockchain and the first parallelized EVM. This allows Sei to get the best of Solana and Ethereum - a hyper optimized execution layer that benefits from the tooling and mindshare around the EVM.

# Overview
**Sei** is a high-performance, low-fee, delegated proof-of-stake blockchain designed for developers. It supports optimistic parallel execution of both EVM and CosmWasm, opening up new design possibilities. With unique optimizations like twin turbo consensus and SeiDB, Sei ensures consistent 400ms block times and a transaction throughput that’s orders of magnitude higher than Ethereum. This means faster, more cost-effective operations. Plus, Sei’s seamless interoperability between EVM and CosmWasm gives developers native access to the entire Cosmos ecosystem, including IBC tokens, multi-sig accounts, and more.
**Sei** is a high-performance, low-fee, delegated proof-of-stake blockchain designed for developers. It supports optimistic parallel execution of both EVM and CosmWasm, opening up new design possibilities. With unique optimizations like twin turbo consensus and SeiDB, Sei ensures consistent 400ms block times and a transaction throughput that’s orders of magnitude higher than Ethereum. This means faster, more cost-effective operations. Plus, Sei’s seamless interoperability between EVM and CosmWasm gives developers native access to multi-sig accounts and more.

# Documentation
For the most up to date documentation please visit https://www.docs.sei.io/
Expand Down
52 changes: 23 additions & 29 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ import (
gigautils "github.com/sei-protocol/sei-chain/giga/executor/utils"
"github.com/sei-protocol/sei-chain/precompiles"
putils "github.com/sei-protocol/sei-chain/precompiles/utils"
"github.com/sei-protocol/sei-chain/sei-ibc-go/modules/apps/transfer"
ibctransferkeeper "github.com/sei-protocol/sei-chain/sei-ibc-go/modules/apps/transfer/keeper"
ibctransfertypes "github.com/sei-protocol/sei-chain/sei-ibc-go/modules/apps/transfer/types"
ibc "github.com/sei-protocol/sei-chain/sei-ibc-go/modules/core"
Expand Down Expand Up @@ -224,7 +223,6 @@ var (
ibc.AppModuleBasic{},
upgrade.AppModuleBasic{},
evidence.AppModuleBasic{},
transfer.AppModuleBasic{},
vesting.AppModuleBasic{},
oraclemodule.AppModuleBasic{},
evm.AppModuleBasic{},
Expand Down Expand Up @@ -301,6 +299,7 @@ var (
const (
MinGasEVMTx = 21000
feegrantModuleName = "feegrant"
transferModuleName = "transfer"

// NewHeadsNotifierCapacity bounds the in-process eth_newHeads
// notifier buffer. Capacity 1 pairs with the notifier's
Expand Down Expand Up @@ -399,16 +398,16 @@ type App struct {
ParamsKeeper paramskeeper.Keeper
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
EvidenceKeeper evidencekeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
WasmKeeper wasm.Keeper
OracleKeeper oraclekeeper.Keeper
EvmKeeper evmkeeper.Keeper
GigaEvmKeeper gigaevmkeeper.Keeper
// HistoricalTransferKeeper supports pre-v6.7 EVM trace replay only.
HistoricalTransferKeeper ibctransferkeeper.Keeper
WasmKeeper wasm.Keeper
OracleKeeper oraclekeeper.Keeper
EvmKeeper evmkeeper.Keeper
GigaEvmKeeper gigaevmkeeper.Keeper

// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
ScopedWasmKeeper capabilitykeeper.ScopedKeeper
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedWasmKeeper capabilitykeeper.ScopedKeeper

EpochKeeper epochmodulekeeper.Keeper

Expand Down Expand Up @@ -561,7 +560,7 @@ func New(
// add capability keeper and ScopeToModule for ibc module
app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey])

// grant capabilities for the ibc and ibc-transfer modules
// Scope IBC and Wasm capabilities plus historical transfer replay access.
scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName)
scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasm.ModuleName)
Expand Down Expand Up @@ -609,22 +608,17 @@ func New(
appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper,
)

// Create Transfer Keepers
app.TransferKeeper = ibctransferkeeper.NewKeeperWithAddressHandler(
// Keep transfer state executable only for versioned historical EVM traces.
app.HistoricalTransferKeeper = ibctransferkeeper.NewKeeper(
appCodec,
keys[ibctransfertypes.StoreKey],
app.GetSubspace(ibctransfertypes.ModuleName),
app.IBCKeeper.ChannelKeeper,
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper,
app.AccountKeeper,
app.BankKeeper,
scopedTransferKeeper,
evmkeeper.NewEvmAddressHandler(&app.EvmKeeper),
)
transferModule := transfer.NewAppModule(app.TransferKeeper)
transferIBCModule := transfer.NewIBCModule(app.TransferKeeper)

// Create evidence Keeper for to register the IBC light client misbehaviour evidence route
evidenceKeeper := evidencekeeper.NewKeeper(
appCodec, keys[evidencetypes.StoreKey], &app.StakingKeeper, app.SlashingKeeper,
Expand Down Expand Up @@ -674,7 +668,6 @@ func New(
scopedWasmKeeper,
app.BankKeeper,
appCodec,
app.TransferKeeper,
&app.EvmKeeper,
app.StakingKeeper,
),
Expand All @@ -693,7 +686,6 @@ func New(
&app.IBCKeeper.PortKeeper,
scopedWasmKeeper,
app.UpgradeKeeper,
app.TransferKeeper,
app.MsgServiceRouter(),
app.GRPCQueryRouter(),
wasmDir,
Expand All @@ -715,7 +707,7 @@ func New(
}
app.EvmKeeper = *evmkeeper.NewKeeper(keys[evmtypes.StoreKey],
tkeys[evmtypes.TransientStoreKey], app.GetSubspace(evmtypes.ModuleName), app.receiptStore, app.BankKeeper,
&app.AccountKeeper, &app.StakingKeeper, app.TransferKeeper,
&app.AccountKeeper, &app.StakingKeeper,
wasmkeeper.NewDefaultPermissionKeeper(app.WasmKeeper), &app.WasmKeeper, &app.UpgradeKeeper)
app.BankKeeper.RegisterRecipientChecker(app.EvmKeeper.CanAddressReceive)

Expand Down Expand Up @@ -786,7 +778,7 @@ func New(

app.GigaEvmKeeper = *gigaevmkeeper.NewKeeper(keys[evmtypes.StoreKey],
tkeys[evmtypes.TransientStoreKey], app.GetSubspace(evmtypes.ModuleName), app.receiptStore, app.GigaBankKeeper,
&app.AccountKeeper, &app.StakingKeeper, app.TransferKeeper,
&app.AccountKeeper, &app.StakingKeeper,
wasmkeeper.NewDefaultPermissionKeeper(app.WasmKeeper), &app.WasmKeeper, &app.UpgradeKeeper)
app.GigaEvmKeeper.UseRegularStore = true
app.GigaBankKeeper.UseRegularStore = true
Expand Down Expand Up @@ -850,9 +842,8 @@ func New(

// this line is used by starport scaffolding # stargate/app/keeperDefinition

// Create static IBC router, add transfer route, then set and seal it
// Create the static IBC router, then set and seal it.
ibcRouter := ibcporttypes.NewRouter()
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferIBCModule)
ibcRouter.AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper))
// this line is used by starport scaffolding # ibc/app/router
app.IBCKeeper.SetRouter(ibcRouter)
Expand Down Expand Up @@ -886,7 +877,6 @@ func New(
oraclemodule.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
evm.NewAppModule(appCodec, &app.EvmKeeper),
transferModule,
epochModule,
tokenfactorymodule.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
Expand Down Expand Up @@ -950,7 +940,6 @@ func New(
ibchost.ModuleName,
genutiltypes.ModuleName,
evidencetypes.ModuleName,
ibctransfertypes.ModuleName,
authz.ModuleName,
oracletypes.ModuleName,
tokenfactorytypes.ModuleName,
Expand Down Expand Up @@ -979,7 +968,6 @@ func New(
oraclemodule.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
ibc.NewAppModule(app.IBCKeeper),
transferModule,
epochModule,
tokenfactorymodule.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper),
// this line is used by starport scaffolding # stargate/app/appModule
Expand Down Expand Up @@ -1070,7 +1058,6 @@ func New(
}

app.ScopedIBCKeeper = scopedIBCKeeper
app.ScopedTransferKeeper = scopedTransferKeeper
app.ScopedWasmKeeper = scopedWasmKeeper

// Create hard fork manager and register all hard fork upgrade handlers. Note,
Expand Down Expand Up @@ -1234,7 +1221,14 @@ func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.Res
}
}
app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
return app.mm.InitGenesis(ctx, app.appCodec, genesisState, app.genesisImportConfig)
response := app.mm.InitGenesis(ctx, app.appCodec, genesisState, app.genesisImportConfig)
app.initializeRetiredTransferModuleAccount(ctx)
return response
}

// initializeRetiredTransferModuleAccount materializes the retained transfer module account during genesis.
func (app *App) initializeRetiredTransferModuleAccount(ctx sdk.Context) {
app.AccountKeeper.GetModuleAccount(ctx, transferModuleName)
}

func (app *App) GetOptimisticProcessingInfo() OptimisticProcessingInfo {
Expand Down
10 changes: 10 additions & 0 deletions app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package app
import (
"github.com/sei-protocol/sei-chain/app/params"
"github.com/sei-protocol/sei-chain/sei-cosmos/std"
ibctransfertypes "github.com/sei-protocol/sei-chain/sei-ibc-go/modules/apps/transfer/types"
)

// MakeEncodingConfig creates an EncodingConfig for testing.
Expand All @@ -12,6 +13,7 @@ func MakeEncodingConfig() params.EncodingConfig {
std.RegisterInterfaces(encodingConfig.InterfaceRegistry)
ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino)
ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry)
registerRetiredModuleCodecs(encodingConfig)
return encodingConfig
}

Expand All @@ -22,5 +24,13 @@ func MakeLegacyEncodingConfig() params.EncodingConfig {
std.RegisterInterfaces(encodingConfig.InterfaceRegistry)
ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino)
ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry)
registerRetiredModuleCodecs(encodingConfig)
return encodingConfig
}

// registerRetiredModuleCodecs keeps historical transactions decodable without
// registering the retired modules' commands, services, or genesis state.
func registerRetiredModuleCodecs(encodingConfig params.EncodingConfig) {
ibctransfertypes.RegisterLegacyAminoCodec(encodingConfig.Amino)
ibctransfertypes.RegisterInterfaces(encodingConfig.InterfaceRegistry)
}
27 changes: 27 additions & 0 deletions app/encoding_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package app

import (
"testing"

"github.com/gogo/protobuf/proto"
codectypes "github.com/sei-protocol/sei-chain/sei-cosmos/codec/types"
sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types"
ibctransfertypes "github.com/sei-protocol/sei-chain/sei-ibc-go/modules/apps/transfer/types"
"github.com/stretchr/testify/require"
)

func TestRetiredTransferMessageRemainsDecodable(t *testing.T) {
require.NotContains(t, ModuleBasics, ibctransfertypes.ModuleName)

msg := &ibctransfertypes.MsgTransfer{}
value, err := proto.Marshal(msg)
require.NoError(t, err)

any := &codectypes.Any{
TypeUrl: sdk.MsgTypeURL(msg),
Value: value,
}
var decoded sdk.Msg
require.NoError(t, MakeEncodingConfig().InterfaceRegistry.UnpackAny(any, &decoded))
require.IsType(t, msg, decoded)
}
2 changes: 1 addition & 1 deletion app/precompiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewPrecompileKeepers(a *App) *PrecompileKeepers {
SlashingMsgServer: slashingkeeper.NewMsgServerImpl(a.SlashingKeeper),
SlashingQuerier: a.SlashingKeeper,
UpgradeQuerier: a.UpgradeKeeper,
TransferKeeper: a.TransferKeeper,
TransferKeeper: a.HistoricalTransferKeeper,
ClientKeeper: a.IBCKeeper.ClientKeeper,
ConnectionKeeper: a.IBCKeeper.ConnectionKeeper,
ChannelKeeper: a.IBCKeeper.ChannelKeeper,
Expand Down
22 changes: 22 additions & 0 deletions app/store_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package app
import (
"testing"

authtypes "github.com/sei-protocol/sei-chain/sei-cosmos/x/auth/types"
"github.com/sei-protocol/sei-chain/sei-db/common/keys"
tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types"
"github.com/stretchr/testify/require"
Expand All @@ -29,3 +30,24 @@ func TestFeegrantStoreRemainsMounted(t *testing.T) {
store.Set([]byte("allowance"), []byte("retained"))
require.Equal(t, []byte("retained"), store.Get([]byte("allowance")))
}

func TestTransferStoreRemainsMounted(t *testing.T) {
require.Contains(t, kvStoreKeyNames, keys.IBCTransferStoreKey)

testApp := Setup(t, false, false, false)
ctx := testApp.NewContext(false, tmproto.Header{})
store := ctx.KVStore(testApp.GetKey(keys.IBCTransferStoreKey))
store.Set([]byte("denom-trace"), []byte("retained"))
require.Equal(t, []byte("retained"), store.Get([]byte("denom-trace")))
}

func TestRetiredTransferModuleAccountRemainsMaterialized(t *testing.T) {
testApp := Setup(t, false, false, false)
ctx := testApp.NewContext(false, tmproto.Header{})

account := testApp.AccountKeeper.GetAccount(ctx, authtypes.NewModuleAddress(transferModuleName))
moduleAccount, ok := account.(authtypes.ModuleAccountI)
require.True(t, ok)
require.Equal(t, transferModuleName, moduleAccount.GetName())
require.ElementsMatch(t, []string{authtypes.Minter, authtypes.Burner}, moduleAccount.GetPermissions())
}
4 changes: 3 additions & 1 deletion app/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestDistributionCommunityTaxParamMigration(t *testing.T) {
testWrapper.Require().Equal(params.CommunityTax, sdk.NewDec(0))
}

func TestV67RemovesFeegrantModuleVersion(t *testing.T) {
func TestV67RemovesRetiredModuleVersions(t *testing.T) {
t.Setenv("UPGRADE_VERSION_LIST", "v6.7")
tm := time.Now().UTC()
valPub := secp256k1.GenPrivKey().PubKey()
Expand All @@ -39,6 +39,7 @@ func TestV67RemovesFeegrantModuleVersion(t *testing.T) {

versionMap := testWrapper.App.UpgradeKeeper.GetModuleVersionMap(testWrapper.Ctx)
versionMap["feegrant"] = 1
versionMap["transfer"] = 2
testWrapper.App.UpgradeKeeper.SetModuleVersionMap(testWrapper.Ctx, versionMap)

testWrapper.App.UpgradeKeeper.ApplyUpgrade(testWrapper.Ctx, types.Plan{
Expand All @@ -48,6 +49,7 @@ func TestV67RemovesFeegrantModuleVersion(t *testing.T) {

versionMap = testWrapper.App.UpgradeKeeper.GetModuleVersionMap(testWrapper.Ctx)
require.NotContains(t, versionMap, "feegrant")
require.NotContains(t, versionMap, "transfer")
}

func TestSkipOptimisticProcessingOnUpgrade(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func (app *App) RegisterUpgradeHandlers() {
return nil, err
}
app.UpgradeKeeper.DeleteModuleVersion(ctx, feegrantModuleName)
app.UpgradeKeeper.DeleteModuleVersion(ctx, transferModuleName)
return newVM, nil
}

Expand Down
Loading
Loading