File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
12
12
- Add support for ` TransactionData::Blob `
13
13
14
+ ### Changed
15
+
16
+ - Change mempool rule to compare gas limit on equal price
17
+
14
18
## [ 1.3.0] - 2025-04-17
15
19
16
20
### Added
Original file line number Diff line number Diff line change @@ -359,7 +359,17 @@ impl MempoolSrv {
359
359
// ensure spend_ids do not exist in the mempool
360
360
for m_tx_id in db. mempool_txs_by_spendable_ids ( & spend_ids) {
361
361
if let Some ( m_tx) = db. mempool_tx ( m_tx_id) ? {
362
- if m_tx. inner . gas_price ( ) < tx. inner . gas_price ( ) {
362
+ // If the transaction spendingId is already in the mempool
363
+ // (same nonce or same nullifier), we check if it can be
364
+ // replaced by the new transaction based on gas price and
365
+ // gas limit.
366
+ // If the new transaction has a higher gas price or the same
367
+ // gas price but a higher gas limit, we replace the old
368
+ // transaction with the new one.
369
+ if m_tx. inner . gas_price ( ) < tx. inner . gas_price ( )
370
+ || ( m_tx. inner . gas_price ( ) == tx. inner . gas_price ( )
371
+ && m_tx. inner . gas_limit ( ) < tx. inner . gas_limit ( ) )
372
+ {
363
373
for deleted in db. delete_mempool_tx ( m_tx_id, false ) ? {
364
374
events. push ( TransactionEvent :: Removed ( deleted) ) ;
365
375
replaced = true ;
You can’t perform that action at this time.
0 commit comments