0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00
bitcoin-core/src
fanquake a62f5ee86c
Merge bitcoin/bitcoin#27675: p2p: Drop m_recently_announced_invs bloom filter
fb02ba3c5f mempool_entry: improve struct packing (Anthony Towns)
1a118062fb net_processing: Clean up INVENTORY_BROADCAST_MAX constants (Anthony Towns)
6fa49937e4 test: Check tx from disconnected block is immediately requestable (glozow)
e4ffabbffa net_processing: don't add txids to m_tx_inventory_known_filter (Anthony Towns)
6ec1809d33 net_processing: drop m_recently_announced_invs bloom filter (Anthony Towns)
a70beafdb2 validation: when adding txs due to a block reorg, allow immediate relay (Anthony Towns)
1e9684f39f mempool_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:
    ACK fb02ba3c5f
  amitiuttarwar:
    review ACK fb02ba3c5f
  glozow:
    reACK fb02ba3c5f

Tree-SHA512: cbba5ee04c86df26b6057f3654c00a2b45ec94d354f4f157a769cecdaa0b509edaac02b3128afba39b023e82473fc5e28c915a787f84457ffe66638c6ac9c2d4
2023-08-17 10:52:06 +01:00
..
bench Merge bitcoin/bitcoin#27675: p2p: Drop m_recently_announced_invs bloom filter 2023-08-17 10:52:06 +01:00
common refactor: remove in-code warning suppression 2023-06-29 14:41:33 +01:00
compat Sort includes in compat.h 2023-08-08 17:50:41 +02:00
config
consensus
crc32c
crypto refactor: add missing headers for BIP324 ciphersuite 2023-08-15 07:30:48 +05:30
index Merge bitcoin/bitcoin#28186: kernel: Prune leveldb headers 2023-08-07 22:31:46 +02:00
init
interfaces
ipc
kernel Merge bitcoin/bitcoin#27675: p2p: Drop m_recently_announced_invs bloom filter 2023-08-17 10:52:06 +01:00
leveldb
logging
minisketch
node Merge bitcoin/bitcoin#27675: p2p: Drop m_recently_announced_invs bloom filter 2023-08-17 10:52:06 +01:00
policy
primitives
qt refactor: Fix logging.h includes 2023-08-05 10:42:56 +02:00
rpc Merge bitcoin/bitcoin#27460: rpc: Add importmempool RPC 2023-08-15 10:15:22 -04:00
script Merge bitcoin/bitcoin#28067: descriptors: do not return top-level only funcs as sub descriptors 2023-07-20 11:16:45 -04:00
secp256k1 Update secp256k1 subtree to latest upstream master 2023-07-18 15:25:05 +01:00
support Don't derive secure_allocator from std::allocator 2023-07-24 22:33:40 -07:00
test Merge bitcoin/bitcoin#27675: p2p: Drop m_recently_announced_invs bloom filter 2023-08-17 10:52:06 +01:00
univalue Remove unused raw-pointer read helper from univalue 2023-07-27 14:24:52 +02:00
util Merge bitcoin/bitcoin#27401: tracepoints: Disables -Wgnu-zero-variadic-macro-arguments to compile without warnings 2023-08-07 16:03:55 +02:00
wallet lint: remove /* Continued */ markers from codebase 2023-08-03 17:52:24 +01:00
zmq
.bear-tidy-config ci: filter all subtrees from tidy output 2023-06-29 11:59:31 +01:00
.clang-format
.clang-tidy tidy: Integrate bicoin-tidy clang-tidy plugin 2023-08-03 17:52:24 +01:00
addrdb.cpp script: appease spelling linter 2023-06-29 16:14:07 -06:00
addrdb.h
addrman.cpp
addrman.h
addrman_impl.h
arith_uint256.cpp
arith_uint256.h
attributes.h
banman.cpp
banman.h
base58.cpp
base58.h
bech32.cpp
bech32.h
bip324.cpp refactor: add missing headers for BIP324 ciphersuite 2023-08-15 07:30:48 +05:30
bip324.h refactor: add missing headers for BIP324 ciphersuite 2023-08-15 07:30:48 +05:30
bitcoin-chainstate.cpp kernel: Remove StartShutdown calls from validation code 2023-07-11 12:30:56 -04:00
bitcoin-cli-res.rc
bitcoin-cli.cpp
bitcoin-tx-res.rc
bitcoin-tx.cpp kernel: Remove Univalue from kernel library 2023-07-25 17:40:07 +02:00
bitcoin-util-res.rc
bitcoin-util.cpp
bitcoin-wallet-res.rc
bitcoin-wallet.cpp
bitcoind-res.rc
bitcoind.cpp
blockencodings.cpp refactor: Fix logging.h includes 2023-08-05 10:42:56 +02:00
blockencodings.h
blockfilter.cpp refactor: use Span for SipHash::Write 2023-07-17 13:27:46 +02:00
blockfilter.h
chain.cpp
chain.h Documentation improvements for assumeutxo 2023-07-24 16:23:38 -04:00
chainparams.cpp
chainparams.h
chainparamsbase.cpp
chainparamsbase.h
chainparamsseeds.h
checkqueue.h
clientversion.cpp
clientversion.h
coins.cpp
coins.h
compressor.cpp
compressor.h
core_io.h kernel: Remove Univalue from kernel library 2023-07-25 17:40:07 +02:00
core_memusage.h
core_read.cpp kernel: Remove Univalue from kernel library 2023-07-25 17:40:07 +02:00
core_write.cpp
cuckoocache.h
dbwrapper.cpp Merge bitcoin/bitcoin#28186: kernel: Prune leveldb headers 2023-08-07 22:31:46 +02:00
dbwrapper.h refactor: Correct dbwrapper key naming 2023-08-05 10:45:19 +02:00
deploymentinfo.cpp
deploymentinfo.h
deploymentstatus.cpp
deploymentstatus.h
dummywallet.cpp
external_signer.cpp
external_signer.h
flatfile.cpp
flatfile.h
hash.cpp
hash.h doc: Remove comments that just repeat what the code does 2023-07-12 10:01:51 +02:00
headerssync.cpp
headerssync.h
httprpc.cpp
httprpc.h
httpserver.cpp
httpserver.h
i2p.cpp
i2p.h
indirectmap.h
init.cpp Merge bitcoin/bitcoin#27460: rpc: Add importmempool RPC 2023-08-15 10:15:22 -04:00
init.h refactor: index, decouple 'Init' from 'Start' 2023-07-10 10:47:17 -03:00
key.cpp
key.h
key_io.cpp
key_io.h
logging.cpp
logging.h
Makefile.am Merge bitcoin/bitcoin#28008: BIP324 ciphersuite 2023-08-10 11:58:59 +02:00
Makefile.bench.include Merge bitcoin/bitcoin#28008: BIP324 ciphersuite 2023-08-10 11:58:59 +02:00
Makefile.crc32c.include
Makefile.leveldb.include
Makefile.minisketch.include
Makefile.qt.include
Makefile.qt_locale.include
Makefile.qttest.include
Makefile.test.include Merge bitcoin/bitcoin#28008: BIP324 ciphersuite 2023-08-10 11:58:59 +02:00
Makefile.test_fuzz.include
Makefile.test_util.include Merge bitcoin/bitcoin#27425: test: move remaining rand code from util/setup_common to util/random 2023-07-19 10:26:11 +01:00
Makefile.univalue.include
mapport.cpp
mapport.h
memusage.h
merkleblock.cpp
merkleblock.h
net.cpp Merge bitcoin/bitcoin#27213: p2p: Diversify automatic outbound connections with respect to networks 2023-08-06 18:44:42 +02:00
net.h Merge bitcoin/bitcoin#27213: p2p: Diversify automatic outbound connections with respect to networks 2023-08-06 18:44:42 +02:00
net_permissions.cpp
net_permissions.h
net_processing.cpp Merge bitcoin/bitcoin#27675: p2p: Drop m_recently_announced_invs bloom filter 2023-08-17 10:52:06 +01:00
net_processing.h net processing: clamp -blockreconstructionextratxn to uint32_t bounds 2023-07-25 21:51:20 +01:00
net_types.cpp
net_types.h
netaddress.cpp
netaddress.h refactor: use Span for SipHash::Write 2023-07-17 13:27:46 +02:00
netbase.cpp Remove now-unnecessary poll, fcntl includes from net(base).cpp 2023-06-28 16:35:45 -05:00
netbase.h
netgroup.cpp
netgroup.h
netmessagemaker.h
noui.cpp
noui.h
outputtype.cpp
outputtype.h
pow.cpp
pow.h
prevector.h
protocol.cpp refactor: Remove duplicate allNetMessageTypesVec 2023-07-11 19:26:52 +02:00
protocol.h
psbt.cpp
psbt.h
pubkey.cpp
pubkey.h Add BIP324Cipher, encapsulating key agreement, derivation, and stream/AEAD ciphers 2023-07-26 17:09:23 -04:00
random.cpp Allow FastRandomContext::randbytes for all byte types 2023-06-30 12:09:44 +02:00
random.h Allow FastRandomContext::randbytes for all byte types 2023-06-30 12:09:44 +02:00
randomenv.cpp
randomenv.h
rest.cpp
rest.h
reverse_iterator.h
scheduler.cpp
scheduler.h
serialize.h refactor: use "if constexpr" in std::vector's Unserialize() 2023-08-03 10:35:22 +02:00
shutdown.cpp
shutdown.h
signet.cpp
signet.h
span.h refactor: Use reinterpret_cast where appropriate 2023-07-24 15:32:35 +02:00
streams.cpp streams: Teach AutoFile how to XOR 2023-07-19 18:12:42 +02:00
streams.h streams: Teach AutoFile how to XOR 2023-07-19 18:12:42 +02:00
sync.cpp
sync.h
threadsafety.h
timedata.cpp
timedata.h
tinyformat.h
torcontrol.cpp Replace LocaleIndependentAtoi with ToIntegral 2023-08-08 16:04:22 +02:00
torcontrol.h iwyu on torcontrol 2023-08-08 16:03:40 +02:00
txdb.cpp
txdb.h
txmempool.cpp Merge bitcoin/bitcoin#27675: p2p: Drop m_recently_announced_invs bloom filter 2023-08-17 10:52:06 +01:00
txmempool.h Merge bitcoin/bitcoin#27675: p2p: Drop m_recently_announced_invs bloom filter 2023-08-17 10:52:06 +01:00
txorphanage.cpp
txorphanage.h
txrequest.cpp refactor: use Span for SipHash::Write 2023-07-17 13:27:46 +02:00
txrequest.h
uint256.cpp
uint256.h Merge bitcoin/bitcoin#27927: util: Allow std::byte and char Span serialization 2023-06-28 15:12:12 -04:00
undo.h
validation.cpp Merge bitcoin/bitcoin#27675: p2p: Drop m_recently_announced_invs bloom filter 2023-08-17 10:52:06 +01:00
validation.h Merge bitcoin/bitcoin#27675: p2p: Drop m_recently_announced_invs bloom filter 2023-08-17 10:52:06 +01:00
validationinterface.cpp
validationinterface.h
version.h
versionbits.cpp
versionbits.h
walletinitinterface.h
warnings.cpp
warnings.h