-
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
EIP-7549 beacon spec #13946
EIP-7549 beacon spec #13946
Conversation
indexedAtt, err := attestation.ConvertToIndexed(ctx, att, committee) | ||
if err != nil { | ||
return err | ||
if att.Version() < version.Electra { |
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 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.
indexedAtt, err := attestation.ConvertToIndexed(ctx, att, committee) | ||
if err != nil { | ||
return err | ||
if att.Version() < version.Electra { |
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.
Same feedback as my other comment, could you refactor the old logic to its own method and put the old spec definition there?
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.
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 { |
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.
This might be a good place to refactor the pre electra and post electra functions into two different functions
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.
Not sure about this, see #13946 (comment)
slices.Sort(attesters) | ||
return slices.Compact(attesters), nil |
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 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)
* EIP-7549 beacon spec * reviews * change signature of AttestingIndices
Implementation of the following changes to beacon spec: