-
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
Capella beacon block #11566
Capella beacon block #11566
Conversation
This reverts commit 081ab74e88fb7d0e3f6a81e00fe5e89483b41f90.
if err != nil { | ||
return err | ||
} | ||
obtainedCtx = digest[:] |
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.
Why is obtainedCtx
assigned in each case instead of after the switch statement?
consensus-types/blocks/types.go
Outdated
deposits []*eth.Deposit | ||
voluntaryExits []*eth.SignedVoluntaryExit | ||
syncAggregate *eth.SyncAggregate | ||
executionPayload *engine.ExecutionPayload |
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't these be in a single interface executionPayload
that has different implementations? Otherwise each fork we'll have to add a possibly nil pointer to the BeaconBlockBody
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 quickly glanced through this. It looks fine
Is there any reason to use a mega PR (2000+) lines diff versus splitting this into more management PRs (e.g. 500 lines) by various components. You'll make @prestonvanloon's day :D
It also might be easier to root cause the e2e failure that way
I think we agreed that splitting PRs does more harm than good.
Current e2e failures cannot be attributed to this PR because it's not merged yet. Or do you mean potential failures that this PR might cause? 😅 |
Why is this? |
validator/client/propose.go
Outdated
@@ -145,7 +145,7 @@ func (v *validator) ProposeBlock(ctx context.Context, slot types.Slot, pubKey [f | |||
trace.Int64Attribute("numAttestations", int64(len(blk.Block().Body().Attestations()))), | |||
) | |||
|
|||
if blk.Version() == version.Bellatrix { | |||
if blk.Version() > version.Altair { |
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.
Do we want to log here also the number of withdrawals included?
testing/util/block.go
Outdated
BaseFeePerGas: make([]byte, fieldparams.RootLength), | ||
BlockHash: make([]byte, fieldparams.RootLength), | ||
Transactions: make([][]byte, 0), | ||
ExtraData: make([]byte, 0), |
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.
Withdrawals?
proto/prysm/v1alpha1/cloners_test.go
Outdated
WithdrawalIndex: 456, | ||
ValidatorIndex: 456, |
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.
WithdrawalIndex: 456, | |
ValidatorIndex: 456, | |
WithdrawalIndex: 123, | |
ValidatorIndex: 456, |
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.
Why?
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.
Because it's closer to reality: withdrawals are sequential in a block or the block is invalid, it should be 124 though, not 123 :)
proto/prysm/v1alpha1/cloners_test.go
Outdated
func genAttestation() *v1alpha1.Attestation { | ||
return &v1alpha1.Attestation{ | ||
AggregationBits: bytes(32), | ||
Data: genAttData(), | ||
Signature: bytes(32), | ||
Signature: bytes(96), |
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.
What is this thing?
proto/prysm/v1alpha1/cloners_test.go
Outdated
@@ -360,35 +360,95 @@ func TestCopyBeaconBlockBodyBellatrix(t *testing.T) { | |||
} | |||
|
|||
func TestCopySignedBlindedBeaconBlockBellatrix(t *testing.T) { | |||
sbb := genSignedBeaconBlockBellatrix() | |||
sbb := genSignedBlindedBeaconBlockBellatrix() |
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.
What are these unrelated fixes?
@@ -243,7 +243,7 @@ func ProcessOperationsNoVerifyAttsSigs( | |||
if err != nil { | |||
return nil, err | |||
} | |||
case version.Altair, version.Bellatrix: | |||
case 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.
case version.Altair, version.Bellatrix, version.Capella: | |
case version.Altair, version.Bellatrix |
Better to leave transition changes out of this PR.
This reverts commit 1ff3a4c864923f5c180aa015aa087a2814498b42.
@@ -81,6 +81,76 @@ func TestWrapExecutionPayloadHeader_SSZ(t *testing.T) { | |||
assert.NoError(t, wsb.UnmarshalSSZ(encoded)) | |||
} | |||
|
|||
func TestWrapExecutionPayloadCapella(t *testing.T) { | |||
data := &enginev1.ExecutionPayloadCapella{GasUsed: 54} |
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.
Personally, I think there's great value to fill in all the fields and test they are not nil
@@ -81,6 +81,76 @@ func TestWrapExecutionPayloadHeader_SSZ(t *testing.T) { | |||
assert.NoError(t, wsb.UnmarshalSSZ(encoded)) | |||
} | |||
|
|||
func TestWrapExecutionPayloadCapella(t *testing.T) { | |||
data := &enginev1.ExecutionPayloadCapella{GasUsed: 54} | |||
wsb, err := blocks.WrappedExecutionPayloadCapella(data) |
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.
wsb
wrapped signed block? this is not a block
if b.executionPayloadHeader != nil { | ||
ph, ok = b.executionPayloadHeader.Proto().(*enginev1.ExecutionPayloadHeader) | ||
if !ok { | ||
return nil, errPayloadHeaderWrongType |
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 test for this? there are four instances that we may hit these errors.
proto/prysm/v1alpha1/cloners_test.go
Outdated
WithdrawalIndex: 456, | ||
ValidatorIndex: 456, |
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.
Because it's closer to reality: withdrawals are sequential in a block or the block is invalid, it should be 124 though, not 123 :)
What type of PR is this?
Feature
What does this PR do? Why is it needed?
version.Capella
for block processing