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]
tests: [unmarked, ibc, ibc_rly_evm, ibc_rly_gas, ibc_timeout, ibc_update_client, ica, gov, upgrade, slow, gas,staking]
env:
TESTS_TO_RUN: ${{ matrix.tests }}
steps:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## UNRELEASED

* [#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
* [#1869](https://github.com/crypto-org-chain/cronos/pull/1869) Add missing tx context during vm initialisation
* [#1872](https://github.com/crypto-org-chain/cronos/pull/1872) Support 4byteTracer for tracer
* [#1875](https://github.com/crypto-org-chain/cronos/pull/1875) Support for preinstalls
Expand Down
20 changes: 13 additions & 7 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,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 @@ -250,9 +251,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 @@ -280,10 +282,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 @@ -429,7 +431,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 @@ -443,6 +445,7 @@ func New(
keys: keys,
tkeys: tkeys,
okeys: okeys,
memKeys: memKeys,
blockProposalHandler: blockProposalHandler,
dummyCheckTx: cast.ToBool(appOpts.Get(FlagUnsafeDummyCheckTx)),
}
Expand Down Expand Up @@ -498,14 +501,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 @@ -957,7 +963,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 @@ -13,7 +13,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
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ require (
replace (
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.20250424063720-28ea58ae20d8
github.com/cosmos/cosmos-sdk => github.com/randy-cro/cosmos-sdk v0.0.0-20251113072857-fbecd698368d
)

replace (
Expand All @@ -303,7 +303,7 @@ replace (
// release/v1.15
github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20250815065500-a4fbafcae0dd
// develop
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.22.1-0.20251007011737-164da0caf703
github.com/evmos/ethermint => github.com/randy-cro/ethermint v0.0.0-20251113080751-200a3fa21286
// 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
14 changes: 6 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -904,14 +904,10 @@ 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.20250424063720-28ea58ae20d8 h1:Sif0pGNc4C384OLucyQ7P/+KjYiJ6uDn8Cf8wR7MI+c=
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20250424063720-28ea58ae20d8/go.mod h1:JwwsMeZldLN20b72mmbWPY0EV9rs+v/12hRu1JFttvY=
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.20251007011737-164da0caf703 h1:O0DF++IbEl5TAknuXtAcxFTocZ8zO8DlZRUMIo9HnLA=
github.com/crypto-org-chain/ethermint v0.22.1-0.20251007011737-164da0caf703/go.mod h1:GVopiVE4ftDRfAm3e6qj7URhNTa3Tv3JrCbfO/s8P/I=
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 Expand Up @@ -1501,8 +1497,8 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
github.com/onsi/ginkgo/v2 v2.26.0 h1:1J4Wut1IlYZNEAWIV3ALrT9NfiaGW2cDCJQSFQMs/gE=
github.com/onsi/ginkgo/v2 v2.26.0/go.mod h1:qhEywmzWTBUY88kfO0BRvX4py7scov9yR+Az2oavUzw=
github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns=
github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
Expand Down Expand Up @@ -1609,6 +1605,10 @@ github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/randy-cro/cosmos-sdk v0.0.0-20251113072857-fbecd698368d h1:e+tr4hox24RlHHgw/ssnoGxbyVyTpi2mpCot7nCima0=
github.com/randy-cro/cosmos-sdk v0.0.0-20251113072857-fbecd698368d/go.mod h1:8/AdT5lF3ILCCl/sDQXyBgzWGtcmD1tInWyhYeREVPA=
github.com/randy-cro/ethermint v0.0.0-20251113080751-200a3fa21286 h1:RVtWqr2eYcKBrUcvxVQJqJEsn8ZxksiHsBTY1PYOk20=
github.com/randy-cro/ethermint v0.0.0-20251113080751-200a3fa21286/go.mod h1:J48dha1E5/Bekfybp6uFD8Pyzb1Ug+JUOH7ygrpiYqQ=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
Expand Down Expand Up @@ -1807,8 +1807,6 @@ go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
Expand Down
12 changes: 6 additions & 6 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ schema = 3
version = "v1.0.0-beta.5"
hash = "sha256-Fy/PbsOsd6iq0Njy3DVWK6HqWsogI+MkE8QslHGWyVg="
[mod."github.com/cosmos/cosmos-sdk"]
version = "v0.50.6-0.20250424063720-28ea58ae20d8"
hash = "sha256-UCynFh2IangiNqQsgux4dKCk8wuF1vgoINQGA8N59QY="
replaced = "github.com/crypto-org-chain/cosmos-sdk"
version = "v0.0.0-20251113072857-fbecd698368d"
hash = "sha256-OKm0aCROqIURMJ55nJ7LF6bdHK8XztoyoWwjl8AoFko="
replaced = "github.com/randy-cro/cosmos-sdk"
[mod."github.com/cosmos/go-bip39"]
version = "v1.0.0"
hash = "sha256-Qm2aC2vaS8tjtMUbHmlBSagOSqbduEEDwc51qvQaBmA="
Expand Down Expand Up @@ -312,9 +312,9 @@ schema = 3
version = "v0.2.2"
hash = "sha256-0MLfSJKdeK3Z7tWAXTdzwB4091dmyxIX38S5SKH5QAw="
[mod."github.com/evmos/ethermint"]
version = "v0.22.1-0.20251007011737-164da0caf703"
hash = "sha256-lWvRrVuhssOIMCv07iXwJLfN2gFRgsbK8HBiqMBTMew="
replaced = "github.com/crypto-org-chain/ethermint"
version = "v0.0.0-20251113080751-200a3fa21286"
hash = "sha256-Tx58Js/jQfjJSkPE78sUlqbqYZbPNn0kxWWAK3Kl7UM="
replaced = "github.com/randy-cro/ethermint"
[mod."github.com/fatih/color"]
version = "v1.17.0"
hash = "sha256-QsKMy3MsvjbYNcA9jP8w6c3wpmWDZ0079bybAEzmXR0="
Expand Down
Loading
Loading