Skip to content

Commit

Permalink
Problem: tx is not replaced by priority
Browse files Browse the repository at this point in the history
Closes: crypto-org-chain#1557

Solution:
- add TxReplacement callback, only replace if priority is higher
  • Loading branch information
yihuang committed Sep 2, 2024
1 parent 825c551 commit 3f0b777
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* (store) [#1526](https://github.com/crypto-org-chain/cronos/pull/1526) Cache index/filters in rocksdb application.db to reduce ram usage.
* (store)[#1529](https://github.com/crypto-org-chain/cronos/pull/1529) Enable pinL0FilterAndIndexBlocksInCache.
* (store)[#1547](https://github.com/crypto-org-chain/cronos/pull/1547) Disable memiavl cache if block-stm is enabled.
* (app) [#]() Only replace tx if new priority is larger.

### Bug Fixes

Expand Down
4 changes: 4 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ func New(
TxPriority: mempool.NewDefaultTxPriority(),
SignerExtractor: evmapp.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)

Expand Down

0 comments on commit 3f0b777

Please sign in to comment.