rpc: validate log query limit when creating filters - #23598
Conversation
There was a problem hiding this comment.
Pull request overview
Adds early rpc.logs.querylimit validation to eth_newFilter, aligning it with eth_getLogs.
Changes:
- Shares log-query limit validation across RPC methods.
- Adds focused validation tests and repairs the concurrency regression test.
- Updates CLI documentation and changelog.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
rpc/jsonrpc/eth_receipts.go |
Extracts shared query-limit validation. |
rpc/jsonrpc/eth_filters.go |
Validates criteria before filter creation. |
rpc/jsonrpc/eth_filters_test.go |
Tests rejection and restores valid concurrency coverage. |
cmd/utils/flags.go |
Updates flag help text. |
docs/site/docs/fundamentals/configuring-erigon.mdx |
Documents eth_newFilter coverage. |
docs/site/static/llms-full.txt |
Updates generated documentation. |
llms-full.txt |
Updates consolidated documentation. |
ChangeLog.md |
Records the breaking behavior change. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
taratorio
left a comment
There was a problem hiding this comment.
this change is not necessary
|
the reason I didn't make this change in my PR is because AI is wrong to suggest that |
|
furthermore for subscriptions (i.e. |
Follow-up to #23296.
Summary
eth_newFiltercriteria that exceedrpc.logs.querylimitbefore creating the filtereth_newFilterandeth_getLogseth_getLogsquery-limit criteria before opening a database transactionTDD
Red:
TestNewFilterAppliesLogQueryLimitAtCreationfailed because both address and topic-alternative cases returned a filter ID without an error.Green:
eth_newFilternow performs the same static topic-position and query-limit validation before subscribing, and the regression test passes.Red:
TestGetLogsAppliesLogQueryLimitBeforeOpeningTransactionpanicked atBeginTemporalRobecause query-limit validation happened after database access.Green:
eth_getLogsnow validates the query limit before opening the transaction, and the regression test passes without a database.The concurrent subscribe/unsubscribe test correction is mechanical: #23296 made its ten-position criteria invalid, so the test stopped creating subscriptions. No production behavior change was needed for that item.