diff --git a/CHANGELOG.md b/CHANGELOG.md index a1f99b7e7b..51550ae470 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ ## UNRELEASED ## v1.4.12 - +* [#1890](https://github.com/crypto-org-chain/cronos/pull/1890) fix: disable memiavl cache when optimistic execution is enabled. * [#1850](https://github.com/crypto-org-chain/cronos/pull/1850) Optimize staking endblocker execution by caching queue entries from iterators. ## v1.4.11 diff --git a/app/app.go b/app/app.go index 2b6712af49..bb133a0f3c 100644 --- a/app/app.go +++ b/app/app.go @@ -366,7 +366,7 @@ func New( db dbm.DB, traceStore io.Writer, loadLatest bool, - // this line is used by starport scaffolding # stargate/app/newArgument +// this line is used by starport scaffolding # stargate/app/newArgument appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *App { @@ -435,16 +435,19 @@ func New( }) blockSTMEnabled := cast.ToString(appOpts.Get(srvflags.EVMBlockExecutor)) == "block-stm" + optimisticExecutionDisabled := cast.ToString(appOpts.Get(srvflags.EVMOptimisticExecution)) == "disable" var cacheSize int - if !blockSTMEnabled { - // only enable memiavl cache if block-stm is not enabled, because it's not concurrency-safe. + if !blockSTMEnabled && optimisticExecutionDisabled { + // only enable memiavl cache if neither block-stm nor optimistic execution is enabled, cacheSize = cast.ToInt(appOpts.Get(memiavlstore.FlagCacheSize)) } baseAppOptions = memiavlstore.SetupMemIAVL(logger, homePath, appOpts, false, false, cacheSize, baseAppOptions) - // enable optimistic execution - baseAppOptions = append(baseAppOptions, baseapp.SetOptimisticExecution()) + // The default value of optimisticExecution is enabled. + if !optimisticExecutionDisabled { + baseAppOptions = append(baseAppOptions, baseapp.SetOptimisticExecution()) + } // NOTE we use custom transaction decoder that supports the sdk.Tx interface instead of sdk.StdTx bApp := baseapp.NewBaseApp(Name, logger, db, txConfig.TxDecoder(), baseAppOptions...) @@ -737,7 +740,7 @@ func New( app.GovKeeper = *govKeeper.SetHooks( govtypes.NewMultiGovHooks( - // register the governance hooks + // register the governance hooks ), ) diff --git a/go.mod b/go.mod index bed05ec220..15fea1a649 100644 --- a/go.mod +++ b/go.mod @@ -275,7 +275,7 @@ replace ( github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240926023215-d2275b4afb9a // release/v1.4.x-2 - github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20251021095308-b55c0f03f7a6 + github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20251022025731-e501888cf647 // 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 diff --git a/go.sum b/go.sum index 88eb31f318..421d27ff98 100644 --- a/go.sum +++ b/go.sum @@ -428,8 +428,8 @@ github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254 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.6.1-0.20251021095308-b55c0f03f7a6 h1:KdA7NKfX7XgsN4uIoK9kNIPCT/fjmLSIvLqku20aI1Y= -github.com/crypto-org-chain/ethermint v0.6.1-0.20251021095308-b55c0f03f7a6/go.mod h1:oDf+clJg3Sn9vmj04ZHCTwh3HDzzn/lN4b+ucno4m+4= +github.com/crypto-org-chain/ethermint v0.6.1-0.20251022025731-e501888cf647 h1:v5khMK4UpS3rLf68CZRN8EnPYnZUnuaQPh5t3uUTJEM= +github.com/crypto-org-chain/ethermint v0.6.1-0.20251022025731-e501888cf647/go.mod h1:oDf+clJg3Sn9vmj04ZHCTwh3HDzzn/lN4b+ucno4m+4= github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716 h1:OvD5Rm0B6LHUJk6z858UgwdP72jU2DuUdXeclRyKpDI= github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716/go.mod h1:iwQTX9xMX8NV9k3o2BiWXA0SswpsZrDk5q3gA7nWYiE= github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240926023215-d2275b4afb9a h1:IUPD+dg1YQl8cLocxQ/Mbx/ObTgAgcrZlcBhFjsLO40= diff --git a/gomod2nix.toml b/gomod2nix.toml index fdb156ad97..3c6a61f01c 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -264,8 +264,8 @@ schema = 3 hash = "sha256-ozwVS2BhAoz+OOisAyMhgg+lq8FdQjf90xoOq9cxtGw=" replaced = "github.com/crypto-org-chain/go-ethereum" [mod."github.com/evmos/ethermint"] - version = "v0.6.1-0.20251021095308-b55c0f03f7a6" - hash = "sha256-nnsR70+JtwYFKtq1SJJCLgRBnxsC2N2VC/987yhC9HI=" + version = "v0.6.1-0.20251022025731-e501888cf647" + hash = "sha256-QC6mOz+sCIYSXRWwOxeUbTN9lDl3+ILqPgiwoNe0ZuA=" replaced = "github.com/crypto-org-chain/ethermint" [mod."github.com/fatih/color"] version = "v1.16.0"