test: Add msgtype to msg_generic slots #32833

pull dergoegge wants to merge 1 commits into bitcoin:master from dergoegge:2025-06-fix-msg_generic changing 1 files +1 −1
  1. dergoegge commented at 10:17 am on June 30, 2025: member

    msg_generic can’t be used unless msgtype is listed in __slots__

    Example from a custom test:

     02025-06-30T10:14:55.418000Z TestFramework (INFO): PRNG seed is: 3137163719543762151
     12025-06-30T10:14:55.418000Z TestFramework (INFO): Initializing test directory /tmp/nix-shell-110135-0/bitcoin_func_test_7lmiemmp
     22025-06-30T10:14:55.675000Z TestFramework (INFO): Setting up connections & mining some blocks...
     32025-06-30T10:14:56.511000Z TestFramework (ERROR): Unexpected exception caught during testing
     4Traceback (most recent call last):
     5  File "/home/dergoegge/workspace/bitcoin/worktrees/master/test/functional/test_framework/test_framework.py", line 189, in main
     6    self.run_test()
     7  File "/home/dergoegge/workspace/bitcoin/worktrees/master/./build/test/functional/p2p_bug28676.py", line 46, in run_test
     8    self.connections[0].send_without_ping(msg_generic(b"block", bytes.fromhex("0500000006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f06b816712ffab8c59299a6abb58ccefa1995a1368ca4348782ef268cbc9bacacdbe5494dffff7f200200000001010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff075105ffffffff00ffffffff0200f90295000000002200204ae81572f06e1b88fd5ced7a1a000945432e83e1551e6f721ee9c00b8cc332600000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000")))
     9  File "/home/dergoegge/workspace/bitcoin/worktrees/master/test/functional/test_framework/messages.py", line 1386, in __init__
    10    self.msgtype = msgtype
    11AttributeError: 'msg_generic' object has no attribute 'msgtype'
    
  2. test: Add msgtype to msg_generic slots 7dc43ea503
  3. DrahtBot added the label Tests on Jun 30, 2025
  4. DrahtBot commented at 10:17 am on June 30, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32833.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK maflcko, theStack

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  5. maflcko commented at 10:23 am on June 30, 2025: member

    lgtm ACK 7dc43ea503a2c145ffd4fe14b794300bfc2bcdee

    Could add a small smoke test, maybe in ./test/functional/p2p_ping.py, but seems fine either way

  6. theStack approved
  7. theStack commented at 11:24 am on June 30, 2025: contributor
    ACK 7dc43ea503a2c145ffd4fe14b794300bfc2bcdee
  8. dergoegge commented at 12:11 pm on June 30, 2025: member

    Could add a small smoke test, maybe in ./test/functional/p2p_ping.py, but seems fine either way

    Not gonna do it here, but if someone wants to do it in a follow up, I can review

  9. fanquake merged this on Jun 30, 2025
  10. fanquake closed this on Jun 30, 2025

  11. fanquake referenced this in commit 4b656e2023 on Jun 30, 2025
  12. fanquake commented at 12:30 pm on June 30, 2025: member
    Backported to 29.x in #32810.
  13. Ahz9619 commented at 12:37 pm on June 30, 2025: none
    test/functional/test_framework/messages.py
  14. maflcko commented at 12:57 pm on June 30, 2025: member

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: 2025-07-01 00:12 UTC

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