Auditor Assignment
Every Slot, each enclave (or TEE) in the set [] is assigned a subset of auditors [] from the set [], such that |[]| = k (where k or AuditorsPerEnclave is a constant that determines the number of auditors assigned per enclave). ] largely consist of different subsets of Auditors for different Slots of an Epoch.
The assignment from [] to [] for slots in epoch is randomized using a seed which is generated at the start of the epoch . is currently considered to be the blockhash of the block at which the epoch starts.
Auditors can only enter or leave the auditor set [A] at the end of an Epoch which ensures that the auditor assignment doesn't change within an Epoch. Enclave set [T] can expand or decrease based on whether a new Job is added or an existing Job is closed or runs out of funds.
Each enclave, for a given Slot of an Epoch, is assigned an auditor subset [] of length k using the following algorithm:
let AuditorSubsetIndices = [];
let count = 0;
let iter = 0;
while(count < k) {
index = (keccak256(`${iter}-${SlotId}-${EnclaveJobId}`)) mod(t)
if(!AuditorSubsetIndices.includes(index)) {
AuditorSubsetIndices.push(index);
count++;
}
iter++;
}
The above algorithm ensures that the auditor subset for any enclave in a Slot consists of unique Auditors. This also ensures that any new enclaves started during the Epoch can still be assigned Auditors. Auditing of the new enclave takes effect only after c slots (JobStartupPeriod) from the Slot at which the Job was created, where c is a constant that determines the delay for auditing new enclaves.