Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport: Merge bitcoin#21029, 21060, 19509, 21107, 25117 #5766

Merged
merged 5 commits into from
Feb 14, 2024

Conversation

vijaydasmp
Copy link

@vijaydasmp vijaydasmp commented Dec 14, 2023

No description provided.

@vijaydasmp vijaydasmp changed the title backport : backport : Merge bitcoin#21029, 20689, 20040 Dec 14, 2023
@vijaydasmp vijaydasmp changed the title backport : Merge bitcoin#21029, 20689, 20040 backport: Merge bitcoin#21029, 20689, 20040 Dec 14, 2023
@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#21029, 20689, 20040 backport: Merge bitcoin#21029, 20689, 20868, 19509, 21060 Dec 15, 2023
@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#21029, 20689, 20868, 19509, 21060 backport: Merge bitcoin#21029, 20689, 20868, 19509, 21060, 18210, 21107 Dec 16, 2023
@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#21029, 20689, 20868, 19509, 21060, 18210, 21107 backport: Merge bitcoin#21029, 20689, 20868, 19509, 21060, 18210, 21107, 21127, 19725, 20210 Dec 17, 2023
Copy link

github-actions bot commented Jan 2, 2024

This pull request has conflicts, please rebase.

Copy link

This pull request has conflicts, please rebase.

Copy link

This pull request has conflicts, please rebase.

Copy link

This pull request has conflicts, please rebase.

@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#21029, 20689, 20868, 19509, 21060, 18210, 21107, 21127, 19725, 20210 backport: Merge bitcoin#21029, 21060, 18210, 21107 Feb 5, 2024
@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#21029, 21060, 18210, 21107 backport: Merge bitcoin#21029, 21060, 21107 Feb 5, 2024
@vijaydasmp vijaydasmp marked this pull request as ready for review February 6, 2024 15:10
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but 21107 should be partial because we don't have 19509 yet

@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#21029, 21060, 21107 backport: Merge bitcoin#21029, 21060, 19509, 21107 Feb 7, 2024
@UdjinM6
Copy link

UdjinM6 commented Feb 7, 2024

pls see 7e47db1, 815aaec and b7fec6c

@vijaydasmp
Copy link
Author

pls see 7e47db1, 815aaec and b7fec6c

Thanks @UdjinM6 , I will apply this changes

@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#21029, 21060, 19509, 21107 backport: Merge bitcoin#21029, 21060, 19509, 21107, 25117 Feb 7, 2024
src/net.cpp Outdated Show resolved Hide resolved
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@UdjinM6 UdjinM6 added this to the 20.1 milestone Feb 8, 2024
@vijaydasmp
Copy link
Author

Hello @PastaPastaPasta , requesting review

@vijaydasmp
Copy link
Author

Hello @PastaPastaPasta , Please review

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK for merging via merge commit

fanquake and others added 5 commits February 14, 2024 10:34
…s" exists)

71430ae bitcoin-cli: Correct docs (no "generatenewaddress" exists) (Luke Dashjr)

Pull request description:

ACKs for top commit:
  jonatack:
    ACK 71430ae

Tree-SHA512: 45ee7a51080598141fac4446563bdf99a59bfaa0ee00d9e092511087a968e8535d9208683ed589be1c975531be6d0319d33720f1f0dc1c3635c7d5ea6d726a41
572fd0f doc: More precise -debug and -debugexclude doc (wodry)

Pull request description:

  I wondered how one could enable debug logging with `-debug=<category>` for multiple categories. Found out solution is to specify that option multiple times for each wanted category.

  This PR documents this behavior and uses the same wording for the same behavior of `-debugexclude=<category>` to make that also clear and stringent.

ACKs for top commit:
  laanwj:
    ACK 572fd0f
  MarcoFalke:
    ACK 572fd0f
  theStack:
    ACK 572fd0f

Tree-SHA512: 8d93db37602fd5ff4247e7c11478e55b99c0e3d47eaa2bb901937805d8f2a466b3a198b713b760981c5411576b74c52e2909c46c6d3f2e0e04215fd521b65cf7
bff7c66 Add documentation to contrib folder (Troy Giorshev)
381f77b Add Message Capture Test (Troy Giorshev)
e4f378a Add capture parser (Troy Giorshev)
4d1a582 Call CaptureMessage at appropriate locations (Troy Giorshev)
f2a77ff Add CaptureMessage (Troy Giorshev)
dbf779d Clean PushMessage and ProcessMessages (Troy Giorshev)

Pull request description:

  This PR introduces per-peer message capture into Bitcoin Core.  📓

  ## Purpose

  The purpose and scope of this feature is intentionally limited.  It answers a question anyone new to Bitcoin's P2P protocol has had: "Can I see what messages my node is sending and receiving?".

  ## Functionality

  When a new debug-only command line argument `capturemessages` is set, any message that the node receives or sends is captured.  The capture occurs in the MessageHandler thread.  When receiving a message, it is captured as soon as the MessageHandler thread takes the message off of the vProcessMsg queue.  When sending, the message is captured just before the message is pushed onto the vSendMsg queue.

  The message capture is as minimal as possible to reduce the performance impact on the node.  Messages are captured to a new `message_capture` folder in the datadir.  Each node has their own subfolder named with their IP address and port.  Inside, received and sent messages are captured into two binary files, msgs_recv.dat and msgs_sent.dat, like so:

  ```
  message_capture/203.0.113.7:56072/msgs_recv.dat
  message_capture/203.0.113.7:56072/msgs_sent.dat
  ```

  Because the messages are raw binary dumps, included in this PR is a Python parsing tool to convert the binary files into human-readable JSON.  This script has been placed on its own and out of the way in the new `contrib/message-capture` folder.  Its usage is simple and easily discovered by the autogenerated `-h` option.

  ## Future Maintenance

  I sympathize greatly with anyone who says "the best code is no code".

  The future maintenance of this feature will be minimal.  The logic to deserialize the payload of the p2p messages exists in our testing framework.  As long as our testing framework works, so will this tool.

  Additionally, I hope that the simplicity of this tool will mean that it gets used frequently, so that problems will be discovered and solved when they are small.

  ## FAQ

  "Why not just use Wireshark"

  Yes, Wireshark has the ability to filter and decode Bitcoin messages.  However, the purpose of the message capture added in this PR is to assist with debugging, primarily for new developers looking to improve their knowledge of the Bitcoin Protocol.  This drives the design in a different direction than Wireshark, in two different ways.  First, this tool must be convenient and simple to use.  Using an external tool, like Wireshark, requires setup and interpretation of the results.  To a new user who doesn't necessarily know what to expect, this is unnecessary difficulty.  This tool, on the other hand, "just works".  Turn on the command line flag, run your node, run the script, read the JSON.  Second, because this tool is being used for debugging, we want it to be as close to the true behavior of the node as possible.  A lot can happen in the SocketHandler thread that would be missed by Wireshark.

  Additionally, if we are to use Wireshark, we are at the mercy of whoever it maintaining the protocol in Wireshark, both as to it being accurate and recent.  As can be seen by the **many** previous attempts to include Bitcoin in Wireshark (google "bitcoin dissector") this is easier said than done.

  Lastly, I truly believe that this tool will be used significantly more by being included in the codebase.  It's just that much more discoverable.

ACKs for top commit:
  MarcoFalke:
    re-ACK bff7c66 only some minor changes: 👚
  jnewbery:
    utACK bff7c66
  theStack:
    re-ACK bff7c66

Tree-SHA512: e59e3160422269221f70f98720b47842775781c247c064071d546c24fa7a35a0e5534e8baa4b4591a750d7eb16de6b4ecf54cbee6d193b261f4f104e28c15f47
…annotations

9913419 test: remove type: comments in favour of actual annotations (fanquake)

Pull request description:

  Now that we require Python 3.6+, we should be using variable type
  annotations directly rather than `# type:` comments.

  Also takes care of the discarded value issue in p2p_message_capture.py.
  See: https://github.com/bitcoin/bitcoin/pull/19509/files#r571674446.

ACKs for top commit:
  MarcoFalke:
    review ACK 9913419
  jnewbery:
    Code review ACK 9913419

Tree-SHA512: 63aba5eef6c1320578f66cf8a6d85ac9dbab9d30b0d21e6e966be8216e63606de12321320c2958c67933bf68d10f2e76e9c43928e5989614cea34dde4187aad8
@PastaPastaPasta PastaPastaPasta merged commit 6c06132 into dashpay:develop Feb 14, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants