Repository navigation
add: p2p-extractor (initially keeps track of ping-pong durations) - #256
Merged
Merged
Conversation
0xB10C
force-pushed
the
2025-09-add-p2p-extractor
branch
2 times, most recently
from
September 17, 2025 11:06
1ae50d2 to
112a95e
Compare
Collaborator
Author
|
This still needs:
|
Collaborator
Author
|
Also, CI fails do to not up-to-date docs. |
0xB10C
force-pushed
the
2025-09-add-p2p-extractor
branch
from
September 19, 2025 11:05
26c9537 to
eb02aa9
Compare
The P2P extractor starts a TCP server and listens for connections from a Bitcoin node. A node can be configured to connect to it with e.g. --addnode=127.0.0.1:9333. Once connected, the extractor and the node will do a version handshake. Once that's done, the extractor can perform measurements over the P2P interface of the node. For example, it can send pings and record the time it takes for a pong response to arrive. This gives insights about the nodes processing backlog.
0xB10C
force-pushed
the
2025-09-add-p2p-extractor
branch
from
September 19, 2025 11:23
eb02aa9 to
0b2bf32
Compare
0xB10C
force-pushed
the
2025-09-add-p2p-extractor
branch
from
September 19, 2025 12:24
0b2bf32 to
53b72aa
Compare
3 tasks done
0xB10C
marked this pull request as ready for review
September 19, 2025 12:52
0xB10C
added a commit
to 0xB10C/nix
that referenced
this pull request
Sep 19, 2025
This was referenced Sep 19, 2025
Collaborator
Author
|
I've been running this for a few days and it seems to work as intended. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a p2p-extractor. The extractor listens on a TCP socket and accepts inbound connections from a Bitcoin node. A Bitcoin node configured with
--addnode=ip:portwill connect (and reconnect) to the extractor. Additionally, the connection will count as a manual connection and not reduce the number of normal outbound (and not inbounds) the node makes. The extractor does only support P2Pv1 for now. This means, the node and the extractor must have the same network magic. The node will open a v2 connection to the p2p-extractor at first, which will be closed. The node will then retry with a v1 connection which then should succeed.Currently, the p2p-extractor only sends a ping and measures the time it takes for the node to respond to a pong. When done on localhost (to reduce network latency), this measures the time it takes for the node to process all other network messages that arrived before it. In a way, we measure the Bitcoin node backlog here.
Additional measurements and events can be extracted in the future. Some ideas are in: #263
part of #141
closes #212