# Some Math on the Variable PTC Deadline
Francesco has an [open PR for implementing a variable PTC deadline](https://github.com/ethereum/consensus-specs/pull/4843). The idea is to create a heuristic to adjust the payload deadline based on the size of the block. This can allow a higher safe gas limit than a fixed deadline, because it avoids budgeting every block as if it had both worst-case propagation and worst-case execution timing (explained below).
From [toni's discussion on this topic](https://hackmd.io/@Nerolation/B1GKtAUcZg) there are two extremes:
- **Pure compute block:** minimal calldata and near-maximal execution gas. It is relatively cheap to propagate, but maximally expensive to execute.
- **Max calldata block:** calldata-heavy enough to hit the [EIP-7623](https://eips.ethereum.org/EIPS/eip-7623) floor. Needs the most propagation time, but only an $\alpha = 0.9375$ fraction of the gas budget remains available for execution.
A clean way to compare **fixed** vs **variable** payload deadlines is to write the execution constraints directly.
Let:
- $S$ = total time budget available for **payload propagation + payload execution**
- $P_s$ = propagation time for a **small** payload (pure compute)
- $P_\ell$ = propagation time for a **large** payload (max calldata)
- $R$ = execution throughput (compute velocity) in **gas / second**
- $G$ = block gas limit
- $\alpha = 0.9375$ = fraction of gas still available for execution in the largest-payload case

$$
P + G/R = S
$$
## Fixed deadline
With a fixed deadline, the protocol has to choose a single payload arrival cutoff that is safe for all blocks. That cutoff **must be late enough to accommodate the slowest-propagating payloads**, i.e. the largest calldata-heavy blocks.
But once there is only a single cutoff, builders are also free to release *small* payloads so that they arrive at that same late time. So the execution budget cannot be computed assuming that small blocks arrive early just because they *could* have propagated early. Under a fixed-deadline design, the adversarial case is **a small payload that arrives as late as the deadline allows and then uses essentially the full gas limit for execution**.
So fixed deadlines combine two worst-case assumptions into one budget:
- propagation is budgeted as if the payload were a large calldata-heavy block
- execution is budgeted as if the payload were a small near-pure-compute block released at the last permissible moment
Those are not the same natural block shape. But a fixed deadline forces the protocol to budget as if the worst propagation pattern and the worst execution pattern could be combined in a single adversarial timing choice.
The safety condition is therefore
$$
\frac{G_{\text{fixed}}}{R} \le S - P_\ell
$$
and at the maximum safe gas limit this binds, giving
$$
G_{\text{fixed}} = R(S - P_\ell)
$$
## Variable deadline
With a variable deadline, small payloads must arrive earlier and large payloads may arrive later.
So we get two constraints:
### Small-payload / max-execution case
The safety condition is
$$
\frac{G_{\text{var}}}{R} \le S - P_s
$$
and at the maximum safe gas limit this binds, giving
$$
G_{\text{var}} = R(S - P_s)
$$
### Large-payload / reduced-execution case
For large payloads, only about $\alpha G$ remains for execution, so the safety condition is
$$
\frac{\alpha G_{\text{var}}}{R} \le S - P_\ell
$$
and at the maximum safe gas limit this binds, giving
$$
G_{\text{var}} = \frac{R(S - P_\ell)}{\alpha}
$$
Therefore,
$$
G_{\text{var}} = \min\left(R(S - P_s), \frac{R(S - P_\ell)}{\alpha}\right)
$$
## Ratio
Now compare the two:
$$
\frac{G_{\text{var}}}{G_{\text{fixed}}}=\frac{\min\left(R(S - P_s), \frac{R(S - P_\ell)}{\alpha}\right)}{R(S - P_\ell)}
$$
and $R$ cancels, as we would expect since execution throughput is the same in both designs:
$$
\frac{G_{\text{var}}}{G_{\text{fixed}}}=
\min\left(
\frac{S - P_s}{S - P_\ell},
\frac{1}{\alpha}
\right)
$$
The nice thing about this expression is that the two terms have a very direct physical interpretation. The first term,
$$
\frac{S - P_s}{S - P_\ell},
$$
captures the benefit from accounting for the fact that small blocks propagate faster than large ones.
With a **fixed** deadline, we effectively budget every block as if it had the propagation time of the largest block, $P_\ell$. That means a small block, which actually propagates in only $P_s$, is artificially denied $\left(P_\ell - P_s\right)$ of execution time. Variable deadlines let us reclaim that slack.
So this term tells us the maximum gas-limit increase we can get purely from giving small / fast-propagating blocks the extra execution time they actually have available.
The second term,
$$
\frac{1}{\alpha},
$$
captures a different effect: the largest blocks are not also the worst execution blocks.
Under the calldata-floor regime, a block that is maximally bandwidth-heavy cannot devote its full gas budget to execution. Only an $\alpha$ fraction of its gas remains available for execution, with the rest effectively forced into calldata-related usage. That means the worst-case propagation block is execution-discounted.
So $\frac{1}{\alpha}$ is the maximum gas-limit increase we can get from recognizing that the "largest block" case and the "max execution" case are not the same block.
Putting it together:
- $\frac{S - P_s}{S - P_\ell}$ measures how much fixed deadlines over-penalize small blocks by pretending they propagate like large ones.
- $\frac{1}{\alpha}$ measures how much fixed deadlines over-penalize execution by pretending the largest blocks also execute the full gas limit.
The variable-deadline design helps with both, but the smaller of the two effects is the one that actually determines the gain.
With $\alpha = 0.9375$, the second cap is:
$$
\frac{1}{0.9375} \approx 1.0666
$$
so in this model **the maximum gain is about 6.66%**.