Error when parsing captured p2p messages using message-capture-parser.py #25954

issue ghost openend this issue on August 29, 2022
  1. ghost commented at 6:02 pm on August 29, 2022: none

    I am unable to read the p2p messages saved in msgs_sent.dat and msgs_recv.dat files.

    Steps to reproduce:

    1. Run bitcoind with capturemessages=1
    2. Wait for a few minutes, ensure there are some peers and corresponding directories created in ~/.bitcoin/message_capture
    3. Run message capture python script with: python message-capture-parser.py -o out.json ~/.bitcoin/message_capture/<IP_ADDRESS>_<PORT>/msgs_sent.dat

    I am getting this error for sent/recv dat files of all peers:

     0python message-capture-parser.py -o out.json /home/test/.bitcoin/signet/message_capture/95.217.184.148_38333/msgs_sent.dat 
     1[ ######################################################################################################################           ]  92%Traceback (most recent call last):
     2  File "/home/test/Downloads/bitcoin/contrib/message-capture/message-capture-parser.py", line 215, in <module>
     3    main()
     4  File "/home/test/Downloads/bitcoin/contrib/message-capture/message-capture-parser.py", line 200, in main
     5    process_file(str(capture), messages, "recv" in capture.stem, progress_bar)
     6  File "/home/test/Downloads/bitcoin/contrib/message-capture/message-capture-parser.py", line 160, in process_file
     7    msg_dict["body"] = to_jsonable(msg)
     8  File "/home/test/Downloads/bitcoin/contrib/message-capture/message-capture-parser.py", line 83, in to_jsonable
     9    assert all(isinstance(a, int) for a in val)
    10AssertionError
    

    Message parsing script: https://github.com/bitcoin/bitcoin/blob/master/contrib/message-capture/message-capture-parser.py Doc: https://github.com/bitcoin/bitcoin/blob/master/contrib/message-capture/message-capture-docs.md

  2. MarcoFalke added the label Scripts and tools on Aug 30, 2022
  3. benfrasersimpson commented at 10:25 am on September 2, 2022: none
    Try removing headers from HASH_INT_VECTORS. I think the deser_uint256_vector requirement is covered by the fact that hashPrevBlock and hashMerkleRoot are in the HASH_INTS list. But someone else should probably confirm this.
  4. theStack referenced this in commit 644772b9ef on Sep 4, 2022
  5. MarcoFalke referenced this in commit 3c5fb9691b on Sep 9, 2022
  6. MarcoFalke closed this on Sep 9, 2022

  7. sidhujag referenced this in commit e01a908af4 on Sep 11, 2022
  8. bitcoin locked this on Sep 9, 2023

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: 2024-09-29 01:12 UTC

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