Conversation
Reth resolves "pending" as head+1 for log queries and returns [] rather than coercing to "latest". Arc intentionally hides all pending-block state for public nodes, so surface this as an explicit -32602 Invalid params error instead of silently returning [], which makes callers think no logs exist at the current head. Changes: - Add ETH_GET_LOGS_METHOD and PENDING_LOGS_ERROR_CODE constants - Add pending_logs_error() that parses filter params for pending fromBlock/toBlock (positional and object-form; case-insensitive; decoupled from Alloy proc-macro names) - Wire into intercept_or_forward before the null-response path Fixes circlefin#426
osr21
requested review from
ZhiyuCircle,
ancazamfir,
romac and
sergio-mena
as code owners
September 17, 2026 22:17
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 already 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()that parses filter params forpendingfromBlock/toBlock(positional and object-form; case-insensitive; decoupled from Alloy proc-macro field names)intercept_or_forwardbefore the null-response pathTesting
Existing middleware unit tests cover the
intercept_or_forwarddispatch path. A targeted test for the new guard can be added as a follow-up using the in-moduleMockRpcServiceharness.