Skip to content

fix(dapi): validate bounded request payloads#4152

Merged
QuantumExplorer merged 2 commits into
v4.1-devfrom
codex/fix-dapi-input-bounds
Jul 22, 2026
Merged

fix(dapi): validate bounded request payloads#4152
QuantumExplorer merged 2 commits into
v4.1-devfrom
codex/fix-dapi-input-bounds

Conversation

@QuantumExplorer

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

Rejects semantically invalid public payloads before representation expansion or backend work. Covers internal review items 003, 004, 170, and 171.

What was done?

  • Applied the active platform state-transition size limit before hashing and encoding.
  • Enforced exact-width state-transition and Core block hashes before subscriptions or RPC work.
  • Removed an avoidable broadcast payload clone and a temporary hash-string allocation.
  • Added boundary regression coverage.

How Has This Been Tested?

  • Full rs-dapi unit and documentation suite: 288 tests.
  • Strict Clippy for rs-dapi across all targets.
  • Workspace formatting check.

Breaking Changes

None for valid requests.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@github-actions github-actions Bot added this to the v4.1.0 milestone Jul 20, 2026
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@QuantumExplorer, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 285df24d-61bf-487b-b8fd-86a8f240d2f9

📥 Commits

Reviewing files that changed from the base of the PR and between fc05d62 and c40644b.

📒 Files selected for processing (5)
  • packages/rs-dapi/src/services/platform_service/broadcast_state_transition.rs
  • packages/rs-dapi/src/services/platform_service/wait_for_state_transition_result.rs
  • packages/rs-dapi/src/services/streaming_service/block_header_stream.rs
  • packages/rs-dapi/src/services/streaming_service/mod.rs
  • packages/rs-dapi/src/services/streaming_service/transaction_stream.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-dapi-input-bounds

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@QuantumExplorer
QuantumExplorer marked this pull request as ready for review July 21, 2026 02:04
@thepastaclaw

thepastaclaw commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

🕓 Ready for review — 39 ahead in queue (commit c40644b)
Queue position: 40/72 · 2 reviews active
ETA: start ~05:03 UTC · complete ~05:32 UTC (median 28m across 30 recent reviews; 2 slots)
Queued 12h 33m ago · Last checked: 2026-07-22 19:40 UTC

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.49%. Comparing base (fc05d62) to head (c40644b).
⚠️ Report is 266 commits behind head on v4.1-dev.

Additional details and impacted files
@@             Coverage Diff              @@
##           v4.1-dev    #4152      +/-   ##
============================================
+ Coverage     87.43%   87.49%   +0.06%     
============================================
  Files          2646     2663      +17     
  Lines        333981   336414    +2433     
============================================
+ Hits         292023   294354    +2331     
- Misses        41958    42060     +102     
Components Coverage Δ
dpp 88.44% <ø> (-0.01%) ⬇️
drive 86.24% <ø> (+0.09%) ⬆️
drive-abci 89.55% <ø> (+0.04%) ⬆️
sdk ∅ <ø> (∅)
dapi-client ∅ <ø> (∅)
platform-version ∅ <ø> (∅)
platform-value 92.90% <ø> (+0.01%) ⬆️
platform-wallet ∅ <ø> (∅)
drive-proof-verifier 49.79% <ø> (+0.23%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Drive enforces the active version's state-transition size limit
authoritatively; the DAPI check is a static upper bound.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@QuantumExplorer QuantumExplorer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@QuantumExplorer
QuantumExplorer merged commit a6d35b8 into v4.1-dev Jul 22, 2026
19 of 21 checks passed
@QuantumExplorer
QuantumExplorer deleted the codex/fix-dapi-input-bounds branch July 22, 2026 08:21
QuantumExplorer added a commit that referenced this pull request Jul 22, 2026
Resolved rs-dapi conflicts against the payload-validation and metric-label
changes that landed on v4.1-dev (#4152, #4151): kept the shared
validate_state_transition_hash/validate_core_block_hash helpers from base
and this branch's stream/wait admission permits and history-range checks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants