Skip to content

Commit 0320e98

Browse files
authored
Merge branch 'main' into bal-perfect-parallel
2 parents 50ba11e + 8619652 commit 0320e98

370 files changed

Lines changed: 5669 additions & 13099 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
- Fast Sync
1515

1616
### Additions and Improvements
17+
- Performance: Optimise EIP-196 AltBn128: EcAdd 33-128% faster, EcMul 8% faster [#9570](https://github.com/hyperledger/besu/pull/9570)
18+
- Update to Netty 4.2.9.Final [#9587](https://github.com/hyperledger/besu/pull/9587)
1719

1820
## 25.12.0
1921

@@ -48,6 +50,7 @@
4850
- Add Linea named networks for `linea_mainnet` and `linea_sepolia` [#9436](https://github.com/hyperledger/besu/pull/9436), [#9518](https://github.com/hyperledger/besu/pull/9518)
4951
- Add `eth_subscribe` and `eth_unsubscribe` support to IPC service [#9504](https://github.com/hyperledger/besu/pull/9504)
5052
- Add experimental `callTracer` tracer option to `debug_trace*` methods. Enabled using `--Xenable-extra-debug-tracers=true` option. Issue [#8326][issue_8326] implemented via PR [#8960][PR_8960] and [#9072][PR_9072].
53+
- Remove EOF [#9559](https://github.com/hyperledger/besu/pull/9559)
5154

5255
### Bug fixes
5356
- Fix non-deterministic sub-protocol registration during IBFT2 to QBFT consensus migration [#9516](https://github.com/hyperledger/besu/pull/9516)

acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/AcceptanceTestBase.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import org.hyperledger.besu.tests.acceptance.dsl.transaction.miner.MinerTransactions;
4545
import org.hyperledger.besu.tests.acceptance.dsl.transaction.net.NetTransactions;
4646
import org.hyperledger.besu.tests.acceptance.dsl.transaction.perm.PermissioningTransactions;
47+
import org.hyperledger.besu.tests.acceptance.dsl.transaction.plugins.PluginsTransactions;
4748
import org.hyperledger.besu.tests.acceptance.dsl.transaction.txpool.TxPoolTransactions;
4849
import org.hyperledger.besu.tests.acceptance.dsl.transaction.web3.Web3Transactions;
4950

@@ -104,6 +105,7 @@ public class AcceptanceTestBase {
104105
protected final TxPoolTransactions txPoolTransactions;
105106
protected final ExitedWithCode exitedSuccessfully;
106107
protected final DebugTransactions debug;
108+
protected final PluginsTransactions plugins;
107109

108110
private final ExecutorService outputProcessorExecutor = Executors.newCachedThreadPool();
109111

@@ -134,6 +136,7 @@ protected AcceptanceTestBase() {
134136
permissionedNodeBuilder = new PermissionedNodeBuilder();
135137
exitedSuccessfully = new ExitedWithCode(0);
136138
debug = new DebugTransactions();
139+
plugins = new PluginsTransactions();
137140
}
138141

139142
@BeforeEach

acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import org.hyperledger.besu.tests.acceptance.dsl.transaction.miner.MinerRequestFactory;
5151
import org.hyperledger.besu.tests.acceptance.dsl.transaction.net.CustomRequestFactory;
5252
import org.hyperledger.besu.tests.acceptance.dsl.transaction.perm.PermissioningJsonRpcRequestFactory;
53+
import org.hyperledger.besu.tests.acceptance.dsl.transaction.plugins.PluginsRequestFactory;
5354
import org.hyperledger.besu.tests.acceptance.dsl.transaction.txpool.TxPoolRequestFactory;
5455

5556
import java.io.File;
@@ -452,7 +453,8 @@ public NodeRequests nodeRequests() {
452453
new TxPoolRequestFactory(web3jService),
453454
new DebugRequestFactory(web3jService),
454455
websocketService,
455-
loginRequestFactory());
456+
loginRequestFactory(),
457+
new PluginsRequestFactory(web3jService));
456458
}
457459

458460
return nodeRequests;

acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
import org.hyperledger.besu.ethereum.core.encoding.BlockBodyEncoder;
4747
import org.hyperledger.besu.ethereum.core.encoding.BlockHeaderEncoder;
4848
import org.hyperledger.besu.ethereum.core.encoding.receipt.TransactionReceiptEncoder;
49-
import org.hyperledger.besu.ethereum.core.plugins.PluginConfiguration;
49+
import org.hyperledger.besu.ethereum.core.plugins.ImmutablePluginConfiguration;
5050
import org.hyperledger.besu.ethereum.core.plugins.PluginInfo;
5151
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
5252
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
@@ -646,9 +646,9 @@ public void loadPluginContext(
646646
besuPluginContext.addService(PermissioningService.class, permissioningService);
647647

648648
besuPluginContext.initialize(
649-
new PluginConfiguration.Builder()
649+
ImmutablePluginConfiguration.builder()
650650
.pluginsDir(pluginsPath)
651-
.requestedPlugins(requestedPlugins.stream().map(PluginInfo::new).toList())
651+
.requestedPluginsInfo(requestedPlugins.stream().map(PluginInfo::new).toList())
652652
.build());
653653
besuPluginContext.registerPlugins();
654654
commandLine.parseArgs(extraCLIOptions.toArray(new String[0]));

acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/transaction/NodeRequests.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.hyperledger.besu.tests.acceptance.dsl.transaction.miner.MinerRequestFactory;
2323
import org.hyperledger.besu.tests.acceptance.dsl.transaction.net.CustomRequestFactory;
2424
import org.hyperledger.besu.tests.acceptance.dsl.transaction.perm.PermissioningJsonRpcRequestFactory;
25+
import org.hyperledger.besu.tests.acceptance.dsl.transaction.plugins.PluginsRequestFactory;
2526
import org.hyperledger.besu.tests.acceptance.dsl.transaction.txpool.TxPoolRequestFactory;
2627

2728
import java.util.Optional;
@@ -43,6 +44,7 @@ public class NodeRequests {
4344
private final MinerRequestFactory miner;
4445
private final TxPoolRequestFactory txPool;
4546
private final DebugRequestFactory debug;
47+
private final PluginsRequestFactory plugins;
4648

4749
public NodeRequests(
4850
final Web3jService web3jService,
@@ -56,7 +58,8 @@ public NodeRequests(
5658
final TxPoolRequestFactory txPool,
5759
final DebugRequestFactory debug,
5860
final Optional<WebSocketService> websocketService,
59-
final LoginRequestFactory login) {
61+
final LoginRequestFactory login,
62+
final PluginsRequestFactory plugins) {
6063
this.web3jService = web3jService;
6164
this.netEth = netEth;
6265
this.clique = clique;
@@ -69,6 +72,7 @@ public NodeRequests(
6972
this.debug = debug;
7073
this.websocketService = websocketService;
7174
this.login = login;
75+
this.plugins = plugins;
7276
}
7377

7478
public Web3j eth() {
@@ -115,6 +119,10 @@ public DebugRequestFactory debug() {
115119
return debug;
116120
}
117121

122+
public PluginsRequestFactory plugins() {
123+
return plugins;
124+
}
125+
118126
public void shutdown() {
119127
netEth.shutdown();
120128
websocketService.ifPresent(WebSocketService::close);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright contributors to Besu.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*
13+
* SPDX-License-Identifier: Apache-2.0
14+
*/
15+
package org.hyperledger.besu.tests.acceptance.dsl.transaction.plugins;
16+
17+
import java.util.Collections;
18+
import java.util.Optional;
19+
20+
import org.web3j.protocol.Web3jService;
21+
import org.web3j.protocol.core.Request;
22+
import org.web3j.protocol.core.Response;
23+
24+
public class PluginsRequestFactory {
25+
26+
public static class ReloadConfigurationResponse extends Response<String> {}
27+
28+
private final Web3jService web3jService;
29+
30+
public PluginsRequestFactory(final Web3jService web3jService) {
31+
this.web3jService = web3jService;
32+
}
33+
34+
public Request<?, ReloadConfigurationResponse> reloadConfiguration(
35+
final Optional<String> maybePluginName) {
36+
return new Request<>(
37+
"plugins_reloadPluginConfig",
38+
maybePluginName.map(Collections::singletonList).orElse(Collections.emptyList()),
39+
web3jService,
40+
ReloadConfigurationResponse.class);
41+
}
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright contributors to Besu.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*
13+
* SPDX-License-Identifier: Apache-2.0
14+
*/
15+
package org.hyperledger.besu.tests.acceptance.dsl.transaction.plugins;
16+
17+
public class PluginsTransactions {
18+
19+
public ReloadPluginConfig reloadConfiguration(final String pluginName) {
20+
return new ReloadPluginConfig(pluginName);
21+
}
22+
23+
public ReloadPluginConfig reloadConfiguration() {
24+
return new ReloadPluginConfig();
25+
}
26+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright contributors to Besu.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*
13+
* SPDX-License-Identifier: Apache-2.0
14+
*/
15+
package org.hyperledger.besu.tests.acceptance.dsl.transaction.plugins;
16+
17+
import static org.assertj.core.api.Assertions.assertThat;
18+
19+
import org.hyperledger.besu.tests.acceptance.dsl.transaction.NodeRequests;
20+
import org.hyperledger.besu.tests.acceptance.dsl.transaction.Transaction;
21+
22+
import java.io.IOException;
23+
import java.util.Optional;
24+
25+
import org.web3j.protocol.core.Response;
26+
27+
public class ReloadPluginConfig implements Transaction<String> {
28+
29+
private final String pluginName;
30+
31+
public ReloadPluginConfig() {
32+
this(null);
33+
}
34+
35+
public ReloadPluginConfig(final String pluginName) {
36+
this.pluginName = pluginName;
37+
}
38+
39+
@Override
40+
public String execute(final NodeRequests node) {
41+
try {
42+
final Response<String> resp =
43+
node.plugins().reloadConfiguration(Optional.ofNullable(pluginName)).send();
44+
assertThat(resp).isNotNull();
45+
assertThat(resp.hasError()).isFalse();
46+
return resp.getResult();
47+
} catch (final IOException e) {
48+
throw new RuntimeException(e);
49+
}
50+
}
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright contributors to Besu.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*
13+
* SPDX-License-Identifier: Apache-2.0
14+
*/
15+
package org.hyperledger.besu.tests.acceptance.plugins;
16+
17+
import org.hyperledger.besu.plugin.BesuPlugin;
18+
import org.hyperledger.besu.plugin.ServiceManager;
19+
20+
import java.io.File;
21+
import java.io.IOException;
22+
import java.util.concurrent.CompletableFuture;
23+
24+
public abstract class AbstractTestReloadConfigurationPlugin implements BesuPlugin {
25+
private File callbackDir;
26+
private final int pluginNum;
27+
28+
public AbstractTestReloadConfigurationPlugin(final int pluginNum) {
29+
this.pluginNum = pluginNum;
30+
}
31+
32+
@Override
33+
public void register(final ServiceManager serviceManager) {
34+
callbackDir = new File(System.getProperty("besu.plugins.dir", "plugins"));
35+
}
36+
37+
@Override
38+
public void start() {}
39+
40+
@Override
41+
public CompletableFuture<Void> reloadConfiguration() {
42+
return CompletableFuture.runAsync(this::notifyConfigurationReloaded);
43+
}
44+
45+
@Override
46+
public void stop() {}
47+
48+
private void notifyConfigurationReloaded() {
49+
try {
50+
final File callbackFile = new File(callbackDir, "reloadConfiguration." + pluginNum);
51+
if (!callbackFile.getParentFile().exists()) {
52+
callbackFile.getParentFile().mkdirs();
53+
callbackFile.getParentFile().deleteOnExit();
54+
}
55+
callbackFile.createNewFile();
56+
callbackFile.deleteOnExit();
57+
} catch (final IOException ioe) {
58+
throw new RuntimeException(ioe);
59+
}
60+
}
61+
}

0 commit comments

Comments
 (0)