From e195207041b431e9b156c01e616eeaeab557e1de Mon Sep 17 00:00:00 2001 From: huangyi Date: Mon, 2 Sep 2024 11:37:57 +0800 Subject: [PATCH] Problem: tx is not replaced by priority Solution: - Add TxReplacement callback --- CHANGELOG.md | 1 + app/app.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7980fc8963..eeadf568ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (evm) [#414](https://github.com/crypto-org-chain/ethermint/pull/414) Integrate go-block-stm for parallel tx execution. * (block-stm) [#498](https://github.com/crypto-org-chain/ethermint/pull/498) Enable incarnation cache for block-stm executor. +* (app) [#]() Only replace tx if new priority is larger. ### State Machine Breaking diff --git a/app/app.go b/app/app.go index 940b0f95b7..3b5b666efd 100644 --- a/app/app.go +++ b/app/app.go @@ -280,6 +280,10 @@ func NewEthermintApp( TxPriority: mempool.NewDefaultTxPriority(), SignerExtractor: NewEthSignerExtractionAdapter(mempool.NewDefaultSignerExtractionAdapter()), MaxTx: maxTxs, + TxReplacement: func(op, np int64, oTx, nTx sdk.Tx) bool { + // tx is only replaced if new priority is higher than old priority + return np > op + }, }) handler := baseapp.NewDefaultProposalHandler(mempool, app)