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

[MEV-Boost\Builder] Unhide hidden params for mev-boost\builder #5860

Merged
merged 12 commits into from
Jul 20, 2022
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ For information on changes in released versions of Teku, see the [releases page]
- Ensured dependencies are up to date
- Validator Registration signature integration with external signer
- Teku-specific Beacon Node API on `/teku/v1/beacon/deposit_snapshot` providing finalized Deposit Tree Snapshot according to the draft EIP-4881
- Added support for Builder API

### Bug Fixes
- Fix not rendering emoticons correctly in graffiti when running in a Docker container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ public class ExecutionLayerOptions {
private String engineJwtSecretFile = null;

@Option(
names = {"--Xeb-endpoint"},
names = {"--builder-endpoint"},
paramLabel = "<NETWORK>",
description = "URL for Execution Builder node.",
arity = "1",
hidden = true)
description = "URL for an external Builder node (optional).",
arity = "1")
private String executionBuilderEndpoint = null;

public void configure(final Builder builder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,55 +50,53 @@ public class ValidatorProposerOptions {
ValidatorConfig.DEFAULT_VALIDATOR_PROPOSER_CONFIG_REFRESH_ENABLED;

@Option(
names = {"--Xvalidators-registration-default-enabled"},
names = {"--validators-builder-registration-default-enabled"},
paramLabel = "<BOOLEAN>",
showDefaultValue = Visibility.ALWAYS,
description = "Enable validators registration to builder infrastructure.",
arity = "0..1",
fallbackValue = "true",
hidden = true)
private boolean validatorsRegistrationDefaultEnabled =
ValidatorConfig.DEFAULT_VALIDATOR_REGISTRATION_DEFAULT_ENABLED;
fallbackValue = "true")
private boolean builderRegistrationDefaultEnabled =
ValidatorConfig.DEFAULT_BUILDER_REGISTRATION_DEFAULT_ENABLED;

@Option(
names = {"--Xvalidators-registration-default-gas-limit"},
names = {"--Xvalidators-builder-registration-default-gas-limit"},
paramLabel = "<uint64>",
showDefaultValue = Visibility.ALWAYS,
description = "Change the default gas limit used for the validators registration.",
arity = "1",
hidden = true,
converter = UInt64Converter.class)
private UInt64 registrationDefaultGasLimit =
ValidatorConfig.DEFAULT_VALIDATOR_REGISTRATION_GAS_LIMIT;
private UInt64 builderRegistrationDefaultGasLimit =
ValidatorConfig.DEFAULT_BUILDER_REGISTRATION_GAS_LIMIT;

@Option(
names = {"--Xvalidators-registration-sending-batch-size"},
names = {"--Xvalidators-builder-registration-sending-batch-size"},
paramLabel = "<INTEGER>",
showDefaultValue = Visibility.ALWAYS,
description =
"Change the default batch size for sending validator registrations to the Beacon Node.",
arity = "1",
hidden = true)
private int registrationSendingBatchSize =
private int builderRegistrationSendingBatchSize =
ValidatorConfig.DEFAULT_VALIDATOR_REGISTRATION_SENDING_BATCH_SIZE;

@Option(
names = {"--Xvalidators-registration-timestamp-override"},
names = {"--validators-builder-registration-timestamp-override"},
paramLabel = "<uint64>",
showDefaultValue = Visibility.ALWAYS,
description =
"Set a constant timestamp in Unix format to be used in validator registrations against builder infrastructure.",
arity = "1",
hidden = true)
private UInt64 validatorsRegistrationTimestampOverride = null;
private UInt64 builderRegistrationTimestampOverride = null;

@Option(
names = {"--Xvalidators-proposer-blinded-blocks-enabled"},
names = {"--validators-proposer-blinded-blocks-enabled"},
paramLabel = "<BOOLEAN>",
showDefaultValue = Visibility.ALWAYS,
description = "Use blinded blocks when in block production duties",
fallbackValue = "true",
hidden = true,
arity = "0..1")
private boolean blindedBlocksEnabled = DEFAULT_VALIDATOR_BLINDED_BLOCKS_ENABLED;

Expand All @@ -109,10 +107,10 @@ public void configure(TekuConfiguration.Builder builder) {
.proposerDefaultFeeRecipient(proposerDefaultFeeRecipient)
.proposerConfigSource(proposerConfig)
.refreshProposerConfigFromSource(proposerConfigRefreshEnabled)
.validatorsRegistrationDefaultEnabled(validatorsRegistrationDefaultEnabled)
.builderRegistrationDefaultEnabled(builderRegistrationDefaultEnabled)
.blindedBeaconBlocksEnabled(blindedBlocksEnabled)
.validatorsRegistrationDefaultGasLimit(registrationDefaultGasLimit)
.validatorsRegistrationSendingBatchSize(registrationSendingBatchSize)
.validatorsRegistrationTimestampOverride(validatorsRegistrationTimestampOverride));
.builderRegistrationDefaultGasLimit(builderRegistrationDefaultGasLimit)
.builderRegistrationSendingBatchSize(builderRegistrationSendingBatchSize)
.builderRegistrationTimestampOverride(builderRegistrationTimestampOverride));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void shouldAcceptEngineAndBuilderEndpointIfSpecEnablesBellatrix() {
"1",
"--ee-endpoint",
"http://example.com:1234/path/",
"--Xeb-endpoint",
"--builder-endpoint",
"http://example2.com:1234/path2/"
};
final TekuConfiguration config = getTekuConfigurationFromArguments(args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
package tech.pegasys.teku.cli.options;

import static org.assertj.core.api.Assertions.assertThat;
import static tech.pegasys.teku.validator.api.ValidatorConfig.DEFAULT_VALIDATOR_REGISTRATION_GAS_LIMIT;
import static tech.pegasys.teku.validator.api.ValidatorConfig.DEFAULT_BUILDER_REGISTRATION_GAS_LIMIT;

import java.net.MalformedURLException;
import java.net.URL;
Expand Down Expand Up @@ -121,7 +121,7 @@ public void shouldReportAddressIfFeeRecipientSpecified() {

@Test
public void shouldEnableBlindedBeaconBlocks() {
final String[] args = {"--Xvalidators-proposer-blinded-blocks-enabled", "true"};
final String[] args = {"--validators-proposer-blinded-blocks-enabled", "true"};
final TekuConfiguration config = getTekuConfigurationFromArguments(args);
assertThat(config.validatorClient().getValidatorConfig().isBlindedBeaconBlocksEnabled())
.isTrue();
Expand All @@ -137,56 +137,45 @@ public void shouldNotUseBlindedBeaconBlocksByDefault() {

@Test
public void shouldEnableValidatorRegistrationtWithBlindedBlocks() {
final String[] args = {"--Xvalidators-registration-default-enabled", "true"};
final String[] args = {"--validators-builder-registration-default-enabled", "true"};
final TekuConfiguration config = getTekuConfigurationFromArguments(args);
assertThat(
config.validatorClient().getValidatorConfig().isValidatorsRegistrationDefaultEnabled())
assertThat(config.validatorClient().getValidatorConfig().isBuilderRegistrationDefaultEnabled())
.isTrue();
assertThat(config.validatorClient().getValidatorConfig().isBlindedBeaconBlocksEnabled())
.isTrue();
}

@Test
public void shouldEnableValidatorRegistrationTimestampOverride() {
final String[] args = {"--Xvalidators-registration-timestamp-override", "120000"};
final String[] args = {"--validators-builder-registration-timestamp-override", "120000"};
final TekuConfiguration config = getTekuConfigurationFromArguments(args);
assertThat(
config
.validatorClient()
.getValidatorConfig()
.getValidatorsRegistrationTimestampOverride())
config.validatorClient().getValidatorConfig().getBuilderRegistrationTimestampOverride())
.isEqualTo(Optional.of(UInt64.valueOf(120000)));
}

@Test
public void shouldNotUseValidatorsRegistrationByDefault() {
final String[] args = {};
final TekuConfiguration config = getTekuConfigurationFromArguments(args);
assertThat(
config.validatorClient().getValidatorConfig().isValidatorsRegistrationDefaultEnabled())
assertThat(config.validatorClient().getValidatorConfig().isBuilderRegistrationDefaultEnabled())
.isFalse();
}

@Test
public void shouldReportDefaultGasLimitIfRegistrationDefaultGasLimitNotSpecified() {
final TekuConfiguration config = getTekuConfigurationFromArguments();
assertThat(
config
.validatorClient()
.getValidatorConfig()
.getValidatorsRegistrationDefaultGasLimit())
.isEqualTo(DEFAULT_VALIDATOR_REGISTRATION_GAS_LIMIT);
config.validatorClient().getValidatorConfig().getBuilderRegistrationDefaultGasLimit())
.isEqualTo(DEFAULT_BUILDER_REGISTRATION_GAS_LIMIT);
}

@Test
public void shouldSETDefaultGasLimitIfRegistrationDefaultGasLimitIsSpecified() {
final String[] args = {"--Xvalidators-registration-default-gas-limit", "1000"};
final String[] args = {"--Xvalidators-builder-registration-default-gas-limit", "1000"};
final TekuConfiguration config = getTekuConfigurationFromArguments(args);
assertThat(
config
.validatorClient()
.getValidatorConfig()
.getValidatorsRegistrationDefaultGasLimit())
config.validatorClient().getValidatorConfig().getBuilderRegistrationDefaultGasLimit())
.isEqualTo(UInt64.valueOf(1000));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ public class ValidatorConfig {
public static final boolean DEFAULT_GENERATE_EARLY_ATTESTATIONS = true;
public static final Optional<Bytes32> DEFAULT_GRAFFITI = Optional.empty();
public static final boolean DEFAULT_VALIDATOR_PROPOSER_CONFIG_REFRESH_ENABLED = false;
public static final boolean DEFAULT_VALIDATOR_REGISTRATION_DEFAULT_ENABLED = false;
public static final boolean DEFAULT_BUILDER_REGISTRATION_DEFAULT_ENABLED = false;
public static final boolean DEFAULT_VALIDATOR_BLINDED_BLOCKS_ENABLED = false;
public static final int DEFAULT_VALIDATOR_REGISTRATION_SENDING_BATCH_SIZE = 100;
public static final UInt64 DEFAULT_VALIDATOR_REGISTRATION_GAS_LIMIT = UInt64.valueOf(30_000_000);
public static final UInt64 DEFAULT_BUILDER_REGISTRATION_GAS_LIMIT = UInt64.valueOf(30_000_000);

private final List<String> validatorKeys;
private final List<String> validatorExternalSignerPublicKeySources;
Expand All @@ -71,11 +71,11 @@ public class ValidatorConfig {
private final Optional<String> proposerConfigSource;
private final boolean refreshProposerConfigFromSource;
private final boolean blindedBeaconBlocksEnabled;
private final boolean validatorsRegistrationDefaultEnabled;
private final boolean builderRegistrationDefaultEnabled;
private final boolean validatorClientUseSszBlocksEnabled;
private final UInt64 validatorsRegistrationDefaultGasLimit;
private final int validatorsRegistrationSendingBatchSize;
private final Optional<UInt64> validatorsRegistrationTimestampOverride;
private final UInt64 builderRegistrationDefaultGasLimit;
private final int builderRegistrationSendingBatchSize;
private final Optional<UInt64> builderRegistrationTimestampOverride;

private final int executorMaxQueueSize;

Expand All @@ -99,12 +99,12 @@ private ValidatorConfig(
final Optional<Eth1Address> proposerDefaultFeeRecipient,
final Optional<String> proposerConfigSource,
final boolean refreshProposerConfigFromSource,
final boolean validatorsRegistrationDefaultEnabled,
final boolean builderRegistrationDefaultEnabled,
final boolean blindedBeaconBlocksEnabled,
final boolean validatorClientUseSszBlocksEnabled,
final UInt64 validatorsRegistrationDefaultGasLimit,
final int validatorsRegistrationSendingBatchSize,
final Optional<UInt64> validatorsRegistrationTimestampOverride,
final UInt64 builderRegistrationDefaultGasLimit,
final int builderRegistrationSendingBatchSize,
final Optional<UInt64> builderRegistrationTimestampOverride,
final int executorMaxQueueSize) {
this.validatorKeys = validatorKeys;
this.validatorExternalSignerPublicKeySources = validatorExternalSignerPublicKeySources;
Expand All @@ -129,11 +129,11 @@ private ValidatorConfig(
this.proposerConfigSource = proposerConfigSource;
this.refreshProposerConfigFromSource = refreshProposerConfigFromSource;
this.blindedBeaconBlocksEnabled = blindedBeaconBlocksEnabled;
this.validatorsRegistrationDefaultEnabled = validatorsRegistrationDefaultEnabled;
this.builderRegistrationDefaultEnabled = builderRegistrationDefaultEnabled;
this.validatorClientUseSszBlocksEnabled = validatorClientUseSszBlocksEnabled;
this.validatorsRegistrationDefaultGasLimit = validatorsRegistrationDefaultGasLimit;
this.validatorsRegistrationSendingBatchSize = validatorsRegistrationSendingBatchSize;
this.validatorsRegistrationTimestampOverride = validatorsRegistrationTimestampOverride;
this.builderRegistrationDefaultGasLimit = builderRegistrationDefaultGasLimit;
this.builderRegistrationSendingBatchSize = builderRegistrationSendingBatchSize;
this.builderRegistrationTimestampOverride = builderRegistrationTimestampOverride;
this.executorMaxQueueSize = executorMaxQueueSize;
}

Expand Down Expand Up @@ -208,16 +208,16 @@ public Optional<String> getProposerConfigSource() {
return proposerConfigSource;
}

public UInt64 getValidatorsRegistrationDefaultGasLimit() {
return validatorsRegistrationDefaultGasLimit;
public UInt64 getBuilderRegistrationDefaultGasLimit() {
return builderRegistrationDefaultGasLimit;
}

public int getValidatorsRegistrationSendingBatchSize() {
return validatorsRegistrationSendingBatchSize;
public int getBuilderRegistrationSendingBatchSize() {
return builderRegistrationSendingBatchSize;
}

public Optional<UInt64> getValidatorsRegistrationTimestampOverride() {
return validatorsRegistrationTimestampOverride;
public Optional<UInt64> getBuilderRegistrationTimestampOverride() {
return builderRegistrationTimestampOverride;
}

public boolean getRefreshProposerConfigFromSource() {
Expand All @@ -232,8 +232,8 @@ public boolean isValidatorClientUseSszBlocksEnabled() {
return validatorClientUseSszBlocksEnabled;
}

public boolean isValidatorsRegistrationDefaultEnabled() {
return validatorsRegistrationDefaultEnabled;
public boolean isBuilderRegistrationDefaultEnabled() {
return builderRegistrationDefaultEnabled;
}

public int getExecutorMaxQueueSize() {
Expand Down Expand Up @@ -275,13 +275,13 @@ public static final class Builder {
private boolean refreshProposerConfigFromSource =
DEFAULT_VALIDATOR_PROPOSER_CONFIG_REFRESH_ENABLED;
private boolean validatorsRegistrationDefaultEnabled =
DEFAULT_VALIDATOR_REGISTRATION_DEFAULT_ENABLED;
DEFAULT_BUILDER_REGISTRATION_DEFAULT_ENABLED;
private boolean blindedBlocksEnabled = DEFAULT_VALIDATOR_BLINDED_BLOCKS_ENABLED;
private boolean validatorClientSszBlocksEnabled = DEFAULT_VALIDATOR_CLIENT_SSZ_BLOCKS_ENABLED;
private UInt64 validatorsRegistrationDefaultGasLimit = DEFAULT_VALIDATOR_REGISTRATION_GAS_LIMIT;
private int validatorsRegistrationSendingBatchSize =
private UInt64 builderRegistrationDefaultGasLimit = DEFAULT_BUILDER_REGISTRATION_GAS_LIMIT;
private int builderRegistrationSendingBatchSize =
DEFAULT_VALIDATOR_REGISTRATION_SENDING_BATCH_SIZE;
private Optional<UInt64> validatorsRegistrationTimestampOverride = Optional.empty();
private Optional<UInt64> builderRegistrationTimestampOverride = Optional.empty();
private int executorMaxQueueSize = DEFAULT_EXECUTOR_MAX_QUEUE_SIZE;

private Builder() {}
Expand Down Expand Up @@ -408,7 +408,7 @@ public Builder refreshProposerConfigFromSource(final boolean refreshProposerConf
return this;
}

public Builder validatorsRegistrationDefaultEnabled(
public Builder builderRegistrationDefaultEnabled(
final boolean validatorsRegistrationDefaultEnabled) {
this.validatorsRegistrationDefaultEnabled = validatorsRegistrationDefaultEnabled;
return this;
Expand All @@ -425,22 +425,22 @@ public Builder validatorClientUseSszBlocksEnabled(
return this;
}

public Builder validatorsRegistrationDefaultGasLimit(
final UInt64 validatorsRegistrationDefaultGasLimit) {
this.validatorsRegistrationDefaultGasLimit = validatorsRegistrationDefaultGasLimit;
public Builder builderRegistrationDefaultGasLimit(
final UInt64 builderRegistrationDefaultGasLimit) {
this.builderRegistrationDefaultGasLimit = builderRegistrationDefaultGasLimit;
return this;
}

public Builder validatorsRegistrationSendingBatchSize(
final int validatorsRegistrationSendingBatchSize) {
this.validatorsRegistrationSendingBatchSize = validatorsRegistrationSendingBatchSize;
public Builder builderRegistrationSendingBatchSize(
final int builderRegistrationSendingBatchSize) {
this.builderRegistrationSendingBatchSize = builderRegistrationSendingBatchSize;
return this;
}

public Builder validatorsRegistrationTimestampOverride(
final UInt64 validatorsRegistrationTimestampOverride) {
this.validatorsRegistrationTimestampOverride =
Optional.ofNullable(validatorsRegistrationTimestampOverride);
public Builder builderRegistrationTimestampOverride(
final UInt64 builderRegistrationTimestampOverride) {
this.builderRegistrationTimestampOverride =
Optional.ofNullable(builderRegistrationTimestampOverride);
return this;
}

Expand Down Expand Up @@ -479,9 +479,9 @@ public ValidatorConfig build() {
validatorsRegistrationDefaultEnabled,
blindedBlocksEnabled,
validatorClientSszBlocksEnabled,
validatorsRegistrationDefaultGasLimit,
validatorsRegistrationSendingBatchSize,
validatorsRegistrationTimestampOverride,
builderRegistrationDefaultGasLimit,
builderRegistrationSendingBatchSize,
builderRegistrationTimestampOverride,
executorMaxQueueSize);
}

Expand Down Expand Up @@ -534,15 +534,15 @@ private void validateExternalSignerURLScheme() {
private void validateValidatorsRegistrationAndBlindedBlocks() {
if (validatorsRegistrationDefaultEnabled && !blindedBlocksEnabled) {
LOG.info(
"'--Xvalidators-registration-default-enabled' requires '--Xvalidators-proposer-blinded-blocks-enabled', enabling it");
"'--validators-builder-registration-default-enabled' requires '--validators-proposer-blinded-blocks-enabled', enabling it");
blindedBlocksEnabled = true;
}
}

private void validatorsRegistrationDefaultEnabledOrProposerConfigSource() {
if (validatorsRegistrationDefaultEnabled && proposerConfigSource.isPresent()) {
throw new InvalidConfigurationException(
"Invalid configuration. --Xvalidators-registration-default-enabled cannot be specified when --validators-proposer-config is used");
"Invalid configuration. --validators-builder-registration-default-enabled cannot be specified when --validators-proposer-config is used");
}
}

Expand Down
Loading