forked from IntersectMBO/cardano-ledger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalue-size.tex
49 lines (42 loc) · 1.66 KB
/
value-size.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
\section{Output Size}
\label{sec:value-size}
Figure \ref{fig:test} gives the formula for calculating the size of a UTxO entry
in the Alonzo era. In addition to the data found in the UTxO in the ShelleyMA
era, the hash of a datum (or $\Nothing$) is added to the output type, which
is accounted for in the size calculation.
\begin{figure*}[h]
\emph{Constants}
\begin{align*}
& \mathsf{JustDataHashSize} \in \MemoryEstimate \\
& \text{The size of a datum hash wrapped in $\DataHash^?$} \\~
\\
& \mathsf{NothingSize} \in \MemoryEstimate \\
& \text{The size of $\Nothing$ wrapped in $\DataHash^?$}
\end{align*}
%
\emph{Helper Functions}
\begin{align*}
& \fun{dataHashSize} \in \DataHash^? \to \MemoryEstimate \\
& \fun{dataHashSize}~ \Nothing = \mathsf{NothingSize} \\
& \fun{dataHashSize}~ \wcard = \mathsf{JustDataHashSize} \\
& \text{Return the size of $\DataHash^?$} \\~\\
& \fun{utxoEntrySize} \in \TxOut \to \MemoryEstimate \\
& \fun{utxoEntrySize}~\var{(a, v, d)} = \mathsf{utxoEntrySizeWithoutVal} + (\fun{size} (\fun{getValue}~(a, v, d))) + \mathsf{dataHashSize}~d \\
& \text{Calculate the size of a UTxO entry}
\end{align*}
\caption{Value Size}
\label{fig:test}
\end{figure*}
\begin{note}
Get dataHashSize from heapwords on the code
\end{note}
There is a change of constant value from the ShelleyMA era, specifically:
\begin{itemize}
\item $\mathsf{adaOnlyUTxOSize} = 29$ instead of $27$
\item $\mathsf{k_0} = 2$ instead of $0$
\end{itemize}
Additionally, the new constants used in Alonzo have values :
\begin{itemize}
\item $\mathsf{JustDataHashSize} = 10$ words
\item $\mathsf{NothingSize} = 0$ words
\end{itemize}