diff --git a/turbo/engineapi/engine_api_methods.go b/turbo/engineapi/engine_api_methods.go index 9e806b15224..9d0eed8498f 100644 --- a/turbo/engineapi/engine_api_methods.go +++ b/turbo/engineapi/engine_api_methods.go @@ -159,17 +159,18 @@ func (e *EngineServer) GetClientVersionV1(ctx context.Context, callerVersion *en if callerVersion != nil { e.logger.Info("[GetClientVersionV1] Received request from" + callerVersion.String()) } - commitBytes := [4]byte{} - c := []byte(params.GitCommit) - if len(c) >= 4 { - copy(commitBytes[:], c[0:4]) + commitString := params.GitCommit + if len(commitString) >= 8 { + commitString = commitString[:8] + } else { + commitString = "00000000" // shouldn't be triggered } result := make([]engine_types.ClientVersionV1, 1) result[0] = engine_types.ClientVersionV1{ Code: params.ClientCode, Name: params.ClientName, - Version: params.Version, - Commit: commitBytes, + Version: params.VersionWithCommit(params.GitCommit), + Commit: "0x" + commitString, } return result, nil } diff --git a/turbo/engineapi/engine_types/jsonrpc.go b/turbo/engineapi/engine_types/jsonrpc.go index b099eaf1d82..d3b58b70566 100644 --- a/turbo/engineapi/engine_types/jsonrpc.go +++ b/turbo/engineapi/engine_types/jsonrpc.go @@ -93,10 +93,10 @@ type GetPayloadResponse struct { } type ClientVersionV1 struct { - Code string `json:"code" gencodec:"required"` - Name string `json:"name" gencodec:"required"` - Version string `json:"version" gencodec:"required"` - Commit [4]byte `json:"commit" gencodec:"required"` + Code string `json:"code" gencodec:"required"` + Name string `json:"name" gencodec:"required"` + Version string `json:"version" gencodec:"required"` + Commit string `json:"commit" gencodec:"required"` } func (c ClientVersionV1) String() string {