perf(erpc:PLA-651): harden eth_getLogs concurrency and cache pressure#50
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b449dfac7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Automated PR ReviewReviewed commit:
HIGH1.
2. The singleflight leader's
3.
MEDIUM4. Go 1.25 has builtin
5. By line 51,
6.
7. This function gates correctness-critical coalescing behavior. Missing negative test cases: unfinalized requests must NOT coalesce, and requests with 8. Force-materialization for the async cache writer discards the error. If materialization fails, a corrupt response may be cached.
9. The comment says "Keep common/smaller methods on the current fast path" but the function forces materialization work onto the foreground.
LOW10.
11. Unlike other background goroutines in the codebase, these lack 12. Defined but never called from production code. 13.
This is an automated review by Claude. |
|
Addressed the latest automated review wave in Fixed:
|
Automated PR Re-ReviewReviewed commit:
Previously flagged issues — now FIXED
HIGH1. Comment says "It does not modify the request or short-circuit; always returns (false, nil, nil)" but line 224 returns
2. Comment says "Align first chunk start to chunkSize boundary" but the code keeps the start at
MEDIUM3. Go 1.25 has builtin
4. By line 51,
5.
6.
7.
8.
9. No direct test. A miscalculation could starve cache writes or overwhelm Postgres. Add a table-driven test. 10. Four constants (10s default, 0.75 factor, 3s floor, 25s ceiling) with no comments explaining the timeout strategy. LOW11. Exported but has zero non-test callers. 12. Error path and success path both release holder/free jrr. Could be consolidated into a single defer. 13. Can be omitted per Go idioms. This is an automated re-review by Claude. Previous review findings that were fixed are marked with strikethrough. |
|
Addressed the actionable items from the automated re-review in the latest push ( Covered there:
|
Automated PR Re-Review (v3)Reviewed commit:
Fixed since v2 review
HIGH1. Comment says "always returns (false, nil, nil)" but line 224 returns
MEDIUM2. Says "Align first chunk start to chunkSize boundary" but it's the chunk END that is aligned. The code example is correct but contradicts the summary.
3. Sets 4. Go 1.25 builtins 5.
6.
7. No direct test. Budget miscalculation could starve cache writes or overwhelm Postgres. 8. holder.Release + jrr.Free is copy-pasted for both error and success paths. Consolidate with a single LOW9.
10. The type-assertion + fallback goroutine logic has no direct test coverage. 11. The explanatory comment ("bounds recursive binary splitting... depth 16 allows up to 2^16") was removed during extraction to This is an automated re-review (v3) by Claude. Items marked "unfixed from v2" were flagged in the previous review. |
Summary
eth_getLogssubrequest fanout and dedupe identical finalized subranges across concurrent requestseth_getLogsandeth_callwith separate network runtime budgets and dedicated getLogs cache pressure guardseth_getLogscache-write cost and dedupe async state-poller refresh triggersChanges
architecture/evm/eth_getLogs.goerpc/networks.goarchitecture/evm/json_rpc_cache.goarchitecture/evm/evm_state_poller.goLinear