mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Fix IsExecutionEnabled for blinded blocks (#11076)
* Fix IsExecutionEnabled for blinded blocks The TransactionsRoot of a blinded block may be non-zero, anyway we do not insert the header in the state until IsExecutionEnabled is true. This last check was failing on blinded blocks because it was actively checking that the root should be zero, when it needn't be. Superseeds #11068 * fix test * test case Co-authored-by: Raul Jordan <raul@prysmaticlabs.com> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
@@ -398,8 +398,6 @@ func TestBellatrixBeaconBlock_ExecutionPayloadHeader(t *testing.T) {
|
||||
}
|
||||
wsb, err := wrapper.WrappedSignedBeaconBlock(sb)
|
||||
require.NoError(t, err)
|
||||
exec, err := wsb.Block().Body().Execution()
|
||||
_, err = wsb.Block().Body().Execution()
|
||||
require.NoError(t, err)
|
||||
_, err = exec.TransactionsRoot()
|
||||
require.ErrorContains(t, "unsupported field for block type", err)
|
||||
}
|
||||
|
||||
@@ -139,11 +139,6 @@ func (e executionPayload) Transactions() ([][]byte, error) {
|
||||
return e.p.Transactions, nil
|
||||
}
|
||||
|
||||
// TransactionsRoot --
|
||||
func (executionPayload) TransactionsRoot() ([]byte, error) {
|
||||
return nil, ErrUnsupportedField
|
||||
}
|
||||
|
||||
// executionPayloadHeader 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.
|
||||
@@ -270,11 +265,6 @@ func (executionPayloadHeader) Transactions() ([][]byte, error) {
|
||||
return nil, ErrUnsupportedField
|
||||
}
|
||||
|
||||
// TransactionsRoot --
|
||||
func (e executionPayloadHeader) TransactionsRoot() ([]byte, error) {
|
||||
return e.p.TransactionsRoot, nil
|
||||
}
|
||||
|
||||
// PayloadToHeader converts `payload` into execution payload header format.
|
||||
func PayloadToHeader(payload interfaces.ExecutionData) (*enginev1.ExecutionPayloadHeader, error) {
|
||||
txs, err := payload.Transactions()
|
||||
@@ -342,16 +332,6 @@ func IsEmptyExecutionData(data interfaces.ExecutionData) (bool, error) {
|
||||
}
|
||||
}
|
||||
|
||||
txsRoot, err := data.TransactionsRoot()
|
||||
switch {
|
||||
case errors.Is(err, ErrUnsupportedField):
|
||||
case err != nil:
|
||||
return false, err
|
||||
default:
|
||||
if !bytes.Equal(txsRoot, make([]byte, fieldparams.RootLength)) {
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
if len(data.ExtraData()) != 0 {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user