-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
single attestation cleanup #14984
single attestation cleanup #14984
Conversation
// Verify the block being voted and the processed state is in beaconDB and the block has passed validation if it's in the beaconDB. | ||
blockRoot := bytesutil.ToBytes32(data.BeaconBlockRoot) | ||
if !s.hasBlockAndState(ctx, blockRoot) { | ||
return s.saveToPendingAttPool(att) | ||
} | ||
|
||
if !s.cfg.chain.InForkchoice(bytesutil.ToBytes32(data.BeaconBlockRoot)) { | ||
if !s.cfg.chain.InForkchoice(blockRoot) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just use blockRoot here, because it's already calculated above
if validationRes != pubsub.ValidationAccept { | ||
return validationRes, err | ||
} | ||
|
||
committee, err := helpers.BeaconCommitteeFromState(ctx, preState, att.GetData().Slot, committeeIndex) | ||
committee, err := helpers.BeaconCommitteeFromState(ctx, preState, data.Slot, committeeIndex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to get data again, we already have data
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
will break out the fix and add unit test for it
log.WithError(err).Debug("Could not save unaggregated attestation") | ||
return | ||
} | ||
} | ||
s.setSeenCommitteeIndicesSlot(data.Slot, data.CommitteeIndex, att.GetAggregationBits()) | ||
s.setSeenCommitteeIndicesSlot(data.Slot, data.GetCommitteeIndex(), attForValidation.GetAggregationBits()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dang this is still wrong pr fixes this #14998
* some cleanup and minor bug fix * adding some comments back in * Update beacon-chain/sync/pending_attestations_queue.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/sync/pending_attestations_queue.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/sync/validate_beacon_attestation.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/sync/validate_beacon_attestation.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/sync/validate_beacon_attestation.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/sync/validate_beacon_attestation.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/sync/validate_beacon_attestation.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/sync/pending_attestations_queue.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * adding comment back in * linting * fixing committeeIndiciesSLot * fixing changelog --------- Co-authored-by: Radosław Kapka <rkapka@wp.pl>
What type of PR is this?
Bug fix
What does this PR do? Why is it needed?
This PR does some minor cleanup to reduce cognitive load when reading what should be a single attestation vs regular attestation
kurtosis run with devnet 6 settings 3 nodes ( teku/nethermind, 2x prysm/geth)

attestation events still working

Which issues(s) does this PR fix?
Fixes #
Other notes for review
Acknowledgements