Skip to content

Commit 8609317

Browse files
committed
Merge branch 'main' into feature/rpc-stack-refactor-phase1-clean
# Conflicts: # ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/handlers/AbstractJsonRpcExecutor.java # ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/handlers/JsonRpcExecutorHandler.java # ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/handlers/JsonRpcObjectExecutor.java # ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/execution/BaseJsonRpcProcessor.java # ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/execution/TimedJsonRpcProcessor.java # ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/execution/TracedJsonRpcProcessor.java
2 parents ad3c50e + 7dbd094 commit 8609317

176 files changed

Lines changed: 5368 additions & 1544 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.

.github/workflows/pre-review.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,26 @@ jobs:
8282
cache-disabled: true
8383
- name: Gradle Compile
8484
run: ./gradlew build -x test -x spotlessCheck
85+
verify-source-metadata:
86+
name: "Verify Dependency Source Metadata"
87+
runs-on: ubuntu-latest
88+
needs: [spotless-checkLicense, gradle-wrapper, repolint]
89+
steps:
90+
- name: Checkout Repo
91+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
92+
with:
93+
ref: ${{ github.event.pull_request.head.sha || github.ref }}
94+
- name: Set up Java
95+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
96+
with:
97+
distribution: temurin
98+
java-version: 21
99+
- name: Setup Gradle
100+
uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1
101+
with:
102+
cache-disabled: true
103+
- name: Verify source artifacts recorded in verification-metadata.xml
104+
run: ./gradlew verifySourceArtifacts
85105
unitTests:
86106
runs-on: besu-research-ubuntu-16 # more cores
87107
needs: [spotless-checkLicense, gradle-wrapper, repolint]
@@ -126,7 +146,7 @@ jobs:
126146
unittests-passed:
127147
name: "unittests-passed"
128148
runs-on: ubuntu-latest
129-
needs: [compile, unitTests]
149+
needs: [compile, unitTests, verify-source-metadata]
130150
permissions:
131151
checks: write
132152
statuses: write

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ are provided with different values, using input as per the execution-apis spec i
4141
- Upgrade besu-native libraries version to 1.5.0. This fixes the issue of besu-native/secp256r1 exporting OpenSSL symbols in JVM space. [besu-native #308](https://github.com/besu-eth/besu-native/pull/308)
4242

4343
### Additions and Improvements
44+
- Add `transactionReceipts` subscription type to `eth_subscribe` that pushes all transaction receipts when a new block is added, with optional `transactionHashes` filter to receive receipts for specific transactions only [#10190](https://github.com/besu-eth/besu/pull/10190)
4445
- `--net-restrict` now supports IPv6 CIDR notation (e.g. `fd00::/64`) in addition to IPv4, enabling subnet-based peer filtering in IPv6 and dual-stack deployments [#10028](https://github.com/besu-eth/besu/pull/10028)
4546
- Stop EngineQosTimer as part of shutdown [#9903](https://github.com/hyperledger/besu/pull/9903)
4647
- Add `--max-blobs-per-transaction` CLI option to configure the maximum number of blobs per transaction [#9912](https://github.com/hyperledger/besu/pull/9912)

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
import org.awaitility.Awaitility;
6363
import org.junit.jupiter.api.AfterEach;
6464
import org.junit.jupiter.api.BeforeEach;
65-
import org.junit.jupiter.api.Test;
6665
import org.junit.jupiter.api.TestInfo;
6766
import org.junit.jupiter.api.extension.ExtendWith;
6867
import org.slf4j.Logger;
@@ -210,11 +209,4 @@ protected void waitForFile(final Path path) {
210209
}
211210
});
212211
}
213-
214-
@Test
215-
public void dryRunDetector() {
216-
assertThat(true)
217-
.withFailMessage("This test is here so gradle --dry-run executes this class")
218-
.isTrue();
219-
}
220212
}

acceptance-tests/tests/src/acceptanceTest/java/org/hyperledger/besu/tests/acceptance/jsonrpc/AbstractJsonRpcTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import okhttp3.Request;
4141
import okhttp3.RequestBody;
4242
import okhttp3.Response;
43-
import org.junit.jupiter.api.Test;
4443
import org.junit.jupiter.params.ParameterizedTest;
4544
import org.junit.jupiter.params.provider.Arguments;
4645
import org.junit.jupiter.params.provider.MethodSource;
@@ -148,11 +147,4 @@ public static Stream<Arguments> testCasesFromPath(final String testCasesPath)
148147

149148
return Arrays.stream(testCasesList).sorted().map(File::toURI).map(Arguments::of);
150149
}
151-
152-
@Test
153-
void dryRunDetector() {
154-
assertThat(true)
155-
.withFailMessage("This test is here so gradle --dry-run executes this class")
156-
.isTrue();
157-
}
158150
}

acceptance-tests/tests/src/acceptanceTest/resources/jsonrpc/engine/paris/test-cases/08_unknown_payload.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"jsonrpc": "2.0",
1212
"id": 67,
1313
"error": {
14-
"code": -32001,
15-
"message": "Payload does not exist / is not available"
14+
"code": -38001,
15+
"message": "Unknown payload"
1616
}
1717
},
1818
"statusCode": 200

app/src/main/java/org/hyperledger/besu/RunnerBuilder.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.pending.PendingTransactionDroppedSubscriptionService;
6262
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.pending.PendingTransactionSubscriptionService;
6363
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.syncing.SyncingSubscriptionService;
64+
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.subscription.transactionreceipts.TransactionReceiptsSubscriptionService;
6465
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
6566
import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator;
6667
import org.hyperledger.besu.ethereum.chain.Blockchain;
@@ -934,6 +935,9 @@ public Runner build() {
934935
context.getBlockchain(), blockchainQueries, subscriptionManager);
935936

936937
createSyncingSubscriptionService(synchronizer, subscriptionManager);
938+
939+
createTransactionReceiptsSubscriptionService(
940+
context.getBlockchain(), blockchainQueries, subscriptionManager, protocolSchedule);
937941
}
938942

939943
Optional<EngineJsonRpcService> engineJsonRpcService = Optional.empty();
@@ -1436,6 +1440,18 @@ private void createNewBlockHeadersSubscriptionService(
14361440
blockchain.observeBlockAdded(newBlockHeadersSubscriptionService);
14371441
}
14381442

1443+
private void createTransactionReceiptsSubscriptionService(
1444+
final Blockchain blockchain,
1445+
final BlockchainQueries blockchainQueries,
1446+
final SubscriptionManager subscriptionManager,
1447+
final ProtocolSchedule protocolSchedule) {
1448+
final TransactionReceiptsSubscriptionService transactionReceiptsSubscriptionService =
1449+
new TransactionReceiptsSubscriptionService(
1450+
subscriptionManager, blockchainQueries, protocolSchedule);
1451+
1452+
blockchain.observeBlockAdded(transactionReceiptsSubscriptionService);
1453+
}
1454+
14391455
private WebSocketService createWebsocketService(
14401456
final Vertx vertx,
14411457
final WebSocketConfiguration configuration,

app/src/main/java/org/hyperledger/besu/cli/BesuCommand.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,7 +1917,10 @@ private void configure() throws Exception {
19171917

19181918
jsonRpcConfiguration =
19191919
jsonRpcHttpOptions.jsonRpcConfiguration(
1920-
hostsAllowlist, p2PDiscoveryConfig.p2pHost(), unstableRPCOptions.getHttpTimeoutSec());
1920+
hostsAllowlist,
1921+
p2PDiscoveryConfig.p2pHost(),
1922+
unstableRPCOptions.getHttpTimeoutSec(),
1923+
unstableRPCOptions.getHttpStreamingTimeoutSec());
19211924
logger.info("RPC HTTP JSON-RPC config: {}", jsonRpcConfiguration);
19221925
if (isEngineApiEnabled()) {
19231926
engineJsonRpcConfiguration = createEngineJsonRpcConfiguration();
@@ -2086,7 +2089,8 @@ private JsonRpcConfiguration createEngineJsonRpcConfiguration() {
20862089
jsonRpcHttpOptions.jsonRpcConfiguration(
20872090
engineRPCConfig.engineHostsAllowlist(),
20882091
p2PDiscoveryConfig.p2pHost(),
2089-
unstableRPCOptions.getHttpTimeoutSec());
2092+
unstableRPCOptions.getHttpTimeoutSec(),
2093+
unstableRPCOptions.getHttpStreamingTimeoutSec());
20902094
engineConfig.setPort(engineRPCConfig.engineRpcPort());
20912095
engineConfig.setRpcApis(Arrays.asList("ENGINE", "ETH"));
20922096
engineConfig.setEnabled(isEngineApiEnabled());

app/src/main/java/org/hyperledger/besu/cli/options/JsonRpcHttpOptions.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,17 +302,22 @@ public JsonRpcConfiguration jsonRpcConfiguration() {
302302
* @param hostsAllowlist List of hosts allowed
303303
* @param defaultHostAddress Default host address
304304
* @param timeoutSec timeout in seconds
305+
* @param streamingTimeoutSec timeout in seconds for streaming methods
305306
* @return A JsonRpcConfiguration instance
306307
*/
307308
public JsonRpcConfiguration jsonRpcConfiguration(
308-
final List<String> hostsAllowlist, final String defaultHostAddress, final Long timeoutSec) {
309+
final List<String> hostsAllowlist,
310+
final String defaultHostAddress,
311+
final Long timeoutSec,
312+
final Long streamingTimeoutSec) {
309313

310314
final JsonRpcConfiguration jsonRpcConfiguration = this.jsonRpcConfiguration();
311315

312316
jsonRpcConfiguration.setHost(
313317
Strings.isNullOrEmpty(rpcHttpHost) ? defaultHostAddress : rpcHttpHost);
314318
jsonRpcConfiguration.setHostsAllowlist(hostsAllowlist);
315319
jsonRpcConfiguration.setHttpTimeoutSec(timeoutSec);
320+
jsonRpcConfiguration.setHttpStreamingTimeoutSec(streamingTimeoutSec);
316321
return jsonRpcConfiguration;
317322
}
318323

app/src/main/java/org/hyperledger/besu/cli/options/RPCOptions.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package org.hyperledger.besu.cli.options;
1616

1717
import org.hyperledger.besu.ethereum.api.handlers.TimeoutOptions;
18+
import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration;
1819

1920
import picocli.CommandLine;
2021

@@ -27,6 +28,14 @@ public class RPCOptions {
2728
description = "HTTP timeout in seconds (default: ${DEFAULT-VALUE})")
2829
private final Long httpTimeoutSec = TimeoutOptions.defaultOptions().getTimeoutSeconds();
2930

31+
@CommandLine.Option(
32+
hidden = true,
33+
names = {"--Xhttp-streaming-timeout-seconds"},
34+
description =
35+
"HTTP timeout in seconds for streaming methods like debug_traceBlock (default: ${DEFAULT-VALUE})")
36+
private final Long httpStreamingTimeoutSec =
37+
JsonRpcConfiguration.DEFAULT_HTTP_STREAMING_TIMEOUT_SEC;
38+
3039
@CommandLine.Option(
3140
hidden = true,
3241
names = {"--Xws-timeout-seconds"},
@@ -54,6 +63,15 @@ public Long getHttpTimeoutSec() {
5463
return httpTimeoutSec;
5564
}
5665

66+
/**
67+
* Gets http streaming timeout sec.
68+
*
69+
* @return the http streaming timeout sec
70+
*/
71+
public Long getHttpStreamingTimeoutSec() {
72+
return httpStreamingTimeoutSec;
73+
}
74+
5775
/**
5876
* Gets WebSocket timeout sec.
5977
*

app/src/test/java/org/hyperledger/besu/ForkIdsNetworkConfigTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949

5050
import com.google.common.collect.Streams;
5151
import org.apache.tuweni.bytes.Bytes;
52-
import org.junit.jupiter.api.Test;
5352
import org.junit.jupiter.api.extension.ExtendWith;
5453
import org.junit.jupiter.params.ParameterizedTest;
5554
import org.junit.jupiter.params.provider.MethodSource;
@@ -207,11 +206,4 @@ public Stream<Long> streamMilestoneBlocks() {
207206
MilestoneStreamingProtocolSchedule::streamMilestoneBlocks);
208207
}
209208
}
210-
211-
@Test
212-
void dryRunDetector() {
213-
assertThat(true)
214-
.withFailMessage("This test is here so gradle --dry-run executes this class")
215-
.isTrue();
216-
}
217209
}

0 commit comments

Comments
 (0)