Skip to content

Commit

Permalink
updated TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
eserilev committed Apr 30, 2024
1 parent fb26e15 commit af73dde
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
};
drop(cache_timer);

// TODO(eip7549) implement electra variant
// TODO(electra) implement electra variant
Ok(Attestation::Base(AttestationBase {
aggregation_bits: BitList::with_capacity(committee_len)?,
data: AttestationData {
Expand Down
1 change: 1 addition & 0 deletions beacon_node/beacon_chain/src/early_attester_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ impl<E: EthSpec> EarlyAttesterCache<E> {
item.committee_lengths
.get_committee_length::<E>(request_slot, request_index, spec)?;

// TODO(electra) make fork-agnostic
let attestation = Attestation::Base(AttestationBase {
aggregation_bits: BitList::with_capacity(committee_len)
.map_err(BeaconStateError::from)?,
Expand Down
6 changes: 3 additions & 3 deletions beacon_node/beacon_chain/src/observed_aggregates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ impl<E: EthSpec> SubsetItem for Attestation<E> {
fn is_subset(&self, other: &Self::Item) -> bool {
match self {
Attestation::Base(att) => att.aggregation_bits.is_subset(other),
// TODO(eip7549) implement electra variant
// TODO(electra) implement electra variant
Attestation::Electra(_) => todo!(),
}
}

fn is_superset(&self, other: &Self::Item) -> bool {
match self {
Attestation::Base(att) => other.is_subset(&att.aggregation_bits),
// TODO(eip7549) implement electra variant
// TODO(electra) implement electra variant
Attestation::Electra(_) => todo!(),
}
}
Expand All @@ -124,7 +124,7 @@ impl<E: EthSpec> SubsetItem for Attestation<E> {
fn get_item(&self) -> Self::Item {
match self {
Attestation::Base(att) => att.aggregation_bits.clone(),
// TODO(eip7549) implement electra variant
// TODO(electra) implement electra variant
Attestation::Electra(_) => todo!(),
}
}
Expand Down
3 changes: 2 additions & 1 deletion beacon_node/beacon_chain/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,7 @@ where
*state.get_block_root(target_slot)?
};

// TODO(electra) make test fork-agnostic
Ok(Attestation::Base(AttestationBase {
aggregation_bits: BitList::with_capacity(committee_len)?,
data: AttestationData {
Expand Down Expand Up @@ -1515,7 +1516,7 @@ where
attestation_2.data_mut().target.epoch = target2.unwrap_or(fork.epoch);

for attestation in &mut [&mut attestation_1, &mut attestation_2] {
// TODO(eip7549) we could explore iter mut here
// TODO(electra) we could explore iter mut here
for i in attestation.attesting_indices_to_vec() {
let sk = &self.validator_keypairs[i as usize].sk;

Expand Down
2 changes: 1 addition & 1 deletion beacon_node/http_api/src/block_packing_efficiency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl<E: EthSpec> PackingEfficiencyHandler<E> {
}
}
}
// TODO(eip7549) implement electra variant
// TODO(electra) implement electra variant
Attestation::Electra(_) => {
todo!()
}
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/operation_pool/src/attestation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ pub fn earliest_attestation_validators<E: EthSpec>(
// Bitfield of validators whose attestations are new/fresh.
let mut new_validators = match attestation.indexed {
CompactIndexedAttestation::Base(indexed_att) => indexed_att.aggregation_bits.clone(),
// TODO(eip7549) per the comments above, this code path is obsolete post altair fork, so maybe we should just return an empty bitlist here?
// TODO(electra) per the comments above, this code path is obsolete post altair fork, so maybe we should just return an empty bitlist here?
CompactIndexedAttestation::Electra(_) => todo!(),
};

Expand Down
6 changes: 3 additions & 3 deletions beacon_node/operation_pool/src/attestation_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl<E: EthSpec> SplitAttestation<E> {
index: data.index,
})
}
// TODO(eip7549) implement electra variant
// TODO(electra) implement electra variant
Attestation::Electra(_) => todo!(),
};

Expand Down Expand Up @@ -157,7 +157,7 @@ impl<E: EthSpec> CompactIndexedAttestation<E> {
(CompactIndexedAttestation::Electra(_), CompactIndexedAttestation::Electra(_)) => {
todo!()
}
// TODO(eip7549) is a mix of electra and base compact indexed attestations an edge case we need to deal with?
// TODO(electra) is a mix of electra and base compact indexed attestations an edge case we need to deal with?
_ => false,
}
}
Expand All @@ -170,7 +170,7 @@ impl<E: EthSpec> CompactIndexedAttestation<E> {
(CompactIndexedAttestation::Electra(_), CompactIndexedAttestation::Electra(_)) => {
todo!()
}
// TODO(eip7549) is a mix of electra and base compact indexed attestations an edge case we need to deal with?
// TODO(electra) is a mix of electra and base compact indexed attestations an edge case we need to deal with?
_ => (),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub fn get_attesting_indices_from_state<E: EthSpec>(
Attestation::Base(att) => {
get_attesting_indices::<E>(committee.committee, &att.aggregation_bits)
}
// TODO(eip7549) implement get_attesting_indices for electra
// TODO(electra) implement get_attesting_indices for electra
Attestation::Electra(_) => todo!(),
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub fn get_indexed_attestation<E: EthSpec>(
) -> Result<IndexedAttestation<E>> {
let attesting_indices = match attestation {
Attestation::Base(att) => get_attesting_indices::<E>(committee, &att.aggregation_bits)?,
// TODO(eip7549) implement get_attesting_indices for electra
// TODO(electra) implement get_attesting_indices for electra
Attestation::Electra(_) => todo!(),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub mod base {
}
}
Attestation::Electra(_) => {
// TODO(eip7549) pending attestations are only phase 0
// TODO(electra) pending attestations are only phase 0
// so we should just raise a relevant error here
todo!()
}
Expand Down
3 changes: 2 additions & 1 deletion slasher/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub fn indexed_att(
target_epoch: u64,
target_root: u64,
) -> IndexedAttestation<E> {
// TODO(electra) make fork-agnostic
IndexedAttestation::Base(IndexedAttestationBase {
attesting_indices: attesting_indices.as_ref().to_vec().into(),
data: AttestationData {
Expand Down Expand Up @@ -85,7 +86,7 @@ pub fn slashed_validators_from_attestations(
continue;
}

// TODO(eip7549) in a nested loop, copying to vecs feels bad
// TODO(electra) in a nested loop, copying to vecs feels bad
let attesting_indices_1 = att1.attesting_indices_to_vec();
let attesting_indices_2 = att2.attesting_indices_to_vec();

Expand Down

0 comments on commit af73dde

Please sign in to comment.