fix audit report template bugs

This commit is contained in:
Christian Grothoff 2019-09-02 03:32:49 +02:00
parent 1891dfd4da
commit 90eef4bd11
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -118,7 +118,7 @@ the tiny threshold. Below, we report {\em non-tiny} wire transfers that are lagg
\label{table:lag} \label{table:lag}
\endlastfoot \endlastfoot
{% for item in wire.lag_details %} {% for item in wire.lag_details %}
\multicolumn{4}{l}{ {\tt {{ item.coin_pub }} } } \\ \multicolumn{4}{l}{ {\tt \small {{ item.coin_pub }} } } \\
\nopagebreak \nopagebreak
& &
{{ item.deadline }} & {{ item.deadline }} &
@ -224,7 +224,7 @@ compromise.
\label{table:emergencies} \label{table:emergencies}
\endlastfoot \endlastfoot
{% for item in data.reserve_inconsistencies %} {% for item in data.reserve_inconsistencies %}
\multicolumn{4}{l}{ {\tt {{ item.denompub_hash }} } } \\ \multicolumn{4}{l}{ {\tt \small {{ item.denompub_hash }} } } \\
\nopagebreak \nopagebreak
& &
{{ item.value }} & {{ item.value }} &
@ -271,17 +271,19 @@ the financial damage done to the customer).
\end{longtable} \end{longtable}
{% endif %} {% endif %}
\subsection{Reserve withdrawals exceeding balance} \subsection{Reserve withdrawals exceeding balance}
This section highlights cases where more coins were withdrawn from a This section highlights cases where more coins were withdrawn from a
reserve than the reserve contained funding for. This is a serious reserve than the reserve contained funding for. This is a serious
compromise resulting in proportional financial losses to the exchange. compromise resulting in proportional financial losses to the exchange.
% Table generation tested by testcase #2 in test-auditor.sh
{% if data.reserve_balance_insufficient_inconsistencies|length() == 0 %} {% if data.reserve_balance_insufficient_inconsistencies|length() == 0 %}
{\bf All withdrawals were covered by sufficient reserve funding.} {\bf All withdrawals were covered by sufficient reserve funding.}
{% else %} {% else %}
\begin{longtable}{p{4.5cm}|r} \begin{longtable}{p{8.5cm}|r}
{\bf Reserve} & {\bf Loss} \\ \hline \hline {\bf Reserve} & {\bf Loss} \\ \hline \hline
\endfirsthead \endfirsthead
{\bf Reserve} & {\bf Loss} \\ \hline \hline {\bf Reserve} & {\bf Loss} \\ \hline \hline
@ -296,7 +298,7 @@ compromise resulting in proportional financial losses to the exchange.
\label{table:reserve:balance_insufficient} \label{table:reserve:balance_insufficient}
\endlastfoot \endlastfoot
{% for item in data.reserve_balance_insufficient_inconsistencies %} {% for item in data.reserve_balance_insufficient_inconsistencies %}
{\tt {{ item.reserve_pub }} } {\tt \small {{ item.reserve_pub }} }
& &
{{ item.loss }} \\ \hline {{ item.loss }} \\ \hline
{% endfor %} {% endfor %}
@ -374,7 +376,7 @@ any effects on its own balance, those entries are excluded from the total.
\endlastfoot \endlastfoot
{% for item in data.coin_inconsistencies %} {% for item in data.coin_inconsistencies %}
{{ item.operation }} & {{ item.operation }} &
\multicolumn{5}{l}{ {\tt {{ item.coin_pub }} } } \\ \multicolumn{5}{l}{ {\tt \small {{ item.coin_pub }} } } \\
\nopagebreak & & \nopagebreak & &
{{ item.exchange }} & {{ item.exchange }} &
{{ item.auditor }} \\ \hline {{ item.auditor }} \\ \hline
@ -416,7 +418,7 @@ public key for ``payback-master'' operations.
\label{table:bad_signature_losses} \label{table:bad_signature_losses}
\endlastfoot \endlastfoot
{% for item in data.bad_sig_losses %} {% for item in data.bad_sig_losses %}
\multicolumn{5}{l}{ {\tt {{ item.key_pub }} } } \\ \multicolumn{5}{l}{ {\tt \small {{ item.key_pub }} } } \\
\nopagebreak \nopagebreak
& {{ item.operation }} & {{ item.rowid }} & & {{ item.operation }} & {{ item.rowid }} &
{{ item.loss }} \\ \hline {{ item.loss }} \\ \hline
@ -426,26 +428,31 @@ public key for ``payback-master'' operations.
\subsection{Actual incoming wire transfers} \subsection{Actual incoming wire transfers} \label{sec:wire_in}
This section highlights cases where the exchange's record about This section highlights cases where the exchange's record about
incoming wire transfers does not match with that of the bank. incoming wire transfers does not match with that of the bank.
% Table generation tested by testcase #3 in test-auditor.sh
{% if wire.reserve_in_amount_inconsistencies|length() == 0 %} {% if wire.reserve_in_amount_inconsistencies|length() == 0 %}
{\bf All incoming wire transfer amounts and subjects matched up.} {\bf All incoming wire transfer amounts and subjects matched up.}
{% else %} {% else %}
\begin{longtable}{p{5.5cm}|r|r} \begin{longtable}{p{5.5cm}|r|r}
\multicolumn{2}{l}{ {\bf Wire transfer identifier} ({\bf Row}) } \\ \multicolumn{2}{l}{ {\bf Wire transfer identifier} ({\bf Row}) } \\
{\bf Diagnostic} & {\bf Wired} & {\bf Expected} \\ \multicolumn{3}{l}{ {\bf Diagnostic} } \\
{\bf When} & {\bf Wired} & {\bf Expected} \\
\hline \hline \hline \hline
\endfirsthead \endfirsthead
\multicolumn{2}{l}{ {\bf Wire transfer identifier} ({\bf Row}) } \\ \multicolumn{2}{l}{ {\bf Wire transfer identifier} ({\bf Row}) } \\
{\bf Diagnostic} & {\bf Wired} & {\bf Expected} \\ \multicolumn{3}{l}{ {\bf Diagnostic} } \\
{\bf When} & {\bf Wired} & {\bf Expected} \\
\hline \hline \hline \hline
\endhead \endhead
\hline \hline \hline \hline
\multicolumn{2}{l}{ {\bf Wire transfer identifier} ({\bf Row}) } \\ \multicolumn{2}{l}{ {\bf Wire transfer identifier} ({\bf Row}) } \\
{\bf Diagnostic} & {\bf Wired} & {\bf Expected} \\ \multicolumn{3}{l}{ {\bf Diagnostic} } \\
{\bf When} & {\bf Wired} & {\bf Expected} \\
\endfoot \endfoot
\hline \hline \hline \hline
{\bf Total deltas} & {\bf Total deltas} &
@ -455,18 +462,33 @@ incoming wire transfers does not match with that of the bank.
\label{table:wire_in:transfer_amount_inconsistencies} \label{table:wire_in:transfer_amount_inconsistencies}
\endlastfoot \endlastfoot
{% for item in wire.reserve_in_amount_inconsistencies %} {% for item in wire.reserve_in_amount_inconsistencies %}
\multicolumn{2}{l}{ {\tt {{ item.wtid }} } ({{ item.row }}) } \\ \multicolumn{3}{l}{ {\tt \small {{ item.wtid }} } ({{ item.row }}) } \\
\nopagebreak \nopagebreak
{{ item.timestamp }}: & \multicolumn{3}{l}{ {{ item.diagnostic }} } \\
\nopagebreak
{{ item.timestamp }} &
{{ item.amount_wired }} & {{ item.amount_wired }} &
{{ item.amount_exchange_expected }} \\ {{ item.amount_exchange_expected }} \\
\multicolumn{3}{l}{ {{ item.diagnostic }} } \\
\hline \hline
{% endfor %} {% endfor %}
\end{longtable} \end{longtable}
{% endif %} {% endif %}
{% if wire.reserve_in_amount_inconsistencies|length() != 0 %}
This means that there are inconsistencies in the exchange's
claims about incoming wire transfers, amounting to:
\begin{itemize}
\item The exchange believing it received
{\bf {{ wire.total_wire_in_delta_plus }} } {\em less} than it
actually received in some reserves.
\item The exchange believing that it received
{\bf {{ wire.total_wire_in_delta_minus}} } {\em more} than it
actually received in some reserves.
\end{itemize}
{% endif %}
\subsection{Missattributed incoming wire transfers} \subsection{Missattributed incoming wire transfers}
This section lists cases where the sender account record of an This section lists cases where the sender account record of an
@ -534,7 +556,7 @@ with respect to outgoing wire transfers.
\label{table:wire_out:transfer_amount_inconsistencies} \label{table:wire_out:transfer_amount_inconsistencies}
\endlastfoot \endlastfoot
{% for item in wire.wire_out_amount_inconsistencies %} {% for item in wire.wire_out_amount_inconsistencies %}
{\tt {{ item.wtid }} } & {\tt \small {{ item.wtid }} } &
{{ item.amount_wired }} & {{ item.amount_wired }} &
{{ item.amount_justified }} \\ \hline {{ item.amount_justified }} \\ \hline
\nopagebreak \nopagebreak
@ -556,11 +578,12 @@ in the database does not match the calculations made by the auditor.
Deltas may indicate a corrupt database, but do not necessarily Deltas may indicate a corrupt database, but do not necessarily
translate into a financial loss (yet). translate into a financial loss (yet).
% Table generation tested by testcase #3 in test-auditor.sh
{% if data.reserve_balance_summary_wrong_inconsistencies|length() == 0 %} {% if data.reserve_balance_summary_wrong_inconsistencies|length() == 0 %}
{\bf All balances matched up.} {\bf All balances matched up.}
{% else %} {% else %}
\begin{longtable}{p{1.5cm}|r|r} \begin{longtable}{p{6cm}|r|r}
{\bf Reserve} & {\bf Auditor} & {\bf Exchange} \\ \hline \hline {\bf Reserve} & {\bf Auditor} & {\bf Exchange} \\ \hline \hline
\endfirsthead \endfirsthead
{\bf Reserve} & {\bf Auditor} & {\bf Exchange} \\ \hline \hline {\bf Reserve} & {\bf Auditor} & {\bf Exchange} \\ \hline \hline
@ -569,22 +592,41 @@ translate into a financial loss (yet).
{\bf Reserve} & {\bf Auditor} & {\bf Exchange} {\bf Reserve} & {\bf Auditor} & {\bf Exchange}
\endfoot \endfoot
\hline \hline
{\bf Total deltas} & & {\bf Total deltas} &
{{ data.total_balance_summary_delta_plus}} & {{ data.total_balance_summary_delta_plus}} &
- {{ data.total_balance_summary_delta_minus}} \\ - {{ data.total_balance_summary_delta_minus}} \\
\caption{Reserves balances not matching up.} \caption{Reserves balances not matching up.}
\label{table:reserve:balance_inconsistencies} \label{table:reserve:balance_inconsistencies}
\endlastfoot \endlastfoot
{% for item in data.reserve_balance_summary_wrong_inconsistencies %} {% for item in data.reserve_balance_summary_wrong_inconsistencies %}
\multicolumn{5}{l}{ {\tt {{ item.reserve_pub }} } } \\ {\tt \tiny {{ item.reserve_pub }} } &
\nopagebreak
&
{{ item.auditor }} & {{ item.auditor }} &
{{ item.exchange }} \\ \hline {{ item.exchange }} \\ \hline
{% endfor %} {% endfor %}
\end{longtable} \end{longtable}
{% endif %} {% endif %}
{% if data.reserve_balance_summary_wrong_inconsistencies|length() != 0 %}
This means that there are inconsistencies in the exchange's
summary data about reserve balances.
\begin{itemize}
\item The exchange believes some reserves contain (in total)
{\bf {{ data.total_balance_summary_delta_plus}} } {\em less} than they
actually contain. A non-zero value here means the exchange may deny legitimate withdrawal
requests, denying customers access to their funds.
\item The exchange believes some reserves contain (in total)
{\bf {{ data.total_balance_summary_delta_minus}} } {\em more} than they
actually contain. A non-zero value here means the exchange may allow coins to be withdrawn
for which it never received any income, at a loss (for the exchange).
\end{itemize}
{% if wire.reserve_in_amount_inconsistencies|length() != 0 %}
Note that inconsistencies detected in Section~\ref{sec:wire_in} may
have created follow-up errors in this table.
{% endif %}
{% endif %}
\subsection{Wire table issues} \subsection{Wire table issues}
@ -754,7 +796,7 @@ reserve expired.
\label{table:reserve:not_closed} \label{table:reserve:not_closed}
\endlastfoot \endlastfoot
{% for item in data.reserve_not_closed_inconsistencies %} {% for item in data.reserve_not_closed_inconsistencies %}
\multicolumn{4}{l}{ {\tt {{ item.reserve_pub }} } } \\ \multicolumn{4}{l}{ {\tt \small {{ item.reserve_pub }} } } \\
\nopagebreak \nopagebreak
& &
{{ item.expiration_time }} & {{ item.expiration_time }} &
@ -792,7 +834,7 @@ may happen even if the exchange is correct.
\label{table:refresh:hanging} \label{table:refresh:hanging}
\endlastfoot \endlastfoot
{% for item in data.refresh_hanging %} {% for item in data.refresh_hanging %}
\multicolumn{4}{l}{ {\tt {{ item.coin_pub }} } } \\ \multicolumn{4}{l}{ {\tt \small {{ item.coin_pub }} } } \\
\nopagebreak \nopagebreak
& &
{{ item.row }} & {{ item.row }} &
@ -831,10 +873,10 @@ implications.
\label{table:withdraw:bad_time} \label{table:withdraw:bad_time}
\endlastfoot \endlastfoot
{% for item in data.denomination_key_validity_withdraw_inconsistencies %} {% for item in data.denomination_key_validity_withdraw_inconsistencies %}
{\tt {{ item.reserve_pub }} } & {{ item.row }} \\ {\tt \small {{ item.reserve_pub }} } & {{ item.row }} \\
\nopagebreak \nopagebreak
& &
{\tt {{ item.denompub_h }} } & {{ item.execution_date }} \\ \hline {\tt \small {{ item.denompub_h }} } & {{ item.execution_date }} \\ \hline
{% endfor %} {% endfor %}
\end{longtable} \end{longtable}
{% endif %} {% endif %}