Skip to content

feat: support platform 4#39

Open
HashEngineering wants to merge 9 commits into
mainfrom
feat/platform-4
Open

feat: support platform 4#39
HashEngineering wants to merge 9 commits into
mainfrom
feat/platform-4

Conversation

@HashEngineering

@HashEngineering HashEngineering commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

V12 for testnet
V11 for mainnet

Summary by CodeRabbit

  • New Features
    • Updated platform SDK/mobile components to newer release versions.
    • Added async signer support and switched identity submission/top-up flows to use private-key variants.
    • Increased request payload decoding limit to 16 MB.
  • Bug Fixes
    • Fixed generated FFI bindings and Java/SWIG constructor wiring for improved compatibility.
    • Corrected platform SDK network/version selection behavior.
    • Improved wallet transaction metadata field presence handling (null vs default values).
  • Documentation
    • Refreshed README version snippets for the latest SDK artifacts.

@HashEngineering HashEngineering self-assigned this Jun 19, 2026
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

More reviews will be available in 21 minutes and 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 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 see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ccc2a45f-a273-4e46-9659-5a0bf73126a7

📥 Commits

Reviewing files that changed from the base of the PR and between 489b62d and 9094d7f.

📒 Files selected for processing (1)
  • .github/workflows/build-and-verify-alignment.yml
📝 Walkthrough

Walkthrough

Versions are bumped in Gradle, README, Rust manifests, and toolchain files. Generated FFI/JNI bindings are updated for ContestedResource and DocumentV0. platform-mobile refreshes SDK setup, signer wiring, submission calls, and matching tests.

Changes

Platform SDK 4.0.0 refresh

Layer / File(s) Summary
Version metadata and example startup
build.gradle, README.md, examples/src/main/kotlin/dashj/org/platform/PlatformExplorer.kt
Gradle and README version strings move to 4.0.0-RC2-SNAPSHOT, and PlatformExplorer switches to verbose log formatting at startup.
Crate versions and dashcore pins
dash-sdk-android/src/main/rust/Cargo.toml, dash-sdk-bindings/Cargo.toml, platform-mobile/Cargo.toml, platform-mobile/rust-toolchain.toml
Crate versions bump to 4.0.0; dashcore is re-pinned to a git revision with updated features; simple-signer enables state-transitions; platform-mobile adds Rust 1.92.
ContestedResource FFI wrapper
dash-sdk-bindings/contested-resource-value-fqn.patch
The generated ContestedResource wrapper switches to the FFI platform_value_Value type, with updated conversion methods and exported constructor and accessor signatures.
DocumentV0 SWIG constructor update
dash-sdk-java/src/main/cpp/config.h, dash-sdk-java/src/main/swig/document.i
The Java SWIG layer adds the Value alias in config.h and passes an extra nullptr through both DocumentV0 constructor paths.
SDK setup and request limits
platform-mobile/src/provider.rs, platform-mobile/src/config.rs, platform-mobile/src/sdk.rs
platform-mobile updates context and core imports, borrows core credentials as &str, sets a 16 MiB decoding limit in setup_api_with_callbacks_cache, and selects PLATFORM_V12/PLATFORM_V11 with explicit request settings in the SDK factories.
Async signer and identity submission
platform-mobile/src/put.rs
CallbackSigner becomes an async Signer<IdentityPublicKey> with sign and sign_create_witness, imports AddressWitness and SingleKeySigner, uses Network::Mainnet for non-testnet, and calls the private-key submission variants for put and top up.
Test call sites and fixtures
platform-mobile/src/voting.rs, platform-mobile/src/put_test.rs, platform-mobile/src/fetch_document.rs
put_test, voting, and fetch_document switch to SingleKeySigner and add_identity_public_key wiring, add creator_id: None and max_decoding_message_size: None in the put tests, and change the single-node fetch test evonode address.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • dashpay/kotlin-platform#38: Also changes dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt, with related protobuf-to-Kotlin field mapping logic.

Suggested reviewers

  • abaranouski

Poem

Hoppity hop, I sniff the release trail 🐰
New pins, new binds, and no old rabbits fail
Mainnet carrots and async thumps galore
I twitched my nose, then asked for one hop more
Fresh code in the burrow, tidy and bright ✨

🚥 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 matches the main change: adding support for platform 4.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/platform-4

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (2)
examples/src/main/kotlin/dashj/org/platform/PlatformExplorer.kt (1)

104-104: Consider gating verbose logging behind an opt-in flag.

At line 104, BriefLogFormatter.initVerbose() is always enabled without user control. Since args[0] is already parsed for the network parameter, consider adding an optional flag (e.g., --verbose) to gate verbose logging, allowing users to opt-in to verbose output when needed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/src/main/kotlin/dashj/org/platform/PlatformExplorer.kt` at line 104,
The BriefLogFormatter.initVerbose() call at line 104 is unconditionally enabled
without user control. Modify the command-line argument parsing logic to check
for an optional --verbose flag (similar to how args[0] is already parsed for the
network parameter), and only invoke BriefLogFormatter.initVerbose() when this
flag is explicitly provided by the user, allowing verbose logging to be opt-in
rather than always enabled.
dash-sdk-java/src/main/swig/document.i (1)

14-26: ⚡ Quick win

Stale comment does not document the new parameter.

The comment documenting the dpp_document_v0_DocumentV0_ctor signature (lines 14-26) is now outdated. The actual constructor now takes an additional parameter (likely creator_id based on related changes), but this comment still shows only 13 parameters. Consider updating the comment to reflect the current signature.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@dash-sdk-java/src/main/swig/document.i` around lines 14 - 26, The comment
documenting the dpp_document_v0_DocumentV0_ctor function signature in the SWIG
interface file is stale and does not include a newly added parameter. Update the
commented function signature to match the actual current constructor signature
by adding the missing parameter (likely creator_id based on related changes) in
the appropriate position within the parameter list. Ensure the comment
accurately reflects all parameters that the current constructor accepts.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt`:
- Line 109: The current code at line 109 checks if protoTxMetadata.index is not
equal to zero to detect unset optional fields, but this approach fails when zero
is a valid value for the index field. Replace the conditional check `if
(protoTxMetadata.index != 0)` with a call to the generated hasIndex() method on
protoTxMetadata, which properly detects whether the optional field was actually
set or left unset, correctly distinguishing between an unset field and an
explicitly set field with value zero.

In `@platform-mobile/src/fetch_document.rs`:
- Line 365: The hardcoded IP address "68.67.122.29" in the
create_dash_sdk_using_single_evonode function call makes the test flaky when
that node is unavailable or rotates. Replace the hardcoded IP string with a
value read from an environment variable (for example, something like
std::env::var) that has a sensible default fallback, allowing CI and local test
runs to override the endpoint when needed for better test stability.

In `@platform-mobile/src/put.rs`:
- Around line 244-246: The sign_create_witness method in the file contains a
todo!() placeholder that will cause a panic if invoked by the SDK dynamically
during identity operations. Replace the todo!() with a proper error return
statement that returns a Result type with an appropriate ProtocolError variant
instead of panicking. This ensures the method safely handles calls from the
SDK's internal logic like put_to_platform_with_private_key without crashing the
application.

In `@platform-mobile/src/sdk.rs`:
- Line 185: The max_decoding_message_size configuration is inconsistent between
different SDK factory outputs in the codebase. Locate the two occurrences of
max_decoding_message_size: None in platform-mobile/src/sdk.rs and replace both
instances with max_decoding_message_size: Some(16 * 1024 * 1024) to match the
consistent behavior defined in the callback-backed setup in
platform-mobile/src/config.rs, which uses the same value. This ensures uniform
request handling across all SDK factory creation paths and prevents
payload-size-dependent decode failures.

In `@README.md`:
- Line 55: The dppVersion variable in the README.md documentation is set to
"4.0.0-SNAPSHOT" but the project's actual version has been bumped to
"4.0.0-RC2-SNAPSHOT". Update the dppVersion value in the README to match the
current project version to prevent users from pulling mismatched artifacts.
Locate the dppVersion assignment and change it to reflect the correct bumped
version from the root build configuration.

---

Nitpick comments:
In `@dash-sdk-java/src/main/swig/document.i`:
- Around line 14-26: The comment documenting the dpp_document_v0_DocumentV0_ctor
function signature in the SWIG interface file is stale and does not include a
newly added parameter. Update the commented function signature to match the
actual current constructor signature by adding the missing parameter (likely
creator_id based on related changes) in the appropriate position within the
parameter list. Ensure the comment accurately reflects all parameters that the
current constructor accepts.

In `@examples/src/main/kotlin/dashj/org/platform/PlatformExplorer.kt`:
- Line 104: The BriefLogFormatter.initVerbose() call at line 104 is
unconditionally enabled without user control. Modify the command-line argument
parsing logic to check for an optional --verbose flag (similar to how args[0] is
already parsed for the network parameter), and only invoke
BriefLogFormatter.initVerbose() when this flag is explicitly provided by the
user, allowing verbose logging to be opt-in rather than always enabled.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7d5844e7-1b5d-4c5c-812a-bcfc48e66b8f

📥 Commits

Reviewing files that changed from the base of the PR and between 60c94e0 and ca59469.

⛔ Files ignored due to path filters (3)
  • dash-sdk-android/src/main/rust/Cargo.lock is excluded by !**/*.lock
  • dash-sdk-bindings/Cargo.lock is excluded by !**/*.lock
  • platform-mobile/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (22)
  • README.md
  • build.gradle
  • dash-sdk-android/src/main/rust/Cargo.toml
  • dash-sdk-android/src/main/rust/src/fermented.rs
  • dash-sdk-bindings/Cargo.toml
  • dash-sdk-bindings/contested-resource-value-fqn.patch
  • dash-sdk-bindings/src/fermented.rs
  • dash-sdk-java/src/main/cpp/config.h
  • dash-sdk-java/src/main/swig/document.i
  • dpp/src/main/java/org/dashj/platform/dashpay/BlockchainIdentity.kt
  • dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt
  • dpp/src/main/proto/wallet-utils.proto
  • examples/src/main/kotlin/dashj/org/platform/PlatformExplorer.kt
  • platform-mobile/Cargo.toml
  • platform-mobile/rust-toolchain.toml
  • platform-mobile/src/config.rs
  • platform-mobile/src/fetch_document.rs
  • platform-mobile/src/provider.rs
  • platform-mobile/src/put.rs
  • platform-mobile/src/put_test.rs
  • platform-mobile/src/sdk.rs
  • platform-mobile/src/voting.rs

Comment thread dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt Outdated
Comment thread platform-mobile/src/fetch_document.rs
Comment thread platform-mobile/src/put.rs
Comment thread platform-mobile/src/sdk.rs Outdated
Comment thread README.md Outdated

@abaranouski abaranouski left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

approved

HashEngineering and others added 4 commits June 25, 2026 06:42
Comparing optional fields against their default value (!= "", != 0L,
!= 0.0) cannot distinguish an unset field from one explicitly set to
the default, silently dropping empty strings, a 0.0 exchangeRate or
originalPrice (a genuinely free item), and a 0 timestamp/index. Use the
generated has*() presence accessors instead, which the proto3 optional
declarations have always provided.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The two SDK factories in sdk.rs left max_decoding_message_size: None
(tonic's 4 MiB default) while the callback-backed path in config.rs uses
Some(16 * 1024 * 1024). Match that value so all SDK creation paths share
the same decode ceiling.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@HashEngineering

Copy link
Copy Markdown
Collaborator Author

This will be merged when v4 replaced v2.

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