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

Merged
merged 14 commits into from
Nov 25, 2024
Merged

Better attestation packing for Electra #14534

merged 14 commits into from
Nov 25, 2024

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 force-pushed the electra-better-packing branch from 756d852 to fd2501b Compare October 14, 2024 13:44
@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 Enhancement New feature or request and removed Enhancement New feature or request labels Oct 14, 2024
@rkapka rkapka force-pushed the electra-better-packing branch from 41e1d96 to 3402608 Compare October 25, 2024 10:56
@rkapka rkapka force-pushed the electra-better-packing branch from 5f27d17 to b2d96d8 Compare October 25, 2024 13:54
@rkapka rkapka force-pushed the electra-better-packing branch from a7258d3 to 41dd445 Compare November 18, 2024 17:35
@rkapka rkapka enabled auto-merge November 25, 2024 18:20
@rkapka rkapka added this pull request to the merge queue Nov 25, 2024
Merged via the queue into develop with commit 67cef41 Nov 25, 2024
17 of 18 checks passed
@rkapka rkapka deleted the electra-better-packing branch November 25, 2024 18:49
@kasey kasey added the changelog/added Changelog Section: Added label Dec 4, 2024
@Jimmyawesom

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/added Changelog Section: Added Electra electra hardfork
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants