Conversation
Reth resolves `"pending"` as `head + 1` for log queries, silently returning `[]` rather than an error. Arc hides all pending-block state for public RPC nodes, so surface this as an explicit Invalid Params error instead of an empty array that misleads callers into thinking no logs exist at the current head. Fixes circlefin#426
osr21
requested review from
ZhiyuCircle,
ancazamfir,
romac and
sergio-mena
as code owners
September 17, 2026 21:56
Contributor
|
Contributor
|
Hi @osr21, Thank you for your interest in contributing to Arc Node. This PR has been automatically closed because you are not assigned to issue #426. We require contributors to be explicitly assigned to an issue before submitting a PR. To contribute properly:
Please see our CONTRIBUTING.md for more details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Closes #426.
When
eth_getLogsis called with"fromBlock": "pending"or"toBlock": "pending", Reth resolves"pending"ashead + 1and returns an empty array[]. Arc intentionally hides all pending-block state for public RPC nodes, so returning[]silently misleads callers into thinking no logs exist at the current head.Solution
Add a
pending_logs_errorguard inNoPendingTransactionsRpcMiddleware::intercept_or_forwardthat detects"pending"tags ineth_getLogsfilter params and returns a-32602 Invalid paramserror:This is consistent with how the middleware handles other pending-block RPCs — rejecting with a structured error rather than returning a misleading empty or null result.
Changes
crates/evm-node/src/rpc_middleware.rsETH_GET_LOGS_METHODandPENDING_LOGS_ERROR_CODEconstantspending_logs_error()helper that parses filter params and checks for pending tags (positional and object-form)intercept_or_forward, returning an error before the null-response pathTesting
Existing middleware unit tests cover the
intercept_or_forwarddispatch path. A targeted test for the new guard should be added in a follow-up (the in-module test harness does not yet exerciseeth_getLogsparams).