Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alonzo audit #2448

Merged
merged 5 commits into from
Sep 15, 2021
Merged

Alonzo audit #2448

merged 5 commits into from
Sep 15, 2021

Conversation

WhatisRT
Copy link
Contributor

@WhatisRT WhatisRT commented Sep 8, 2021

Lots of small changes/additions pointed out by different audits

Copy link
Contributor

@JaredCorduan JaredCorduan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

\nextdef
& \fun{feesOK} \in \PParams \to \Tx \to \UTxO \to \Bool \\
& \fun{feesOK}~\var{pp}~tx~utxo~= \\
&~~ \minfee{pp}~{tx} \leq \txfee{txb} \wedge (\fun{txrdmrs}~tx \neq \Nothing \Rightarrow \\
&~~~~~~((\forall (a, \wcard, \_) \in \fun{range}~(\fun{collateral}~{txb} \restrictdom \var{utxo}), \fun{paymentHK}~a \in \AddrVKey) \\
&~~~~~~((\forall (a, \wcard, \_) \in \fun{range}~(\fun{collateral}~{txb} \restrictdom \var{utxo}), a \in \AddrVKey) \\
&~~~~~~\wedge~ \fun{adaOnly}~\var{balance} \\
&~~~~~~\wedge~ \var{balance}~*~100 \geq \txfee~{txb} * (\fun{collateralPercent}~pp))) \\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this has a couple extra brackets? I'm having a hard time tracking them here hehe

&~~~~~~\wedge~ \fun{adaOnly}~\var{balance} \\
&~~~~~~\wedge~ \var{balance}~*~100 \geq \txfee~{txb} * (\fun{collateralPercent}~pp))) \\
&~~~~~~\wedge~ \fun{collateral}~{tx}~ \neq~\{\} \\
&~~~~~~\wedge~ \fun{collateral}~{tx}~ \neq~\{\}) \\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this closes the line 21 first bracket?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think the parentheses are fine

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -659,7 +663,7 @@ \subsection{The UTXOS transition system}
\var{txb}\leteq\txbody{tx} &
\fun{ininterval}~\var{slot}~(\fun{txvldt}~{tx}) &
\hldiff{\var{(\wcard, i_f)}\leteq\fun{txvldt}~{tx}} \\~\\
\hldiff{\fun{txrdmrs}~\var{tx}\neq \Nothing ~\Rightarrow~ \fun{epochInfoSlotToUTCTime}~\mathsf{epochInfo}~\mathsf{systemTime}~i_f \neq \Nothing} \\
\hldiff{\Nothing \notin \{\fun{txrdmrs}~\var{tx}, i_f\} ~\Rightarrow~ \fun{epochInfoSlotToUTCTime}~\mathsf{epochInfo}~\mathsf{systemTime}~i_f \neq \Nothing} \\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\notin?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a compact way of saying that both of those aren't Nothing. So this modifies the line to only check the conversion if i_f isn't nothing as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, didnt notice it was \notin ... a set

@polinavino
Copy link
Contributor

two tiny things (which maybe Im just confused about, looks really good otherwise)

@polinavino polinavino self-requested a review September 15, 2021 14:23
@polinavino polinavino merged commit bc963e0 into master Sep 15, 2021
@iohk-bors iohk-bors bot deleted the andre/alonzo-audit branch September 15, 2021 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants