Block Production Explained
Overview
Block production involves complex timing mechanisms to ensure efficient and reliable blockchain operations. This guide explains how block producers coordinate to maintain network consensus, with detailed examples showing different network scenarios.
Key Concepts and Variables
Understanding block production requires familiarity with several key variables and timing mechanisms:
Variable | Value | Description |
---|---|---|
r | 12 | Producer Repetitions - Number of blocks each producer creates in their turn |
m | varies | Max Block CPU Usage - Maximum CPU time allowed per block (consensus parameter) |
u | varies | Max Block Net Usage - Maximum network bandwidth per block (consensus parameter) |
t | varies | Block Time - When a block should be finalized |
e | config | Produce Block Offset - Configuration setting in nodeop |
w | 500ms | Block Time Interval - Fixed time between blocks |
a | e/r ms | Early Release Time(ms) - Block release offset |
l | t-a | Produce Block Time - When block production actually starts |
p | w-a | Production Window - Available time to produce a block |
c | min(m, w-a) | Billed CPU Time - Actual CPU time charged for the block |
n | varies | Network Latency - Time for data to travel between nodes |
h | varies | Block Header Validation Time - Time to validate block headers |
Network Topology
Block producers operate in a network where timing is critical. Let's consider the example of the following two BPs and their network topology as depicted in the below diagram
How Block Rounds Work
Each block producer creates 12 consecutive blocks during their turn at a fixed interval of 500ms:
BP-A
will send block at l
and, BP-B
needs block at time t
or otherwise will drop it.
If BP-A
’s schedule is:
b₁ @ t1, b₂ @ t1.5, b₃ @ t2, b₄ @ t2.5, … up to b₁₂ @ t6.5, then
BP-B
must receive b₁₂ no later than t 6.5. That leavesBP-B
the remaining 0.5 s of the slot to begin producing its own first block (b₁₃ @ t7).
The last block time of BP-A (t 6.5) is therefore the hand-off moment: BP-A finishes, BP-B must immediately start.
A block is produced and sent when either it reaches m
or u
or p
.
Blocks are propagated after block header validation. This means instead of BP-A Peer
& BP-B Peer
taking m
time to validate and forward a block it only takes a small number of milliseconds to verify the block header and then forward the block.
Block Timing in Wire Sysio v5.0
Blocks start immediately after the previous block completes, with all sleep moved to the end of the round
Examples
Context
Each example analyzes one full production round — 12 blocks created by a single producer ( r = 12
) and block interval is w = 500ms
.
The question is always the same:
Will the last block of BP-A’s round reach BP-B in time for BP-B to begin its own production?
To answer that, every scenario plugs its specific numbers into the same core equation: