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

Electra: Consensus types additions #13925

Closed
wants to merge 5 commits into from

Conversation

prestonvanloon
Copy link
Member

@prestonvanloon prestonvanloon commented Apr 26, 2024

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.

@prestonvanloon prestonvanloon force-pushed the electra-consensus-types branch 3 times, most recently from 3550c7c to e2aa01e Compare April 26, 2024 17:03
@prestonvanloon prestonvanloon force-pushed the electra-consensus-types branch from e2aa01e to fc373b3 Compare April 26, 2024 18:54
@prestonvanloon prestonvanloon force-pushed the electra-consensus-types branch from fc373b3 to 84ab470 Compare April 26, 2024 19:00
@prestonvanloon prestonvanloon marked this pull request as ready for review April 26, 2024 19:54
@prestonvanloon prestonvanloon requested a review from a team as a code owner April 26, 2024 19:54
@@ -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 {
Copy link
Contributor

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 {
Copy link
Member

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:

https://github.com/prysmaticlabs/prysm/pull/13914/files#diff-a4ffcfb9e9d5ea43d14f3217b54c9d2502a8b33d05934d07628b07ff79394887R488

}
cp := eth.CopySignedBeaconBlockElectra(pb.(*eth.SignedBeaconBlockElectra))
return initSignedBlockFromProtoElectra(cp)

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

@@ -1079,13 +1223,20 @@ func (b *BeaconBlockBody) BlobKzgCommitments() ([][]byte, error) {
switch b.version {
case version.Phase0, version.Altair, version.Bellatrix, version.Capella:
Copy link
Contributor

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?

Copy link
Contributor

@rkapka rkapka left a 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)

@prestonvanloon prestonvanloon force-pushed the electra-consensus-types branch from fa9d8fa to 1824295 Compare April 29, 2024 16:44
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
@prestonvanloon
Copy link
Member Author

This landed in #13937

@prestonvanloon prestonvanloon deleted the electra-consensus-types branch May 1, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants