fix: bound rpc genvm calls and health scans#1648
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR adds two control mechanisms: a reusable admission-control context manager that gates GenVM concurrency across JSON-RPC endpoints with -32006 rejection when overloaded, and a cooldown-based suppression mechanism for expensive consensus "no-progress" scans when they time out. ChangesGenVM Admission Control
Health Check Cooldown Suppression
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
9c2bfdc to
592278c
Compare
|
|
🎉 This PR is included in version 0.120.18 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |



Summary
gen_call,sim_call, and GenVM-backedeth_callbehind shared RPC admission control so busy pods reject excess work before opening validator snapshots or contract snapshots.eth_callsnapshot debug print.Incident Fit
Prod showed JSON-RPC pool exhaustion and repeated no-progress scan timeouts while GenVM remained locally healthy. This keeps GenVM-backed reads from queueing unlimited DB/GenVM work in the API process and prevents a timed-out health scan from compounding the pressure.
Tests
/Users/edgars/Dev/genlayer-studio/.venv/bin/python -m py_compile backend/protocol_rpc/endpoints.py backend/protocol_rpc/health.py tests/unit/test_rpc_genvm_admission.py tests/db-sqlalchemy/test_health_orphan_detection.py/Users/edgars/Dev/genlayer-studio/.venv/bin/python -m pytest tests/unit/test_rpc_genvm_admission.py tests/unit/test_contract_not_found_handling.py tests/unit/test_call_interceptor.py/Users/edgars/Dev/genlayer-studio/.venv/bin/python -m pytest tests/db-sqlalchemy/test_health_orphan_detection.py -k 'no_progress_scan_error or no_progress_scan_timeout'blocked locally becausePOSTGRES_URLis not set.Summary by CodeRabbit