Skip to content

Commit

Permalink
Fix aggregator index calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhauner committed Sep 14, 2020
1 parent 404d681 commit 7e819bc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions validator_client/src/duties_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ impl DutyAndProof {
validator_store: &ValidatorStore<T, E>,
spec: &ChainSpec,
) -> Result<(), String> {
let (committee_count_at_slot, slot) = if let (Some(count), Some(slot)) = (
self.duty.committee_count_at_slot,
self.duty.attestation_slot,
) {
let (committee_length, slot) = if let (Some(count), Some(slot)) =
(self.duty.committee_length, self.duty.attestation_slot)
{
(count as usize, slot)
} else {
// If there are no attester duties we assume the validator is inactive.
Expand All @@ -61,7 +60,7 @@ impl DutyAndProof {
.ok_or_else(|| "Failed to produce selection proof".to_string())?;

self.selection_proof = selection_proof
.is_aggregator(committee_count_at_slot, spec)
.is_aggregator(committee_length, spec)
.map_err(|e| format!("Invalid modulo: {:?}", e))
.map(|is_aggregator| {
if is_aggregator {
Expand Down

0 comments on commit 7e819bc

Please sign in to comment.