Skip to content

Commit

Permalink
Fix committee_index retrieval for attestations
Browse files Browse the repository at this point in the history
  • Loading branch information
Tumas authored and povi committed Feb 12, 2025
1 parent fe60f3e commit 069742a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
10 changes: 3 additions & 7 deletions fork_choice_store/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,6 @@ impl<P: Preset> Store<P> {
Ok(BlockAction::Accept(chain_link, attester_slashing_results))
}

#[expect(clippy::too_many_lines)]
pub fn validate_aggregate_and_proof<I>(
&self,
aggregate_and_proof: Arc<SignedAggregateAndProof<P>>,
Expand Down Expand Up @@ -1205,12 +1204,9 @@ impl<P: Preset> Store<P> {
}
}

let AttestationData {
slot,
index,
target,
..
} = aggregate.data();
let AttestationData { slot, target, .. } = aggregate.data();

let index = misc::committee_index(&aggregate);

// TODO(feature/deneb): Figure out why this validation is split over 2 methods.
// TODO(feature/deneb): This appears to be unfinished.
Expand Down
3 changes: 2 additions & 1 deletion http_api/src/standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2912,7 +2912,6 @@ async fn submit_attestation_to_pool<P: Preset, W: Wait>(
let run = async {
let AttestationData {
slot,
index: committee_index,
beacon_block_root,
target,
..
Expand All @@ -2931,6 +2930,8 @@ async fn submit_attestation_to_pool<P: Preset, W: Wait>(
let committees_per_slot =
accessors::get_committee_count_per_slot(&target_state, relative_epoch);

let committee_index = misc::committee_index(&attestation);

let subnet_id =
misc::compute_subnet_for_attestation::<P>(committees_per_slot, slot, committee_index)?;

Expand Down

0 comments on commit 069742a

Please sign in to comment.