fix(dapi): bound path element queries#4153
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughPath-elements validation is added at the gRPC and query layers, covering request versions, path/key counts, and byte budgets. The Platform method retains cached Drive dispatch through a custom implementation. Platform and Core gRPC decoding limits are separated. ChangesPath Elements Guardrails
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
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 |
|
🕓 Ready for review — 31 ahead in queue (commit ad46a85) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v4.1-dev #4153 +/- ##
=============================================
+ Coverage 65.42% 87.46% +22.03%
=============================================
Files 26 2651 +2625
Lines 2707 334731 +332024
=============================================
+ Hits 1771 292756 +290985
- Misses 936 41975 +41039
🚀 New features to boost your workflow:
|
… budgets The transport cap and the getPathElements aggregate budget were both 64 KiB, but they measure different things: the cap bounds the *encoded* protobuf message while MAX_PATH_QUERY_BYTES bounds the *raw* component bytes. A maximal in-budget path query encodes to ~65 KiB (per-component tag/length overhead plus message wrappers), so tonic rejected it at the transport before validate_path_elements_request ever ran — making the documented budget unreachable end-to-end and replacing the precise RESOURCE_EXHAUSTED messages with tonic's generic decode-limit status. Raise the transport cap to 128 KiB so it stays a coarse DoS backstop (still 512x tighter than the previous 64 MiB) while the app-layer validators remain the precise gate, and document the composition requirement next to the constant. Broadcast state transitions stay far below either bound (max_state_transition_size = 20 KiB). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts: # packages/rs-drive-abci/src/query/service.rs
Issue being fixed or feature implemented
Keeps public Platform queries within explicit request and diagnostic-work budgets. Covers internal review items 118, 311, 312, and 313.
What was done?
How Has This Been Tested?
Breaking Changes
None for valid Platform requests.
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes