Skip to content
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

Onchain permissioning deprecation warnings on CLI #7902

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,32 +56,40 @@ public class PermissionsOptions {
"Account permissioning config TOML file (default: a file named \"permissions_config.toml\" in the Besu data folder)")
private String accountPermissionsConfigFile = null;

private static final String DEPRECATION_PREFIX =
"Deprecated. Onchain permissioning is deprecated. See CHANGELOG for alternative options. ";

@CommandLine.Option(
names = {"--permissions-nodes-contract-address"},
description = "Address of the node permissioning smart contract",
description = DEPRECATION_PREFIX + "Address of the node permissioning smart contract",
arity = "1")
private final Address permissionsNodesContractAddress = null;

@CommandLine.Option(
names = {"--permissions-nodes-contract-version"},
description = "Version of the EEA Node Permissioning interface (default: ${DEFAULT-VALUE})")
description =
DEPRECATION_PREFIX
+ "Version of the EEA Node Permissioning interface (default: ${DEFAULT-VALUE})")
private final Integer permissionsNodesContractVersion = 1;

@CommandLine.Option(
names = {"--permissions-nodes-contract-enabled"},
description = "Enable node level permissions via smart contract (default: ${DEFAULT-VALUE})")
description =
DEPRECATION_PREFIX
+ "Enable node level permissions via smart contract (default: ${DEFAULT-VALUE})")
private final Boolean permissionsNodesContractEnabled = false;

@CommandLine.Option(
names = {"--permissions-accounts-contract-address"},
description = "Address of the account permissioning smart contract",
description = DEPRECATION_PREFIX + "Address of the account permissioning smart contract",
arity = "1")
private final Address permissionsAccountsContractAddress = null;

@CommandLine.Option(
names = {"--permissions-accounts-contract-enabled"},
description =
"Enable account level permissions via smart contract (default: ${DEFAULT-VALUE})")
DEPRECATION_PREFIX
+ "Enable account level permissions via smart contract (default: ${DEFAULT-VALUE})")
private final Boolean permissionsAccountsContractEnabled = false;

/** Default constructor. */
Expand Down Expand Up @@ -151,6 +159,7 @@ public Optional<PermissioningConfiguration> permissioningConfiguration(
SmartContractPermissioningConfiguration.createDefault();

if (Boolean.TRUE.equals(permissionsNodesContractEnabled)) {
logger.warn("Onchain (contract) node permissioning options are " + DEPRECATION_PREFIX);
if (permissionsNodesContractAddress == null) {
throw new CommandLine.ParameterException(
commandLine,
Expand All @@ -170,6 +179,7 @@ public Optional<PermissioningConfiguration> permissioningConfiguration(
}

if (Boolean.TRUE.equals(permissionsAccountsContractEnabled)) {
logger.warn("Onchain (contract) account permissioning options are " + DEPRECATION_PREFIX);
if (permissionsAccountsContractAddress == null) {
throw new CommandLine.ParameterException(
commandLine,
Expand Down
Loading