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:
- Which peers announce new headers first, and whether headers arrived via compact block announcements.
- Per-peer compact block reconstruction success.
- Where each transaction came from — prefilled, mempool, extra pool, or a
getblocktxnround trip. - How often compact blocks reconstruct with no round trip, and the bandwidth cost when they don't.
- Whether high-bandwidth compact block peers actually improve relay, and how mempool divergence affects reconstruction quality.
Design notes.
- All data is already available at the reconstruction point; nothing new is computed in the hot path. USDT tracepoints stay inactive unless a tracing tool is attached.
- Mempool and extra-pool counts are reported as disjoint fields, so consumers can aggregate without double-counting. The reconstruction tracepoint includes the peer ID, making metrics attributable to the peer that supplied the compact block data.