This PR completely removes the startingheight field in the getpeerinfo RPC, previously deprecated in v31.0 (see #34197). The second commit goes one step further: the only remaining usage for a Peers m_starting_height field is for printing P2P debug messages. Considering that the information is untrusted and not deemed useful (see discussion #33990), remove the field and only print the starting height information once at reception of the VERSION message (suggested by ajtowns in #33990 (comment)), without saving it.
rpc, net: remove `startingheight` field of `getpeerinfo` RPC and from node state #34796
pull theStack wants to merge 2 commits into bitcoin:master from theStack:2026-remove-starting_height_field changing 6 files +12 −21-
theStack commented at 2:44 AM on March 11, 2026: contributor
-
DrahtBot commented at 2:44 AM on March 11, 2026: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #34588 (refactor: decompose Peer struct into focused sub-components by w0xlt)
- #34389 (net/log: standardize peer+addr log formatting via
LogPeerby l0rinc)
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.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
- theStack force-pushed on Mar 11, 2026
- DrahtBot added the label CI failed on Mar 11, 2026
-
paseco-qu commented at 5:42 AM on March 11, 2026: none
tACK e0425924291020a4cc9498d686410ea09d704889 .
python3 build/test/functional/test_runner.py rpc_net.pyTEST STATUS DURATION rpc_net.py --v1transport✓ Passed 7 s rpc_net.py --v2transport✓ Passed 7 s ALL ✓ Passed 14 s (accumulated) Also did a quick manual check on regtest with two connected nodes.
build/bin/bitcoind -regtest -datadir=/tmp/btc1 -daemon > Bitcoin Core starting build/bin/bitcoind -regtest -datadir=/tmp/btc2 -port=18445 -rpcport=18443 -daemon > Bitcoin Core starting build/bin/bitcoin-cli -regtest -datadir=/tmp/btc1 addnode "127.0.0.1:18445" onetry build/bin/bitcoin-cli -regtest -datadir=/tmp/btc1 getpeerinfo | jq 'all(.[]; has("startingheight") | not)' > true - stickies-v approved
-
stickies-v commented at 6:45 AM on March 11, 2026: contributor
ACK e0425924291020a4cc9498d686410ea09d704889
I agree with the deprecation rationale in the predecessor PR, and thus also with this removal.
The
start_heightfield is now only still used to produce aDebuglog message. We also still advertise our ownm_best_heightto peers, which is fine because it's free and we continue to adhere to the network protocol, even if the field seems to offer little benefit. - maflcko added this to the milestone 32.0 on Mar 11, 2026
-
maflcko commented at 7:17 AM on March 11, 2026: member
review ACK e0425924291020a4cc9498d686410ea09d704889 🚍
<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 e0425924291020a4cc9498d686410ea09d704889 🚍 hifMtQ8VwzmwmuWnmHrQELhcYUzQVnMGF1FEww2Qb3x+gNInpdLlyG9TI8i24AoJxhn3f7misRTrV+bo4WQ2DA==</details>
- DrahtBot removed the label CI failed on Mar 11, 2026
-
rkrux commented at 8:03 AM on March 11, 2026: contributor
code review ACK e0425924291020a4cc9498d686410ea09d704889
Follow up to the previous deprecation PR gone in v31.
- sedited approved
-
sedited commented at 9:48 AM on March 11, 2026: contributor
ACK e0425924291020a4cc9498d686410ea09d704889
Seems fine to remove the starting height from the debug log too.
- DrahtBot added the label Needs rebase on Mar 11, 2026
-
rpc, net: completely remove `startingheight` field of `getpeerinfo` RPC b267efcdaf
-
p2p: remove m_starting_height field from node state (only show once in debug log) 745ad941de
- theStack force-pushed on Mar 11, 2026
- DrahtBot removed the label Needs rebase on Mar 11, 2026
-
w0xlt commented at 7:40 PM on March 11, 2026: contributor
ACK 745ad941dedaa0f4e2a5fdda58a3bf683d672196
- DrahtBot requested review from maflcko on Mar 11, 2026
- DrahtBot requested review from stickies-v on Mar 11, 2026
- DrahtBot requested review from sedited on Mar 11, 2026
- DrahtBot requested review from rkrux on Mar 11, 2026
- sedited approved
-
sedited commented at 7:41 PM on March 11, 2026: contributor
Re-ACK 745ad941dedaa0f4e2a5fdda58a3bf683d672196
-
stickies-v commented at 3:25 AM on March 12, 2026: contributor
re-ACK 745ad941dedaa0f4e2a5fdda58a3bf683d672196, no changes except for addressing minor merge conflict
- sedited merged this on Mar 12, 2026
- sedited closed this on Mar 12, 2026
- theStack deleted the branch on Mar 12, 2026