Make EvmTool CLI to the main distribution (#1465)

This adds EvmTool to the standard distributions.

In addition, add a property flag that disables the secpk256k1
auto-randomization for just the EvmTool to speed up invocation.
(fixes #1464)

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
pull/1482/head
Danno Ferrin 4 years ago committed by GitHub
parent 112e7535cc
commit 15d1789689
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      CHANGELOG.md
  2. 67
      build.gradle
  3. 3
      ethereum/evmtool/build.gradle

@ -1,10 +1,13 @@
# Changelog
## 20.10.1
### Additions and Improvements
* `--random-peer-priority-enabled` flag added. Allows for incoming connections to be prioritized randomly. This will prevent (typically small, stable) networks from forming impenetrable peer cliques. [#1440](https://github.com/hyperledger/besu/pull/1440)
* Hide deprecated `--host-whitelist` option. [\#1444](https://github.com/hyperledger/besu/pull/1444)
* Prioritize high gas prices during mining. Previously we ordered only by the order in which the transactions were received. This will increase expected profit when mining. [\#1449](https://github.com/hyperledger/besu/pull/1449)
* Added support for the updated smart contract-based [node permissioning EEA interface](https://entethalliance.github.io/client-spec/spec.html#dfn-connectionallowed). [\#1435](https://github.com/hyperledger/besu/pull/1435)
* Added EvmTool binary to the distribution. EvmTool is a CLI that can execute EVM bytecode and execute ethereum state tests. [\#1465](https://github.com/hyperledger/besu/pull/1465)
## Deprecated and Scheduled for removal in _Next_ Release

@ -17,7 +17,6 @@
import groovy.transform.Memoized
import net.ltgt.gradle.errorprone.CheckSeverity
import java.nio.file.Paths
import java.text.SimpleDateFormat
plugins {
@ -494,38 +493,59 @@ run {
}
}
startScripts {
def tweakStartScript(createScriptTask) {
def shortenWindowsClasspath = { line ->
line = line.replaceAll(/^set CLASSPATH=.*$/, "set CLASSPATH=%APP_HOME%/lib/*")
line.replaceAll(/^set CLASSPATH=.*$/, "set CLASSPATH=%APP_HOME%/lib/*")
}
doLast {
unixScript.text = unixScript.text.replace('BESU_HOME', '\$APP_HOME')
windowsScript.text = windowsScript.text.replace('BESU_HOME', '%~dp0..')
// OpenTelemetry Wiring for unix scripts
def agentFileName = configurations.javaAgent.singleFile.toPath().getFileName()
def unixRegex = $/exec "$$JAVACMD" /$
def forwardSlash = "/"
def unixReplacement = $/if [ -n "$$TRACING" ];then
createScriptTask.unixScript.text = createScriptTask.unixScript.text.replace('BESU_HOME', '\$APP_HOME')
createScriptTask.windowsScript.text = createScriptTask.windowsScript.text.replace('BESU_HOME', '%~dp0..')
// OpenTelemetry Wiring for unix scripts
def agentFileName = configurations.javaAgent.singleFile.toPath().getFileName()
def unixRegex = $/exec "$$JAVACMD" /$
def forwardSlash = "/"
def unixReplacement = $/if [ -n "$$TRACING" ];then
TRACING_AGENT="-javaagent:$$APP_HOME/agent${forwardSlash}${agentFileName}"
fi
exec "$$JAVACMD" $$TRACING_AGENT /$
unixScript.text = unixScript.text.replace(unixRegex, unixReplacement)
// OpenTelemetry Wiring for windows scripts
def windowsRegex = $/"%JAVA_EXE%" %DEFAULT_JVM_OPTS%/$
def windowsReplacement = $/if Defined TRACING (TRACING_AGENT="-javaagent:"%APP_HOME%\agent\/$ + agentFileName + '")\r\n"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %TRACING_AGENT%'
windowsScript.text = windowsScript.text.replace(windowsRegex, windowsReplacement)
createScriptTask.unixScript.text = createScriptTask.unixScript.text.replace(unixRegex, unixReplacement)
// OpenTelemetry Wiring for windows scripts
def windowsRegex = $/"%JAVA_EXE%" %DEFAULT_JVM_OPTS%/$
def windowsReplacement = $/if Defined TRACING (TRACING_AGENT="-javaagent:"%APP_HOME%\agent\/$ + agentFileName + '")\r\n"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %TRACING_AGENT%'
createScriptTask.windowsScript.text = createScriptTask.windowsScript.text.replace(windowsRegex, windowsReplacement)
// Prevent the error originating from the 8191 chars limit on Windows
createScriptTask.windowsScript.text =
createScriptTask.windowsScript
.readLines()
.collect(shortenWindowsClasspath)
.join('\r\n')
}
// Prevent the error originating from the 8191 chars limit on Windows
windowsScript.text =
windowsScript
.readLines()
.collect(shortenWindowsClasspath)
.join('\r\n')
startScripts {
doLast {
tweakStartScript(startScripts)
}
}
task evmToolStartScripts(type: CreateStartScripts) {
mainClassName = 'org.hyperledger.besu.evmtool.EvmTool'
classpath = startScripts.classpath
outputDir = startScripts.outputDir
applicationName = 'evm'
defaultJvmOpts = [
"-Dsecp256k1.randomize=false"
]
doLast {
tweakStartScript(evmToolStartScripts)
}
}
// Include the additional start scripts in the distribution
applicationDistribution.into("bin") {
from(tasks.withType(CreateStartScripts))
fileMode = 0755
}
installDist { dependsOn checkLicenses }
@ -777,6 +797,7 @@ configurations {
dependencies {
implementation project(':besu')
implementation project(':ethereum:evmtool')
javaAgent group: 'io.opentelemetry.instrumentation.auto', name: 'opentelemetry-javaagent', classifier: 'all'
errorprone 'com.google.errorprone:error_prone_core'
}

@ -60,6 +60,9 @@ mainClassName = 'org.hyperledger.besu.evmtool.EvmTool'
startScripts {
applicationName = 'evm'
defaultJvmOpts = [
"-Dsecp256k1.randomize=false"
]
doLast {
unixScript.text = unixScript.text.replace('BESU_HOME', '\$APP_HOME')
windowsScript.text = windowsScript.text.replace('BESU_HOME', '%~dp0..')

Loading…
Cancel
Save