Skip to content

RPC HTTP timeout - override value to be used for engine API#9170

Merged
macfarla merged 11 commits into
besu-eth:mainfrom
macfarla:http-timeout
Sep 26, 2025
Merged

RPC HTTP timeout - override value to be used for engine API#9170
macfarla merged 11 commits into
besu-eth:mainfrom
macfarla:http-timeout

Conversation

@macfarla
Copy link
Copy Markdown
Contributor

@macfarla macfarla commented Sep 11, 2025

Signed-off-by: Sally MacFarlane macfarla.github@gmail.com

PR description

  • fixed bug where Engine RPC config was using WS config value not HTTP
  • log rpc config at startup time
  • log timeout ms at time of timeout
  • refactor rpc timeout test so we're not testing the default
  • rename timout to timeout

see example output from starting besu - user specified 42 is used for RPC HTTP and Engine RPC

besu --Xhttp-timeout-seconds=42
...
2025-09-11 15:26:15.782+1000 | main | INFO  | Besu | RPC HTTP JSON-RPC config: JsonRpcConfiguration{enabled=false, port=8545, host=127.0.0.1, corsAllowedDomains=[], hostsAllowlist=[localhost, 127.0.0.1], rpcApis=[ETH, NET, WEB3], authenticationEnabled=false, authenticationCredentialsFile=null, authenticationPublicKeyFile=null, tlsConfiguration=Optional.empty, httpTimeoutSec=42, maxActiveConnections=80, maxBatchSize=1024}
2025-09-11 15:26:15.783+1000 | main | WARN  | Besu | Engine API authentication enabled without key file. Expect ephemeral jwt.hex file in datadir
2025-09-11 15:26:15.783+1000 | main | INFO  | Besu | Engine JSON-RPC config: JsonRpcConfiguration{enabled=true, port=8551, host=127.0.0.1, corsAllowedDomains=[], hostsAllowlist=[localhost, 127.0.0.1], rpcApis=[ENGINE, ETH], authenticationEnabled=true, authenticationCredentialsFile=null, authenticationPublicKeyFile=null, tlsConfiguration=Optional.empty, httpTimeoutSec=42, maxActiveConnections=80, maxBatchSize=1024}

Fixed Issue(s)

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • spotless: ./gradlew spotlessApply
  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests
  • hive tests: Engine or other RPCs modified?

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
@macfarla macfarla changed the title RPC HTTP timeout - improve visibility RPC HTTP timeout - override value to be used for engine API Sep 11, 2025
Copy link
Copy Markdown
Contributor

@Matilda-Clerke Matilda-Clerke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just the one question about the changelog

@@ -1,2 +1,2 @@
Xplugin-rocksdb-high-spec-enabled=true
Xbonsai-parallel-tx-processing-enabled=true No newline at end of file
bonsai-parallel-tx-processing-enabled=true No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth adding a changelog entry for this change?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't be any functional impact, just preparing for deprecation -> removal

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that is kinda unrelated to this PR but should be zero impact, just tidying up

@macfarla
Copy link
Copy Markdown
Contributor Author

macfarla commented Sep 12, 2025

besu with default settings ie 30s timeout - this call succeeds that takes 1.870s

2025-09-12 10:22:59.904+1000 | vert.x-worker-thread-0 | INFO  | AbstractEngineNewPayload | Imported #1  (cbc0a.....7fcfa)|    1 tx|  0 ws|  0 blobs|      7 wei bfee| 150,000,000 (  0.0%) gas used| 1.870s exec|  80.21 Mgas/s|  0 peers

you can see timeout occur if timeout is reduced to 1s

besu --Xhttp-timeout-seconds=1
...

2025-09-12 11:22:11.922+1000 | main | INFO  | Besu | RPC HTTP JSON-RPC config: JsonRpcConfiguration{enabled=true, port=8545, host=127.0.0.1, corsAllowedDomains=[], hostsAllowlist=[localhost, 127.0.0.1], rpcApis=[ETH, DEBUG], authenticationEnabled=false, authenticationCredentialsFile=null, authenticationPublicKeyFile=null, tlsConfiguration=Optional.empty, httpTimeoutSec=1, maxActiveConnections=80, maxBatchSize=1024}
2025-09-12 11:22:11.923+1000 | main | INFO  | Besu | Engine JSON-RPC config: JsonRpcConfiguration{enabled=true, port=8551, host=127.0.0.1, corsAllowedDomains=[], hostsAllowlist=[localhost, 127.0.0.1], rpcApis=[ENGINE, ETH], authenticationEnabled=false, authenticationCredentialsFile=null, authenticationPublicKeyFile=null, tlsConfiguration=Optional.empty, httpTimeoutSec=1, maxActiveConnections=80, maxBatchSize=1024}

2025-09-12 11:22:26.329+1000 | vert.x-eventloop-thread-1 | ERROR | RoutingContext | Unhandled exception in router
2025-09-12 11:22:26.331+1000 | vert.x-eventloop-thread-1 | ERROR | JsonRpcExecutorHandler | Timeout (1000 ms) occurred in JSON-RPC executor for method {"jsonrpc":"2.0","id":1,"method":"engine_newPayloadV4","params":[{"parentHash":"0x9e51f4538c29aa411f9c9f77cc7b2b7935fecfaf1481821a45e7fbba8a5dd22b","feeRecipient":"0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba","stateRoot":"0x5ca68134d6b26fcacf19cb923886dd4fe0c404e120c82c6aea8f6c16293faf39","receiptsRoot":"0x9764a9b29133339b51f219a18d3bc2b617ce983cb602f95df5647fa4d7362828","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","blockNumber":"0x1","gasLimit":"0xe8d4a51000","gasUsed":"0x5f5e100","timestamp":"0x3e8","extraData":"0x00","prevRandao":"0x0000000000000000000000000000000000000000000000000000000000000000","baseFeePerGas":"0x7","blobGasUsed":"0x0","excessBlobGas":"0x0","blockHash":"0xc71e425ded141a632434f29eaf5879dbd2248610c7f09b06c9a2d80b3b16645e","transactions":["0xf8a2800a8405f5e1009467a80dc067c3e3bad14a6c135508350f5903ec8180b8400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000125a0fd6daac7db81c5f43384e794dfd592c7cb36a31e67f4ce08aee06e151012de91a04b66b5b39c5698250eb8fb7ba3326a60b05f7c48cf61caba282dae83fae124b6"],"withdrawals":[]},[],"0x0000000000000000000000000000000000000000000000000000000000000000",[]]}
2025-09-12 11:22:26.728+1000 | vert.x-worker-thread-0 | INFO  | AbstractEngineNewPayload | Imported #1  (c71e4.....6645e)|    1 tx|  0 ws|  0 blobs|      7 wei bfee| 100,000,000 (  0.0%) gas used| 1.399s exec|  71.48 Mgas/s|  0 peers
2025-09-12 11:22:26.729+1000 | vert.x-worker-thread-1 | ERROR | JsonRpcExecutorHandler | Unhandled exception in JSON-RPC executor for method {"jsonrpc":"2.0","id":1,"method":"engine_newPayloadV4","params":[{"parentHash":"0x9e51f4538c29aa411f9c9f77cc7b2b7935fecfaf1481821a45e7fbba8a5dd22b","feeRecipient":"0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba","stateRoot":"0x5ca68134d6b26fcacf19cb923886dd4fe0c404e120c82c6aea8f6c16293faf39","receiptsRoot":"0x9764a9b29133339b51f219a18d3bc2b617ce983cb602f95df5647fa4d7362828","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","blockNumber":"0x1","gasLimit":"0xe8d4a51000","gasUsed":"0x5f5e100","timestamp":"0x3e8","extraData":"0x00","prevRandao":"0x0000000000000000000000000000000000000000000000000000000000000000","baseFeePerGas":"0x7","blobGasUsed":"0x0","excessBlobGas":"0x0","blockHash":"0xc71e425ded141a632434f29eaf5879dbd2248610c7f09b06c9a2d80b3b16645e","transactions":["0xf8a2800a8405f5e1009467a80dc067c3e3bad14a6c135508350f5903ec8180b8400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000125a0fd6daac7db81c5f43384e794dfd592c7cb36a31e67f4ce08aee06e151012de91a04b66b5b39c5698250eb8fb7ba3326a60b05f7c48cf61caba282dae83fae124b6"],"withdrawals":[]},[],"0x0000000000000000000000000000000000000000000000000000000000000000",[]]}
java.lang.IllegalStateException: Response head already sent
	at io.vertx.core.http.impl.Http1xServerResponse.checkHeadWritten(Http1xServerResponse.java:722)
	at io.vertx.core.http.impl.Http1xServerResponse.setStatusCode(Http1xServerResponse.java:151)
	at org.hyperledger.besu.ethereum.api.handlers.JsonRpcObjectExecutor.handleJsonObjectResponse(JsonRpcObjectExecutor.java:72)
	at org.hyperledger.besu.ethereum.api.handlers.JsonRpcObjectExecutor.execute(JsonRpcObjectExecutor.java:58)
	at org.hyperledger.besu.ethereum.api.handlers.JsonRpcExecutorHandler.lambda$handler$1(JsonRpcExecutorHandler.java:65)
	at java.base/java.util.Optional.ifPresentOrElse(Optional.java:196)
	at org.hyperledger.besu.ethereum.api.handlers.JsonRpcExecutorHandler.lambda$handler$3(JsonRpcExecutorHandler.java:62)
	at io.vertx.ext.web.impl.BlockingHandlerDecorator.lambda$handle$0(BlockingHandlerDecorator.java:48)
	at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$5(ContextImpl.java:205)
	at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:270)
	at io.vertx.core.impl.ContextImpl$1.execute(ContextImpl.java:221)
	at io.vertx.core.impl.WorkerTask.run(WorkerTask.java:56)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1570)

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
@macfarla
Copy link
Copy Markdown
Contributor Author

improved readability of error logging with latest commit

2025-09-12 13:59:45.117+1000 | main | INFO  | Runner | Ethereum main loop is up.
2025-09-12 13:59:52.985+1000 | vert.x-worker-thread-0 | INFO  | AbstractEngineNewPayload | Imported #1  (42a6f.....4f05a)|    1 tx|  0 ws|  0 blobs|      7 wei bfee|  45,000,000 (  0.0%) gas used| 0.736s exec|  61.14 Mgas/s|  0 peers
2025-09-12 14:00:00.711+1000 | vert.x-eventloop-thread-1 | ERROR | RoutingContext | Unhandled exception in router
2025-09-12 14:00:00.713+1000 | vert.x-eventloop-thread-1 | ERROR | JsonRpcExecutorHandler | Timeout (1000 ms) occurred for method {"jsonrpc":"2.0","id":1,"method":"engine_newPayloadV4","params":[{"parentHash":"0x9e51f4538c29aa411f9c9f77cc7b2b7935fecfaf148182...
2025-09-12 14:00:01.678+1000 | vert.x-worker-thread-0 | INFO  | AbstractEngineNewPayload | Imported #1  (cbc0a.....7fcfa)|    1 tx|  0 ws|  0 blobs|      7 wei bfee| 150,000,000 (  0.0%) gas used| 1.967s exec|  76.26 Mgas/s|  0 peers
2025-09-12 14:00:13.280+1000 | vert.x-eventloop-thread-1 | ERROR | RoutingContext | Unhandled exception in router
2025-09-12 14:00:13.281+1000 | vert.x-eventloop-thread-1 | ERROR | JsonRpcExecutorHandler | Timeout (1000 ms) occurred for method {"jsonrpc":"2.0","id":1,"method":"engine_newPayloadV4","params":[{"parentHash":"0x9e51f4538c29aa411f9c9f77cc7b2b7935fecfaf148182...
2025-09-12 14:00:13.537+1000 | vert.x-worker-thread-0 | INFO  | AbstractEngineNewPayload | Imported #1  (c71e4.....6645e)|    1 tx|  0 ws|  0 blobs|      7 wei bfee| 100,000,000 (  0.0%) gas used| 1.256s exec|  79.62 Mgas/s|  0 peers
2025-09-12 14:04:12.277+1000 | vert.x-eventloop-thread-4 | WARN  | EngineQosTimer | Execution engine not called in 120 seconds, consensus client may not be connected

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
@macfarla
Copy link
Copy Markdown
Contributor Author

extend to 1024 chars of the request at error; print entire request at TRACE

2025-09-12 16:13:17.049+1000 | vert.x-eventloop-thread-1 | ERROR | JsonRpcExecutorHandler | Timeout (1000 ms) occurred in JSON-RPC executor for method {"jsonrpc":"2.0","id":1,"method":"engine_newPayloadV4","params":[{"parentHash":"0x9e51f4538c29aa411f9c9f77cc7b2b7935fecfaf1481821a45e7fbba8a5dd22b","feeRecipient":"0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba","stateRoot":"0x1116f88be2747a8d12b878255a630a08d366573a78dea9ebae473d2c4922f796","receiptsRoot":"0x4999064e3026d4d95acad703b602529a9e17cd036aaa4608a966124bbee51b3b","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","blockNumber":"0x1","gasLimit":"0xe8d4a51000","gasUsed":"0x8f0d180","timestamp":"0x3e8","extraData":"0x00","prevRandao":"0...

@macfarla macfarla enabled auto-merge (squash) September 26, 2025 00:18
@macfarla macfarla merged commit 4b94eac into besu-eth:main Sep 26, 2025
46 checks passed
@macfarla macfarla deleted the http-timeout branch September 26, 2025 04:53
AliZDev-v0 pushed a commit to AliZDev-v0/besu that referenced this pull request Oct 5, 2025
…#9170)

* log the timeout ms
* test with non-default value
* http timeout not ws timeout
* full request in trace log

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Ali Zhagparov <alijakparov.kz@gmail.com>
jflo pushed a commit to jflo/besu that referenced this pull request Oct 13, 2025
…#9170)

* log the timeout ms
* test with non-default value
* http timeout not ws timeout
* full request in trace log

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: jflo <justin+github@florentine.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants