Files
papers/lux-evm-precompiles/sections/08-gas-pricing-methodology.tex
zeekay abf99d05fc papers: reorganize into per-paper dirs, add Antje Worring as co-author
Restructured from flat .tex/.pdf files into per-paper subdirectories.
Added Antje Worring as co-author on all papers.
Synced PDFs to pdfs/ for download site.
2026-04-18 21:50:07 -07:00

51 lines
2.4 KiB
TeX

\section{Gas Pricing Methodology}
\label{sec:gas}
\subsection{Calibration Principle}
Gas prices are calibrated so that 1 gas $\approx$ 1 nanosecond of execution on reference hardware (AMD EPYC 7763, 2.45 GHz, single core). With Lux's 1\,B gas block limit, this yields a target block execution time of $\sim$1\,s on a single core---well within the 10\,ms GPU BLS finality window when executed on GPU or multi-core C++ EVM (which processes 1\,B gas in $\sim$48\,ms). This ensures consistent block execution times regardless of transaction mix.
\begin{definition}[Gas Price Invariant]
For precompile $P$ with execution time $t_P$ milliseconds:
\begin{equation}
G_P = \left\lfloor t_P \cdot 10^6 \cdot \kappa \right\rfloor
\end{equation}
where $\kappa = 1.5$ is a safety factor accounting for variance across hardware.
\end{definition}
\subsection{Benchmark Results}
\begin{table}[H]
\centering
\caption{Precompile benchmarks on AMD EPYC 7763 (single core).}
\label{tab:benchmarks}
\begin{tabular}{lrrr}
\toprule
\textbf{Precompile} & \textbf{Time (ms)} & \textbf{Calibrated Gas} & \textbf{Assigned Gas} \\
\midrule
BLS12-381 G1 Add & 0.003 & 450 & 500 \\
BLS12-381 G1 Mul & 0.25 & 10,625 & 12,000 \\
BLS12-381 Pairing (1 pair) & 1.70 & 106,250 & 113,000 \\
BLS12-381 Map to G1 & 0.05 & 5,000 & 5,500 \\
BN254 Pairing (2 pairs) & 1.10 & 73,750 & 80,000 \\
secp256k1 Batch (100) & 12.0 & 170,000 & 183,000 \\
Dilithium-3 Verify & 0.30 & 32,500 & 35,000 \\
FALCON-512 Verify & 0.25 & 26,000 & 28,000 \\
Warp Verify & 0.40 & 45,000 & 50,000 \\
\bottomrule
\end{tabular}
\end{table}
The ratio of assigned gas to calibrated gas ranges from 1.07 to 1.33, within the target $\kappa = 1.5$ safety factor.
\subsection{DoS Resistance}
\begin{proposition}[Bounded Execution]
All precompiles execute in $O(n)$ time where $n$ is the input size in bytes, with constant factors bounded by $c \leq 50$ ns/byte. No precompile has super-linear time complexity in its input.
\end{proposition}
\begin{proof}
MSM operations have time $O(n \log n / \log \log n)$ via Pippenger's algorithm, but input size for $k$ points is $O(k)$ and execution is $O(k \log k)$. Since $k$ is bounded by the block gas limit ($k \leq G_{\text{block}} / G_{\text{point}}$, where $G_{\text{block}} = 1{,}000{,}000{,}000$ on Lux), the absolute time is bounded. The 1\,B gas limit enables $\sim$83{,}000 G1 scalar multiplications or $\sim$8{,}800 BLS12-381 pairing checks per block.
\end{proof}