Disable native encryption in acceptance tests (#835)

Add a configuration option that disables the secp256k1 and altbn128 native libraries during acceptance tests.
This option is disabled by default.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
pull/872/head
Danno Ferrin 5 years ago committed by GitHub
parent 4708071580
commit e8dd0cb55b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java
  2. 3
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ProcessBesuNodeRunner.java
  3. 14
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeConfiguration.java
  4. 14
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeConfigurationBuilder.java
  5. 2
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeFactory.java
  6. 2
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/PrivacyNode.java

@ -99,6 +99,8 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
private final boolean discoveryEnabled; private final boolean discoveryEnabled;
private final List<URI> bootnodes = new ArrayList<>(); private final List<URI> bootnodes = new ArrayList<>();
private final boolean bootnodeEligible; private final boolean bootnodeEligible;
private final boolean secp256k1Native;
private final boolean altbn128Native;
private Optional<String> genesisConfig = Optional.empty(); private Optional<String> genesisConfig = Optional.empty();
private NodeRequests nodeRequests; private NodeRequests nodeRequests;
private LoginRequestFactory loginRequestFactory; private LoginRequestFactory loginRequestFactory;
@ -125,14 +127,14 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
final boolean discoveryEnabled, final boolean discoveryEnabled,
final boolean bootnodeEligible, final boolean bootnodeEligible,
final boolean revertReasonEnabled, final boolean revertReasonEnabled,
final boolean secp256k1Native,
final boolean altbn128Native,
final List<String> plugins, final List<String> plugins,
final List<String> extraCLIOptions, final List<String> extraCLIOptions,
final List<String> staticNodes, final List<String> staticNodes,
final Optional<PrivacyParameters> privacyParameters, final Optional<PrivacyParameters> privacyParameters,
final Optional<String> runCommand) final Optional<String> runCommand)
throws IOException { throws IOException {
this.bootnodeEligible = bootnodeEligible;
this.revertReasonEnabled = revertReasonEnabled;
this.homeDirectory = dataPath.orElseGet(BesuNode::createTmpDataDirectory); this.homeDirectory = dataPath.orElseGet(BesuNode::createTmpDataDirectory);
keyfilePath.ifPresent( keyfilePath.ifPresent(
path -> { path -> {
@ -154,6 +156,10 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
this.p2pEnabled = p2pEnabled; this.p2pEnabled = p2pEnabled;
this.networkingConfiguration = networkingConfiguration; this.networkingConfiguration = networkingConfiguration;
this.discoveryEnabled = discoveryEnabled; this.discoveryEnabled = discoveryEnabled;
this.bootnodeEligible = bootnodeEligible;
this.revertReasonEnabled = revertReasonEnabled;
this.secp256k1Native = secp256k1Native;
this.altbn128Native = altbn128Native;
this.runCommand = runCommand; this.runCommand = runCommand;
plugins.forEach( plugins.forEach(
pluginName -> { pluginName -> {
@ -562,6 +568,14 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
return devMode; return devMode;
} }
public boolean isSecp256k1Native() {
return secp256k1Native;
}
public boolean isAltbn128Native() {
return altbn128Native;
}
@Override @Override
public boolean isDiscoveryEnabled() { public boolean isDiscoveryEnabled() {
return discoveryEnabled; return discoveryEnabled;

@ -228,6 +228,9 @@ public class ProcessBesuNodeRunner implements BesuNodeRunner {
params.add("--revert-reason-enabled"); params.add("--revert-reason-enabled");
} }
params.add("--Xsecp256k1-native-enabled=" + node.isSecp256k1Native());
params.add("--Xaltbn128-native-enabled=" + node.isAltbn128Native());
node.getPermissioningConfiguration() node.getPermissioningConfiguration()
.flatMap(PermissioningConfiguration::getLocalConfig) .flatMap(PermissioningConfiguration::getLocalConfig)
.ifPresent( .ifPresent(

@ -44,6 +44,8 @@ public class BesuNodeConfiguration {
private final boolean discoveryEnabled; private final boolean discoveryEnabled;
private final boolean bootnodeEligible; private final boolean bootnodeEligible;
private final boolean revertReasonEnabled; private final boolean revertReasonEnabled;
private final boolean secp256k1Native;
private final boolean altbn128Native;
private final List<String> plugins; private final List<String> plugins;
private final List<String> extraCLIOptions; private final List<String> extraCLIOptions;
private final List<String> staticNodes; private final List<String> staticNodes;
@ -66,6 +68,8 @@ public class BesuNodeConfiguration {
final boolean discoveryEnabled, final boolean discoveryEnabled,
final boolean bootnodeEligible, final boolean bootnodeEligible,
final boolean revertReasonEnabled, final boolean revertReasonEnabled,
final boolean secp256k1Native,
final boolean altbn128Native,
final List<String> plugins, final List<String> plugins,
final List<String> extraCLIOptions, final List<String> extraCLIOptions,
final List<String> staticNodes, final List<String> staticNodes,
@ -86,6 +90,8 @@ public class BesuNodeConfiguration {
this.discoveryEnabled = discoveryEnabled; this.discoveryEnabled = discoveryEnabled;
this.bootnodeEligible = bootnodeEligible; this.bootnodeEligible = bootnodeEligible;
this.revertReasonEnabled = revertReasonEnabled; this.revertReasonEnabled = revertReasonEnabled;
this.secp256k1Native = secp256k1Native;
this.altbn128Native = altbn128Native;
this.plugins = plugins; this.plugins = plugins;
this.extraCLIOptions = extraCLIOptions; this.extraCLIOptions = extraCLIOptions;
this.staticNodes = staticNodes; this.staticNodes = staticNodes;
@ -161,6 +167,14 @@ public class BesuNodeConfiguration {
return revertReasonEnabled; return revertReasonEnabled;
} }
public boolean isSecp256k1Native() {
return secp256k1Native;
}
public boolean isAltbn128Native() {
return altbn128Native;
}
public List<String> getStaticNodes() { public List<String> getStaticNodes() {
return staticNodes; return staticNodes;
} }

@ -55,6 +55,8 @@ public class BesuNodeConfigurationBuilder {
private boolean discoveryEnabled = true; private boolean discoveryEnabled = true;
private boolean bootnodeEligible = true; private boolean bootnodeEligible = true;
private boolean revertReasonEnabled = false; private boolean revertReasonEnabled = false;
private boolean secp256K1Native = false;
private boolean altbn128Native = false;
private final List<String> plugins = new ArrayList<>(); private final List<String> plugins = new ArrayList<>();
private final List<String> extraCLIOptions = new ArrayList<>(); private final List<String> extraCLIOptions = new ArrayList<>();
private List<String> staticNodes = new ArrayList<>(); private List<String> staticNodes = new ArrayList<>();
@ -251,6 +253,16 @@ public class BesuNodeConfigurationBuilder {
return this; return this;
} }
public BesuNodeConfigurationBuilder secp256k1Native() {
this.secp256K1Native = true;
return this;
}
public BesuNodeConfigurationBuilder altbn128() {
this.altbn128Native = true;
return this;
}
public BesuNodeConfigurationBuilder staticNodes(final List<String> staticNodes) { public BesuNodeConfigurationBuilder staticNodes(final List<String> staticNodes) {
this.staticNodes = staticNodes; this.staticNodes = staticNodes;
return this; return this;
@ -283,6 +295,8 @@ public class BesuNodeConfigurationBuilder {
discoveryEnabled, discoveryEnabled,
bootnodeEligible, bootnodeEligible,
revertReasonEnabled, revertReasonEnabled,
secp256K1Native,
altbn128Native,
plugins, plugins,
extraCLIOptions, extraCLIOptions,
staticNodes, staticNodes,

@ -63,6 +63,8 @@ public class BesuNodeFactory {
config.isDiscoveryEnabled(), config.isDiscoveryEnabled(),
config.isBootnodeEligible(), config.isBootnodeEligible(),
config.isRevertReasonEnabled(), config.isRevertReasonEnabled(),
config.isSecp256k1Native(),
config.isAltbn128Native(),
config.getPlugins(), config.getPlugins(),
config.getExtraCLIOptions(), config.getExtraCLIOptions(),
config.getStaticNodes(), config.getStaticNodes(),

@ -101,6 +101,8 @@ public class PrivacyNode implements AutoCloseable {
besuConfig.isDiscoveryEnabled(), besuConfig.isDiscoveryEnabled(),
besuConfig.isBootnodeEligible(), besuConfig.isBootnodeEligible(),
besuConfig.isRevertReasonEnabled(), besuConfig.isRevertReasonEnabled(),
besuConfig.isSecp256k1Native(),
besuConfig.isAltbn128Native(),
besuConfig.getPlugins(), besuConfig.getPlugins(),
besuConfig.getExtraCLIOptions(), besuConfig.getExtraCLIOptions(),
Collections.emptyList(), Collections.emptyList(),

Loading…
Cancel
Save