-
Notifications
You must be signed in to change notification settings - Fork 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
Electra: Consensus types additions #13925
Conversation
3550c7c
to
e2aa01e
Compare
e2aa01e
to
fc373b3
Compare
fc373b3
to
84ab470
Compare
@@ -122,13 +122,9 @@ func (b *SignedBeaconBlock) SetBLSToExecutionChanges(blsToExecutionChanges []*et | |||
|
|||
// SetBlobKzgCommitments sets the blob kzg commitments in the block. | |||
func (b *SignedBeaconBlock) SetBlobKzgCommitments(c [][]byte) error { | |||
switch b.version { | |||
case version.Phase0, version.Altair, version.Bellatrix, version.Capella: | |||
if b.version < version.Deneb { |
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.
nice small improvement here
// executionPayloadHeaderElectra is a convenience wrapper around a blinded beacon block body's execution header data structure. | ||
// This wrapper allows us to conform to a common interface so that beacon | ||
// blocks for future forks can also be applied across Prysm without issues. | ||
type executionPayloadHeaderElectra struct { |
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'd also consider adding unit tests for all the new methods. Here is an example what I did for ePBS. Feel free to copy:
} | ||
cp := eth.CopySignedBeaconBlockElectra(pb.(*eth.SignedBeaconBlockElectra)) | ||
return initSignedBlockFromProtoElectra(cp) | ||
|
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.
@@ -1079,13 +1223,20 @@ func (b *BeaconBlockBody) BlobKzgCommitments() ([][]byte, error) { | |||
switch b.version { | |||
case version.Phase0, version.Altair, version.Bellatrix, version.Capella: |
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.
Can we refactor this to if b.version < version.Deneb
?
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.
- Please add Electra test cases to test files inside the package
BuildSignedBeaconBlockFromExecutionPayload
is missing (you can cherry-pick c859d11)
fa9d8fa
to
1824295
Compare
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
This landed in #13937 |
What type of PR is this?
Feature
What does this PR do? Why is it needed?
Some of the consensus types changes for Electra.
Which issues(s) does this PR fix?
Required for #13919
Other notes for review
Depends on #13921, #13923, and #13924. Merge those before this can be marked as ready for review.