Files
papers/lux-state-sync/sections/09-storage-layer-integration.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

33 lines
1.0 KiB
TeX

\section{Storage Layer Integration}
\label{sec:storage}
\subsection{Database Schema}
Synced state is stored in a key-value database (LevelDB or Pebble):
\begin{table}[H]
\centering
\caption{Database key prefixes for synced state.}
\label{tab:db}
\begin{tabular}{lll}
\toprule
\textbf{Prefix} & \textbf{Key Format} & \textbf{Value} \\
\midrule
\texttt{a/} & Account hash & RLP-encoded account \\
\texttt{s/} & Account hash + slot hash & Storage value \\
\texttt{c/} & Code hash & Contract bytecode \\
\texttt{n/} & Trie node hash & RLP-encoded trie node \\
\texttt{m/} & Sync metadata key & Progress, roots \\
\bottomrule
\end{tabular}
\end{table}
\subsection{Write Amplification}
\begin{proposition}[Write Amplification Bound]
Trie-aligned chunking achieves write amplification $\leq 2$: each state entry is written at most twice (once as raw data, once as trie node).
\end{proposition}
This is an improvement over naive sync approaches where rebuilding the trie from flat state incurs write amplification of $O(d)$ due to intermediate node recomputation.