Page MenuHomePhabricator

net_processing: remove mapRelay, relay txs from m_most_recent_block
ClosedPublic

Authored by PiRK on Jul 15 2025, 12:53.

Details

Summary

mapRelay (used to relay announced transactions that are no longer in the mempool) doesn't have an absolute memory limit, only an implicit one based on the rate of transaction announcements.
Remove it.

Note that we can't remove a transaction from the mempool with a replacement transaction, as the sendrawtransaction(tx_b) RPC would fail with txn-mempool-conflict, but as of D15279 we can use avalanche to reject a tx from the mempool.

This is a backport of core#27625
Depends on D18366

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Jul 15 2025, 12:53

lint: sort imports

test/functional/p2p_leak_tx.py
24 ↗(On Diff #54853)

without this the test takes 41s, with it it runs in 8s

Fabien requested changes to this revision.Jul 15 2025, 14:19
Fabien added a subscriber: Fabien.

How does it work during a reorg ?

This revision now requires changes to proceed.Jul 15 2025, 14:19

add a reorg test
The transaction is put back in the mempool so it should be available for request

test/functional/p2p_leak_tx.py
148 ↗(On Diff #54860)

Note that this still works on my machine in the first iteration, it does not seem affected by the self.noban_tx_relay = True (which can affect the speed of announcing / relaying transactions to peers)

This revision is now accepted and ready to land.Jul 15 2025, 21:31