Skip to content

Add deneb block to consensus types#12368

Merged
terencechain merged 2 commits intodeneb-integrationfrom
deneb-consensus-changes
May 8, 2023
Merged

Add deneb block to consensus types#12368
terencechain merged 2 commits intodeneb-integrationfrom
deneb-consensus-changes

Conversation

@terencechain
Copy link
Collaborator

Add deneb block to consensus types

  • executionPayloadHeaderDeneb implementation
  • executionPayloadDeneb implementation
  • New execution getter ExcessDataGas across all executionPayloadXYZ implementations
  • Helper to convert PayloadToHeaderDeneb
  • Block factory to support Deneb
  • Block getters to support Deneb
  • Block proto to support Deneb
  • Cloners for Deneb blocks

@terencechain terencechain self-assigned this May 6, 2023
@terencechain terencechain requested a review from a team as a code owner May 6, 2023 22:41
@terencechain terencechain requested review from james-prysm, potuz and saolyn and removed request for a team May 6, 2023 22:41
@terencechain terencechain force-pushed the deneb-consensus-changes branch from 762ad2b to 07f9093 Compare May 6, 2023 22:55
}

// PbCapella --
func (e executionPayloadCapella) ExcessDataGas() ([]byte, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing doc

}

// PbCapella --
func (e executionPayloadHeaderCapella) ExcessDataGas() ([]byte, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing doc

return true, nil
}

// executionPayloadHeaderDeneb is a convenience wrapper around a blinded beacon block body's execution header data structure
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
// executionPayloadHeaderDeneb is a convenience wrapper around a blinded beacon block body's execution header data structure
// executionPayloadHeaderDeneb is a convenience wrapper around a blinded beacon block body's execution header data structure.

Comment on lines +59 to +64
case *eth.GenericSignedBeaconBlock_Deneb:
return initSignedBlockFromProtoDeneb(b.Deneb.Block)
case *eth.SignedBeaconBlockDeneb:
return initSignedBlockFromProtoDeneb(b)
case *eth.SignedBlindedBeaconBlockDeneb:
return initBlindedSignedBlockFromProtoDeneb(b)
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing GenericSignedBeaconBlock_BlindedDeneb

If everything works correctly without this, it makes me wonder if we even need GenericXXX cases here. But that it a question for another time, here I would blindly add it.

Comment on lines +99 to +106
case *eth.GenericBeaconBlock_Deneb:
return initBlockFromProtoDeneb(b.Deneb.Block)
case *eth.BeaconBlockDeneb:
return initBlockFromProtoDeneb(b)
case *eth.BlindedBeaconBlockDeneb:
return initBlindedBlockFromProtoDeneb(b)
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing GenericBeaconBlock_BlindedDeneb

VoluntaryExits: f.voluntaryExits,
SyncAggregate: f.syncAggregate,
ExecutionPayloadHeader: f.execPayloadHeaderDeneb,
BlsToExecutionChanges: f.blsToExecutionChanges,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as for bodyPbDeneb()

voluntaryExits: f.voluntaryExits,
syncAggregate: f.syncAggregate,
executionPayload: p,
blsToExecutionChanges: f.blsToExecutionChanges,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as for bodyPbDeneb()

voluntaryExits: f.voluntaryExits,
syncAggregate: f.syncAggregate,
executionPayloadHeader: ph,
blsToExecutionChanges: f.blsToExecutionChanges,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as for bodyPbDeneb()

func (b *SignedBeaconBlock) SetBlobKzgCommitments(c [][]byte) error {
switch b.version {
case version.Phase0, version.Altair, version.Bellatrix, version.Capella:
return consensus_types.ErrNotSupported("BlobKzgCommitments", b.version)
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
return consensus_types.ErrNotSupported("BlobKzgCommitments", b.version)
return consensus_types.ErrNotSupported("SetBlobKzgCommitments", b.version)

Header() (*ethpb.SignedBeaconBlockHeader, error)
}

type ReadOnlySignedBeaconBlockSlice []ReadOnlySignedBeaconBlock
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is unused

@terencechain terencechain force-pushed the deneb-consensus-changes branch from 3fe5ab4 to cd2a5c2 Compare May 8, 2023 20:30
@terencechain terencechain merged commit 8f05f11 into deneb-integration May 8, 2023
@terencechain terencechain deleted the deneb-consensus-changes branch May 8, 2023 23:47
kasey pushed a commit that referenced this pull request May 19, 2023
kasey pushed a commit that referenced this pull request May 22, 2023
james-prysm added a commit that referenced this pull request May 23, 2023
terencechain added a commit that referenced this pull request Jul 7, 2023
terencechain added a commit that referenced this pull request Jul 9, 2023
kasey pushed a commit that referenced this pull request Jul 20, 2023
james-prysm pushed a commit that referenced this pull request Aug 4, 2023
kasey pushed a commit that referenced this pull request Aug 21, 2023
kasey pushed a commit that referenced this pull request Aug 22, 2023
kasey pushed a commit that referenced this pull request Aug 22, 2023
kasey pushed a commit that referenced this pull request Aug 22, 2023
kasey pushed a commit that referenced this pull request Aug 23, 2023
kasey pushed a commit that referenced this pull request Aug 23, 2023
kasey pushed a commit that referenced this pull request Aug 23, 2023
kasey pushed a commit that referenced this pull request Aug 24, 2023
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.

2 participants