Repository navigation
Conversation
BIP14 specifies that the `sub_version_num` field is a user agent string.
A few values can safely be renamed automatically.
-BEGIN VERIFY SCRIPT-
git grep -qE 'FormatUserAgent|formatUserAgent|strUserAgent|MAX_USER_AGENT_LENGTH|cleanUserAgent|m_user_agent_mutex|USER_AGENT_COLUMN_WIDTH|P2P_USER_AGENT' -- src test/functional && echo "Error: Target identifiers already exist in src/ or test/functional" && exit 1
git grep -lE 'FormatSubVersion|formatSubVersion|strSubVersion|MAX_SUBVERSION_LENGTH|cleanSubVer|m_subver_mutex|SUBVERSION_COLUMN_WIDTH|P2P_SUBVERSION|strSubVer|Subversion' -- src test/functional | \
xargs sed --in-place \
-e 's/FormatSubVersion/FormatUserAgent/g' \
-e 's/formatSubVersion/formatUserAgent/g' \
-e 's/strSubVersion/strUserAgent/g' \
-e 's/MAX_SUBVERSION_LENGTH/MAX_USER_AGENT_LENGTH/g' \
-e 's/cleanSubVer/cleanUserAgent/g' \
-e 's/m_subver_mutex/m_user_agent_mutex/g' \
-e 's/SUBVERSION_COLUMN_WIDTH/USER_AGENT_COLUMN_WIDTH/g' \
-e 's/P2P_SUBVERSION/P2P_USER_AGENT/g' \
-e 's/strSubVer/user_agent/g' \
-e 's/Subversion/UserAgent/g'
-END VERIFY SCRIPT-
BIP14 specifies that the `sub_version_num` field is a user agent string.
Update user-facing text, comments, and local variable names accordingly, while keeping RPC keys ("subver", "subversion") unchanged for compatibility.
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. LLM Linter (✨ experimental)Possible places where named args for integral literals may be used (e.g.
2026-01-29 13:25:27 |
naiyoma
left a comment
There was a problem hiding this comment.
Concept ACK
Changes align with proposal:-> https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki#proposal
"
The currently unused sub_version_num field in "version" packets will become the new user-agent string."
I grepped twice to check on the remaining instance
git grep -i "subver" -- src test/functional
git grep -i "subver" -- ':!src' ':!test/functional
Other than the RPC keys. These changes also do not touch the release notes and doc/bips.md, which should be left as-is.
|
Concept NACK. This touches 28 files for a purely cosmetic rename — the merge conflict cost (already 3 conflicting PRs) and git blame churn outweigh the naming consistency benefit IMO. The internal terminology has been "subversion" for 15 years and is well-understood by anyone working on this code. BIP 14 defined how we format the string, and introduced the separation between protocol and client version, but I don't think it obligates us to match its naming internally. (Personally, I think "subversion" is a nice string to have peppered through our codebase anyway) If the concern is that bips.md's description feels inaccurate, note that the entry already has a bug: it cites #669 (multisig/OP_EVAL) but the actual BIP 14 implementation was #707. (** Using AI to edit my NACKs to make them less mean) |
|
Thanks for the feedback. |
Problem
BIP14 defines the
sub_version_numfield inversionmessages as a user-agent string, but there are still internal and user-facing references to "subver/subversion" (as noted in #34389 (comment)).Fix
The first commit performs the bulk of the mechanical work via a
scripted-diffthat (with a leading preflight check to make sure the target names don't collide), renaming internal identifiers from*SubVersion*/subver*to*UserAgent*/user_agent. I have verified the mechanical renames via to produce the same binary (except for thetest_FormatSubVersionunit test name).The second commit follows up with the remaining non-mechanical cleanup, adjusting user-facing descriptions, comments, and local variable names to use "user agent" and explicitly referencing BIP14 as justification.
For compatibility, the RPC keys (
subver,subversion) are intentionally left unchanged.