Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

### Breaking Changes
- Clique consensus has been removed. Besu can no longer start or mine on pure Clique networks. Syncing networks that started as Clique and have since transitioned to PoS via `terminalTotalDifficulty` (e.g. Linea Mainnet) are still supported. [#9852](https://github.com/hyperledger/besu/pull/9852)

### Upcoming Breaking Changes
- RPC changes to enhance compatibility with other ELs
Expand All @@ -11,7 +12,6 @@
- Holesky network is deprecated [#9437](https://github.com/hyperledger/besu/pull/9437)
- Sunsetting features - for more context on the reasoning behind the deprecation of these features, including alternative options, read [this blog post](https://www.lfdecentralizedtrust.org/blog/sunsetting-tessera-and-simplifying-hyperledger-besu)
- Proof of Work consensus (PoW)
- Clique Block Production (mining) - you will still be able to sync existing Clique networks, but not be a validator or create new Clique networks.

### Bug fixes
- BFT forks that change block period on time-based forks don't take effect [9681](https://github.com/hyperledger/besu/issues/9681)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import static java.util.Arrays.asList;
import static java.util.stream.Collectors.toList;
import static org.hyperledger.besu.ethereum.api.jsonrpc.RpcApis.ADMIN;
import static org.hyperledger.besu.ethereum.api.jsonrpc.RpcApis.CLIQUE;
import static org.hyperledger.besu.ethereum.api.jsonrpc.RpcApis.IBFT;
import static org.hyperledger.besu.ethereum.api.jsonrpc.RpcApis.PLUGINS;
import static org.hyperledger.besu.tests.acceptance.dsl.transaction.bft.ConsensusType.QBFT;
Expand All @@ -36,7 +35,6 @@
import org.hyperledger.besu.tests.acceptance.dsl.node.Node;
import org.hyperledger.besu.tests.acceptance.dsl.node.RunnableNode;
import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.genesis.GenesisConfigurationFactory;
import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.genesis.GenesisConfigurationFactory.CliqueOptions;

import java.io.File;
import java.io.IOException;
Expand All @@ -46,7 +44,6 @@
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.function.UnaryOperator;

import org.apache.tuweni.bytes.Bytes;
Expand Down Expand Up @@ -117,19 +114,14 @@ public BesuNode createArchiveNode(
public BesuNode createNode(
final String name, final UnaryOperator<BesuNodeConfigurationBuilder> configModifier)
throws IOException {
final BesuNodeConfigurationBuilder configBuilder =
configModifier.apply(new BesuNodeConfigurationBuilder().name(name));
return create(configBuilder.build());
}
final String[] enableRpcApis = new String[] {ADMIN.name()};

public Node createArchiveNodeThatMustNotBeTheBootnode(final String name) throws IOException {
return create(
final BesuNodeConfigurationBuilder builder =
new BesuNodeConfigurationBuilder()
.name(name)
.jsonRpcEnabled()
.webSocketEnabled()
.bootnodeEligible(false)
.build());
.jsonRpcConfiguration(node.createJsonRpcWithRpcApiEnabledConfig(enableRpcApis));

return create(configModifier.apply(builder).build());
}

public Node createQbftNodeThatMustNotBeTheBootnode(final String name) throws IOException {
Expand Down Expand Up @@ -233,15 +225,6 @@ public BesuNode createNodeWithAuthenticationUsingEcdsaJwtPublicKey(final String
.build());
}

public BesuNode createNodeWithP2pDisabled(final String name) throws IOException {
return create(
new BesuNodeConfigurationBuilder()
.name(name)
.p2pEnabled(false)
.jsonRpcConfiguration(node.createJsonRpcEnabledConfig())
.build());
}

public BesuNode createArchiveNodeWithRpcDisabled(final String name) throws IOException {
return create(new BesuNodeConfigurationBuilder().name(name).build());
}
Expand Down Expand Up @@ -310,40 +293,14 @@ public BesuNode createQbftNode(final String name) throws IOException {
return createQbftNode(name, UnaryOperator.identity());
}

public BesuNode createCliqueNode(final String name) throws IOException {
return createCliqueNode(name, UnaryOperator.identity());
}

public BesuNode createCliqueNode(
final String name, final UnaryOperator<BesuNodeConfigurationBuilder> configModifier)
throws IOException {
final List<String> enableRpcApis = new ArrayList<>(Arrays.asList());
enableRpcApis.addAll(List.of(IBFT.name(), ADMIN.name(), CLIQUE.name()));
BesuNodeConfigurationBuilder builder =
new BesuNodeConfigurationBuilder()
.name(name)
.jsonRpcConfiguration(
node.createJsonRpcWithRpcApiEnabledConfig(enableRpcApis.toArray(String[]::new)))
.webSocketConfiguration(node.createWebSocketEnabledConfig())
.devMode(false)
.jsonRpcTxPool()
.genesisConfigProvider(GenesisConfigurationFactory::createCliqueGenesisConfig);

builder = configModifier.apply(builder);

return create(builder.build());
}

public BesuNode createQbftNode(
final String name, final UnaryOperator<BesuNodeConfigurationBuilder> configModifier)
throws IOException {
final List<String> enableRpcApis = new ArrayList<>(Arrays.asList());
enableRpcApis.addAll(List.of(QBFT.name(), ADMIN.name()));
final String[] enableRpcApis = new String[] {QBFT.name(), ADMIN.name()};
BesuNodeConfigurationBuilder builder =
new BesuNodeConfigurationBuilder()
.name(name)
.jsonRpcConfiguration(
node.createJsonRpcWithRpcApiEnabledConfig(enableRpcApis.toArray(String[]::new)))
.jsonRpcConfiguration(node.createJsonRpcWithRpcApiEnabledConfig(enableRpcApis))
.webSocketConfiguration(node.createWebSocketEnabledConfig())
.devMode(false)
.jsonRpcTxPool()
Expand All @@ -358,68 +315,6 @@ public BesuNode createQbftNodeWithRevertReasonEnabled(final String name) throws
return createQbftNode(name, BesuNodeConfigurationBuilder::revertReasonEnabled);
}

public BesuNode createCliquePluginsNode(
final String name,
final List<String> plugins,
final List<String> extraCLIOptions,
final String... extraRpcApis)
throws IOException {

final List<String> enableRpcApis = new ArrayList<>(Arrays.asList(extraRpcApis));
enableRpcApis.addAll(List.of(IBFT.name(), ADMIN.name(), PLUGINS.name(), CLIQUE.name()));

return create(
new BesuNodeConfigurationBuilder()
.name(name)
.jsonRpcConfiguration(
node.createJsonRpcWithRpcApiEnabledConfig(enableRpcApis.toArray(String[]::new)))
.webSocketConfiguration(node.createWebSocketEnabledConfig())
.plugins(plugins)
.extraCLIOptions(extraCLIOptions)
.devMode(false)
.jsonRpcTxPool()
.genesisConfigProvider(
validators ->
GenesisConfigurationFactory.createCliqueGenesisConfig(
validators, CliqueOptions.DEFAULT))
.build());
}

public BesuNode createCliqueNode(final String name, final CliqueOptions cliqueOptions)
throws IOException {
return createCliqueNodeWithExtraCliOptionsAndRpcApis(name, cliqueOptions, List.of());
}

public BesuNode createCliqueNodeWithExtraCliOptionsAndRpcApis(
final String name, final CliqueOptions cliqueOptions, final List<String> extraCliOptions)
throws IOException {
return createCliqueNodeWithExtraCliOptionsAndRpcApis(
name, cliqueOptions, extraCliOptions, Set.of());
}

public BesuNode createCliqueNodeWithExtraCliOptionsAndRpcApis(
final String name,
final CliqueOptions cliqueOptions,
final List<String> extraCliOptions,
final Set<String> extraRpcApis)
throws IOException {
return create(
new BesuNodeConfigurationBuilder()
.name(name)
.miningEnabled()
.jsonRpcConfiguration(node.createJsonRpcWithCliqueEnabledConfig(extraRpcApis))
.webSocketConfiguration(node.createWebSocketEnabledConfig())
.inProcessRpcConfiguration(node.createInProcessRpcConfiguration(extraRpcApis))
.devMode(false)
.jsonRpcTxPool()
.genesisConfigProvider(
validators ->
GenesisConfigurationFactory.createCliqueGenesisConfig(
validators, cliqueOptions))
.extraCLIOptions(extraCliOptions)
.build());
}

public BesuNode createIbft2NonValidatorBootnode(final String name, final String genesisFile)
throws IOException {
return create(
Expand Down Expand Up @@ -463,22 +358,6 @@ public BesuNode createIbft2NodeWithLocalAccountPermissioning(
.build());
}

public BesuNode createIbft2Node(final String name, final String genesisFile) throws IOException {
return create(
new BesuNodeConfigurationBuilder()
.name(name)
.miningEnabled()
.jsonRpcConfiguration(node.createJsonRpcWithIbft2AdminEnabledConfig())
.webSocketConfiguration(node.createWebSocketEnabledConfig())
.devMode(false)
.genesisConfigProvider(
validators ->
GenesisConfigurationFactory.createIbft2GenesisConfigFilterBootnode(
validators, genesisFile))
.bootnodeEligible(false)
.build());
}

public BesuNode createIbft2Node(
final String name, final boolean fixedPort, final DataStorageFormat storageFormat)
throws IOException {
Expand Down Expand Up @@ -659,34 +538,6 @@ public BesuNode createExecutionEngineGenesisNode(final String name, final String
.build());
}

public BesuNode createCliqueNodeWithValidators(final String name, final String... validators)
throws IOException {
return createCliqueNodeWithValidators(name, CliqueOptions.DEFAULT, validators);
}

public BesuNode createCliqueNodeWithValidators(
final String name, final CliqueOptions cliqueOptions, final String... validators)
throws IOException {

return create(
new BesuNodeConfigurationBuilder()
.name(name)
.miningEnabled()
.jsonRpcConfiguration(node.createJsonRpcWithCliqueEnabledConfig(Set.of()))
.webSocketConfiguration(node.createWebSocketEnabledConfig())
.jsonRpcTxPool()
.devMode(false)
.genesisConfigProvider(
nodes ->
node.createGenesisConfigForValidators(
asList(validators),
nodes,
vs ->
GenesisConfigurationFactory.createCliqueGenesisConfig(
vs, cliqueOptions)))
.build());
}

public BesuNode createIbft2NodeWithValidators(final String name, final String... validators)
throws IOException {

Expand All @@ -706,25 +557,6 @@ public BesuNode createIbft2NodeWithValidators(final String name, final String...
.build());
}

public BesuNode createQbftTLSNodeWithValidators(
final String name, final String type, final String... validators) throws IOException {

return create(
new BesuNodeConfigurationBuilder()
.name(name)
.miningEnabled()
.jsonRpcConfiguration(node.createJsonRpcWithIbft2EnabledConfig(false))
.webSocketConfiguration(node.createWebSocketEnabledConfig())
.devMode(false)
.genesisConfigProvider(
nodes ->
node.createGenesisConfigForValidators(
asList(validators),
nodes,
GenesisConfigurationFactory::createIbft2GenesisConfig))
.build());
}

public BesuNode createQbftNodeWithValidators(final String name, final String... validators)
throws IOException {

Expand Down Expand Up @@ -789,33 +621,22 @@ private BesuNodeConfigurationBuilder createConfigurationBuilderWithStaticNodes(
}

public BesuNode createNodeWithNonDefaultSignatureAlgorithm(
final String name,
final String genesisPath,
final KeyPair keyPair,
final List<Node> staticNodes)
throws IOException {
final String name, final KeyPair keyPair, final List<Node> staticNodes) throws IOException {
BesuNodeConfigurationBuilder builder =
createNodeConfigurationWithNonDefaultSignatureAlgorithm(
name, genesisPath, keyPair, staticNodes);
createNodeConfigurationWithNonDefaultSignatureAlgorithm(name, keyPair, staticNodes);
return create(builder.build());
}

public BesuNodeConfigurationBuilder createNodeConfigurationWithNonDefaultSignatureAlgorithm(
final String name,
final String genesisPath,
final KeyPair keyPair,
final List<Node> staticNodes) {

final List<String> enableRpcApis = new ArrayList<>(Arrays.asList());
enableRpcApis.addAll(List.of(QBFT.name(), ADMIN.name()));
final String name, final KeyPair keyPair, final List<Node> staticNodes) {

final String[] enableRpcApis = new String[] {QBFT.name(), ADMIN.name()};
BesuNodeConfigurationBuilder builder =
createConfigurationBuilderWithStaticNodes(name, staticNodes);

builder =
builder
.jsonRpcConfiguration(
node.createJsonRpcWithRpcApiEnabledConfig(enableRpcApis.toArray(String[]::new)))
.jsonRpcConfiguration(node.createJsonRpcWithRpcApiEnabledConfig(enableRpcApis))
.webSocketConfiguration(node.createWebSocketEnabledConfig())
.devMode(false)
.jsonRpcTxPool()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ private static Optional<String> updateGenesisExtraData(
return Optional.of(genesis);
}

public static Optional<String> createFromResource(final String resourceName) {
return Optional.of(readGenesisFile(resourceName));
}

private static String updateGenesisCliqueOptions(
final String template, final CliqueOptions cliqueOptions) {
return template
Expand Down

This file was deleted.

Loading