Skip to content

Commit

Permalink
Merge branch 'main' into eof/mask_returndataload
Browse files Browse the repository at this point in the history
  • Loading branch information
shemnon committed Sep 24, 2024
2 parents a174b9a + aed6bb0 commit 2ba4244
Show file tree
Hide file tree
Showing 42 changed files with 994 additions and 278 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
# Changelog

## [Unreleased]
- Add configuration of Consolidation Request Contract Address via genesis configuration [#7647](https://github.com/hyperledger/besu/pull/7647)


### Upcoming Breaking Changes
- k8s (KUBERNETES) Nat method is now deprecated and will be removed in a future release

### Breaking Changes
- Besu will now fail to start if any plugins encounter errors during initialization. To allow Besu to continue running despite plugin errors, use the `--plugin-continue-on-error` option. [#7662](https://github.com/hyperledger/besu/pull/7662)

### 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)
- Implemented support for emptyBlockPeriodSeconds in QBFT [#6965](https://github.com/hyperledger/besu/pull/6965)


### Bug fixes
- Fix mounted data path directory permissions for besu user [#7575](https://github.com/hyperledger/besu/pull/7575)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,9 @@ public BesuPluginContextImpl providePluginContext(
besuPluginContext.addService(PermissioningService.class, permissioningService);
besuPluginContext.addService(PrivacyPluginService.class, new PrivacyPluginServiceImpl());

besuPluginContext.registerPlugins(
besuPluginContext.initialize(
new PluginConfiguration.Builder().pluginsDir(pluginsPath).build());
besuPluginContext.registerPlugins();
commandLine.parseArgs(extraCLIOptions.toArray(new String[0]));

// register built-in plugins
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright ConsenSys AG.
* Copyright contributors to Hyperledger Besu.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -32,16 +32,25 @@
public class TestPicoCLIPlugin implements BesuPlugin {
private static final Logger LOG = LoggerFactory.getLogger(TestPicoCLIPlugin.class);

private static final String UNSET = "UNSET";
private static final String FAIL_REGISTER = "FAILREGISTER";
private static final String FAIL_BEFORE_EXTERNAL_SERVICES = "FAILBEFOREEXTERNALSERVICES";
private static final String FAIL_START = "FAILSTART";
private static final String FAIL_AFTER_EXTERNAL_SERVICE_POST_MAIN_LOOP =
"FAILAFTEREXTERNALSERVICEPOSTMAINLOOP";
private static final String FAIL_STOP = "FAILSTOP";
private static final String PLUGIN_LIFECYCLE_PREFIX = "pluginLifecycle.";

@Option(
names = {"--Xplugin-test-option"},
hidden = true,
defaultValue = "UNSET")
defaultValue = UNSET)
String testOption = System.getProperty("testPicoCLIPlugin.testOption");

@Option(
names = {"--plugin-test-stable-option"},
hidden = true,
defaultValue = "UNSET")
defaultValue = UNSET)
String stableOption = "";

private String state = "uninited";
Expand All @@ -52,7 +61,7 @@ public void register(final BesuContext context) {
LOG.info("Registering. Test Option is '{}'", testOption);
state = "registering";

if ("FAILREGISTER".equals(testOption)) {
if (FAIL_REGISTER.equals(testOption)) {
state = "failregister";
throw new RuntimeException("I was told to fail at registration");
}
Expand All @@ -66,12 +75,26 @@ public void register(final BesuContext context) {
state = "registered";
}

@Override
public void beforeExternalServices() {
LOG.info("Before external services. Test Option is '{}'", testOption);
state = "beforeExternalServices";

if (FAIL_BEFORE_EXTERNAL_SERVICES.equals(testOption)) {
state = "failbeforeExternalServices";
throw new RuntimeException("I was told to fail before external services");
}

writeSignal("beforeExternalServices");
state = "beforeExternalServicesFinished";
}

@Override
public void start() {
LOG.info("Starting. Test Option is '{}'", testOption);
state = "starting";

if ("FAILSTART".equals(testOption)) {
if (FAIL_START.equals(testOption)) {
state = "failstart";
throw new RuntimeException("I was told to fail at startup");
}
Expand All @@ -80,12 +103,26 @@ public void start() {
state = "started";
}

@Override
public void afterExternalServicePostMainLoop() {
LOG.info("After external services post main loop. Test Option is '{}'", testOption);
state = "afterExternalServicePostMainLoop";

if (FAIL_AFTER_EXTERNAL_SERVICE_POST_MAIN_LOOP.equals(testOption)) {
state = "failafterExternalServicePostMainLoop";
throw new RuntimeException("I was told to fail after external services post main loop");
}

writeSignal("afterExternalServicePostMainLoop");
state = "afterExternalServicePostMainLoopFinished";
}

@Override
public void stop() {
LOG.info("Stopping. Test Option is '{}'", testOption);
state = "stopping";

if ("FAILSTOP".equals(testOption)) {
if (FAIL_STOP.equals(testOption)) {
state = "failstop";
throw new RuntimeException("I was told to fail at stop");
}
Expand All @@ -103,7 +140,7 @@ public String getState() {
@SuppressWarnings("ResultOfMethodCallIgnored")
private void writeSignal(final String signal) {
try {
final File callbackFile = new File(callbackDir, "pluginLifecycle." + signal);
final File callbackFile = new File(callbackDir, PLUGIN_LIFECYCLE_PREFIX + signal);
if (!callbackFile.getParentFile().exists()) {
callbackFile.getParentFile().mkdirs();
callbackFile.getParentFile().deleteOnExit();
Expand Down
Loading

0 comments on commit 2ba4244

Please sign in to comment.