mirror of https://github.com/BOINC/boinc.git
78 lines
2.4 KiB
HTML
78 lines
2.4 KiB
HTML
<title>Validation of results and credit</title>
|
|
<body bgcolor=ffffff>
|
|
<h2>Validation of results and credit</h2>
|
|
<p>
|
|
Communication from the core client can easily be altered or forged.
|
|
Some users will attempt to get undeserved credit
|
|
by falsifying their CPU metrics or CPU times.
|
|
Output files may be wrong.
|
|
This can result from tampering or hardware failures.
|
|
<p>
|
|
Both problems - credit-cheating and wrong results - can be addressed
|
|
by <b>redundant computing</b> and <b>result validation</b>.
|
|
In this approach, each workunit is processed at least twice.
|
|
The project back end waits until a minimum number of results have been returned,
|
|
then compares the results and decides which are considered correct.
|
|
The notion of equality of results,
|
|
and the policy for deciding which are correct,
|
|
are project-specific.
|
|
<p>
|
|
The back end then marks correct results as "validated",
|
|
finds the minimum reported credit for the correct results of a given workunit,
|
|
and assigns this amount of credit to all the correct results.
|
|
This ensures that as long as a reasonable majority of participants
|
|
don't falsify credit, almost all credit accounting will be correct.
|
|
|
|
<h3>The validation program</h3>
|
|
|
|
BOINC supplies a utility program <b>validate</b>
|
|
to perform validation and credit-granting.
|
|
This program must be linked with two project-specific functions:
|
|
<pre>
|
|
int check_set(vector<RESULT> results, int& canonicalid, double& credit);
|
|
int check_pair(RESULT& r1, RESULT& r2, bool& match);
|
|
</pre>
|
|
<b>check_set()</b> takes a set of results.
|
|
If there is sufficient agreement,
|
|
it selects one of them as the "canonical" result
|
|
(returning its ID) and also decides what credit should
|
|
be granted for correct results for this workunit.
|
|
<p>
|
|
<b>check_pair()</b> compares two results and returns match=true
|
|
if they agree.
|
|
|
|
<p>
|
|
The file <b>validate_test.C</b> contains an example
|
|
implementation of check_set() and check_pair().
|
|
|
|
|
|
<hr>
|
|
<h3>Implementation</h3>
|
|
|
|
The following database fields are used:
|
|
|
|
<p>
|
|
<b>WORKUNIT</b>
|
|
<dt> bool need_validate
|
|
<dd>
|
|
true iff this workunit has one or more results in state DONE
|
|
and validate_state UNCHECKED
|
|
<dt>
|
|
int canonical_resultid
|
|
<dd>
|
|
nonzero if a conclusive check has been done for this WU;
|
|
indicates the canonical result
|
|
|
|
<p>
|
|
<b>RESULT</b>
|
|
<dt>
|
|
int state
|
|
<dd> INACTIVE, ..., DONE, ERROR
|
|
<dt>
|
|
int validate_state
|
|
<dd>
|
|
NEED_CHECK,
|
|
VALID,
|
|
INVALID
|
|
|