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

EIP-7549 beacon spec #13946

Merged
merged 4 commits into from
May 7, 2024
Merged

EIP-7549 beacon spec #13946

merged 4 commits into from
May 7, 2024

Conversation

@rkapka rkapka requested a review from a team as a code owner May 2, 2024 09:58
@rkapka rkapka added Electra electra hardfork Ready For Review A pull request ready for code review labels May 2, 2024
indexedAtt, err := attestation.ConvertToIndexed(ctx, att, committee)
if err != nil {
return err
if att.Version() < version.Electra {
Copy link
Contributor

Choose a reason for hiding this comment

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

we should decide the direction of these checks for more consistency reviewing, some other parts do the reverse where it checks the version is >= version.Electra. just something we can align on.

proto/prysm/v1alpha1/attestation/attestation_utils.go Outdated Show resolved Hide resolved
proto/prysm/v1alpha1/attestation/attestation_utils.go Outdated Show resolved Hide resolved
indexedAtt, err := attestation.ConvertToIndexed(ctx, att, committee)
if err != nil {
return err
if att.Version() < version.Electra {
Copy link
Member

Choose a reason for hiding this comment

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

Same feedback as my other comment, could you refactor the old logic to its own method and put the old spec definition there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not as straightforward here because the other function was basically replaced in whole. Here only a small subset of validation in the middle of the function is different.

indexedAtt, err := attestation.ConvertToIndexed(ctx, att, committee)
if err != nil {
return err
if att.Version() < version.Electra {
Copy link
Member

Choose a reason for hiding this comment

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

This might be a good place to refactor the pre electra and post electra functions into two different functions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure about this, see #13946 (comment)

Comment on lines +114 to +115
slices.Sort(attesters)
return slices.Compact(attesters), nil
Copy link
Member

Choose a reason for hiding this comment

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

We will want to test this for performance. Sorting is O(nlogn) where using a map would be O(n) at the cost of additional O(n)

@rkapka rkapka added this pull request to the merge queue May 7, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 7, 2024
@rkapka rkapka added this pull request to the merge queue May 7, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 7, 2024
@rkapka rkapka added this pull request to the merge queue May 7, 2024
Merged via the queue into develop with commit 5f1b903 May 7, 2024
16 of 17 checks passed
@rkapka rkapka deleted the eip-7549-beacon-spec branch May 7, 2024 14:24
nisdas pushed a commit that referenced this pull request Jul 4, 2024
* EIP-7549 beacon spec

* reviews

* change signature of AttestingIndices
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.

4 participants