diff --git a/.golangci.yaml b/.golangci.yaml index e0bbea7..af7817a 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -43,6 +43,8 @@ linters: - varcheck linters-settings: + cyclop: + max-complexity: 20 tagliatelle: case: rules: diff --git a/utils/utils.go b/utils/utils.go index 196fdd9..2235632 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -294,6 +294,13 @@ func ComputeBlockHash(payload *api.VersionedExecutionPayload, parentBeaconRoot * return phase0.Hash32{}, err } return phase0.Hash32(header.Hash()), nil + case spec.DataVersionElectra: + // Electra uses the same ExecutionPayload as Deneb + header, err := denebExecutionPayloadToBlockHeader(payload.Electra, parentBeaconRoot) + if err != nil { + return phase0.Hash32{}, err + } + return phase0.Hash32(header.Hash()), nil case spec.DataVersionPhase0, spec.DataVersionAltair: return phase0.Hash32{}, fmt.Errorf("%w: %d", ErrUnsupportedVersion, payload.Version) case spec.DataVersionUnknown: