mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Merge bitcoin/bitcoin#27675: p2p: Drop m_recently_announced_invs bloom filter
fb02ba3c5fmempool_entry: improve struct packing (Anthony Towns)1a118062fbnet_processing: Clean up INVENTORY_BROADCAST_MAX constants (Anthony Towns)6fa49937e4test: Check tx from disconnected block is immediately requestable (glozow)e4ffabbffanet_processing: don't add txids to m_tx_inventory_known_filter (Anthony Towns)6ec1809d33net_processing: drop m_recently_announced_invs bloom filter (Anthony Towns)a70beafdb2validation: when adding txs due to a block reorg, allow immediate relay (Anthony Towns)1e9684f39fmempool_entry: add mempool entry sequence number (Anthony Towns) Pull request description: This PR replaces the `m_recently_announced_invs` bloom filter with a simple sequence number tracking the mempool state when we last considered sending an INV message to a node. This saves 33kB per peer (or more if we raise the rate at which we relay transactions over the network, in which case we would need to increase the size of the bloom filter proportionally). The philosophy here (compare with #18861 and #19109) is that we consider the rate limiting on INV messages to only be about saving bandwidth and not protecting privacy, and therefore after you receive an INV message, it's immediately fair game to request any transaction that was in the mempool at the time the INV message was sent. We likewise consider the BIP 133 feefilter and BIP 37 bloom filters to be bandwidth optimisations here, and treat transactions as requestable if they would have been announced without those filters. Given that philosophy, tracking the timestamp of the last INV message and comparing that against the mempool entry time allows removal of each of `m_recently_announced_invs`, `m_last_mempool_req` and `UNCONDITIONAL_RELAY_DELAY` and associated logic. ACKs for top commit: naumenkogs: ACKfb02ba3c5famitiuttarwar: review ACKfb02ba3c5fglozow: reACKfb02ba3c5fTree-SHA512: cbba5ee04c86df26b6057f3654c00a2b45ec94d354f4f157a769cecdaa0b509edaac02b3128afba39b023e82473fc5e28c915a787f84457ffe66638c6ac9c2d4
This commit is contained in:
@@ -241,7 +241,8 @@ struct PackageMempoolAcceptResult
|
||||
* @param[in] tx The transaction to submit for mempool acceptance.
|
||||
* @param[in] accept_time The timestamp for adding the transaction to the mempool.
|
||||
* It is also used to determine when the entry expires.
|
||||
* @param[in] bypass_limits When true, don't enforce mempool fee and capacity limits.
|
||||
* @param[in] bypass_limits When true, don't enforce mempool fee and capacity limits,
|
||||
* and set entry_sequence to zero.
|
||||
* @param[in] test_accept When true, run validation checks but don't submit to mempool.
|
||||
*
|
||||
* @returns a MempoolAcceptResult indicating whether the transaction was accepted/rejected with reason.
|
||||
|
||||
Reference in New Issue
Block a user