-
Notifications
You must be signed in to change notification settings - Fork 863
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
Reintroduce engine get client version v1 with commit in manifest #7548
Merged
garyschulte
merged 13 commits into
hyperledger:main
from
Matilda-Clerke:reintroduce-engine-getClientVersionV1-with-commit-in-manifest
Aug 30, 2024
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e58ecc9
Revert "Check for commit hash before appending another in build.gradl…
Matilda-Clerke f855091
Revert engine_getClientVersionV1 changes
Matilda-Clerke ddaa36f
Merge branch 'main' into revert-engine-getclientversionv1-changes
Matilda-Clerke ad5a9a6
Include Commit-Hash in manifests
Matilda-Clerke 147e107
Use full commit hash for Commit-Hash in manifests
Matilda-Clerke 33a03a6
Add commit method in BesuInfo
Matilda-Clerke e4b799e
Merge branch 'main' into reintroduce-engine-getClientVersionV1-with-c…
Matilda-Clerke 913654d
Add commit method in BesuInfo
Matilda-Clerke 2541a66
Revert "Revert engine_getClientVersionV1 changes"
Matilda-Clerke 15e8cf7
Use 8 character hash in EngineGetClientVersionV1 and revert calculate…
Matilda-Clerke c8450fe
Apply spotless
Matilda-Clerke e2eface
fix besu info test regex
garyschulte 1f36c7f
spotless
garyschulte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Revert "Revert engine_getClientVersionV1 changes"
This reverts commit f855091 Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>
- Loading branch information
commit 2541a66ed004bc6aa89fb734159b8f4afea9ed78
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...perledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetClientVersionV1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright contributors to Hyperledger Besu. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine; | ||
|
||
import org.hyperledger.besu.ethereum.ProtocolContext; | ||
import org.hyperledger.besu.ethereum.api.jsonrpc.RpcMethod; | ||
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; | ||
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.ExecutionEngineJsonRpcMethod; | ||
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse; | ||
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse; | ||
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.EngineGetClientVersionResultV1; | ||
|
||
import io.vertx.core.Vertx; | ||
|
||
public class EngineGetClientVersionV1 extends ExecutionEngineJsonRpcMethod { | ||
private static final String ENGINE_CLIENT_CODE = "BU"; | ||
private static final String ENGINE_CLIENT_NAME = "Besu"; | ||
|
||
private final String clientVersion; | ||
private final String commit; | ||
|
||
public EngineGetClientVersionV1( | ||
final Vertx vertx, | ||
final ProtocolContext protocolContext, | ||
final EngineCallListener engineCallListener, | ||
final String clientVersion, | ||
final String commit) { | ||
super(vertx, protocolContext, engineCallListener); | ||
this.clientVersion = clientVersion; | ||
this.commit = commit; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return RpcMethod.ENGINE_GET_CLIENT_VERSION_V1.getMethodName(); | ||
} | ||
|
||
@Override | ||
public JsonRpcResponse syncResponse(final JsonRpcRequestContext request) { | ||
return new JsonRpcSuccessResponse( | ||
request.getRequest().getId(), | ||
new EngineGetClientVersionResultV1( | ||
ENGINE_CLIENT_CODE, ENGINE_CLIENT_NAME, clientVersion, commit)); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
...yperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetClientVersionResultV1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright contributors to Hyperledger Besu. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package org.hyperledger.besu.ethereum.api.jsonrpc.internal.results; | ||
|
||
import com.fasterxml.jackson.annotation.JsonGetter; | ||
|
||
public class EngineGetClientVersionResultV1 { | ||
private final String code; | ||
private final String name; | ||
private final String version; | ||
private final String commit; | ||
|
||
public EngineGetClientVersionResultV1( | ||
final String code, final String name, final String version, final String commit) { | ||
this.code = code; | ||
this.name = name; | ||
this.version = version; | ||
this.commit = commit; | ||
} | ||
|
||
@JsonGetter(value = "code") | ||
public String getCode() { | ||
return code; | ||
} | ||
|
||
@JsonGetter(value = "name") | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
@JsonGetter(value = "version") | ||
public String getVersion() { | ||
return version; | ||
} | ||
|
||
@JsonGetter(value = "commit") | ||
public String getCommit() { | ||
return commit; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
8 seems fine, but if we are going to generate commit sha metadata that is different from the build artifact name, we may as well use all 40 here