Skip to content

Commit 9be49c0

Browse files
feat: backport release/v1.5.x to main (#1906)
* fix: disable memiavl cache when optimistic execution is enabled (#1892) * fix: disable memiavl cache when optimistic execution is enabled * update go.mod * fmt * add changelog * fix: check authorisation list for blocklisted address (#1898) * check authorisation list for blocklisted address * v1.5.3 release * add changelog * fix lint * chore: cleanup release branch (#1900) * cleanup release branch * cleanup * feat: add additional flags for mempool (#1901) * fix prioritynoncemempool and add additional flags * add changelog * fix build * add tests * avoid conflicts * move tx replacement test to mempool * isort * release: v1.5.4 (#1902) * feat: check authorization list in e2ee (#1903) * check authorisation list in e2ee * fix golang-ci * fix upgrade * add integration tests * fix changelog * fix typo * add missing commit * tdy * update ethermint * fix: bug on multiple tx replacements (#1911) * add integration tests for multiple replace txs * change wait block * fix * change dep to crypto org chain * fix integration tests * update cosmos sdk * fix integration tests --------- Signed-off-by: Thomas <81727899+thomas-nguy@users.noreply.github.com> Co-authored-by: songgaoye <songgao.ye@crypto.com>
1 parent 47a2ae0 commit 9be49c0

File tree

20 files changed

+451
-82
lines changed

20 files changed

+451
-82
lines changed

CHANGELOG.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,42 @@
22

33
## UNRELEASED
44

5-
* [#1869](https://github.com/crypto-org-chain/cronos/pull/1869) Add missing tx context during vm initialisation
6-
* [#1872](https://github.com/crypto-org-chain/cronos/pull/1872) Support 4byteTracer for tracer
75
* [#1875](https://github.com/crypto-org-chain/cronos/pull/1875) Support for preinstalls
86
* [#1882](https://github.com/crypto-org-chain/cronos/pull/1882) Support for eip2935
97
* [#1880](https://github.com/crypto-org-chain/cronos/pull/1880) Move module from v2 to v1 to follow semver convention
8+
9+
10+
11+
*Nov 30, 2025*
12+
13+
## v1.5.4
14+
15+
### Improvements
16+
17+
* [#1898](https://github.com/crypto-org-chain/cronos/pull/1898) Chore: cleanup release by reverting #1892, #1893 and #1850.
18+
* [#1901](https://github.com/crypto-org-chain/cronos/pull/1901) Feat: add mempool.feebump and disable-tx-replacement flags.
19+
* [#1911](https://github.com/crypto-org-chain/cronos/pull/1911) Fix: bug on multiple tx replacements
20+
21+
22+
*Oct 30, 2025*
23+
24+
## v1.5.3
25+
26+
### Bug fixes
27+
* [#1898](https://github.com/crypto-org-chain/cronos/pull/1898) Check authorisation list for blocklisted address.
28+
29+
## v1.5.2
30+
31+
* [#1892](https://github.com/crypto-org-chain/cronos/pull/1892) fix: disable memiavl cache when optimistic execution is enabled.
32+
* [#1893](https://github.com/crypto-org-chain/cronos/pull/1893) Normalize cache validator queue key to be UTC.
33+
* [#1850](https://github.com/crypto-org-chain/cronos/pull/1850) Optimize staking endblocker execution by caching queue entries from iterators. Upgrade RocksDB to `v10.4.2` and enable asyncIO.
34+
35+
*Oct 15, 2025*
36+
37+
## v1.5.1
38+
39+
* [#1869](https://github.com/crypto-org-chain/cronos/pull/1869) Add missing tx context during vm initialisation
40+
* [#1872](https://github.com/crypto-org-chain/cronos/pull/1872) fix(evm): support 4byteTracer for tracer
1041
* [#1888](https://github.com/crypto-org-chain/cronos/pull/1888) Patch comet bft (GHSA-hrhf-2vcr-ghch)
1142

1243
*Sep 4, 2025*

app/app.go

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ import (
112112
servertypes "github.com/cosmos/cosmos-sdk/server/types"
113113
sdk "github.com/cosmos/cosmos-sdk/types"
114114
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
115-
mempool "github.com/cosmos/cosmos-sdk/types/mempool"
115+
"github.com/cosmos/cosmos-sdk/types/mempool"
116116
"github.com/cosmos/cosmos-sdk/types/module"
117117
"github.com/cosmos/cosmos-sdk/types/msgservice"
118118
sigtypes "github.com/cosmos/cosmos-sdk/types/tx/signing"
@@ -174,6 +174,11 @@ const (
174174
FlagBlockedAddresses = "blocked-addresses"
175175
FlagUnsafeIgnoreBlockListFailure = "unsafe-ignore-block-list-failure"
176176
FlagUnsafeDummyCheckTx = "unsafe-dummy-check-tx"
177+
178+
FlagMempoolFeeBump = "mempool.feebump"
179+
180+
FlagDisableTxReplacement = "cronos.disable-tx-replacement"
181+
FlagDisableOptimisticExecution = "cronos.disable-optimistic-execution"
177182
)
178183

179184
var Forks = []Fork{}
@@ -377,14 +382,22 @@ func New(
377382
addressCodec := authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix())
378383

379384
var mpool mempool.Mempool
380-
if maxTxs := cast.ToInt(appOpts.Get(server.FlagMempoolMaxTxs)); maxTxs >= 0 {
385+
mempoolMaxTxs := cast.ToInt(appOpts.Get(server.FlagMempoolMaxTxs))
386+
feeBump := cast.ToInt64(appOpts.Get(FlagMempoolFeeBump))
387+
if mempoolMaxTxs >= 0 && feeBump >= 0 {
381388
// NOTE we use custom transaction decoder that supports the sdk.Tx interface instead of sdk.StdTx
382389
// Setup Mempool and Proposal Handlers
383-
logger.Info("NewPriorityMempool is enabled")
390+
logger.Info("NewPriorityMempool is enabled", "feebump", feeBump)
384391
mpool = mempool.NewPriorityMempool(mempool.PriorityNonceMempoolConfig[int64]{
385392
TxPriority: mempool.NewDefaultTxPriority(),
386393
SignerExtractor: evmapp.NewEthSignerExtractionAdapter(mempool.NewDefaultSignerExtractionAdapter()),
387-
MaxTx: maxTxs,
394+
MaxTx: mempoolMaxTxs,
395+
TxReplacement: func(op, np int64, oTx, nTx sdk.Tx) bool {
396+
// we set a rule which the priority of the new Tx must be {feebump}% more than the priority of the old Tx
397+
// otherwise, the Insert will return error
398+
threshold := 100 + feeBump
399+
return np >= op*threshold/100
400+
},
388401
})
389402
} else {
390403
logger.Info("NoOpMempool is enabled")
@@ -410,16 +423,21 @@ func New(
410423
})
411424

412425
blockSTMEnabled := cast.ToString(appOpts.Get(srvflags.EVMBlockExecutor)) == "block-stm"
426+
optimisticExecutionDisabled := cast.ToBool(appOpts.Get(FlagDisableOptimisticExecution))
413427

414428
var cacheSize int
415-
if !blockSTMEnabled {
416-
// only enable memiavl cache if block-stm is not enabled, because it's not concurrency-safe.
429+
if !blockSTMEnabled && optimisticExecutionDisabled {
430+
// only enable memiavl cache if neither block-stm nor optimistic execution is enabled, because it's not concurrency-safe.
417431
cacheSize = cast.ToInt(appOpts.Get(memiavlstore.FlagCacheSize))
418432
}
419433
baseAppOptions = memiavlstore.SetupMemIAVL(logger, homePath, appOpts, false, false, cacheSize, baseAppOptions)
420434

421-
// enable optimistic execution
422-
baseAppOptions = append(baseAppOptions, baseapp.SetOptimisticExecution())
435+
// The default value of optimisticExecution is enabled.
436+
if !optimisticExecutionDisabled {
437+
// enable optimistic execution
438+
logger.Info("Enable optimistic execution")
439+
baseAppOptions = append(baseAppOptions, baseapp.SetOptimisticExecution())
440+
}
423441

424442
// NOTE we use custom transaction decoder that supports the sdk.Tx interface instead of sdk.StdTx
425443
bApp := baseapp.NewBaseApp(Name, logger, db, txConfig.TxDecoder(), baseAppOptions...)
@@ -963,9 +981,19 @@ func New(
963981
app.SetPreBlocker(app.PreBlocker)
964982
app.SetBeginBlocker(app.BeginBlocker)
965983
app.SetEndBlocker(app.EndBlocker)
984+
985+
mempoolCacheMaxTxs := mempoolMaxTxs
986+
if cast.ToBool(appOpts.Get(FlagDisableTxReplacement)) {
987+
mempoolCacheMaxTxs = -1
988+
}
989+
if mempoolCacheMaxTxs >= 0 {
990+
logger.Info("Tx replacement is enabled")
991+
} else {
992+
logger.Info("Tx replacement is disabled")
993+
}
966994
if err := app.setAnteHandler(txConfig,
967995
cast.ToUint64(appOpts.Get(srvflags.EVMMaxTxGasWanted)),
968-
cast.ToInt(appOpts.Get(server.FlagMempoolMaxTxs)),
996+
mempoolCacheMaxTxs,
969997
cast.ToStringSlice(appOpts.Get(FlagBlockedAddresses)),
970998
); err != nil {
971999
panic(err)

app/block_address.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55

66
"github.com/crypto-org-chain/cronos/x/cronos/types"
7+
evmtypes "github.com/evmos/ethermint/x/evm/types"
78

89
"cosmossdk.io/errors"
910

@@ -41,6 +42,25 @@ func (bad BlockAddressesDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simula
4142
}
4243
}
4344
}
45+
46+
// check EIP-7702 authorisation list
47+
for _, msg := range tx.GetMsgs() {
48+
msgEthTx, ok := msg.(*evmtypes.MsgEthereumTx)
49+
if ok {
50+
ethTx := msgEthTx.AsTransaction()
51+
if ethTx.SetCodeAuthorizations() != nil {
52+
for _, auth := range ethTx.SetCodeAuthorizations() {
53+
addr, err := auth.Authority()
54+
if err == nil {
55+
if _, ok := bad.blockedMap[sdk.AccAddress(addr.Bytes()).String()]; ok {
56+
return ctx, fmt.Errorf("signer is blocked: %s", addr.String())
57+
}
58+
}
59+
}
60+
}
61+
}
62+
}
63+
4464
admin := bad.getParams(ctx).CronosAdmin
4565
for _, msg := range tx.GetMsgs() {
4666
if blocklistMsg, ok := msg.(*types.MsgStoreBlockList); ok {

app/proposal.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99

1010
"filippo.io/age"
1111
abci "github.com/cometbft/cometbft/abci/types"
12+
evmtypes "github.com/evmos/ethermint/x/evm/types"
1213

1314
"cosmossdk.io/core/address"
1415

@@ -173,6 +174,25 @@ func (h *ProposalHandler) ValidateTransaction(tx sdk.Tx, txBz []byte) error {
173174
return fmt.Errorf("signer is blocked: %s", encoded)
174175
}
175176
}
177+
178+
// check EIP-7702 authorisation list
179+
for _, msg := range tx.GetMsgs() {
180+
msgEthTx, ok := msg.(*evmtypes.MsgEthereumTx)
181+
if ok {
182+
ethTx := msgEthTx.AsTransaction()
183+
if ethTx.SetCodeAuthorizations() != nil {
184+
for _, auth := range ethTx.SetCodeAuthorizations() {
185+
addr, err := auth.Authority()
186+
if err == nil {
187+
if _, ok := h.blocklist[sdk.AccAddress(addr.Bytes()).String()]; ok {
188+
return fmt.Errorf("signer is blocked: %s", addr.String())
189+
}
190+
}
191+
}
192+
}
193+
}
194+
}
195+
176196
return nil
177197
}
178198

app/upgrades.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ package app
22

33
import (
44
"context"
5-
"fmt"
65

7-
storetypes "cosmossdk.io/store/types"
86
upgradetypes "cosmossdk.io/x/upgrade/types"
97

108
"github.com/cosmos/cosmos-sdk/codec"
@@ -13,24 +11,9 @@ import (
1311

1412
// RegisterUpgradeHandlers returns if store loader is overridden
1513
func (app *App) RegisterUpgradeHandlers(cdc codec.BinaryCodec, maxVersion int64) bool {
16-
planName := "v1.5" // TBD
14+
planName := "v1.6" // TBD
1715
app.UpgradeKeeper.SetUpgradeHandler(planName, func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
1816
return app.ModuleManager.RunMigrations(ctx, app.configurator, fromVM)
1917
})
20-
21-
upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
22-
if err != nil {
23-
panic(fmt.Sprintf("failed to read upgrade info from disk %s", err))
24-
}
25-
26-
if !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
27-
if upgradeInfo.Name == planName {
28-
app.SetStoreLoader(MaxVersionUpgradeStoreLoader(maxVersion, upgradeInfo.Height, &storetypes.StoreUpgrades{
29-
Deleted: []string{"capability", "feeibc"},
30-
}))
31-
return true
32-
}
33-
}
34-
3518
return false
3619
}

cmd/cronosd/cmd/root.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
dbm "github.com/cosmos/cosmos-db"
1212
rosettaCmd "github.com/cosmos/rosetta/cmd"
1313
"github.com/crypto-org-chain/cronos/app"
14+
config2 "github.com/crypto-org-chain/cronos/cmd/cronosd/config"
1415
"github.com/crypto-org-chain/cronos/cmd/cronosd/opendb"
1516
memiavlcfg "github.com/crypto-org-chain/cronos/store/config"
1617
"github.com/crypto-org-chain/cronos/x/cronos"
@@ -272,6 +273,7 @@ func initAppConfig() (string, interface{}) {
272273

273274
MemIAVL memiavlcfg.MemIAVLConfig `mapstructure:"memiavl"`
274275
VersionDB VersionDBConfig `mapstructure:"versiondb"`
276+
Cronos config2.CronosConfig `mapstructure:"cronos"`
275277
}
276278

277279
tpl, cfg := servercfg.AppConfig("")
@@ -280,9 +282,10 @@ func initAppConfig() (string, interface{}) {
280282
Config: cfg.(servercfg.Config),
281283
MemIAVL: memiavlcfg.DefaultMemIAVLConfig(),
282284
VersionDB: DefaultVersionDBConfig(),
285+
Cronos: config2.DefaultCronosConfig(),
283286
}
284287

285-
return tpl + memiavlcfg.DefaultConfigTemplate + DefaultVersionDBTemplate, customAppConfig
288+
return tpl + memiavlcfg.DefaultConfigTemplate + DefaultVersionDBTemplate + config2.DefaultCronosConfigTemplate, customAppConfig
286289
}
287290

288291
// newApp creates the application

cmd/cronosd/config/config.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,17 @@ func SetBech32Prefixes(config *sdk.Config) {
88
config.SetBech32PrefixForValidator(Bech32PrefixValAddr, Bech32PrefixValPub)
99
config.SetBech32PrefixForConsensusNode(Bech32PrefixConsAddr, Bech32PrefixConsPub)
1010
}
11+
12+
type CronosConfig struct {
13+
// Set to true to disable tx replacement.
14+
DisableTxReplacement bool `mapstructure:"disable-tx-replacement"`
15+
// Set to true to disable optimistic execution.
16+
DisableOptimisticExecution bool `mapstructure:"disable-optimistic-execution"`
17+
}
18+
19+
func DefaultCronosConfig() CronosConfig {
20+
return CronosConfig{
21+
DisableTxReplacement: false,
22+
DisableOptimisticExecution: false,
23+
}
24+
}

cmd/cronosd/config/toml.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package config
2+
3+
// DefaultCronosConfigTemplate defines the configuration template for cronos configuration
4+
const DefaultCronosConfigTemplate = `
5+
###############################################################################
6+
### Cronos Configuration ###
7+
###############################################################################
8+
9+
[cronos]
10+
11+
# Set to true to disable tx replacement.
12+
disable-tx-replacement = {{ .Cronos.DisableTxReplacement }}
13+
14+
# Set to true to disable optimistic execution (not recommended on validator nodes).
15+
disable-optimistic-execution = {{ .Cronos.DisableOptimisticExecution }}
16+
`

default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
nativeByteOrder ? true, # nativeByteOrder mode will panic on big endian machines
1212
}:
1313
let
14-
version = "v1.5.0";
14+
version = "v1.6.0";
1515
pname = "cronosd";
1616
tags = [
1717
"ledger"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ replace (
303303
// release/v1.15
304304
github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20250815065500-a4fbafcae0dd
305305
// develop
306-
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.22.1-0.20251007011737-164da0caf703
306+
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.22.1-0.20251112062728-d8a1c9e5f577
307307
// Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities.
308308
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
309309
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0

0 commit comments

Comments
 (0)