mirror of
https://github.com/vacp2p/linea-besu.git
synced 2026-01-09 15:37:54 -05:00
Merge branch 'main' into zkbesu
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
- Update Gradle to 7.6.4 [#7030](https://github.com/hyperledger/besu/pull/7030)
|
||||
- Remove deprecated Goerli testnet [#7049](https://github.com/hyperledger/besu/pull/7049)
|
||||
- Default bonsai to use full-flat db and code-storage-by-code-hash [#6984](https://github.com/hyperledger/besu/pull/6894)
|
||||
- New RPC methods miner_setExtraData and miner_getExtraData [#7078](https://github.com/hyperledger/besu/pull/7078)
|
||||
|
||||
### Bug fixes
|
||||
- Fix txpool dump/restore race condition [#6665](https://github.com/hyperledger/besu/pull/6665)
|
||||
|
||||
@@ -26,6 +26,8 @@ import picocli.CommandLine.RunLast;
|
||||
|
||||
/** Besu bootstrap class. */
|
||||
public final class Besu {
|
||||
/** Default constructor. */
|
||||
public Besu() {}
|
||||
|
||||
/**
|
||||
* The main entrypoint to Besu application
|
||||
|
||||
@@ -194,6 +194,9 @@ public class RunnerBuilder {
|
||||
private boolean legacyForkIdEnabled;
|
||||
private Optional<EnodeDnsConfiguration> enodeDnsConfiguration;
|
||||
|
||||
/** Instantiates a new Runner builder. */
|
||||
public RunnerBuilder() {}
|
||||
|
||||
/**
|
||||
* Add Vertx.
|
||||
*
|
||||
|
||||
@@ -136,7 +136,7 @@ public class JsonBlockImporter {
|
||||
// For simplicity only set these for PoW consensus algorithms.
|
||||
// Other consensus algorithms use these fields for special purposes or ignore them.
|
||||
miner.setCoinbase(blockData.getCoinbase().orElse(Address.ZERO));
|
||||
miner.setExtraData(blockData.getExtraData().orElse(Bytes.EMPTY));
|
||||
controller.getMiningParameters().setExtraData(blockData.getExtraData().orElse(Bytes.EMPTY));
|
||||
} else if (blockData.getCoinbase().isPresent() || blockData.getExtraData().isPresent()) {
|
||||
// Fail if these fields are set for non-ethash chains
|
||||
final Stream.Builder<String> fields = Stream.builder();
|
||||
|
||||
@@ -65,6 +65,9 @@ public class RlpBlockImporter implements Closeable {
|
||||
private final Stopwatch segmentTimer = Stopwatch.createUnstarted();
|
||||
private static final long SEGMENT_SIZE = 1000;
|
||||
|
||||
/** Default Constructor. */
|
||||
public RlpBlockImporter() {}
|
||||
|
||||
/**
|
||||
* Imports blocks that are stored as concatenated RLP sections in the given file into Besu's block
|
||||
* storage.
|
||||
|
||||
@@ -62,6 +62,8 @@ public class ConfigurationOverviewBuilder {
|
||||
private BesuPluginContextImpl besuPluginContext;
|
||||
|
||||
/**
|
||||
* Create a new ConfigurationOverviewBuilder.
|
||||
*
|
||||
* @param logger the logger
|
||||
*/
|
||||
public ConfigurationOverviewBuilder(final Logger logger) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.List;
|
||||
|
||||
/** The Network deprecation message. */
|
||||
public class NetworkDeprecationMessage {
|
||||
private NetworkDeprecationMessage() {}
|
||||
|
||||
/**
|
||||
* Generate deprecation message for specified testnet network.
|
||||
|
||||
@@ -30,7 +30,14 @@ import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/** The Eth network config. */
|
||||
/**
|
||||
* The Eth network config.
|
||||
*
|
||||
* @param genesisConfigFile Genesis Config File
|
||||
* @param networkId Network Id
|
||||
* @param bootNodes Boot Nodes
|
||||
* @param dnsDiscoveryUrl DNS Discovery URL
|
||||
*/
|
||||
public record EthNetworkConfig(
|
||||
GenesisConfigFile genesisConfigFile,
|
||||
BigInteger networkId,
|
||||
|
||||
@@ -24,6 +24,9 @@ import picocli.CommandLine;
|
||||
public class DurationMillisConverter
|
||||
implements CommandLine.ITypeConverter<Duration>, TypeFormatter<Duration> {
|
||||
|
||||
/** Default constructor. */
|
||||
public DurationMillisConverter() {}
|
||||
|
||||
@Override
|
||||
public Duration convert(final String value) throws DurationConversionException {
|
||||
try {
|
||||
|
||||
@@ -22,6 +22,9 @@ import picocli.CommandLine;
|
||||
/** The Fraction converter to convert floats in CLI. */
|
||||
public class FractionConverter implements CommandLine.ITypeConverter<Fraction> {
|
||||
|
||||
/** Default constructor. */
|
||||
public FractionConverter() {}
|
||||
|
||||
@Override
|
||||
public Fraction convert(final String value) throws FractionConversionException {
|
||||
try {
|
||||
|
||||
@@ -29,6 +29,9 @@ public class MetricCategoryConverter implements CommandLine.ITypeConverter<Metri
|
||||
|
||||
private final Map<String, MetricCategory> metricCategories = new HashMap<>();
|
||||
|
||||
/** Default Constructor. */
|
||||
public MetricCategoryConverter() {}
|
||||
|
||||
@Override
|
||||
public MetricCategory convert(final String value) {
|
||||
final MetricCategory category = metricCategories.get(value);
|
||||
|
||||
@@ -21,6 +21,8 @@ import picocli.CommandLine;
|
||||
|
||||
/** The Percentage Cli type converter. */
|
||||
public class PercentageConverter implements CommandLine.ITypeConverter<Percentage> {
|
||||
/** Default Constructor. */
|
||||
public PercentageConverter() {}
|
||||
|
||||
@Override
|
||||
public Percentage convert(final String value) throws PercentageConversionException {
|
||||
|
||||
@@ -26,6 +26,8 @@ import picocli.CommandLine;
|
||||
* intended for use with PicoCLI to process command line arguments that specify plugin information.
|
||||
*/
|
||||
public class PluginInfoConverter implements CommandLine.ITypeConverter<List<PluginInfo>> {
|
||||
/** Default Constructor. */
|
||||
public PluginInfoConverter() {}
|
||||
|
||||
/**
|
||||
* Converts a comma-separated string into a list of {@link PluginInfo}.
|
||||
|
||||
@@ -21,6 +21,8 @@ import picocli.CommandLine;
|
||||
|
||||
/** The PositiveNumber Cli type converter. */
|
||||
public class PositiveNumberConverter implements CommandLine.ITypeConverter<PositiveNumber> {
|
||||
/** Default Constructor. */
|
||||
public PositiveNumberConverter() {}
|
||||
|
||||
@Override
|
||||
public PositiveNumber convert(final String value) throws PercentageConversionException {
|
||||
|
||||
@@ -29,6 +29,8 @@ import picocli.CommandLine.ParameterException;
|
||||
|
||||
/** The Rpc authentication file validator. */
|
||||
public class RpcAuthFileValidator {
|
||||
/** Default Constructor. */
|
||||
RpcAuthFileValidator() {}
|
||||
|
||||
/**
|
||||
* Validate auth file.
|
||||
|
||||
@@ -20,6 +20,10 @@ import picocli.CommandLine.Model.CommandSpec;
|
||||
|
||||
/** Custom Execution Exception Handler used by PicoCLI framework. */
|
||||
public class BesuExecutionExceptionHandler implements IExecutionExceptionHandler {
|
||||
|
||||
/** Default constructor. */
|
||||
public BesuExecutionExceptionHandler() {}
|
||||
|
||||
@Override
|
||||
public int handleExecutionException(
|
||||
final Exception ex,
|
||||
|
||||
@@ -21,6 +21,8 @@ import org.apache.logging.log4j.core.config.ConfigurationSource;
|
||||
|
||||
/** Custom Log4J Configuration Factory for Besu */
|
||||
public class BesuLoggingConfigurationFactory extends ConfigurationFactory {
|
||||
/** Default constructor. */
|
||||
public BesuLoggingConfigurationFactory() {}
|
||||
|
||||
@Override
|
||||
protected String[] getSupportedTypes() {
|
||||
|
||||
@@ -29,6 +29,8 @@ import org.apache.tuweni.units.bigints.UInt256;
|
||||
|
||||
/** The Option parser. */
|
||||
public class OptionParser {
|
||||
/** Default Constructor. */
|
||||
OptionParser() {}
|
||||
|
||||
/**
|
||||
* Parse long range range.
|
||||
|
||||
@@ -29,6 +29,8 @@ import picocli.CommandLine;
|
||||
* and trace filter range.
|
||||
*/
|
||||
public class ApiConfigurationOptions {
|
||||
/** Default constructor. */
|
||||
public ApiConfigurationOptions() {}
|
||||
|
||||
@CommandLine.Option(
|
||||
names = {"--api-gas-price-blocks"},
|
||||
|
||||
@@ -71,6 +71,9 @@ public class DataStorageOptions implements CLIOptions<DataStorageConfiguration>
|
||||
@CommandLine.ArgGroup(validate = false)
|
||||
private final DataStorageOptions.Unstable unstableOptions = new Unstable();
|
||||
|
||||
/** Default Constructor. */
|
||||
DataStorageOptions() {}
|
||||
|
||||
/** The unstable options for data storage. */
|
||||
public static class Unstable {
|
||||
private static final String BONSAI_LIMIT_TRIE_LOGS_ENABLED =
|
||||
@@ -113,6 +116,9 @@ public class DataStorageOptions implements CLIOptions<DataStorageConfiguration>
|
||||
description =
|
||||
"Enables code storage using code hash instead of by account hash. (default: ${DEFAULT-VALUE})")
|
||||
private boolean bonsaiCodeUsingCodeHashEnabled = DEFAULT_BONSAI_CODE_USING_CODE_HASH_ENABLED;
|
||||
|
||||
/** Default Constructor. */
|
||||
Unstable() {}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -56,6 +56,9 @@ public class GraphQlOptions {
|
||||
private final CorsAllowedOriginsProperty graphQLHttpCorsAllowedOrigins =
|
||||
new CorsAllowedOriginsProperty();
|
||||
|
||||
/** Default constructor */
|
||||
public GraphQlOptions() {}
|
||||
|
||||
/**
|
||||
* Validates the GraphQL HTTP options.
|
||||
*
|
||||
|
||||
@@ -208,6 +208,9 @@ public class JsonRpcHttpOptions {
|
||||
description = "Enable JSON pretty print format (default: ${DEFAULT-VALUE})")
|
||||
private final Boolean prettyJsonEnabled = DEFAULT_PRETTY_JSON_ENABLED;
|
||||
|
||||
/** Default constructor */
|
||||
public JsonRpcHttpOptions() {}
|
||||
|
||||
/**
|
||||
* Validates the Rpc Http options.
|
||||
*
|
||||
|
||||
@@ -23,6 +23,8 @@ import picocli.CommandLine.Spec;
|
||||
|
||||
/** The Logging level CLI option. */
|
||||
public class LoggingLevelOption {
|
||||
/** Default Constructor. */
|
||||
LoggingLevelOption() {}
|
||||
|
||||
/**
|
||||
* Create logging level option.
|
||||
|
||||
@@ -22,6 +22,8 @@ import picocli.CommandLine;
|
||||
|
||||
/** The Node private key file Cli option. */
|
||||
public class NodePrivateKeyFileOption {
|
||||
/** Default constructor. */
|
||||
NodePrivateKeyFileOption() {}
|
||||
|
||||
/**
|
||||
* Create node private key file option.
|
||||
|
||||
@@ -103,6 +103,9 @@ public class P2PTLSConfigOptions {
|
||||
"Whether to send a SNI header in the TLS ClientHello message (default: ${DEFAULT-VALUE})")
|
||||
private final Boolean p2pTlsClientHelloSniHeaderEnabled = false;
|
||||
|
||||
/** Default constructor. */
|
||||
P2PTLSConfigOptions() {}
|
||||
|
||||
/**
|
||||
* Generate P2p tls configuration.
|
||||
*
|
||||
|
||||
@@ -83,6 +83,9 @@ public class PermissionsOptions {
|
||||
"Enable account level permissions via smart contract (default: ${DEFAULT-VALUE})")
|
||||
private final Boolean permissionsAccountsContractEnabled = false;
|
||||
|
||||
/** Default constructor. */
|
||||
public PermissionsOptions() {}
|
||||
|
||||
/**
|
||||
* Creates a PermissioningConfiguration based on the provided options.
|
||||
*
|
||||
|
||||
@@ -37,6 +37,9 @@ public class PluginsConfigurationOptions implements CLIOptions<PluginConfigurati
|
||||
arity = "1..*")
|
||||
private List<PluginInfo> plugins;
|
||||
|
||||
/** Default Constructor. */
|
||||
public PluginsConfigurationOptions() {}
|
||||
|
||||
@Override
|
||||
public PluginConfiguration toDomainObject() {
|
||||
return new PluginConfiguration(plugins);
|
||||
|
||||
@@ -120,6 +120,9 @@ public class RpcWebsocketOptions {
|
||||
arity = "1")
|
||||
private final File rpcWsAuthenticationPublicKeyFile = null;
|
||||
|
||||
/** Default Constructor. */
|
||||
public RpcWebsocketOptions() {}
|
||||
|
||||
/**
|
||||
* Validates the WebSocket options.
|
||||
*
|
||||
|
||||
@@ -61,6 +61,9 @@ public class ChainPruningOptions implements CLIOptions<ChainPrunerConfiguration>
|
||||
private final PositiveNumber chainDataPruningBlocksFrequency =
|
||||
PositiveNumber.fromInt(DEFAULT_CHAIN_DATA_PRUNING_FREQUENCY);
|
||||
|
||||
/** Default Constructor. */
|
||||
ChainPruningOptions() {}
|
||||
|
||||
/**
|
||||
* Create chain pruning options.
|
||||
*
|
||||
|
||||
@@ -43,6 +43,9 @@ public class DnsOptions implements CLIOptions<EnodeDnsConfiguration> {
|
||||
arity = "1")
|
||||
private Boolean dnsUpdateEnabled = Boolean.FALSE;
|
||||
|
||||
/** Instantiates a new Dns options. */
|
||||
DnsOptions() {}
|
||||
|
||||
/**
|
||||
* Create dns options.
|
||||
*
|
||||
|
||||
@@ -30,6 +30,9 @@ public class EvmOptions implements CLIOptions<EvmConfiguration> {
|
||||
/** The constant WORLDSTATE_UPDATE_MODE. */
|
||||
public static final String WORLDSTATE_UPDATE_MODE = "--Xevm-worldstate-update-mode";
|
||||
|
||||
/** Default constructor. */
|
||||
EvmOptions() {}
|
||||
|
||||
/**
|
||||
* Create evm options.
|
||||
*
|
||||
|
||||
@@ -25,6 +25,9 @@ import picocli.CommandLine;
|
||||
public class IpcOptions {
|
||||
private static final String DEFAULT_IPC_FILE = "besu.ipc";
|
||||
|
||||
/** Default constructor. */
|
||||
IpcOptions() {}
|
||||
|
||||
/**
|
||||
* Create ipc options.
|
||||
*
|
||||
|
||||
@@ -37,6 +37,9 @@ public class NatOptions {
|
||||
arity = "1")
|
||||
private final Boolean natMethodFallbackEnabled = true;
|
||||
|
||||
/** Default constructor. */
|
||||
NatOptions() {}
|
||||
|
||||
/**
|
||||
* Create nat options.
|
||||
*
|
||||
|
||||
@@ -55,6 +55,9 @@ public class NativeLibraryOptions {
|
||||
arity = "1")
|
||||
private final Boolean nativeModExp = Boolean.TRUE;
|
||||
|
||||
/** Default constructor. */
|
||||
NativeLibraryOptions() {}
|
||||
|
||||
/**
|
||||
* Create native library options.
|
||||
*
|
||||
|
||||
@@ -107,6 +107,9 @@ public class PkiBlockCreationOptions {
|
||||
description = "File with all CRLs for PKI Block Creation.")
|
||||
Path crlFile = null;
|
||||
|
||||
/** Default Constructor. */
|
||||
PkiBlockCreationOptions() {}
|
||||
|
||||
/**
|
||||
* As domain config optional.
|
||||
*
|
||||
|
||||
@@ -18,6 +18,8 @@ import static picocli.CommandLine.Option;
|
||||
|
||||
/** The Privacy plugin Cli options. */
|
||||
public class PrivacyPluginOptions {
|
||||
/** Default Constructor. */
|
||||
PrivacyPluginOptions() {}
|
||||
|
||||
/**
|
||||
* Create privacy plugin options.
|
||||
|
||||
@@ -35,6 +35,9 @@ public class RPCOptions {
|
||||
arity = "1")
|
||||
private final Long wsTimeoutSec = TimeoutOptions.defaultOptions().getTimeoutSeconds();
|
||||
|
||||
/** Default Constructor. */
|
||||
RPCOptions() {}
|
||||
|
||||
/**
|
||||
* Create rpc options.
|
||||
*
|
||||
|
||||
@@ -24,6 +24,9 @@ public class PreSynchronizationTaskRunner {
|
||||
|
||||
private final List<PreSynchronizationTask> tasks = new ArrayList<>();
|
||||
|
||||
/** Default Constructor. */
|
||||
public PreSynchronizationTaskRunner() {}
|
||||
|
||||
/**
|
||||
* Add task.
|
||||
*
|
||||
|
||||
@@ -89,6 +89,9 @@ public class RetestethSubCommand implements Runnable {
|
||||
|
||||
private InetAddress autoDiscoveredDefaultIP;
|
||||
|
||||
/** Default Constructor. */
|
||||
public RetestethSubCommand() {}
|
||||
|
||||
// Used to discover the default IP of the client.
|
||||
// Loopback IP is used by default as this is how smokeTests require it to be
|
||||
// and it's probably a good security behaviour to default only on the localhost.
|
||||
|
||||
@@ -45,6 +45,9 @@ import picocli.CommandLine.ParentCommand;
|
||||
versionProvider = VersionProvider.class)
|
||||
public class BackupState implements Runnable {
|
||||
|
||||
/** Default constructor. */
|
||||
public BackupState() {}
|
||||
|
||||
@Option(
|
||||
names = "--block",
|
||||
paramLabel = MANDATORY_LONG_FORMAT_HELP,
|
||||
|
||||
@@ -59,6 +59,9 @@ public class GenerateLogBloomCache implements Runnable {
|
||||
|
||||
@ParentCommand private OperatorSubCommand parentCommand;
|
||||
|
||||
/** Default constructor. */
|
||||
public GenerateLogBloomCache() {}
|
||||
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
@@ -83,6 +83,9 @@ public class RestoreState implements Runnable {
|
||||
private BesuController besuController;
|
||||
private ForestWorldStateKeyValueStorage.Updater updater;
|
||||
|
||||
/** Default Constructor. */
|
||||
RestoreState() {}
|
||||
|
||||
private Path accountFileName(final int fileNumber, final boolean compressed) {
|
||||
return StateBackupService.accountFileName(backupDir, targetBlock, fileNumber, compressed);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ public class IbftExtraDataCLIAdapter implements JSONToRLP {
|
||||
private static final ObjectMapper MAPPER = new ObjectMapper();
|
||||
private static final TypeReference<Collection<String>> TYPE_REF = new TypeReference<>() {};
|
||||
|
||||
/** Default constructor. */
|
||||
public IbftExtraDataCLIAdapter() {}
|
||||
|
||||
@Override
|
||||
public Bytes encode(final String json) throws IOException {
|
||||
return fromJsonAddresses(json);
|
||||
|
||||
@@ -31,6 +31,9 @@ public class QbftExtraDataCLIAdapter implements JSONToRLP {
|
||||
private static final ObjectMapper MAPPER = new ObjectMapper();
|
||||
private static final TypeReference<Collection<String>> TYPE_REF = new TypeReference<>() {};
|
||||
|
||||
/** Default Constructor. */
|
||||
public QbftExtraDataCLIAdapter() {}
|
||||
|
||||
@Override
|
||||
public Bytes encode(final String json) throws IOException {
|
||||
return fromJsonAddresses(json);
|
||||
|
||||
@@ -57,6 +57,9 @@ public class RevertMetadataSubCommand implements Runnable {
|
||||
@CommandLine.Spec
|
||||
private CommandLine.Model.CommandSpec spec;
|
||||
|
||||
/** Default Constructor. */
|
||||
public RevertMetadataSubCommand() {}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
spec.commandLine().usage(System.out);
|
||||
|
||||
@@ -35,6 +35,9 @@ import org.slf4j.LoggerFactory;
|
||||
public class RocksDbHelper {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(RocksDbHelper.class);
|
||||
|
||||
/** Default Constructor. */
|
||||
RocksDbHelper() {}
|
||||
|
||||
static void forEachColumnFamily(
|
||||
final String dbPath, final BiConsumer<RocksDB, ColumnFamilyHandle> task) {
|
||||
RocksDB.loadLibrary();
|
||||
|
||||
@@ -44,6 +44,9 @@ public class RocksDbSubCommand implements Runnable {
|
||||
@CommandLine.Spec
|
||||
private CommandLine.Model.CommandSpec spec;
|
||||
|
||||
/** Default Constructor. */
|
||||
public RocksDbSubCommand() {}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
spec.commandLine().usage(System.out);
|
||||
|
||||
@@ -59,6 +59,9 @@ public class TrieLogHelper {
|
||||
private static final int ROCKSDB_MAX_INSERTS_PER_TRANSACTION = 1000;
|
||||
private static final Logger LOG = LoggerFactory.getLogger(TrieLogHelper.class);
|
||||
|
||||
/** Default Constructor. */
|
||||
public TrieLogHelper() {}
|
||||
|
||||
boolean prune(
|
||||
final DataStorageConfiguration config,
|
||||
final BonsaiWorldStateKeyValueStorage rootWorldStateStorage,
|
||||
|
||||
@@ -71,6 +71,9 @@ public class TrieLogSubCommand implements Runnable {
|
||||
@CommandLine.Spec
|
||||
private CommandLine.Model.CommandSpec spec; // Picocli injects reference to command spec
|
||||
|
||||
/** Default Constructor. */
|
||||
TrieLogSubCommand() {}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
final PrintWriter out = spec.commandLine().getOut();
|
||||
|
||||
@@ -27,6 +27,8 @@ import picocli.CommandLine;
|
||||
* @param <T> the type of configuration resource this finder will return
|
||||
*/
|
||||
public abstract class AbstractConfigurationFinder<T> {
|
||||
/** Default Constructor. */
|
||||
public AbstractConfigurationFinder() {}
|
||||
|
||||
/**
|
||||
* Returns the name of the configuration option.
|
||||
|
||||
@@ -48,6 +48,8 @@ public class CommandLineUtils {
|
||||
public static final String DEPRECATED_AND_USELESS_WARNING_MSG =
|
||||
"{} has been deprecated and is now useless, remove it.";
|
||||
|
||||
private CommandLineUtils() {}
|
||||
|
||||
/**
|
||||
* Check if options are passed that require an option to be true to have any effect and log a
|
||||
* warning with the list of affected options.
|
||||
|
||||
@@ -30,6 +30,9 @@ import picocli.CommandLine;
|
||||
public class ConfigFileFinder extends AbstractConfigurationFinder<File> {
|
||||
private static final String CONFIG_FILE_ENV_NAME = "BESU_CONFIG_FILE";
|
||||
|
||||
/** Default constructor. */
|
||||
public ConfigFileFinder() {}
|
||||
|
||||
/**
|
||||
* Returns the name of the configuration option.
|
||||
*
|
||||
|
||||
@@ -34,6 +34,9 @@ import picocli.CommandLine;
|
||||
public class ProfileFinder extends AbstractConfigurationFinder<InputStream> {
|
||||
private static final String PROFILE_ENV_NAME = "BESU_PROFILE";
|
||||
|
||||
/** Default Constructor. */
|
||||
public ProfileFinder() {}
|
||||
|
||||
@Override
|
||||
protected String getConfigOptionName() {
|
||||
return PROFILE_OPTION_NAME;
|
||||
|
||||
@@ -37,6 +37,8 @@ import org.slf4j.Logger;
|
||||
*/
|
||||
@Module
|
||||
public class BesuCommandModule {
|
||||
/** Default constructor. */
|
||||
public BesuCommandModule() {}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
|
||||
@@ -26,6 +26,9 @@ import dagger.Provides;
|
||||
@Module
|
||||
public class BesuPluginContextModule {
|
||||
|
||||
/** Default constructor. */
|
||||
public BesuPluginContextModule() {}
|
||||
|
||||
/**
|
||||
* Creates a BesuPluginContextImpl, used for plugin service discovery.
|
||||
*
|
||||
|
||||
@@ -311,6 +311,8 @@ public class BesuController implements java.io.Closeable {
|
||||
|
||||
/** The type Builder. */
|
||||
public static class Builder {
|
||||
/** Instantiates a new Builder. */
|
||||
public Builder() {}
|
||||
|
||||
/**
|
||||
* From eth network config besu controller builder.
|
||||
|
||||
@@ -205,6 +205,9 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
|
||||
|
||||
private int numberOfBlocksToCache = 0;
|
||||
|
||||
/** Instantiates a new Besu controller builder. */
|
||||
protected BesuControllerBuilder() {}
|
||||
|
||||
/**
|
||||
* Provide a BesuComponent which can be used to get other dependencies
|
||||
*
|
||||
|
||||
@@ -24,6 +24,9 @@ import com.google.common.base.Suppliers;
|
||||
/** Base class for BFT based Besu Controller Builders. */
|
||||
public abstract class BftBesuControllerBuilder extends BesuControllerBuilder {
|
||||
|
||||
/** Default constructor to be used by subclasses. */
|
||||
protected BftBesuControllerBuilder() {}
|
||||
|
||||
/**
|
||||
* Bft extra data codec supplier.
|
||||
*
|
||||
|
||||
@@ -57,6 +57,9 @@ public class CliqueBesuControllerBuilder extends BesuControllerBuilder {
|
||||
private final BlockInterface blockInterface = new CliqueBlockInterface();
|
||||
private ForksSchedule<CliqueConfigOptions> forksSchedule;
|
||||
|
||||
/** Default constructor. */
|
||||
public CliqueBesuControllerBuilder() {}
|
||||
|
||||
@Override
|
||||
protected void prepForBuild() {
|
||||
localAddress = Util.publicKeyToAddress(nodeKey.getPublicKey());
|
||||
|
||||
@@ -94,6 +94,9 @@ public class IbftBesuControllerBuilder extends BftBesuControllerBuilder {
|
||||
private ForksSchedule<BftConfigOptions> forksSchedule;
|
||||
private ValidatorPeers peers;
|
||||
|
||||
/** Default Constructor */
|
||||
public IbftBesuControllerBuilder() {}
|
||||
|
||||
@Override
|
||||
protected Supplier<BftExtraDataCodec> bftExtraDataCodec() {
|
||||
return Suppliers.memoize(IbftExtraDataCodec::new);
|
||||
|
||||
@@ -36,6 +36,9 @@ public class MainnetBesuControllerBuilder extends BesuControllerBuilder {
|
||||
|
||||
private EpochCalculator epochCalculator = new EpochCalculator.DefaultEpochCalculator();
|
||||
|
||||
/** Default constructor. */
|
||||
public MainnetBesuControllerBuilder() {}
|
||||
|
||||
@Override
|
||||
protected MiningCoordinator createMiningCoordinator(
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
|
||||
@@ -58,6 +58,9 @@ public class MergeBesuControllerBuilder extends BesuControllerBuilder {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MergeBesuControllerBuilder.class);
|
||||
private final AtomicReference<SyncState> syncState = new AtomicReference<>();
|
||||
|
||||
/** Default constructor. */
|
||||
public MergeBesuControllerBuilder() {}
|
||||
|
||||
@Override
|
||||
protected MiningCoordinator createMiningCoordinator(
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
|
||||
@@ -18,6 +18,8 @@ import org.hyperledger.besu.services.BesuPluginContextImpl;
|
||||
|
||||
/** The Noop plugin service factory. */
|
||||
public class NoopPluginServiceFactory implements PluginServiceFactory {
|
||||
/** Default Constructor. */
|
||||
public NoopPluginServiceFactory() {}
|
||||
|
||||
@Override
|
||||
public void appendPluginServices(final BesuPluginContextImpl besuContext) {}
|
||||
|
||||
@@ -106,6 +106,9 @@ public class QbftBesuControllerBuilder extends BftBesuControllerBuilder {
|
||||
private ValidatorPeers peers;
|
||||
private TransactionValidatorProvider transactionValidatorProvider;
|
||||
|
||||
/** Default Constructor. */
|
||||
public QbftBesuControllerBuilder() {}
|
||||
|
||||
@Override
|
||||
protected Supplier<BftExtraDataCodec> bftExtraDataCodec() {
|
||||
return Suppliers.memoize(
|
||||
|
||||
@@ -29,6 +29,9 @@ public class BesuConfigurationImpl implements BesuConfiguration {
|
||||
private DataStorageConfiguration dataStorageConfiguration;
|
||||
private MiningParameters miningParameters;
|
||||
|
||||
/** Default Constructor. */
|
||||
public BesuConfigurationImpl() {}
|
||||
|
||||
/**
|
||||
* Post creation initialization
|
||||
*
|
||||
|
||||
@@ -84,6 +84,9 @@ public class BesuPluginContextImpl implements BesuContext, PluginVersionsProvide
|
||||
|
||||
private final List<String> pluginVersions = new ArrayList<>();
|
||||
|
||||
/** Instantiates a new Besu plugin context. */
|
||||
public BesuPluginContextImpl() {}
|
||||
|
||||
/**
|
||||
* Add service.
|
||||
*
|
||||
|
||||
@@ -28,6 +28,9 @@ public class PermissioningServiceImpl implements PermissioningService {
|
||||
private final List<NodeConnectionPermissioningProvider> connectionPermissioningProviders =
|
||||
Lists.newArrayList();
|
||||
|
||||
/** Default Constructor. */
|
||||
public PermissioningServiceImpl() {}
|
||||
|
||||
@Override
|
||||
public void registerNodePermissioningProvider(
|
||||
final NodeConnectionPermissioningProvider provider) {
|
||||
|
||||
@@ -34,6 +34,9 @@ public class PrivacyPluginServiceImpl implements PrivacyPluginService {
|
||||
(privacyGroupId, privacyUserId, blockNumber) -> true;
|
||||
private PrivacyGroupGenesisProvider privacyGroupGenesisProvider;
|
||||
|
||||
/** Default Constructor. */
|
||||
public PrivacyPluginServiceImpl() {}
|
||||
|
||||
@Override
|
||||
public void setPayloadProvider(final PrivacyPluginPayloadProvider privacyPluginPayloadProvider) {
|
||||
this.privacyPluginPayloadProvider = privacyPluginPayloadProvider;
|
||||
|
||||
@@ -33,6 +33,9 @@ import java.util.stream.Collectors;
|
||||
public class RpcEndpointServiceImpl implements RpcEndpointService {
|
||||
private final Map<String, Function<PluginRpcRequest, ?>> rpcMethods = new HashMap<>();
|
||||
|
||||
/** Default Constructor. */
|
||||
public RpcEndpointServiceImpl() {}
|
||||
|
||||
@Override
|
||||
public <T> void registerRPCEndpoint(
|
||||
final String namespace,
|
||||
|
||||
@@ -27,6 +27,9 @@ public class SecurityModuleServiceImpl implements SecurityModuleService {
|
||||
private final Map<String, Supplier<SecurityModule>> securityModuleSuppliers =
|
||||
new ConcurrentHashMap<>();
|
||||
|
||||
/** Default Constructor. */
|
||||
public SecurityModuleServiceImpl() {}
|
||||
|
||||
@Override
|
||||
public void register(final String name, final Supplier<SecurityModule> securityModuleSupplier) {
|
||||
securityModuleSuppliers.put(name, securityModuleSupplier);
|
||||
|
||||
@@ -25,6 +25,9 @@ public class TransactionPoolValidatorServiceImpl implements TransactionPoolValid
|
||||
|
||||
private Optional<PluginTransactionPoolValidatorFactory> factory = Optional.empty();
|
||||
|
||||
/** Default Constructor. */
|
||||
public TransactionPoolValidatorServiceImpl() {}
|
||||
|
||||
@Override
|
||||
public PluginTransactionPoolValidator createTransactionValidator() {
|
||||
return factory
|
||||
|
||||
@@ -25,6 +25,9 @@ public class TransactionSelectionServiceImpl implements TransactionSelectionServ
|
||||
|
||||
private Optional<PluginTransactionSelectorFactory> factory = Optional.empty();
|
||||
|
||||
/** Default Constructor. */
|
||||
public TransactionSelectionServiceImpl() {}
|
||||
|
||||
@Override
|
||||
public PluginTransactionSelector createPluginTransactionSelector() {
|
||||
return factory
|
||||
|
||||
@@ -26,6 +26,8 @@ import java.util.stream.Collectors;
|
||||
|
||||
/** The Permissioning configuration validator. */
|
||||
public class PermissioningConfigurationValidator {
|
||||
/** Default Constructor. */
|
||||
PermissioningConfigurationValidator() {}
|
||||
|
||||
/**
|
||||
* Check if all nodes are in allowlist.
|
||||
|
||||
@@ -19,6 +19,8 @@ import java.util.function.Function;
|
||||
|
||||
/** some useful tools to display strings in command line help or error messages */
|
||||
public class StringUtils {
|
||||
/** Default Constructor. */
|
||||
StringUtils() {}
|
||||
|
||||
/**
|
||||
* Joins a list into string elements with a delimiter but having a last different delimiter
|
||||
|
||||
@@ -33,7 +33,7 @@ public class LoggingLevelOptionTest {
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
levelOption = new LoggingLevelOption();
|
||||
levelOption = LoggingLevelOption.create();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -82,7 +82,7 @@ public class ConfigDefaultValueProviderStrategyTest {
|
||||
.thenReturn(mockConfigOptionSpec);
|
||||
lenient().when(mockParseResult.hasMatchedOption(CONFIG_FILE_OPTION_NAME)).thenReturn(true);
|
||||
lenient().when(mockConfigOptionSpec.getter()).thenReturn(mockConfigOptionGetter);
|
||||
levelOption = new LoggingLevelOption();
|
||||
levelOption = LoggingLevelOption.create();
|
||||
levelOption.setLogLevel("INFO");
|
||||
configParsingHandler = new ConfigDefaultValueProviderStrategy(resultHandler, environment);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
|
||||
/** The Json util class. */
|
||||
public class JsonUtil {
|
||||
/** Default constructor. */
|
||||
private JsonUtil() {}
|
||||
|
||||
/**
|
||||
* Converts all the object keys (but none of the string values) to lowercase for easier lookup.
|
||||
|
||||
@@ -20,6 +20,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
public class MergeConfigOptions {
|
||||
private static final AtomicBoolean mergeEnabled = new AtomicBoolean(false);
|
||||
|
||||
/** Default constructor. */
|
||||
private MergeConfigOptions() {}
|
||||
|
||||
/**
|
||||
* Enables merge.
|
||||
*
|
||||
|
||||
@@ -83,6 +83,9 @@ public class StubGenesisConfigOptions implements GenesisConfigOptions, Cloneable
|
||||
private boolean zeroBaseFee = false;
|
||||
private boolean fixedBaseFee = false;
|
||||
|
||||
/** Default constructor. */
|
||||
public StubGenesisConfigOptions() {}
|
||||
|
||||
@Override
|
||||
public StubGenesisConfigOptions clone() {
|
||||
try {
|
||||
|
||||
@@ -44,6 +44,8 @@ import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
/** The Block header validation ruleset factory. */
|
||||
public class BlockHeaderValidationRulesetFactory {
|
||||
/** Default constructor. */
|
||||
private BlockHeaderValidationRulesetFactory() {}
|
||||
|
||||
/**
|
||||
* Creates a set of rules which when executed will determine if a given block header is valid with
|
||||
|
||||
@@ -27,6 +27,9 @@ import org.apache.tuweni.bytes.Bytes;
|
||||
|
||||
/** The Clique block hashing. */
|
||||
public class CliqueBlockHashing {
|
||||
/** Default constructor. */
|
||||
private CliqueBlockHashing() {}
|
||||
|
||||
/**
|
||||
* Constructs a hash of the block header, suitable for use when creating the proposer seal. The
|
||||
* extra data is modified to have a null proposer seal and empty list of committed seals.
|
||||
|
||||
@@ -21,6 +21,8 @@ import org.hyperledger.besu.ethereum.mainnet.MainnetBlockHeaderFunctions;
|
||||
|
||||
/** The Clique block header functions. */
|
||||
public class CliqueBlockHeaderFunctions implements BlockHeaderFunctions {
|
||||
/** Default constructor. */
|
||||
public CliqueBlockHeaderFunctions() {}
|
||||
|
||||
@Override
|
||||
public Hash hash(final BlockHeader header) {
|
||||
|
||||
@@ -44,6 +44,9 @@ public class CliqueBlockInterface implements BlockInterface {
|
||||
VoteType.ADD, ADD_NONCE,
|
||||
VoteType.DROP, DROP_NONCE);
|
||||
|
||||
/** Default constructor. */
|
||||
public CliqueBlockInterface() {}
|
||||
|
||||
@Override
|
||||
public Address getProposerOfBlock(final BlockHeader header) {
|
||||
return CliqueHelpers.getProposerOfBlock(header);
|
||||
|
||||
@@ -24,6 +24,8 @@ import org.hyperledger.besu.consensus.common.ForksScheduleFactory;
|
||||
|
||||
/** The Clique forks schedules factory. */
|
||||
public class CliqueForksSchedulesFactory {
|
||||
/** Default constructor. */
|
||||
CliqueForksSchedulesFactory() {}
|
||||
|
||||
/**
|
||||
* Create forks schedule.
|
||||
|
||||
@@ -27,6 +27,8 @@ import java.util.Comparator;
|
||||
|
||||
/** The Clique helpers. */
|
||||
public class CliqueHelpers {
|
||||
/** Default constructor. */
|
||||
CliqueHelpers() {}
|
||||
|
||||
/**
|
||||
* Gets proposer of block.
|
||||
|
||||
@@ -50,6 +50,9 @@ public class CliqueProtocolSchedule {
|
||||
|
||||
private static final BigInteger DEFAULT_CHAIN_ID = BigInteger.valueOf(4);
|
||||
|
||||
/** Default constructor. */
|
||||
CliqueProtocolSchedule() {}
|
||||
|
||||
/**
|
||||
* Create protocol schedule.
|
||||
*
|
||||
|
||||
@@ -31,6 +31,9 @@ public class CliqueDifficultyValidationRule implements AttachedBlockHeaderValida
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(CliqueDifficultyValidationRule.class);
|
||||
|
||||
/** Default constructor. */
|
||||
public CliqueDifficultyValidationRule() {}
|
||||
|
||||
@Override
|
||||
public boolean validate(
|
||||
final BlockHeader header, final BlockHeader parent, final ProtocolContext protocolContext) {
|
||||
|
||||
@@ -26,6 +26,9 @@ public class CliqueNoEmptyBlockValidationRule implements DetachedBlockHeaderVali
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(CliqueNoEmptyBlockValidationRule.class);
|
||||
|
||||
/** Default constructor. */
|
||||
public CliqueNoEmptyBlockValidationRule() {}
|
||||
|
||||
/**
|
||||
* Responsible for ensuring there are no empty transactions. This is used when createEmptyBlocks
|
||||
* is false, to ensure that no empty blocks are created.
|
||||
|
||||
@@ -28,6 +28,9 @@ public class SignerRateLimitValidationRule implements AttachedBlockHeaderValidat
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SignerRateLimitValidationRule.class);
|
||||
|
||||
/** Default constructor. */
|
||||
public SignerRateLimitValidationRule() {}
|
||||
|
||||
@Override
|
||||
public boolean validate(
|
||||
final BlockHeader header, final BlockHeader parent, final ProtocolContext protocolContext) {
|
||||
|
||||
@@ -26,6 +26,9 @@ public class VoteValidationRule implements DetachedBlockHeaderValidationRule {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(VoteValidationRule.class);
|
||||
|
||||
/** Default constructor. */
|
||||
public VoteValidationRule() {}
|
||||
|
||||
/**
|
||||
* Responsible for ensuring the nonce is either auth or drop.
|
||||
*
|
||||
|
||||
@@ -200,7 +200,7 @@ public class CliqueMinerExecutorTest {
|
||||
null,
|
||||
ethScheduler);
|
||||
|
||||
executor.setExtraData(modifiedVanityData);
|
||||
miningParameters.setExtraData(modifiedVanityData);
|
||||
final Bytes extraDataBytes = executor.calculateExtraData(blockHeaderBuilder.buildHeader());
|
||||
|
||||
final CliqueExtraData cliqueExtraData =
|
||||
|
||||
@@ -28,6 +28,8 @@ import java.util.function.Predicate;
|
||||
|
||||
/** The Combined protocol schedule factory. */
|
||||
public class CombinedProtocolScheduleFactory {
|
||||
/** Default constructor. */
|
||||
public CombinedProtocolScheduleFactory() {}
|
||||
|
||||
/**
|
||||
* Create protocol schedule.
|
||||
|
||||
@@ -18,6 +18,8 @@ import org.apache.tuweni.bytes.Bytes;
|
||||
|
||||
/** The Consensus helpers. */
|
||||
public class ConsensusHelpers {
|
||||
/** Default constructor. */
|
||||
private ConsensusHelpers() {}
|
||||
|
||||
/**
|
||||
* Zero left pad bytes.
|
||||
|
||||
@@ -43,6 +43,9 @@ public class ForksScheduleFactory {
|
||||
T create(ForkSpec<T> lastSpec, U fork);
|
||||
}
|
||||
|
||||
/** Default constructor. */
|
||||
private ForksScheduleFactory() {}
|
||||
|
||||
/**
|
||||
* Create forks schedule.
|
||||
*
|
||||
|
||||
@@ -29,7 +29,6 @@ import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import org.apache.tuweni.bytes.Bytes;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -108,11 +107,6 @@ public class MigratingMiningCoordinator implements MiningCoordinator, BlockAdded
|
||||
return activeMiningCoordinator.getMinPriorityFeePerGas();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraData(final Bytes extraData) {
|
||||
activeMiningCoordinator.setExtraData(extraData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Address> getCoinbase() {
|
||||
return activeMiningCoordinator.getCoinbase();
|
||||
|
||||
@@ -43,6 +43,9 @@ public abstract class BaseBftProtocolScheduleBuilder {
|
||||
|
||||
private static final BigInteger DEFAULT_CHAIN_ID = BigInteger.ONE;
|
||||
|
||||
/** Default constructor. */
|
||||
protected BaseBftProtocolScheduleBuilder() {}
|
||||
|
||||
/**
|
||||
* Create protocol schedule.
|
||||
*
|
||||
|
||||
@@ -38,6 +38,9 @@ public abstract class BftExtraDataCodec {
|
||||
/** The constant EXTRA_VANITY_LENGTH. */
|
||||
public static int EXTRA_VANITY_LENGTH = 32;
|
||||
|
||||
/** Default constructor. */
|
||||
public BftExtraDataCodec() {}
|
||||
|
||||
/**
|
||||
* Encode.
|
||||
*
|
||||
|
||||
@@ -30,6 +30,9 @@ public class BftHelpers {
|
||||
public static final Hash EXPECTED_MIX_HASH =
|
||||
Hash.fromHexString("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365");
|
||||
|
||||
/** Default constructor. */
|
||||
private BftHelpers() {}
|
||||
|
||||
/**
|
||||
* Calculate required validator quorum int.
|
||||
*
|
||||
|
||||
@@ -124,16 +124,6 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
|
||||
ethScheduler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets extra data.
|
||||
*
|
||||
* @param extraData the extra data
|
||||
*/
|
||||
public void setExtraData(final Bytes extraData) {
|
||||
|
||||
miningParameters.setExtraData(extraData.copy());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets min transaction gas price.
|
||||
*
|
||||
|
||||
@@ -33,7 +33,6 @@ import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import org.apache.tuweni.bytes.Bytes;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -154,11 +153,6 @@ public class BftMiningCoordinator implements MiningCoordinator, BlockAddedObserv
|
||||
return blockCreatorFactory.getMinPriorityFeePerGas();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraData(final Bytes extraData) {
|
||||
blockCreatorFactory.setExtraData(extraData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Address> getCoinbase() {
|
||||
return Optional.of(blockCreatorFactory.getLocalAddress());
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user