net: align v2 message type validation with v1 range #35958

pull brunoerg wants to merge 1 commits into bitcoin:master from brunoerg:2026-08-v2-fix changing 2 files +13 −3
  1. brunoerg commented at 1:13 PM on August 12, 2026: contributor

    BIP324 specifies the 13-byte long-form message type encoding as "an ASCII message type (as in the v1 P2P protocol)", but V2Transport::GetMessageType() accepted bytes up to 0x7F, while for V1 it only accepts printable ASCII (0x20-0x7E).

    This changes V2 to match V1 on it and add test coverage.

  2. net: align v2 message type validation with v1 range
    BIP324 specifies the 13-byte long-form message type encoding as
    "an ASCII message type (as in the v1 P2P protocol)", but
    V2Transport::GetMessageType() accepted bytes up to 0x7F, while
    for V1 it only accepts printable ASCII (0x20-0x7E).
    
    This changes V2 to match V1 on it and add test coverage.
    cc577de954
  3. DrahtBot added the label P2P on Aug 12, 2026
  4. DrahtBot commented at 1:13 PM on August 12, 2026: 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/35958.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK nervana21, w0xlt

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. nervana21 commented at 8:56 PM on August 12, 2026: contributor

    tACK cc577de954671378268bab2a78714869b4f7388d

    The changes match CMessageHeader::IsMessageTypeValid and BIP324's "ASCII as in v1" wording.

  6. w0xlt commented at 6:33 PM on August 13, 2026: contributor

    ACK cc577de954671378268bab2a78714869b4f7388d

  7. fanquake requested review from mzumsande on Aug 14, 2026


mzumsande

Labels

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-08-21 04:51 UTC

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