Remove deprecated `--privacy-onchain-groups-enabled` option (#6411)

Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
pull/6412/head
Gabriel-Trintinalia 10 months ago committed by GitHub
parent 2c1d3d2841
commit c316a6dfb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 21
      besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
  3. 11
      besu/src/main/java/org/hyperledger/besu/cli/util/ConfigOptionSearchAndRunHandler.java
  4. 51
      besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java
  5. 1
      besu/src/test/resources/everything_config.toml

@ -5,6 +5,7 @@
### Breaking Changes
- New `EXECUTION_HALTED` error returned if there is an error executing or simulating a transaction, with the reason for execution being halted. Replaces the generic `INTERNAL_ERROR` return code in certain cases which some applications may be checking for [#6343](https://github.com/hyperledger/besu/pull/6343)
- The Besu Docker images with `openjdk-latest` tags since 23.10.3 were incorrectly using UID 1001 instead of 1000 for the container's `besu` user. The user now uses 1000 again. Containers created from or migrated to images using UID 1001 will need to chown their persistent database files to UID 1000 [#6360](https://github.com/hyperledger/besu/pull/6360)
- The deprecated `--privacy-onchain-groups-enabled` option has now been removed. Use the `--privacy-flexible-groups-enabled` option instead. [#6411](https://github.com/hyperledger/besu/pull/6411)
### Deprecations

@ -22,7 +22,6 @@ import static java.util.Collections.singletonList;
import static org.hyperledger.besu.cli.DefaultCommandValues.getDefaultBesuDataPath;
import static org.hyperledger.besu.cli.config.NetworkName.MAINNET;
import static org.hyperledger.besu.cli.util.CommandLineUtils.DEPENDENCY_WARNING_MSG;
import static org.hyperledger.besu.cli.util.CommandLineUtils.DEPRECATION_WARNING_MSG;
import static org.hyperledger.besu.cli.util.CommandLineUtils.isOptionSet;
import static org.hyperledger.besu.controller.BesuController.DATABASE_PATH;
import static org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration.DEFAULT_GRAPHQL_HTTP_PORT;
@ -953,13 +952,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
names = {"--privacy-flexible-groups-enabled"},
description = "Enable flexible privacy groups (default: ${DEFAULT-VALUE})")
private final Boolean isFlexiblePrivacyGroupsEnabled = false;
@Option(
hidden = true,
names = {"--privacy-onchain-groups-enabled"},
description =
"!!DEPRECATED!! Use `--privacy-flexible-groups-enabled` instead. Enable flexible (onchain) privacy groups (default: ${DEFAULT-VALUE})")
private final Boolean isOnchainPrivacyGroupsEnabled = false;
}
// Metrics Option Group
@ -1716,8 +1708,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
}
if (unstablePrivacyPluginOptions.isPrivacyPluginEnabled()
&& (privacyOptionGroup.isFlexiblePrivacyGroupsEnabled
|| privacyOptionGroup.isOnchainPrivacyGroupsEnabled)) {
&& privacyOptionGroup.isFlexiblePrivacyGroupsEnabled) {
throw new ParameterException(
commandLine, "Privacy Plugin can not be used with flexible privacy groups");
}
@ -2056,13 +2047,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
"--security-module=" + DEFAULT_SECURITY_MODULE);
}
if (Boolean.TRUE.equals(privacyOptionGroup.isOnchainPrivacyGroupsEnabled)) {
logger.warn(
DEPRECATION_WARNING_MSG,
"--privacy-onchain-groups-enabled",
"--privacy-flexible-groups-enabled");
}
if (isPruningEnabled()) {
if (dataStorageOptions
.toDomainObject()
@ -2750,8 +2734,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
privacyParametersBuilder.setMultiTenancyEnabled(
privacyOptionGroup.isPrivacyMultiTenancyEnabled);
privacyParametersBuilder.setFlexiblePrivacyGroupsEnabled(
privacyOptionGroup.isFlexiblePrivacyGroupsEnabled
|| privacyOptionGroup.isOnchainPrivacyGroupsEnabled);
privacyOptionGroup.isFlexiblePrivacyGroupsEnabled);
privacyParametersBuilder.setPrivacyPluginEnabled(
unstablePrivacyPluginOptions.isPrivacyPluginEnabled());

@ -55,7 +55,6 @@ public class ConfigOptionSearchAndRunHandler extends CommandLine.RunLast {
public List<Object> handle(final ParseResult parseResult) throws ParameterException {
final CommandLine commandLine = parseResult.commandSpec().commandLine();
final Optional<File> configFile = findConfigFile(parseResult, commandLine);
validatePrivacyOptions(parseResult, commandLine);
commandLine.setDefaultValueProvider(createDefaultValueProvider(commandLine, configFile));
commandLine.setExecutionStrategy(resultHandler);
commandLine.setParameterExceptionHandler(parameterExceptionHandler);
@ -64,16 +63,6 @@ public class ConfigOptionSearchAndRunHandler extends CommandLine.RunLast {
return new ArrayList<>();
}
private void validatePrivacyOptions(
final ParseResult parseResult, final CommandLine commandLine) {
if (parseResult.hasMatchedOption("--privacy-onchain-groups-enabled")
&& parseResult.hasMatchedOption("--privacy-flexible-groups-enabled")) {
throw new ParameterException(
commandLine,
"The `--privacy-onchain-groups-enabled` option is deprecated and you should only use `--privacy-flexible-groups-enabled`");
}
}
private Optional<File> findConfigFile(
final ParseResult parseResult, final CommandLine commandLine) {
if (parseResult.hasMatchedOption("--config-file")

@ -29,7 +29,6 @@ import static org.hyperledger.besu.cli.config.NetworkName.MAINNET;
import static org.hyperledger.besu.cli.config.NetworkName.MORDOR;
import static org.hyperledger.besu.cli.config.NetworkName.SEPOLIA;
import static org.hyperledger.besu.cli.util.CommandLineUtils.DEPENDENCY_WARNING_MSG;
import static org.hyperledger.besu.cli.util.CommandLineUtils.DEPRECATION_WARNING_MSG;
import static org.hyperledger.besu.ethereum.api.jsonrpc.RpcApis.ENGINE;
import static org.hyperledger.besu.ethereum.api.jsonrpc.RpcApis.ETH;
import static org.hyperledger.besu.ethereum.api.jsonrpc.RpcApis.NET;
@ -1977,16 +1976,6 @@ public class BesuCommandTest extends CommandTestAbstract {
"The `--ethstats-contact` requires ethstats server URL to be provided. Either remove --ethstats-contact or provide a URL (via --ethstats=nodename:secret@host:port)");
}
@Test
public void privacyOnchainGroupsEnabledCannotBeUsedWithPrivacyFlexibleGroupsEnabled() {
parseCommand("--privacy-onchain-groups-enabled", "--privacy-flexible-groups-enabled");
Mockito.verifyNoInteractions(mockRunnerBuilder);
assertThat(commandOutput.toString(UTF_8)).isEmpty();
assertThat(commandErrorOutput.toString(UTF_8))
.contains(
"The `--privacy-onchain-groups-enabled` option is deprecated and you should only use `--privacy-flexible-groups-enabled`");
}
@Test
public void parsesValidBonsaiTrieLimitBackLayersOption() {
parseCommand("--data-storage-format", "BONSAI", "--bonsai-historical-block-limit", "11");
@ -4203,46 +4192,6 @@ public class BesuCommandTest extends CommandTestAbstract {
assertThat(privacyParameters.isFlexiblePrivacyGroupsEnabled()).isEqualTo(false);
}
@Test
public void onchainPrivacyGroupEnabledFlagValueIsSet() {
parseCommand(
"--privacy-enabled",
"--privacy-public-key-file",
ENCLAVE_PUBLIC_KEY_PATH,
"--privacy-onchain-groups-enabled",
"--min-gas-price",
"0");
final ArgumentCaptor<PrivacyParameters> privacyParametersArgumentCaptor =
ArgumentCaptor.forClass(PrivacyParameters.class);
verify(mockControllerBuilder).privacyParameters(privacyParametersArgumentCaptor.capture());
verify(mockControllerBuilder).build();
assertThat(commandOutput.toString(UTF_8)).isEmpty();
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
final PrivacyParameters privacyParameters = privacyParametersArgumentCaptor.getValue();
assertThat(privacyParameters.isFlexiblePrivacyGroupsEnabled()).isEqualTo(true);
}
@Test
public void onchainPrivacyGroupEnabledOptionIsDeprecated() {
parseCommand(
"--privacy-enabled",
"--privacy-public-key-file",
ENCLAVE_PUBLIC_KEY_PATH,
"--privacy-onchain-groups-enabled",
"--min-gas-price",
"0");
verify(mockLogger)
.warn(
DEPRECATION_WARNING_MSG,
"--privacy-onchain-groups-enabled",
"--privacy-flexible-groups-enabled");
}
@Test
public void flexiblePrivacyGroupEnabledFlagValueIsSet() {
parseCommand(

@ -169,7 +169,6 @@ privacy-enabled=false
privacy-multi-tenancy-enabled=true
privacy-marker-transaction-signing-key-file="./signerKey"
privacy-enable-database-migration=false
privacy-onchain-groups-enabled=false
privacy-flexible-groups-enabled=false
# Transaction Pool

Loading…
Cancel
Save