dash/src
MarcoFalke 00e556ac7a
Merge bitcoin/bitcoin#21872: net: Sanitize message type for logging
09205b33aa74e385caa2803aa6febc18ad1efa32 net: Clarify message header validation errors (W. J. van der Laan)
955eee76803c098978cf0bbc7f1f6d3c230544e2 net: Sanitize message type for logging (W. J. van der Laan)

Pull request description:

  - Use `SanitizeString` when logging message errors to make sure that the message type is sanitized. I have checked all logging in `net.cpp`.

  - For the `MESSAGESTART` error don't inspect and log header details at all: receiving invalid start bytes makes it likely that the packet isn't even formatted as valid P2P message. Logging the four unexpected start bytes (as hex) should be enough.

  - Update `p2p_invalid_messages.py` test to check this.

  - Improve error messages in a second commit.

  Issue reported by gmaxwell.

ACKs for top commit:
  MarcoFalke:
    re-ACK 09205b33aa74e385caa2803aa6febc18ad1efa32 only change is log message fixup 🔂
  practicalswift:
    re-ACK 09205b33aa74e385caa2803aa6febc18ad1efa32

Tree-SHA512: 8fe5326af135cfcf39ea953d9074a8c966b9b85a810b06a2c45b8a745cf115de4f321e72fc769709d6bbecfc5953aab83176db6735b04c0bc6796f59272cadce
2024-05-19 11:19:52 -05:00
..
bench Merge bitcoin/bitcoin#22292: bench, doc: benchmarking updates and fixups 2024-05-15 03:03:18 +07:00
bls
coinjoin merge bitcoin#25109: Strengthen AssertLockNotHeld assertions 2024-05-09 08:52:48 +00:00
compat Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
config
consensus Merge #21377: Speedy trial support for versionbits 2024-04-23 22:41:10 +07:00
crc32c Merge bitcoin/bitcoin#25836: subtree: update crc32c subtree 2024-02-29 09:35:00 -06:00
crypto Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
dashbls
evo masternode: replace LOCKS_EXCLUDED with negative EXCLUSIVE_LOCKS_REQUIRED 2024-04-30 11:47:04 +00:00
governance merge bitcoin#21943: Dedup and RAII-fy the creation of a copy of CConnman::vNodes 2024-05-08 16:21:51 +00:00
gsl
immer
index merge bitcoin#25109: Strengthen AssertLockNotHeld assertions 2024-05-09 08:52:48 +00:00
interfaces Merge bitcoin/bitcoin#22214: refactor: Rearrange fillPSBT arguments 2024-05-19 11:11:30 -05:00
leveldb Merge bitcoin/bitcoin#26209: Update leveldb subtree 2024-03-05 10:40:36 -06:00
llmq Merge #5954: refactor: significant Mutex refactoring 2024-05-14 09:16:33 -05:00
logging Merge bitcoin/bitcoin#22736: log, sync: change lock contention from preprocessor directive to log category 2024-04-02 12:09:35 -05:00
masternode scripted-diff: Merge #21836: Replace three dots with ellipsis in the UI string 2024-05-19 11:16:42 -05:00
node refactor: remove fMasternodeMode and fDisableGovernance from Qt code 2024-04-25 10:04:45 +00:00
policy Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
primitives Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
qt scripted-diff: Merge #21836: Replace three dots with ellipsis in the UI string 2024-05-19 11:16:42 -05:00
rpc Merge #21718: rpc: Improve error message for getblock invalid datatype. 2024-05-19 11:19:51 -05:00
script Merge bitcoin/bitcoin#21329: descriptor wallet: Cache last hardened xpub and use in normalized descriptors 2024-05-10 14:02:01 +07:00
secp256k1
support Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
test Merge bitcoin/bitcoin#22169: p2p, rpc, fuzz: various tiny follow-ups 2024-05-19 11:13:42 -05:00
univalue
util net: add more details to log information in ETE and WakeupPipes 2024-05-14 17:23:15 +00:00
wallet Merge bitcoin/bitcoin#21759: wallet: document coin selection code 2024-05-19 11:19:51 -05:00
zmq Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
.clang-format Merge #21221: [tools] Allow argument/parameter bin packing in clang-format 2024-04-11 02:25:07 +07:00
addrdb.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
addrdb.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
addressindex.cpp
addressindex.h
addrman.cpp
addrman.h
amount.h
arith_uint256.cpp
arith_uint256.h
attributes.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
banman.cpp scripted-diff: Merge #21836: Replace three dots with ellipsis in the UI string 2024-05-19 11:16:42 -05:00
banman.h
base58.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
base58.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
batchedlogger.cpp Merge #19809: log: Prefix log messages with function name and source code location if -logsourcelocations is set 2024-04-11 02:25:08 +07:00
batchedlogger.h Merge #19809: log: Prefix log messages with function name and source code location if -logsourcelocations is set 2024-04-11 02:25:08 +07:00
bech32.cpp
bech32.h
bip324.cpp merge bitcoin#28267: BIP324 ciphersuite follow-up 2024-03-05 21:43:22 +00:00
bip324.h merge bitcoin#28267: BIP324 ciphersuite follow-up 2024-03-05 21:43:22 +00:00
bitcoin-cli.cpp partial bitcoin#25176: Fix frequent -netinfo JSON errors from null getpeerinfo#relaytxes 2024-04-26 20:25:55 +00:00
bitcoin-tx.cpp Merge #20611: Move TX_MAX_STANDARD_VERSION to policy 2024-04-03 14:16:42 +07:00
bitcoin-wallet.cpp feat: add option -usehd to wallettool to let create non-hd wallets 2024-04-10 01:59:00 +07:00
bitcoind.cpp Merge #21007: bitcoind: Add -daemonwait option to wait for initialization 2024-04-22 09:42:16 -05:00
blockencodings.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
blockencodings.h
blockfilter.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
blockfilter.h Merge bitcoin/bitcoin#25967: refactor: add LIFETIMEBOUND to blockfilter where needed 2024-02-29 09:35:01 -06:00
bloom.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
bloom.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
cachemap.h
cachemultimap.h
chain.cpp
chain.h Merge bitcoin/bitcoin#22121: doc: Various validation doc fixups 2024-04-23 09:15:20 -05:00
chainparams.cpp Merge bitcoin/bitcoin#22135: CRegTestParams: Use args instead of gArgs. 2024-05-19 11:13:42 -05:00
chainparams.h
chainparamsbase.cpp feat: new command line argument -bip147height for bitcoin#21373 2024-04-23 22:41:10 +07:00
chainparamsbase.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
chainparamsseeds.h chore: update seeds for v20.1 2024-03-03 23:34:34 -06:00
checkqueue.h merge bitcoin#25109: Strengthen AssertLockNotHeld assertions 2024-05-09 08:52:48 +00:00
clientversion.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
clientversion.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
coins.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
coins.h
compat.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
compressor.cpp
compressor.h
context.h
core_io.h Merge #20406: util: Avoid invalid integer negation in FormatMoney and ValueFromAmount 2024-04-22 09:42:16 -05:00
core_memusage.h
core_read.cpp
core_write.cpp Merge #20406: util: Avoid invalid integer negation in FormatMoney and ValueFromAmount 2024-04-22 09:42:16 -05:00
ctpl_stl.h
cuckoocache.h
cxxtimer.hpp
dash-cli-res.rc
dash-tx-res.rc
dash-wallet-res.rc
dashd-res.rc
dbwrapper.cpp
dbwrapper.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
deploymentinfo.cpp
deploymentinfo.h
deploymentstatus.cpp
deploymentstatus.h
dsnotificationinterface.cpp refactor: limit usage of fDisableGovernance, use IsValid() instead 2024-04-25 10:04:44 +00:00
dsnotificationinterface.h net: move CConnman::RelayInv{Filtered} into PeerManager 2024-04-23 16:08:10 +00:00
dummywallet.cpp Merge #14582: wallet: always do avoid partial spends if fees are within a specified range 2024-03-18 16:01:38 +07:00
flat-database.h
flatfile.cpp
flatfile.h
fs.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
fs.h
hash.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
hash.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
httprpc.cpp partial bitcoin#25001: Modernize util/strencodings and util/string: string_view and optional 2024-02-28 13:37:35 -06:00
httprpc.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
httpserver.cpp merge bitcoin#25109: Strengthen AssertLockNotHeld assertions 2024-05-09 08:52:48 +00:00
httpserver.h
i2p.cpp
i2p.h merge bitcoin#25109: Strengthen AssertLockNotHeld assertions 2024-05-09 08:52:48 +00:00
indirectmap.h
init.cpp scripted-diff: Merge #21836: Replace three dots with ellipsis in the UI string 2024-05-19 11:16:42 -05:00
init.h Merge #21007: bitcoind: Add -daemonwait option to wait for initialization 2024-04-22 09:42:16 -05:00
key_io.cpp
key_io.h
key.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
key.h
limitedmap.h
logging.cpp Merge #19809: log: Prefix log messages with function name and source code location if -logsourcelocations is set 2024-04-11 02:25:08 +07:00
logging.h Merge #19809: log: Prefix log messages with function name and source code location if -logsourcelocations is set 2024-04-11 02:25:08 +07:00
Makefile.am refactor: introduce WakeupPipe, move wakeup select pipe logic there 2024-05-14 17:23:15 +00:00
Makefile.bench.include merge bitcoin#28008: BIP324 ciphersuite 2024-03-05 21:43:21 +00:00
Makefile.crc32c.include
Makefile.leveldb.include
Makefile.qt_locale.include
Makefile.qt.include
Makefile.qttest.include Merge #21531: test: remove qt byteswap compattests 2024-04-10 03:19:40 +07:00
Makefile.test_fuzz.include
Makefile.test_util.include
Makefile.test.include Merge bitcoin/bitcoin#21884: fuzz: Remove unused --enable-danger-fuzz-link-all option 2024-04-23 22:41:09 +07:00
Makefile.univalue.include
mapport.cpp
mapport.h
memusage.h
merkleblock.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
merkleblock.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
messagesigner.cpp
messagesigner.h
miner.cpp refactor: more passing CDeterministicMNManager by ref 2024-03-19 15:21:00 +00:00
miner.h refactor: more passing CDeterministicMNManager by ref 2024-03-19 15:21:00 +00:00
net_permissions.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
net_permissions.h merge bitcoin#22387: Rate limit the processing of rumoured addresses 2024-04-12 16:40:58 +00:00
net_processing.cpp merge bitcoin#25109: Strengthen AssertLockNotHeld assertions 2024-05-09 08:52:48 +00:00
net_processing.h merge bitcoin#21160: Move tx inventory into net_processing 2024-04-26 20:25:55 +00:00
net_types.h
net.cpp Merge bitcoin/bitcoin#21872: net: Sanitize message type for logging 2024-05-19 11:19:52 -05:00
net.h refactor: introduce WakeupPipe, move wakeup select pipe logic there 2024-05-14 17:23:15 +00:00
netaddress.cpp Merge bitcoin/bitcoin#22169: p2p, rpc, fuzz: various tiny follow-ups 2024-05-19 11:13:42 -05:00
netaddress.h merge bitcoin#22211: relay I2P addresses even if not reachable (by us) 2024-04-12 16:38:36 +00:00
netbase.cpp
netbase.h merge bitcoin#19771: Replace enum CConnMan::NumConnections with enum class ConnectionDirection 2024-04-03 16:10:15 +00:00
netfulfilledman.cpp refactor: remove CNetFulfilledRequestManager global, move to NodeContext 2024-03-18 21:36:34 +00:00
netfulfilledman.h refactor: remove CNetFulfilledRequestManager global, move to NodeContext 2024-03-18 21:36:34 +00:00
netmessagemaker.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
noui.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
noui.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
outputtype.cpp
outputtype.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
pow.cpp
pow.h
prevector.h
protocol.cpp Merge bitcoin/bitcoin#21939: refactor: Replace memset calls with array initialization 2024-04-23 09:53:06 -05:00
protocol.h Merge bitcoin/bitcoin#21939: refactor: Replace memset calls with array initialization 2024-04-23 09:53:06 -05:00
psbt.cpp
psbt.h
pubkey.cpp Merge bitcoin/bitcoin#21745: refactor: Add missing includes in pubkey.cpp/pubkey.h 2024-05-19 11:11:35 -05:00
pubkey.h Merge bitcoin/bitcoin#21745: refactor: Add missing includes in pubkey.cpp/pubkey.h 2024-05-19 11:11:35 -05:00
random.cpp merge bitcoin#25109: Strengthen AssertLockNotHeld assertions 2024-05-09 08:52:48 +00:00
random.h merge bitcoin#28100: more Span<std::byte> modernization & follow-ups 2024-03-05 21:43:22 +00:00
randomenv.cpp
randomenv.h
rest.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
reverse_iterator.h
saltedhasher.cpp
saltedhasher.h
scheduler.cpp
scheduler.h merge bitcoin#25109: Strengthen AssertLockNotHeld assertions 2024-05-09 08:52:48 +00:00
serialize.h merge bitcoin#28012: Allow FastRandomContext::randbytes for std::byte, Allow std::byte serialization 2024-02-28 13:37:36 -06:00
shutdown.cpp Merge #21007: bitcoind: Add -daemonwait option to wait for initialization 2024-04-22 09:42:16 -05:00
shutdown.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
source_location.h
span.h
spentindex.h
spork.cpp net: move CConnman::RelayInv{Filtered} into PeerManager 2024-04-23 16:08:10 +00:00
spork.h spork: replace LOCKS_EXCLUDED with negative EXCLUSIVE_LOCKS_REQUIRED 2024-04-30 11:47:07 +00:00
stacktraces.cpp
stacktraces.h
statsd_client.cpp refactor: replace multiple C-style casts to reinterpret_cast 2024-03-06 03:31:46 +07:00
statsd_client.h refactor: add more consts everywhere as required by cppcheck 2.13.0 2024-03-06 03:31:48 +07:00
streams.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
sync.cpp Merge #5961: feat: implement read write locks in threading and use them for CActiveMasternodeManager::cs 2024-04-03 10:36:12 -05:00
sync.h merge bitcoin#25109: Strengthen AssertLockNotHeld assertions 2024-05-09 08:52:48 +00:00
threadinterrupt.cpp
threadinterrupt.h merge bitcoin#25109: Strengthen AssertLockNotHeld assertions 2024-05-09 08:52:48 +00:00
threadsafety.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
timedata.cpp partial bitcoin#20196: fix GetListenPort() to derive the proper port 2024-04-26 20:25:31 +00:00
timedata.h partial bitcoin#20196: fix GetListenPort() to derive the proper port 2024-04-26 20:25:31 +00:00
timestampindex.h
tinyformat.h
torcontrol.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
torcontrol.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
txdb.cpp
txdb.h
txmempool.cpp refactor: remove CDeterministicMNManager global, move to NodeContext 2024-04-16 12:55:14 -05:00
txmempool.h refactor: remove CDeterministicMNManager global, move to NodeContext 2024-04-16 12:55:14 -05:00
uint256.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
uint256.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
undo.h
unordered_lru_cache.h
validation.cpp scripted-diff: Merge #21836: Replace three dots with ellipsis in the UI string 2024-05-19 11:16:42 -05:00
validation.h Merge bitcoin/bitcoin#23044: refactor: Remove unused validation includes 2024-05-18 17:54:16 -05:00
validationinterface.cpp merge bitcoin#25109: Strengthen AssertLockNotHeld assertions 2024-05-09 08:52:48 +00:00
validationinterface.h refactor: move GetListAtChainTip() calls out of CGovernanceVote 2024-03-19 15:20:59 +00:00
version.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
versionbits.cpp Merge #21377: Speedy trial support for versionbits 2024-04-23 22:41:10 +07:00
versionbits.h merge bitcoin#25109: Strengthen AssertLockNotHeld assertions 2024-05-09 08:52:48 +00:00
walletinitinterface.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
warnings.cpp Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00
warnings.h Merge #20813: scripted-diff: Bump copyright headers 2024-04-10 03:19:34 +07:00