feat: support platform 4#39
Conversation
|
Warning Review limit reached
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughVersions are bumped in Gradle, README, Rust manifests, and toolchain files. Generated FFI/JNI bindings are updated for ChangesPlatform SDK 4.0.0 refresh
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
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. Sinceargs[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 winStale comment does not document the new parameter.
The comment documenting the
dpp_document_v0_DocumentV0_ctorsignature (lines 14-26) is now outdated. The actual constructor now takes an additional parameter (likelycreator_idbased 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
⛔ Files ignored due to path filters (3)
dash-sdk-android/src/main/rust/Cargo.lockis excluded by!**/*.lockdash-sdk-bindings/Cargo.lockis excluded by!**/*.lockplatform-mobile/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (22)
README.mdbuild.gradledash-sdk-android/src/main/rust/Cargo.tomldash-sdk-android/src/main/rust/src/fermented.rsdash-sdk-bindings/Cargo.tomldash-sdk-bindings/contested-resource-value-fqn.patchdash-sdk-bindings/src/fermented.rsdash-sdk-java/src/main/cpp/config.hdash-sdk-java/src/main/swig/document.idpp/src/main/java/org/dashj/platform/dashpay/BlockchainIdentity.ktdpp/src/main/java/org/dashj/platform/wallet/TxMetadataItem.ktdpp/src/main/proto/wallet-utils.protoexamples/src/main/kotlin/dashj/org/platform/PlatformExplorer.ktplatform-mobile/Cargo.tomlplatform-mobile/rust-toolchain.tomlplatform-mobile/src/config.rsplatform-mobile/src/fetch_document.rsplatform-mobile/src/provider.rsplatform-mobile/src/put.rsplatform-mobile/src/put_test.rsplatform-mobile/src/sdk.rsplatform-mobile/src/voting.rs
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>
|
This will be merged when v4 replaced v2. |
V12 for testnet
V11 for mainnet
Summary by CodeRabbit