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

Better attestation packing for Electra #14534

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Conversation

rkapka
Copy link
Contributor

@rkapka rkapka commented Oct 14, 2024

What type of PR is this?

Feature

What does this PR do? Why is it needed?

Our current packing algorithm for Electra is very non-optimal and was only supposed to be used in devnets, where the network is very small and communication between nodes is very reliable, resulting in a small number of aggregates. This algorithm creates only one on-chain attestation per an attestation_data+committee combination. It means that if there are two aggregates for the same data and committee, the one with less attestation bits will always be dropped, even if it could be packed into a block.

The new algorithm loops through aggregates until all of them are included in an on-chain attestation.

Acknowledgements

  • I have read CONTRIBUTING.md.
  • I have made an appropriate entry to CHANGELOG.md.
  • I have added a description to this PR with sufficient context for reviewers to understand this PR.

@rkapka rkapka requested a review from a team as a code owner October 14, 2024 13:37
@rkapka rkapka added the Electra electra hardfork label Oct 14, 2024
@@ -231,7 +259,6 @@ func (a proposerAtts) sortBySlotAndCommittee() (proposerAtts, error) {
type slotAtts struct {
candidates map[primitives.CommitteeIndex]proposerAtts
selected map[primitives.CommitteeIndex]proposerAtts
leftover map[primitives.CommitteeIndex]proposerAtts
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We ignore leftover attestations, so this is not needed.

@rkapka rkapka added Ready For Review A pull request ready for code review Enhancement New feature or request and removed Enhancement New feature or request labels Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Electra electra hardfork Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant