Skip to content

feat: support platform 4#39

Merged
HashEngineering merged 13 commits into
mainfrom
feat/platform-4
Jul 2, 2026
Merged

feat: support platform 4#39
HashEngineering merged 13 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 and bindings to newer release versions.
    • Added async signer support and migrated identity submission/top-up to private-key flows.
    • Increased request decoding limit to 16 MB.
  • Bug Fixes
    • Fixed FFI bindings and Java/SWIG constructor wiring for improved interop.
    • Corrected platform version/network selection and related setup behavior.
    • Improved wallet transaction metadata parsing to respect protobuf field presence.
  • Documentation
    • Updated README Gradle version snippets for the latest SDK artifacts.
  • Chores
    • Updated CI alignment, added Rust toolchain configuration, and refreshed affected tests.

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

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 72453014-9e85-4197-a0cc-6da811d2a27d

📥 Commits

Reviewing files that changed from the base of the PR and between 489b62d and 4e5a38d.

⛔ 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 (4)
  • .github/workflows/build-and-verify-alignment.yml
  • README.md
  • build.gradle
  • platform-mobile/src/sdk.rs

📝 Walkthrough

Walkthrough

Versions, dependency pins, generated bindings, SDK setup, signer flows, tests, workflow alignment, and protobuf field mapping are updated for the new release line.

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 are updated, 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
dash-sdk-android, dash-sdk-bindings, and platform-mobile bump crate versions, re-pin dashcore to a git revision with updated features, enable state-transitions for simple-signer, and add the Rust 1.92 toolchain file.
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.
TxMetadataItem presence mapping
dpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.kt
The protobuf-backed TxMetadataItem constructor now uses hasX presence checks to populate nullable fields instead of comparing against protobuf default values.
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.
Alignment workflow branch update
.github/workflows/build-and-verify-alignment.yml
The Android alignment workflow clones the hashengineering/platform repository from the ferment-4.0 branch instead of ferment-2.0.

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

🚥 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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 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

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

@HashEngineering
HashEngineering merged commit 3d92c92 into main Jul 2, 2026
0 of 2 checks passed
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