forked from IntersectMBO/cardano-ledger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ledger.tex
119 lines (116 loc) · 3.13 KB
/
ledger.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
\section{Ledger State Transition}
\label{sec:ledger-trans}
Figure~\ref{fig:rules:ledger} separates the case where all the scripts
in a transaction successfully validate from the case where there is one or more that does not.
These two cases are distinguished by the use of the $\IsValid$ tag.
%
Besides collateral collection, no side effects should occur when processing a
transaction that contains a script that does not validate. That is, no
delegation or pool state updates, update proposals, or any other observable state change, should be
applied. The UTxO rule is still applied, however, as this is where the correctness of the
validation tag is verified, and where collateral inputs are collected.
\begin{figure}
\begin{equation}
\label{eq:ledger}
\inference[ledger-V]
{
\fun{isValid}~{tx} = \True \\~\\
{
\begin{array}{c}
\var{slot} \\
\var{txIx} \\
\var{pp} \\
\var{tx}\\
\var{acnt}
\end{array}
}
\vdash
dpstate \trans{\hyperref[fig:rules:delegation-sequence]{delegs}}{
\fun{txcerts}~(\txbody{tx})} dpstate'
\\~\\
(\var{dstate}, \var{pstate}) \leteq \var{dpstate} \\
(\_, \_, \_, \_, \_, \var{genDelegs}, \_) \leteq \var{dstate} \\
(\var{poolParams}, \_, \_) \leteq \var{pstate} \\
\\~\\
{
\begin{array}{c}
\var{slot} \\
\var{pp} \\
\var{poolParams} \\
\var{genDelegs} \\
\end{array}
}
\vdash \var{utxoSt} \trans{\hyperref[fig:rules:utxow-shelley]{utxow}}{tx} \var{utxoSt'}
}
{
\begin{array}{c}
\var{slot} \\
\var{txIx} \\
\var{pp} \\
\var{acnt}
\end{array}
\vdash
\left(
\begin{array}{ll}
\var{utxoSt} \\
\var{dpstate} \\
\end{array}
\right)
\trans{ledger}{tx}
\left(
\begin{array}{ll}
\varUpdate{utxoSt'} \\
\varUpdate{dpstate'} \\
\end{array}
\right)
}
\end{equation}
%
\nextdef
%
\begin{equation}
\label{eq:ledger}
\inference[ledger-NV]
{
\fun{isValid}~{tx} = \False \\~\\
(\var{dstate}, \var{pstate}) \leteq \var{dpstate} \\
(\_, \_, \_, \_, \_, \var{genDelegs}, \_) \leteq \var{dstate} \\
(\var{poolParams}, \_, \_) \leteq \var{pstate} \\
\\~\\
{
\begin{array}{c}
\var{slot} \\
\var{pp} \\
\var{poolParams} \\
\var{genDelegs} \\
\end{array}
}
\vdash \var{utxoSt} \trans{\hyperref[fig:rules:utxow-shelley]{utxow}}{tx} \var{utxoSt'}
}
{
\begin{array}{c}
\var{slot} \\
\var{txIx} \\
\var{pp} \\
\var{acnt}
\end{array}
\vdash
\left(
\begin{array}{ll}
\var{utxoSt} \\
\var{dpstate} \\
\end{array}
\right)
\trans{ledger}{tx}
\left(
\begin{array}{ll}
\varUpdate{utxoSt'} \\
\var{dpstate} \\
\end{array}
\right)
}
\end{equation}
\caption{Ledger inference rules}
\label{fig:rules:ledger}
\end{figure}
\clearpage