Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
c317972 to
c96e7d7
Compare
c96e7d7 to
fbfeb88
Compare
|
CI error unrelated. See #34731. |
|
Generally in favor of having a way of exposing data about this in a non-logging way. Especially since fast compact block relay and reconstructions seem to be somewhat of a share priority by contributors. Concept ACK on exposing this data. In peer-observer/peer-observer#420, @m4ycon has been working on reading very similar information for the debug log. My understanding is that this works well, but is obviously brittle. There's also the question about adding more tracepoints now, or investing time into seeing if #35142 is feasible... |
| block_hash.ToString(), | ||
| index.nHeight, | ||
| peer.LogPeer() | ||
| ); |
There was a problem hiding this comment.
With tracepoints essentially matching the log statements, I wonder if there's some way of combine the two - but that's obviously out of scope for this PR.
There was a problem hiding this comment.
I think a structured logging interface as discussed in #35369 would be a good solution avoiding duplication between logging statements and tracepoints. We'd get the same information about compact block reconstructions in a machine-to-machine interface.
m4ycon
left a comment
There was a problem hiding this comment.
Concept ACK
Also a suggestion on additional info.
| TRACEPOINT(net, compact_block_reconstructed, | ||
| peer.GetId(), | ||
| stats.prefilled_txn_count, | ||
| stats.mempool_txn_count, | ||
| stats.extra_pool_txn_count, | ||
| stats.requested_txn_count, | ||
| stats.requested_txn_bytes, | ||
| hash.data() | ||
| ); |
There was a problem hiding this comment.
While monitoring dashboards from peer-observer/peer-observer#420, my node had a pretty weird period where it was always requesting txs from other nodes (stats.requested_txn_count > 0). The image below, this panels measures time taken to reconstruct a block, left panel shows reconstructions that didn't need to request txs, and the right one shows more than zero requested transactions.
One of the things that people suggested to me, it was that I look at what kind of transactions were being requested, if there was some pattern or things like that. Unfortunately, I didn't have -debug=net enabled which probably would have helped me to answer it.
But with your PR, it makes me think if this isn't an interesting information to pass through tracepoints: all the txids from vtx_missing. What do you guys think? Maybe this is too much data to send? As a real sample from my node, the highest "transactions requested" was 2041 in the last 30 days.
There was a problem hiding this comment.
It's rather impractical to pass lists or sets via tracaepoints, they don't really support it. While it might work by concatenating the txids and passing the length and passing the concatenated bytes, I don't think we should do these kind of hacks if we can avoid it.
I didn't have -debug=net enabled
Note that you only need compact block logging enabled. However, we only print the txids if there were less than 5 transactions missing. I've in the past ran a patched bitcoind that removed this limitation and logged all missing txids. To look up why your node didn't know about a certain transaction, you probably want to have -debug=net enabled. It might tell you that a transaction was replaced, evicted from orphanage, you never got an inv for it, ...
bitcoin/src/blockencodings.cpp
Lines 222 to 232 in de92545
I agree it would make more sense to clarify that first before adding more tracepoints. |
|
I don't think the IPC tracing discussion should block this functionality, assuming there is demand for it. My understanding is that IPC tracing is a promising direction, but not a drop-in replacement for USDT today. That callback model is a poor fit for high-frequency tracing, especially for events like raw P2P messages or per-UTXO cache events, unless it is designed with non-blocking buffering, batching, filtering, and backpressure/drop handling. So I see IPC tracing as a longer-term project with its own tradeoffs, while this PR is a small addition to the existing USDT tracing interface. |
|
@w0xlt can you rebase this? |
|
This has been in need of rebase for a few months now. Are you still working on this? |
fbfeb88 to
ef3121b
Compare
|
@sedited Rebased. Thanks |
|
🐙 This pull request conflicts with the target branch and needs rebase. |
Not sure about adding code that will be removed soon anyway? Ref #35142 (comment)
But no strong opinion. If there are active users that want this pull, it should be trivial for them to step up and review it? Though, if those users are compiling from source anyway, they can just use this code (or any other code their LLM writes) without having to go through review here. Again, no objection. I am just curious about the direction and impact. |
|
Thanks for the feedback. Added my two cents in the thread: #35142 (comment) |

This PR adds two USDT tracepoints for compact block relay:
net:block_header: fires when a new valid header is received from a peer (viaheadersorcmpctblock).net:compact_block_reconstructed: fires when a compact block is successfully reconstructed, just before validation.The motivation is to expose structured, low-overhead observability for compact block relay behavior.
Compact block relay is performance-sensitive: whether a node reconstructs a block without round trips depends on mempool overlap, extra transaction pool usefulness, and peer behavior.
Today this information is mostly available only through debug logs, which are string-based, less precise for tooling, and not ideal for continuous measurement.
What they enable measuring:
getblocktxnround trip.Design notes.