The "High-Bandwidth"Mode: Understanding `SENDCMPCT` options
12. The "High-Bandwidth" Mode: Understanding SENDCMPCT options
Compact Blocks come in two "Flavors": Low-Bandwidth and High-Bandwidth. This choice is managed by the SENDCMPCT message. It is a strategic decision that the Diplomat makes with every peer. It determines how "Aggressive" the node should be when announcing new blocks.
For the Sovereign Architect, High-Bandwidth mode is the "Reflex" of the node. It is the choice between "Waiting to be asked" and "Shouting immediately."
Analyzing the Reflex: SENDCMPCT
In the source code, we see how a node tells its peer which mode it prefers.
/**
* PEDAGOGICAL ANALYSIS: THE SPEED SETTING
* This logic tells our peer if we want them to "Push" blocks
* to us immediately or "Announce" them first.
*/
void PeerManagerImpl::SendCMPCT(CNode& pfrom)
{
// 1. Send the preference for version 2 (SegWit compatible).
// 2. Set "high_bandwidth" to true for our best friends.
bool high_bandwidth = true;
MakeAndPushMessage(pfrom, NetMsgType::SENDCMPCT, high_bandwidth, 2);
}
Explaining the Reflex: The Trade-off of Speed
-
Low-Bandwidth Mode (
high_bandwidth=false): This is the "Standard" mode. When a peer hears about a new block, they send you aninv(the postcard). You check if you need it, and then you ask for the compact block. This is slower (it takes more "Round Trips"), but it ensures you never receive a block twice. It is the Frugality of the Sovereign. -
High-Bandwidth Mode (
high_bandwidth=true): This is the "Premium" mode. You tell your peer: "I trust your speed. The moment you see a new block, don't send an announcement—just send me the fullCMPCTBLOCKsketch immediately." This is much faster, but if two peers both send you the sketch at the same time, you've wasted some bandwidth. It is the Velocity of the Machine. -
"The 3-Peer Limit": To avoid "Bandwidth Explosion," Bitcoin Core usually only enables High-Bandwidth mode with 3 peers. This gives you three "Reflex" connections and several "Standard" connections. It is the Balance of the Core.
-
SENDCMPCTVersioning: Notice the2in the code. This refers to the version of the compact block protocol. Version 2 is required for SegWit transactions. If a peer doesn't support version 2, the Diplomat will gracefully fall back to version 1. It is the Compatibility of the Protocol.
The Sovereignty of the Reflex
By choosing which peers to use for High-Bandwidth mode, you are tuning the "Nervous System" of your node. You are deciding which "Paths" in the global mesh should be the fastest. As a Sovereign Architect, you know that "Speed is Security" in a blockchain reorganization. By having at least a few high-bandwidth peers, you ensure your node is always among the first to hear the new truth. You are the "Master of the Reflex."
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: