Repository navigation
fix(drive-abci): bound CheckTx verification work - #4164
Conversation
|
Warning Review limit reached
Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (17)
✨ Finishing Touches🧪 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 |
|
✅ Final review complete — no blockers (commit f7a8843) |
thepastaclaw
left a comment
There was a problem hiding this comment.
Preliminary review — Codex only
Verified the full PR delta at exact head 0d5219e. The limiter correctly protects the shielded proofs routed through validate_shielded_proof, and the focused tests pass, but ShieldFromAssetLock still performs Halo2 verification before the permit and CheckTx discards its penalty action on failure. This leaves a repeatable CPU-exhaustion path, so changes are required; two non-blocking regression-test gaps are also noted.
Validated blockers were found in the Codex precheck. Sonnet is deferred until a fresh Codex revalidation clears the blocker gate.
Review provenance
- Codex reviewers:
gpt-5.6-sol— general (failed),gpt-5.6-sol— security-auditor (failed),gpt-5.6-sol— rust-quality (failed),gpt-5.6-sol— general (failed),gpt-5.6-sol— security-auditor (failed),gpt-5.6-sol— rust-quality (failed),gpt-5.6-sol— general (failed),gpt-5.6-sol— security-auditor (failed),gpt-5.6-sol— rust-quality (failed),gpt-5.6-sol— general (failed),gpt-5.6-sol— security-auditor (failed),gpt-5.6-sol— rust-quality (failed),gpt-5.6-sol— general (failed),gpt-5.6-sol— security-auditor (failed),gpt-5.6-sol— rust-quality (failed),gpt-5.6-sol— general (failed),gpt-5.6-sol— security-auditor (failed),gpt-5.6-sol— rust-quality (failed),gpt-5.6-sol— general (completed),gpt-5.6-sol— security-auditor (completed),gpt-5.6-sol— rust-quality (completed) - Verifier:
gpt-5.6-sol— verifier - Sonnet: not run (deferred by blocker gate)
🔴 1 blocking | 🟡 2 suggestion(s)
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `packages/rs-drive-abci/src/execution/validation/state_transition/check_tx_verification/v0/mod.rs`:
- [BLOCKING] packages/rs-drive-abci/src/execution/validation/state_transition/check_tx_verification/v0/mod.rs:331-337: ShieldFromAssetLock bypasses the CheckTx proof-verification budget
The permit is conditional on has_shielded_proof_validation(), which explicitly excludes ShieldFromAssetLock. That transition's earlier transform_into_action call instead invokes reconstruct_and_verify_bundle directly at shield_from_asset_lock/transform_into_action/v0/mod.rs:298. A bad proof returns a PartiallyUseAssetLockAction together with a consensus error, but this CheckTx path converts the result to errors only at lines 318-323, and check_tx_v0 rejects it without executing or persisting the penalty action. The asset-lock owner can therefore mutate a canonical proof, re-sign each transition, and repeatedly run Halo2 verification against the same funded lock outside the new action-weighted limit. Acquire the CheckTx permit around ShieldFromAssetLock proof verification after its cheap asset-lock and state admission checks, while preserving the transformer's penalty action for proposal and block processing, and add a regression test covering this path.
In `packages/rs-drive-abci/src/platform_types/check_tx_proof_verifier.rs`:
- [SUGGESTION] packages/rs-drive-abci/src/platform_types/check_tx_proof_verifier.rs:87-98: Exercise the limiter under concurrent contention
The current test acquires permits sequentially and never sends competing callers through the compare-exchange retry path. Add a barrier-based multithreaded test that holds admitted permits, records the maximum simultaneous weight, verifies it never exceeds the configured limit, and confirms all capacity is released afterward. This directly protects the concurrency property the limiter was introduced to enforce.
In `packages/rs-drive-abci/src/abci/handler/check_tx.rs`:
- [SUGGESTION] packages/rs-drive-abci/src/abci/handler/check_tx.rs:150-156: Cover backpressure through the complete CheckTx error path
Retryable backpressure depends on the validator producing CheckTxProofVerificationBusy, this handler propagating it instead of converting it into an in-band ABCI response, and the application mapping it to tonic ResourceExhausted. Existing tests cover the validator and status mapper independently, so removing this special case would still leave them green. Add a handler/application-level test that occupies the permit, submits a state-admissible shielded transition, and asserts the resulting tonic status is ResourceExhausted.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v4.1-dev #4164 +/- ##
============================================
+ Coverage 87.43% 87.45% +0.02%
============================================
Files 2646 2649 +3
Lines 333981 334578 +597
============================================
+ Hits 292023 292616 +593
- Misses 41958 41962 +4
🚀 New features to boost your workflow:
|
Summary
Addresses security review findings DS-CAND-207 through DS-CAND-211.
Verification
cargo test -p drive-abci --lib check_tx_verification -- --nocapturecargo clippy -p drive-abci --lib --no-deps -- -D warningscargo fmt --all -- --checkgit diff --check