Skip to content

Commit

Permalink
Merge branch 'main' into fix-tx-pool-min-score-config
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Di Fabio <[email protected]>
  • Loading branch information
fab-10 authored Sep 20, 2024
2 parents b9b2cca + 19d3ca8 commit c11f3a6
Show file tree
Hide file tree
Showing 80 changed files with 1,823 additions and 277 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true

env:
GRADLE_OPTS: "-Xmx6g"
GRADLE_OPTS: "-Xmx7g"
total-runners: 12

jobs:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@

### Additions and Improvements
- Remove privacy test classes support [#7569](https://github.com/hyperledger/besu/pull/7569)
- Add Blob Transaction Metrics [#7622](https://github.com/hyperledger/besu/pull/7622)

### Bug fixes
- Fix mounted data path directory permissions for besu user [#7575](https://github.com/hyperledger/besu/pull/7575)
- Fix for `debug_traceCall` to handle transactions without specified gas price. [#7510](https://github.com/hyperledger/besu/pull/7510)
- Corrects a regression where custom plugin services are not initialized correctly. [#7625](https://github.com/hyperledger/besu/pull/7625)
- Fix for IBFT2 chains using the BONSAI DB format [#7631](https://github.com/hyperledger/besu/pull/7631)
- Fix reading `tx-pool-min-score` option from configuration file [#7623](https://github.com/hyperledger/besu/pull/7623)

## 24.9.1
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
| Matthew Whitehead| matthew1001 | matthew.whitehead |
| Meredith Baxter | mbaxter | mbaxter |
| Stefan Pingel | pinges | pinges |
| Danno Ferrin | shemnon | shemnon |
| Simon Dudley | siladu | siladu |
| Usman Saleem | usmansaleem | usmansaleem |

Expand All @@ -52,6 +51,7 @@
| Rai Sur | RatanRSur | ratanraisur |
| Rob Dawson | rojotek | RobDawson |
| Sajida Zouarhi | sajz | SajidaZ |
| Danno Ferrin | shemnon | shemnon |
| Taccat Isid | taccatisid | taccatisid |
| Tim Beiko | timbeiko | timbeiko |
| Vijay Michalik | vmichalik | VijayMichalik |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,70 @@ public void startNode(final BesuNode node) {

final Path dataDir = node.homeDirectory();

final List<String> params = commandlineArgs(node, dataDir);

LOG.info("Creating besu process with params {}", params);
final ProcessBuilder processBuilder =
new ProcessBuilder(params)
.directory(new File(System.getProperty("user.dir")).getParentFile().getParentFile())
.redirectErrorStream(true)
.redirectInput(Redirect.INHERIT);
if (!node.getPlugins().isEmpty()) {
processBuilder
.environment()
.put(
"BESU_OPTS",
"-Dbesu.plugins.dir=" + dataDir.resolve("plugins").toAbsolutePath().toString());
}
// Use non-blocking randomness for acceptance tests
processBuilder
.environment()
.put(
"JAVA_OPTS",
"-Djava.security.properties="
+ "acceptance-tests/tests/build/resources/test/acceptanceTesting.security");
// add additional environment variables
processBuilder.environment().putAll(node.getEnvironment());

try {
int debugPort = Integer.parseInt(System.getenv("BESU_DEBUG_CHILD_PROCESS_PORT"));
LOG.warn("Waiting for debugger to attach to SUSPENDED child process");
String debugOpts =
" -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:" + debugPort;
String prevJavaOpts = processBuilder.environment().get("JAVA_OPTS");
if (prevJavaOpts == null) {
processBuilder.environment().put("JAVA_OPTS", debugOpts);
} else {
processBuilder.environment().put("JAVA_OPTS", prevJavaOpts + debugOpts);
}

} catch (NumberFormatException e) {
LOG.debug(
"Child process may be attached to by exporting BESU_DEBUG_CHILD_PROCESS_PORT=<port> to env");
}

try {
checkState(
isNotAliveOrphan(node.getName()),
"A live process with name: %s, already exists. Cannot create another with the same name as it would orphan the first",
node.getName());

final Process process = processBuilder.start();
process.onExit().thenRun(() -> node.setExitCode(process.exitValue()));
outputProcessorExecutor.execute(() -> printOutput(node, process));
besuProcesses.put(node.getName(), process);
} catch (final IOException e) {
LOG.error("Error starting BesuNode process", e);
}

if (node.getRunCommand().isEmpty()) {
waitForFile(dataDir, "besu.ports");
waitForFile(dataDir, "besu.networks");
}
MDC.remove("node");
}

private List<String> commandlineArgs(final BesuNode node, final Path dataDir) {
final List<String> params = new ArrayList<>();
params.add("build/install/besu/bin/besu");

Expand Down Expand Up @@ -388,66 +452,7 @@ public void startNode(final BesuNode node) {
}

params.addAll(node.getRunCommand());

LOG.info("Creating besu process with params {}", params);
final ProcessBuilder processBuilder =
new ProcessBuilder(params)
.directory(new File(System.getProperty("user.dir")).getParentFile().getParentFile())
.redirectErrorStream(true)
.redirectInput(Redirect.INHERIT);
if (!node.getPlugins().isEmpty()) {
processBuilder
.environment()
.put(
"BESU_OPTS",
"-Dbesu.plugins.dir=" + dataDir.resolve("plugins").toAbsolutePath().toString());
}
// Use non-blocking randomness for acceptance tests
processBuilder
.environment()
.put(
"JAVA_OPTS",
"-Djava.security.properties="
+ "acceptance-tests/tests/build/resources/test/acceptanceTesting.security");
// add additional environment variables
processBuilder.environment().putAll(node.getEnvironment());

try {
int debugPort = Integer.parseInt(System.getenv("BESU_DEBUG_CHILD_PROCESS_PORT"));
LOG.warn("Waiting for debugger to attach to SUSPENDED child process");
String debugOpts =
" -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:" + debugPort;
String prevJavaOpts = processBuilder.environment().get("JAVA_OPTS");
if (prevJavaOpts == null) {
processBuilder.environment().put("JAVA_OPTS", debugOpts);
} else {
processBuilder.environment().put("JAVA_OPTS", prevJavaOpts + debugOpts);
}

} catch (NumberFormatException e) {
LOG.debug(
"Child process may be attached to by exporting BESU_DEBUG_CHILD_PROCESS_PORT=<port> to env");
}

try {
checkState(
isNotAliveOrphan(node.getName()),
"A live process with name: %s, already exists. Cannot create another with the same name as it would orphan the first",
node.getName());

final Process process = processBuilder.start();
process.onExit().thenRun(() -> node.setExitCode(process.exitValue()));
outputProcessorExecutor.execute(() -> printOutput(node, process));
besuProcesses.put(node.getName(), process);
} catch (final IOException e) {
LOG.error("Error starting BesuNode process", e);
}

if (node.getRunCommand().isEmpty()) {
waitForFile(dataDir, "besu.ports");
waitForFile(dataDir, "besu.networks");
}
MDC.remove("node");
return params;
}

private boolean isNotAliveOrphan(final String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ public void startNode(final BesuNode node) {
final PermissioningServiceImpl permissioningService = new PermissioningServiceImpl();

GlobalOpenTelemetry.resetForTest();
final ObservableMetricsSystem metricsSystem = component.getObservableMetricsSystem();
final ObservableMetricsSystem metricsSystem =
(ObservableMetricsSystem) component.getMetricsSystem();
final List<EnodeURL> bootnodes =
node.getConfiguration().getBootnodes().stream().map(EnodeURLImpl::fromURI).toList();

Expand Down Expand Up @@ -280,6 +281,16 @@ public BesuNodeProviderModule(final BesuNode toProvide) {
this.toProvide = toProvide;
}

@Provides
@Singleton
MetricsConfiguration provideMetricsConfiguration() {
if (toProvide.getMetricsConfiguration() != null) {
return toProvide.getMetricsConfiguration();
} else {
return MetricsConfiguration.builder().build();
}
}

@Provides
public BesuNode provideBesuNodeRunner() {
return toProvide;
Expand Down Expand Up @@ -410,13 +421,13 @@ public BesuControllerBuilder provideBesuControllerBuilder(
public BesuController provideBesuController(
final SynchronizerConfiguration synchronizerConfiguration,
final BesuControllerBuilder builder,
final ObservableMetricsSystem metricsSystem,
final MetricsSystem metricsSystem,
final KeyValueStorageProvider storageProvider,
final MiningParameters miningParameters) {

builder
.synchronizerConfiguration(synchronizerConfiguration)
.metricsSystem(metricsSystem)
.metricsSystem((ObservableMetricsSystem) metricsSystem)
.dataStorageConfiguration(DataStorageConfiguration.DEFAULT_FOREST_CONFIG)
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.clock(Clock.systemUTC())
Expand Down Expand Up @@ -562,12 +573,6 @@ BesuCommand provideBesuCommand(final BesuPluginContextImpl pluginContext) {
return besuCommand;
}

@Provides
@Singleton
MetricsConfiguration provideMetricsConfiguration() {
return MetricsConfiguration.builder().build();
}

@Provides
@Named("besuCommandLogger")
@Singleton
Expand Down
5 changes: 4 additions & 1 deletion besu/src/main/java/org/hyperledger/besu/Besu.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import org.hyperledger.besu.cli.BesuCommand;
import org.hyperledger.besu.cli.logging.BesuLoggingConfigurationFactory;
import org.hyperledger.besu.components.BesuComponent;
import org.hyperledger.besu.components.DaggerBesuComponent;

import io.netty.util.internal.logging.InternalLoggerFactory;
Expand All @@ -36,13 +37,15 @@ public Besu() {}
*/
public static void main(final String... args) {
setupLogging();
final BesuCommand besuCommand = DaggerBesuComponent.create().getBesuCommand();
final BesuComponent besuComponent = DaggerBesuComponent.create();
final BesuCommand besuCommand = besuComponent.getBesuCommand();
int exitCode =
besuCommand.parse(
new RunLast(),
besuCommand.parameterExceptionHandler(),
besuCommand.executionExceptionHandler(),
System.in,
besuComponent,
args);

System.exit(exitCode);
Expand Down
Loading

0 comments on commit c11f3a6

Please sign in to comment.