Skip to content

test(rs-sdk): expect network floor in mock sdk seed test#3938

Open
thepastaclaw wants to merge 1 commit into
dashpay:v3.1-devfrom
thepastaclaw:fix/sdk-builder-floor-test
Open

test(rs-sdk): expect network floor in mock sdk seed test#3938
thepastaclaw wants to merge 1 commit into
dashpay:v3.1-devfrom
thepastaclaw:fix/sdk-builder-floor-test

Conversation

@thepastaclaw

@thepastaclaw thepastaclaw commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

Fixes #3933.

The sdk_builder_default_seeds_atomic_to_floor rs-sdk integration test
still expected the raw DEFAULT_INITIAL_PROTOCOL_VERSION, but mock SDK
construction defaults to mainnet and seeds the effective protocol floor as
max(DEFAULT_INITIAL_PROTOCOL_VERSION, mainnet network floor).

What was done?

  • Updated the test expectation to use
    DEFAULT_INITIAL_PROTOCOL_VERSION.max(PROTOCOL_VERSION_11).
  • Adjusted the nearby comment to describe the effective floor rather than only
    the initial floor.
  • Left production SDK behavior unchanged.

How Has This Been Tested?

  • cargo fmt --all
  • cargo test -p dash-sdk --all-features --test main fetch::document_query_v0_v1::sdk_builder_default_seeds_atomic_to_floor -- --exact --nocapture
  • Pre-PR code review gate: ship

Breaking Changes

None.

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

Summary by CodeRabbit

  • Tests
    • Updated protocol version handling assertions in tests to reflect updated minimum version logic.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@thepastaclaw, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 13 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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 credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ccc1459e-f996-46a9-a2b9-300d77a05913

📥 Commits

Reviewing files that changed from the base of the PR and between 985b4a5 and c565e77.

📒 Files selected for processing (1)
  • packages/rs-sdk/tests/fetch/document_query_v0_v1.rs
📝 Walkthrough

Walkthrough

The test sdk_builder_default_seeds_atomic_to_floor in the rs-sdk fetch test module adds an import of PROTOCOL_VERSION_11 and updates its assertion to expect max(DEFAULT_INITIAL_PROTOCOL_VERSION, PROTOCOL_VERSION_11) as the seeded protocol version, instead of asserting DEFAULT_INITIAL_PROTOCOL_VERSION directly.

Changes

Protocol Version Floor Test Fix

Layer / File(s) Summary
Update protocol version floor assertion
packages/rs-sdk/tests/fetch/document_query_v0_v1.rs
Adds PROTOCOL_VERSION_11 import and updates sdk_builder_default_seeds_atomic_to_floor to compute the expected protocol version as max(DEFAULT_INITIAL_PROTOCOL_VERSION, PROTOCOL_VERSION_11), matching the SDK's per-network clamping behavior for Network::Mainnet.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • dashpay/platform#3809: Altered SdkBuilder's default protocol-version seeding to DEFAULT_INITIAL_PROTOCOL_VERSION (PV10), directly connected to the floor assertion being corrected here.
  • dashpay/platform#3886: Introduced the per-network protocol-version floor/clamping logic in the SDK that causes the observed left: 11, right: 10 test failure this PR fixes.
  • dashpay/platform#3900: Refactored the core per-network protocol-version floor behavior (v11/v12 minimums) that this test now correctly accounts for.

Suggested reviewers

  • shumkov
  • QuantumExplorer

Poem

A rabbit checks the floor with care,
PV10 or 11—whichever's there!
max() picks the higher ground,
No more failing test to be found.
🐇 The assertion hops just right! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: updating test expectations to account for the network floor in the mock SDK seed test.
Linked Issues check ✅ Passed The PR directly addresses issue #3933 by updating test expectations to account for the network floor constraint using max(DEFAULT_INITIAL_PROTOCOL_VERSION, PROTOCOL_VERSION_11) as specified.
Out of Scope Changes check ✅ Passed All changes are focused solely on fixing the failing test by updating assertions and comments to reflect the network floor behavior; no unrelated modifications are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@thepastaclaw

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@thepastaclaw thepastaclaw marked this pull request as ready for review June 18, 2026 17:38
@thepastaclaw

thepastaclaw commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator Author

✅ Review complete (commit c565e77)

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Code Review

The PR is a single test-only correction in packages/rs-sdk/tests/fetch/document_query_v0_v1.rs. Source verification confirms SdkBuilder::new_mock() defaults to mainnet and build() clamps the initial protocol version to max(DEFAULT_INITIAL_PROTOCOL_VERSION, min_protocol_version(Network::Mainnet)), so expecting max(DEFAULT_INITIAL_PROTOCOL_VERSION, PROTOCOL_VERSION_11) matches the actual SDK behavior. The targeted Cargo test could not complete because the build script needed to download Tenderdash sources and network escalation was not approved.

No active findings.

Review coverage note: Claude reviewer/verifier were unavailable due the ACP Claude limit, so this used Codex general review plus Codex verifier. The verifier inspected the pinned SHA and relevant SDK floor logic. The focused Cargo test began compiling but could not complete because the build wanted to download Tenderdash sources and network escalation was not approved.

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.18%. Comparing base (a0c013f) to head (c565e77).

Additional details and impacted files
@@              Coverage Diff              @@
##           v3.1-dev    #3938       +/-   ##
=============================================
+ Coverage     52.54%   87.18%   +34.63%     
=============================================
  Files            11     2632     +2621     
  Lines          1707   327563   +325856     
=============================================
+ Hits            897   285592   +284695     
- Misses          810    41971    +41161     
Components Coverage Δ
dpp 87.70% <ø> (∅)
drive 86.14% <ø> (∅)
drive-abci 89.45% <ø> (∅)
sdk ∅ <ø> (∅)
dapi-client ∅ <ø> (∅)
platform-version ∅ <ø> (∅)
platform-value 92.20% <ø> (∅)
platform-wallet ∅ <ø> (∅)
drive-proof-verifier 49.55% <ø> (∅)
🚀 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.

@thepastaclaw

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@thepastaclaw

Copy link
Copy Markdown
Collaborator Author

Rebased on current v3.1-dev and resolved the conflict with #3900 by keeping the effective-floor assertion against INITIAL_PROTOCOL_VERSION.max(PROTOCOL_VERSION_11).\n\nValidation: cargo test -p dash-sdk --all-features --test main fetch::document_query_v0_v1::sdk_builder_default_seeds_atomic_to_floor -- --exact --nocapture.

@thepastaclaw thepastaclaw force-pushed the fix/sdk-builder-floor-test branch from 985b4a5 to c565e77 Compare June 19, 2026 13:30

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Code Review

Test-only update to rs-sdk mock SDK seed expectation: assertion now computes max(INITIAL_PROTOCOL_VERSION, PROTOCOL_VERSION_11), which equals 11 and matches the mainnet floor returned by Sdk::min_protocol_version in SdkBuilder::build(). Production SDK behavior is unchanged. Both agents found nothing in scope and CodeRabbit's rate-limited summary aligns with the change; no concrete inline findings to react to.

No active findings.

Review coverage note: specialist selector chose no additional specialists; Claude and Codex general reviewers both produced parseable outputs, verifier completed cleanly, and CodeRabbit had 0 inline findings with rate-limited summary-only context. Posted as a COMMENT review because GitHub does not allow approving my own PR.

@thepastaclaw

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@thepastaclaw

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@thepastaclaw

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

test(rs-sdk): sdk_builder_default_seeds_atomic_to_floor expects pre-floor protocol version

1 participant