The confusing "command" terminology for the 12-byte field in the (v1) p2p message header was replaced with the more proper term "message type" in other modules already years ago, see eg #18533, #18937, #24078, #24141. This PR does the same for the protocol.{h,cpp} module to complete the replacements. Note that "GetCommand" is a method name also used in the ArgsManager (there it makes much more sense), so the scripted-diff lists for this replacement the files explicitly, rather than using $(git grep -l ...).
scripted-diff: get rid of remaining "command" terminology in protocol.{h,cpp} #31163
pull theStack wants to merge 1 commits into bitcoin:master from theStack:202410-remaining_command_terminology changing 11 files +53 −53-
theStack commented at 10:02 PM on October 26, 2024: contributor
-
4120c7543e
scripted-diff: get rid of remaining "command" terminology in protocol.{h,cpp}
-BEGIN VERIFY SCRIPT- sed -i s/COMMAND_SIZE/MESSAGE_TYPE_SIZE/g $(git grep -l COMMAND_SIZE) sed -i s/pszCommand/msg_type/g $(git grep -l pszCommand) sed -i s/pchCommand/m_msg_type/g $(git grep -l pchCommand) sed -i s/GetCommand/GetMessageType/g ./src/net.cpp ./src/protocol.cpp ./src/protocol.h ./src/test/fuzz/protocol.cpp sed -i s/IsCommandValid/IsMessageTypeValid/g $(git grep -l IsCommandValid) sed -i "s/command/message type/g" ./src/protocol.h ./src/protocol.cpp -END VERIFY SCRIPT-
-
DrahtBot commented at 10:02 PM on October 26, 2024: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
Code Coverage & Benchmarks
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31163.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
- DrahtBot added the label Refactoring on Oct 26, 2024
-
laanwj commented at 9:16 AM on October 27, 2024: member
Concept ACK, always has been a pet peeve of mine.
- rkrux approved
-
rkrux commented at 12:17 PM on November 1, 2024: contributor
tACK 4120c7543ee32efed7396d7153411ecbbd588ad3
Successful make and functional tests. I tested the script using the script checker script without any issues; ended up installing gnu sed and gnu grep on my MAC.
➜ bitcoin git:(202410-remaining_command_terminology) ✗ test/lint/commit-script-check.sh 2a52718d734cf65aaeeb18f627547e5bca3483f4..4120c7543ee32efed7396d7153411ecbbd588ad3 Running script for: 4120c7543ee32efed7396d7153411ecbbd588ad3 sed -i s/COMMAND_SIZE/MESSAGE_TYPE_SIZE/g $(git grep -l COMMAND_SIZE) sed -i s/pszCommand/msg_type/g $(git grep -l pszCommand) sed -i s/pchCommand/m_msg_type/g $(git grep -l pchCommand) sed -i s/GetCommand/GetMessageType/g ./src/net.cpp ./src/protocol.cpp ./src/protocol.h ./src/test/fuzz/protocol.cpp sed -i s/IsCommandValid/IsMessageTypeValid/g $(git grep -l IsCommandValid) sed -i "s/command/message type/g" ./src/protocol.h ./src/protocol.cpp OK - DrahtBot requested review from laanwj on Nov 1, 2024
-
maflcko commented at 12:42 PM on November 8, 2024: member
Makes sense to change the remaining ones as well for consistency.
review ACK 4120c7543ee32efed7396d7153411ecbbd588ad3 🛒
<details><summary>Show signature</summary>
Signature:
untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}" RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM= trusted comment: review ACK 4120c7543ee32efed7396d7153411ecbbd588ad3 🛒 7vjp2D1kDy9UmqzutdkVvYk7liAUtZbaDL2JgIy7nV9sObdoKSAsgJMdXvpiR4SvnlI0HXlpm/4U+vZih4+JAw==</details>
-
fjahr commented at 12:17 AM on November 10, 2024: contributor
Code review ACK 4120c7543ee32efed7396d7153411ecbbd588ad3
Did some light checks to see if anything was missed and reviewed changes.
- fanquake merged this on Nov 11, 2024
- fanquake closed this on Nov 11, 2024
- theStack deleted the branch on Nov 11, 2024
- TheCharlatan referenced this in commit a73b2bd0f0 on Nov 14, 2024
- Fabcien referenced this in commit 86a917d767 on Jun 17, 2025
- bug-castercv502 referenced this in commit fdcc066ca0 on Sep 28, 2025
- bitcoin locked this on Nov 11, 2025