0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-14 11:26:09 -05:00
bitcoin-bitcoin-core/src/kernel
Andrew Chow d232e36abd
Merge bitcoin/bitcoin#28207: mempool: Persist with XOR
fa6b053b5c mempool: persist with XOR (MarcoFalke)

Pull request description:

  Currently the `mempool.dat` file stores data received from remote peers as-is. This may be problematic when a program other than Bitcoin Core tries to interpret them by accident. For example, an anti-virus program or other program may scan the file and move it into quarantine, or delete it, or corrupt it.

  While the local wallet is expected to re-submit any pending transactions, unrelated transactions may be missing from the mempool after a restart. This may cause fee estimates to be off, or may cause block relay to be slower.

  Fix this, similar to https://github.com/bitcoin/bitcoin/pull/6650, by rolling a random XOR pattern over the dat file when writing or reading it.

  Obviously this can only protect against programs that accidentally and unintentionally are trying to mess with the dat file. Any program that intentionally wants to mess with the dat file can still trivially do so.

ACKs for top commit:
  achow101:
    re-ACK fa6b053b5c
  glozow:
    reACK fa6b053b5c
  ismaelsadeeq:
    ACK fa6b053b5c

Tree-SHA512: ded2ce3d81bc944b828263534e3178a1e45a914fe8e024f4a14c6561a73e301820944ecc75dd704b3d4221a7a3a5c0597ccab79546250c1197609ee981fe324e
2023-11-13 11:28:15 -05:00
..
bitcoinkernel.cpp b-cs: Define G_TRANSLATION_FUN in bitcoinkernel.cpp 2022-04-26 16:30:53 -04:00
blockmanager_opts.h refactor: Move stopafterblockimport handling out of blockstorage 2023-07-11 12:00:57 +02:00
chain.cpp validation: add ChainstateRole 2023-09-30 06:38:47 -04:00
chain.h validation: add ChainstateRole 2023-09-30 06:38:47 -04:00
chainparams.cpp chainparams, assumeutxo: Fix signet txoutset hash 2023-10-20 22:53:07 +02:00
chainparams.h chainparams: add blockhash to AssumeutxoData 2023-09-30 06:38:47 -04:00
chainstatemanager_opts.h kernel: Remove StartShutdown calls from validation code 2023-07-11 12:30:56 -04:00
checks.cpp refactor: Replace std::optional<bilingual_str> with util::Result 2023-05-24 08:55:47 -04:00
checks.h fix includes for touched header files (iwyu) 2023-05-29 13:26:31 +02:00
coinstats.cpp coinstats: Fix hash_serialized2 calculation 2023-10-20 22:53:05 +02:00
coinstats.h coinstats: Fix hash_serialized2 calculation 2023-10-20 22:53:05 +02:00
context.cpp util: Add SignalInterrupt class and use in shutdown.cpp 2023-06-28 09:49:28 +02:00
context.h util: Add SignalInterrupt class and use in shutdown.cpp 2023-06-28 09:49:28 +02:00
cs_main.cpp kernel: add missing include 2023-02-22 15:46:21 +00:00
cs_main.h refactor: add kernel/cs_main.* 2023-01-05 09:05:14 +00:00
disconnected_transactions.cpp bugfix: correct DisconnectedBlockTransactions memory usage 2023-10-19 16:14:36 +01:00
disconnected_transactions.h bugfix: correct DisconnectedBlockTransactions memory usage 2023-10-19 16:14:36 +01:00
mempool_entry.h scripted-diff: rename vTxHashes to txns_randomized 2023-11-10 16:44:44 +01:00
mempool_limits.h refactor: mempool: add MemPoolLimits::NoLimits() 2022-10-05 13:07:11 +01:00
mempool_options.h mempool: persist with XOR 2023-11-09 19:44:50 +01:00
mempool_persist.cpp mempool: persist with XOR 2023-11-09 19:44:50 +01:00
mempool_persist.h Add importmempool RPC 2023-08-07 11:33:34 +02:00
mempool_removal_reason.cpp move-only: Create src/kernel/mempool_removal_reason.h 2023-08-17 16:26:20 +02:00
mempool_removal_reason.h move-only: Create src/kernel/mempool_removal_reason.h 2023-08-17 16:26:20 +02:00
messagestartchars.h kernel: Move MessageStartChars to its own file 2023-09-12 22:51:38 +02:00
notifications_interface.h kernel: Remove StartShutdown calls from validation code 2023-07-11 12:30:56 -04:00
validation_cache_sizes.h validationcaches: Use size_t for sizes 2022-08-03 12:03:28 -04:00