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
  1. theStack commented at 2:44 AM on March 11, 2026: contributor

    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.

  2. 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.

    Type Reviewers
    ACK w0xlt, sedited, stickies-v
    Stale ACK paseco-qu, maflcko, rkrux

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</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 LogPeer by 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-->

  3. theStack force-pushed on Mar 11, 2026
  4. DrahtBot added the label CI failed on Mar 11, 2026
  5. paseco-qu commented at 5:42 AM on March 11, 2026: none

    tACK e0425924291020a4cc9498d686410ea09d704889 .

    python3 build/test/functional/test_runner.py rpc_net.py

    TEST 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
    
  6. stickies-v approved
  7. 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_height field is now only still used to produce a Debug log message. We also still advertise our own m_best_height to 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.

  8. maflcko added this to the milestone 32.0 on Mar 11, 2026
  9. 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>

  10. DrahtBot removed the label CI failed on Mar 11, 2026
  11. 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.

  12. sedited approved
  13. 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.

  14. DrahtBot added the label Needs rebase on Mar 11, 2026
  15. rpc, net: completely remove `startingheight` field of `getpeerinfo` RPC b267efcdaf
  16. p2p: remove m_starting_height field from node state (only show once in debug log) 745ad941de
  17. theStack force-pushed on Mar 11, 2026
  18. theStack commented at 3:17 PM on March 11, 2026: contributor

    Rebased on master (due to conflict after #34389). Thanks for the quick reviews!

  19. DrahtBot removed the label Needs rebase on Mar 11, 2026
  20. w0xlt commented at 7:40 PM on March 11, 2026: contributor

    ACK 745ad941dedaa0f4e2a5fdda58a3bf683d672196

  21. DrahtBot requested review from maflcko on Mar 11, 2026
  22. DrahtBot requested review from stickies-v on Mar 11, 2026
  23. DrahtBot requested review from sedited on Mar 11, 2026
  24. DrahtBot requested review from rkrux on Mar 11, 2026
  25. sedited approved
  26. sedited commented at 7:41 PM on March 11, 2026: contributor

    Re-ACK 745ad941dedaa0f4e2a5fdda58a3bf683d672196

  27. stickies-v commented at 3:25 AM on March 12, 2026: contributor

    re-ACK 745ad941dedaa0f4e2a5fdda58a3bf683d672196, no changes except for addressing minor merge conflict

  28. sedited merged this on Mar 12, 2026
  29. sedited closed this on Mar 12, 2026

  30. theStack deleted the branch on Mar 12, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 21:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me