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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
timeout-minutes: 240
strategy:
matrix:
tests: [unmarked, ibc, ibc_rly_evm, ibc_rly_gas, ibc_timeout, ibc_update_client, ica, gov, upgrade, slow, gas, mint]
tests: [unmarked, ibc, ibc_rly_evm, ibc_rly_gas, ibc_timeout, ibc_update_client, ica, gov, upgrade, slow, gas, mint, staking]
env:
TESTS_TO_RUN: ${{ matrix.tests }}
steps:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## UNRELEASED

* [#1910](https://github.com/crypto-org-chain/cronos/pull/1910) fix: Optimize staking endblocker with an in-memory KV store and standardize gas consumption for staking related messages. Temporary patch to not allow staking messages.
* [#1907](https://github.com/crypto-org-chain/cronos/pull/1907) fix: Optimize staking endblocker with an in-memory KV store and standardize gas consumption for staking related messages

### Improvements

* [#1903](https://github.com/crypto-org-chain/cronos/pull/1903) Feat: check authorization list in e2ee.
Expand Down
22 changes: 14 additions & 8 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ func StoreKeys() (
map[string]*storetypes.KVStoreKey,
map[string]*storetypes.TransientStoreKey,
map[string]*storetypes.ObjectStoreKey,
map[string]*storetypes.MemoryStoreKey,
) {
storeKeys := []string{
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
Expand All @@ -255,9 +256,10 @@ func StoreKeys() (
}
keys := storetypes.NewKVStoreKeys(storeKeys...)
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
memKeys := storetypes.NewMemoryStoreKeys(stakingtypes.CacheStoreKey, cronostypes.MemStoreKey)
okeys := storetypes.NewObjectStoreKeys(banktypes.ObjectStoreKey, evmtypes.ObjectStoreKey)

return keys, tkeys, okeys
return keys, tkeys, okeys, memKeys
}

var (
Expand Down Expand Up @@ -285,10 +287,10 @@ type App struct {
pendingTxListeners []evmante.PendingTxListener

// keys to access the substores
keys map[string]*storetypes.KVStoreKey
tkeys map[string]*storetypes.TransientStoreKey
okeys map[string]*storetypes.ObjectStoreKey

keys map[string]*storetypes.KVStoreKey
tkeys map[string]*storetypes.TransientStoreKey
okeys map[string]*storetypes.ObjectStoreKey
memKeys map[string]*storetypes.MemoryStoreKey
// keepers
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
Expand Down Expand Up @@ -447,7 +449,7 @@ func New(
bApp.SetInterfaceRegistry(interfaceRegistry)
bApp.SetTxEncoder(txConfig.TxEncoder())

keys, tkeys, okeys := StoreKeys()
keys, tkeys, okeys, memKeys := StoreKeys()

invCheckPeriod := cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod))
app := &App{
Expand All @@ -461,6 +463,7 @@ func New(
keys: keys,
tkeys: tkeys,
okeys: okeys,
memKeys: memKeys,
blockProposalHandler: blockProposalHandler,
dummyCheckTx: cast.ToBool(appOpts.Get(FlagUnsafeDummyCheckTx)),
}
Expand Down Expand Up @@ -516,14 +519,17 @@ func New(
panic(err)
}
app.txConfig = txConfig
stakingCacheSize := cast.ToInt(appOpts.Get(server.FlagStakingCacheSize))
app.StakingKeeper = stakingkeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[stakingtypes.StoreKey]),
runtime.NewMemStoreService(memKeys[stakingtypes.CacheStoreKey]),
app.AccountKeeper,
app.BankKeeper,
authAddr,
address.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()),
address.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()),
stakingCacheSize,
)
app.MintKeeper = mintkeeper.NewKeeper(
appCodec,
Expand Down Expand Up @@ -666,7 +672,7 @@ func New(
app.CronosKeeper = *cronoskeeper.NewKeeper(
appCodec,
keys[cronostypes.StoreKey],
keys[cronostypes.MemStoreKey],
memKeys[cronostypes.MemStoreKey],
app.BankKeeper,
app.TransferKeeper,
app.EvmKeeper,
Expand Down Expand Up @@ -975,7 +981,7 @@ func New(
app.MountKVStores(keys)
app.MountTransientStores(tkeys)
app.MountObjectStores(okeys)

app.MountMemoryStores(memKeys)
// initialize BaseApp
app.SetInitChainer(app.InitChainer)
app.SetPreBlocker(app.PreBlocker)
Expand Down
2 changes: 1 addition & 1 deletion cmd/cronosd/cmd/versiondb.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func ChangeSetCmd() *cobra.Command {
keys, _, _ := app.StoreKeys()
keys, _, _, _ := app.StoreKeys()
storeNames := make([]string, 0, len(keys))
for name := range keys {
storeNames = append(storeNames, name)
Expand Down
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ replace (
// release/v0.50.x
cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254
cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241217090828-cfbca9fe8254
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20251119062431-8d0a31ef043d
// release/v0.50-cronosv1.6.x
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.0.0-20251121110054-d5e74b9954c1
)

replace (
Expand All @@ -305,8 +306,8 @@ replace (
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2
// release/v1.15
github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20250815065500-a4fbafcae0dd
// release/v0.22.x
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.22.1-0.20251105021702-154426496ecd
// release/v0.22.x-cronosv1.6-optstaking
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.0.0-20251124090103-12d426c14aea
// Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities.
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -906,14 +906,14 @@ github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c h1:MOgfS4+F
github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
github.com/crypto-org-chain/cometbft v0.0.0-20251014161156-b0e778b18408 h1:7dfWkDRYCsguKrpd0t14nrZ3Xf/9aVHiQrWx5o0DCdo=
github.com/crypto-org-chain/cometbft v0.0.0-20251014161156-b0e778b18408/go.mod h1:khbgmtxbgwJfMqDmnGY4rl2sQpTdzpPb1f9nqnfpy1o=
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20251119062431-8d0a31ef043d h1:ffzsdKbhbSSBIMBAGJGjezjEr60A/JgpznOJhMUMbfE=
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20251119062431-8d0a31ef043d/go.mod h1:8/AdT5lF3ILCCl/sDQXyBgzWGtcmD1tInWyhYeREVPA=
github.com/crypto-org-chain/cosmos-sdk v0.0.0-20251121110054-d5e74b9954c1 h1:4aMpMx19bBo0vXDLx9jBtBW/BvWyOVW5SN4ciC7WhDc=
github.com/crypto-org-chain/cosmos-sdk v0.0.0-20251121110054-d5e74b9954c1/go.mod h1:8/AdT5lF3ILCCl/sDQXyBgzWGtcmD1tInWyhYeREVPA=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254 h1:NEgy0r3otU/O+0OAjMdEhbn4VotQlg+98hHbD7M23wU=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241217090828-cfbca9fe8254 h1:JzLOFRiKsDtLJt5h0M0jkEIPDKvFFyja7VEp7gG6O9U=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241217090828-cfbca9fe8254/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w=
github.com/crypto-org-chain/ethermint v0.22.1-0.20251105021702-154426496ecd h1:R6G28wQwmbjLhtTp6qJQk8vRSk65b2LaA237hkrMpWo=
github.com/crypto-org-chain/ethermint v0.22.1-0.20251105021702-154426496ecd/go.mod h1:StA36YNgLruMKlg6FG+fUie0+k3hQS8dapZJzl+CPI4=
github.com/crypto-org-chain/ethermint v0.0.0-20251124090103-12d426c14aea h1:H1hoG9J3ElBeAL3RzJufa0VvR6+hEqXDvp+ME7sKhpI=
github.com/crypto-org-chain/ethermint v0.0.0-20251124090103-12d426c14aea/go.mod h1:/E17R2sdjWWygJJP+ZSh3CkfJD2U8Z4HbA85iObApoc=
github.com/crypto-org-chain/go-block-stm v0.0.0-20241213061541-7afe924fb4a6 h1:6KPEi8dWkDSBddQb4NAvEXmNnTXymF3yVeTaT4Hz1iU=
github.com/crypto-org-chain/go-block-stm v0.0.0-20241213061541-7afe924fb4a6/go.mod h1:iwQTX9xMX8NV9k3o2BiWXA0SswpsZrDk5q3gA7nWYiE=
github.com/crypto-org-chain/go-ethereum v1.10.20-0.20250815065500-a4fbafcae0dd h1:ebSnzvM9yKVGFjvoGly7LFQQCS2HuOWMCvQyByJ52Gs=
Expand Down
8 changes: 4 additions & 4 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ schema = 3
version = "v1.0.0-beta.5"
hash = "sha256-Fy/PbsOsd6iq0Njy3DVWK6HqWsogI+MkE8QslHGWyVg="
[mod."github.com/cosmos/cosmos-sdk"]
version = "v0.50.6-0.20251119062431-8d0a31ef043d"
hash = "sha256-VxQus9ynUK8nAZh3ubNXRcxJsITzgndjd7UYYgMt6C0="
version = "v0.0.0-20251121110054-d5e74b9954c1"
hash = "sha256-XzBX/BIFpKZWMBqyGML0RpSBHMnQu1QVY9+dMi85mws="
replaced = "github.com/crypto-org-chain/cosmos-sdk"
[mod."github.com/cosmos/go-bip39"]
version = "v1.0.0"
Expand Down Expand Up @@ -315,8 +315,8 @@ schema = 3
version = "v0.2.2"
hash = "sha256-0MLfSJKdeK3Z7tWAXTdzwB4091dmyxIX38S5SKH5QAw="
[mod."github.com/evmos/ethermint"]
version = "v0.22.1-0.20251105021702-154426496ecd"
hash = "sha256-VU/v4owuoa6L9BffE/8dN/fEU7cJTZPwIUyNxDBjvdE="
version = "v0.0.0-20251124090103-12d426c14aea"
hash = "sha256-4C9kaSpyzHGtM1mY5UC6HiWpZZDoG2P/2vNQ/zO9bzc="
replaced = "github.com/crypto-org-chain/ethermint"
[mod."github.com/fatih/color"]
version = "v1.17.0"
Expand Down
Loading
Loading