Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not add Electra attestations if committees size is not retrievable #8323

Conversation

StefanBratanov
Copy link
Contributor

PR Description

Filter out Electra attestations for which we can't retrieve the committees size from the relevant state

Fixed Issue(s)

N/A

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

@StefanBratanov StefanBratanov marked this pull request as ready for review May 17, 2024 12:42
};
final Bytes32 targetRoot = attestationData.getTarget().getRoot();
LOG.debug(
"Committees size was not readily available for attestation with target root {}. Will attempt to retrieve it using the relevant state.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd probably change this to just be something short like
Committee size was not found via target root {} for attestation at slot {}

if (attestation.requiresCommitteeBits()) {
final AttestationData attestationData = attestation.getData();
LOG.debug(
"Committees size was not found for target root {} for attestation at slot {}. Will attempt to retrieve it using the relevant state.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think id still delete 'will attempt...'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deleted the whole log and moved it to getOrCreateAttestationGroup. It is now:

LOG.debug("Committees size was not available for attestation at slot {} and block root {}. Will NOT add this attestation to the pool.",attestationData.getTarget().getRoot(), attestationData.getBeaconBlockRoot());

@@ -56,14 +55,14 @@ public class MatchingDataAttestationGroup implements Iterable<ValidatableAttesta
private final Spec spec;
private Optional<Bytes32> committeeShufflingSeed = Optional.empty();
private final AttestationData attestationData;
private final Supplier<Int2IntMap> commiteesSizeSupplier;
private final Optional<Int2IntMap> committeesSize;
Copy link
Contributor

@rolfyone rolfyone May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think maybeCommitteeSize would be cleaner

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left it as it is because we use that name in other places (where it is still Optional)

@StefanBratanov StefanBratanov force-pushed the do_not_add_electra_att_if_exception branch from 4f3da70 to 5c23687 Compare May 17, 2024 14:07
@StefanBratanov StefanBratanov enabled auto-merge (squash) May 17, 2024 14:12
@StefanBratanov StefanBratanov enabled auto-merge (squash) May 17, 2024 14:20
@StefanBratanov StefanBratanov merged commit f24e663 into Consensys:master May 17, 2024
15 of 16 checks passed
@StefanBratanov StefanBratanov deleted the do_not_add_electra_att_if_exception branch May 17, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants