mirror of
https://github.com/lux-apps/papers.git
synced 2026-10-30 18:15:21 +00:00
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.
33 lines
1.0 KiB
TeX
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.
|
|
|