-
Notifications
You must be signed in to change notification settings - Fork 45
build!: upgrade bincode to 2.0.1 #2991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v3.0-dev
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughBincode bumped from 2.0.0-rc.3 to 2.0.1; bincode_derive removed and derive imports moved to bincode; decoding APIs were made context-aware (DefaultDecode/DefaultBorrowDecode and Decoder/BorrowDecoder with Context / BincodeContext); multiple git dependency revisions updated; wallet API signatures changed. Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/wasm-dpp2/Cargo.toml`:
- Line 12: The bincode dependency in Cargo.toml is missing the serde feature
required by code that calls bincode::serde::encode_to_vec and
bincode::serde::decode_from_slice (used in chain.rs and proof.rs); update the
bincode entry (the line with bincode = { git =
"https://github.com/dashpay/bincode", tag = "v2.0.0-rc.3", version =
"=2.0.0-rc.3" }) to include features = ["serde"] so the bincode::serde module is
available at compile time.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (14)
Cargo.tomlpackages/rs-dpp/Cargo.tomlpackages/rs-drive-abci/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-drive/Cargo.tomlpackages/rs-platform-serialization/Cargo.tomlpackages/rs-platform-value/Cargo.tomlpackages/rs-platform-version/Cargo.tomlpackages/rs-sdk-ffi/Cargo.tomlpackages/simple-signer/Cargo.tomlpackages/strategy-tests/Cargo.tomlpackages/wasm-dpp/Cargo.tomlpackages/wasm-dpp2/Cargo.tomlpackages/wasm-drive-verify/Cargo.toml
🧰 Additional context used
🧠 Learnings (23)
📓 Common learnings
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2431
File: packages/rs-drive/Cargo.toml:55-60
Timestamp: 2025-01-19T07:36:46.042Z
Learning: The grovedb dependencies in packages/rs-drive/Cargo.toml and related files are intentionally kept at specific revisions rather than using the latest stable version, with plans to update them at a later time.
Learnt from: shumkov
Repo: dashpay/platform PR: 2489
File: packages/rs-dpp/Cargo.toml:32-32
Timestamp: 2025-03-11T09:39:23.071Z
Learning: In the Dash Platform project, dependencies are currently managed using Git repository references with tags (repo+tag format in Cargo.toml) rather than published crates, as the team is not currently publishing crates to crates.io.
Learnt from: shumkov
Repo: dashpay/platform PR: 2375
File: packages/rs-drive-abci/Cargo.toml:61-63
Timestamp: 2024-12-05T09:29:38.918Z
Learning: In the `drive-abci` package, avoid adding unused dependencies like `hashbrown` to `Cargo.toml`. The team relies on CI to detect dependency version issues.
📚 Learning: 2025-01-19T07:36:46.042Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2431
File: packages/rs-drive/Cargo.toml:55-60
Timestamp: 2025-01-19T07:36:46.042Z
Learning: The grovedb dependencies in packages/rs-drive/Cargo.toml and related files are intentionally kept at specific revisions rather than using the latest stable version, with plans to update them at a later time.
Applied to files:
packages/wasm-drive-verify/Cargo.tomlpackages/rs-platform-value/Cargo.tomlpackages/rs-sdk-ffi/Cargo.tomlpackages/rs-drive/Cargo.tomlpackages/simple-signer/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-drive-abci/Cargo.tomlpackages/strategy-tests/Cargo.tomlpackages/wasm-dpp/Cargo.tomlCargo.tomlpackages/rs-dpp/Cargo.tomlpackages/wasm-dpp2/Cargo.tomlpackages/rs-platform-serialization/Cargo.tomlpackages/rs-platform-version/Cargo.toml
📚 Learning: 2024-12-05T09:29:38.918Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2375
File: packages/rs-drive-abci/Cargo.toml:61-63
Timestamp: 2024-12-05T09:29:38.918Z
Learning: In the `drive-abci` package, avoid adding unused dependencies like `hashbrown` to `Cargo.toml`. The team relies on CI to detect dependency version issues.
Applied to files:
packages/wasm-drive-verify/Cargo.tomlpackages/rs-platform-value/Cargo.tomlpackages/rs-sdk-ffi/Cargo.tomlpackages/rs-drive/Cargo.tomlpackages/simple-signer/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-drive-abci/Cargo.tomlpackages/strategy-tests/Cargo.tomlpackages/wasm-dpp/Cargo.tomlCargo.tomlpackages/wasm-dpp2/Cargo.tomlpackages/rs-platform-serialization/Cargo.tomlpackages/rs-platform-version/Cargo.toml
📚 Learning: 2025-03-11T09:39:23.071Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2489
File: packages/rs-dpp/Cargo.toml:32-32
Timestamp: 2025-03-11T09:39:23.071Z
Learning: In the Dash Platform project, dependencies are currently managed using Git repository references with tags (repo+tag format in Cargo.toml) rather than published crates, as the team is not currently publishing crates to crates.io.
Applied to files:
packages/wasm-drive-verify/Cargo.tomlpackages/rs-platform-value/Cargo.tomlpackages/rs-sdk-ffi/Cargo.tomlpackages/rs-drive/Cargo.tomlpackages/simple-signer/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-drive-abci/Cargo.tomlpackages/strategy-tests/Cargo.tomlpackages/wasm-dpp/Cargo.tomlCargo.tomlpackages/rs-dpp/Cargo.tomlpackages/wasm-dpp2/Cargo.tomlpackages/rs-platform-serialization/Cargo.tomlpackages/rs-platform-version/Cargo.toml
📚 Learning: 2024-09-27T08:23:18.028Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2139
File: packages/rs-sdk/Cargo.toml:0-0
Timestamp: 2024-09-27T08:23:18.028Z
Learning: `bincode` is used in the `mocks` feature of the `rs-sdk`.
Applied to files:
packages/wasm-drive-verify/Cargo.tomlpackages/rs-platform-value/Cargo.tomlpackages/rs-sdk-ffi/Cargo.tomlpackages/simple-signer/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-platform-serialization/Cargo.toml
📚 Learning: 2024-10-18T15:39:51.172Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2254
File: packages/rs-sdk/src/sdk.rs:585-585
Timestamp: 2024-10-18T15:39:51.172Z
Learning: The 'platform' project uses Rust version 1.80, so code in 'packages/rs-sdk' can use features available in Rust 1.80, such as the `abs_diff()` method.
Applied to files:
packages/rs-platform-value/Cargo.tomlpackages/rs-sdk-ffi/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/wasm-dpp/Cargo.tomlCargo.tomlpackages/rs-platform-serialization/Cargo.tomlpackages/rs-platform-version/Cargo.toml
📚 Learning: 2024-10-29T10:42:00.521Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2277
File: packages/rs-dapi-client/Cargo.toml:22-22
Timestamp: 2024-10-29T10:42:00.521Z
Learning: In `packages/rs-dapi-client/Cargo.toml`, `backon` will not work without the `tokio-sleep` feature in our setup, so it's unnecessary to declare `tokio-sleep` as a separate feature in the `[features]` section.
Applied to files:
packages/rs-platform-value/Cargo.tomlpackages/rs-sdk-ffi/Cargo.tomlpackages/rs-drive/Cargo.tomlpackages/simple-signer/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-drive-abci/Cargo.tomlpackages/strategy-tests/Cargo.tomlpackages/wasm-dpp/Cargo.tomlpackages/rs-dpp/Cargo.tomlpackages/wasm-dpp2/Cargo.tomlpackages/rs-platform-serialization/Cargo.tomlpackages/rs-platform-version/Cargo.toml
📚 Learning: 2025-09-03T16:37:11.605Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2756
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_list/update_state_masternode_list/v0/mod.rs:11-11
Timestamp: 2025-09-03T16:37:11.605Z
Learning: In packages/rs-dpp/Cargo.toml, the abci feature already includes core_rpc_client, and core_rpc_client is defined as ["dep:dashcore-rpc"]. This means rs-drive-abci can access dashcore-rpc types through dpp when using the abci feature.
Applied to files:
packages/rs-platform-value/Cargo.tomlpackages/rs-sdk-ffi/Cargo.tomlpackages/rs-drive/Cargo.tomlpackages/simple-signer/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-drive-abci/Cargo.tomlpackages/strategy-tests/Cargo.tomlpackages/wasm-dpp/Cargo.tomlCargo.tomlpackages/rs-dpp/Cargo.tomlpackages/wasm-dpp2/Cargo.tomlpackages/rs-platform-serialization/Cargo.tomlpackages/rs-platform-version/Cargo.toml
📚 Learning: 2024-10-08T13:28:03.529Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2227
File: packages/rs-drive-abci/src/platform_types/platform_state/mod.rs:141-141
Timestamp: 2024-10-08T13:28:03.529Z
Learning: When converting `PlatformStateV0` to `PlatformStateForSavingV1` in `packages/rs-drive-abci/src/platform_types/platform_state/mod.rs`, only version `0` needs to be handled in the match on `platform_state_for_saving_structure_default` because the changes are retroactive.
Applied to files:
packages/rs-platform-value/Cargo.tomlpackages/rs-platform-version/Cargo.toml
📚 Learning: 2024-10-09T00:22:57.778Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2207
File: packages/rs-sdk/src/mock/requests.rs:0-0
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In Rust, when serializing `IndexMap<K, V>` with bincode, use `bincode::serde::encode_to_vec` and `bincode::serde::decode_from_slice` because `IndexMap` does not implement `bincode::Encode`.
Applied to files:
packages/rs-platform-value/Cargo.tomlpackages/simple-signer/Cargo.tomlpackages/rs-platform-serialization/Cargo.toml
📚 Learning: 2024-11-15T14:39:23.704Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2332
File: packages/rs-drive-proof-verifier/src/error.rs:21-23
Timestamp: 2024-11-15T14:39:23.704Z
Learning: In the `packages/rs-drive-proof-verifier`, avoid suggesting size limits for `proof_bytes` in errors unless there's a specific need, as it may not be necessary.
Applied to files:
packages/rs-drive-proof-verifier/Cargo.toml
📚 Learning: 2024-10-29T14:44:01.184Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2277
File: packages/rs-dapi-client/src/executor.rs:38-38
Timestamp: 2024-10-29T14:44:01.184Z
Learning: In `packages/rs-dapi-client/src/executor.rs`, for the structs `ExecutionError<E>` and `ExecutionResponse<R>`, only the serde derives (`Serialize`, `Deserialize`) should be conditional based on the "mocks" feature; the other derives (`Debug`, `Clone`, `Eq`, `PartialEq`) should always be present.
Applied to files:
packages/rs-drive-proof-verifier/Cargo.toml
📚 Learning: 2024-10-10T10:30:19.883Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2232
File: packages/rs-sdk/src/mock/sdk.rs:90-95
Timestamp: 2024-10-10T10:30:19.883Z
Learning: In `packages/rs-sdk/src/mock/sdk.rs`, the `load_expectations` method in `MockDashPlatformSdk` remains asynchronous (`async`) for backward compatibility, even though it now delegates to the synchronous `load_expectations_sync` method.
Applied to files:
packages/rs-drive-proof-verifier/Cargo.toml
📚 Learning: 2025-01-24T07:54:55.723Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2440
File: packages/rs-drive-abci/Cargo.toml:76-76
Timestamp: 2025-01-24T07:54:55.723Z
Learning: In the drive-abci package, bls-signatures is intentionally declared twice:
1. As an optional dependency in [dependencies] to make it an optional feature in production
2. As a non-optional dependency in [dev-dependencies] to ensure it's always available for tests
Applied to files:
packages/rs-drive-abci/Cargo.toml
📚 Learning: 2024-10-22T10:53:12.111Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2259
File: packages/rs-dapi-client/src/dapi_client.rs:137-139
Timestamp: 2024-10-22T10:53:12.111Z
Learning: In `packages/rs-dapi-client/src/dapi_client.rs`, when passing data into asynchronous code, ensure that data structures are `Send + Sync`. Using `Arc<AtomicUsize>` is necessary for the retry counter.
Applied to files:
packages/rs-drive-abci/Cargo.toml
📚 Learning: 2024-10-09T00:22:57.778Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2207
File: packages/rs-drive-proof-verifier/Cargo.toml:46-46
Timestamp: 2024-10-09T00:22:57.778Z
Learning: Usages of `BTreeMap` in crates that are out of scope of a change should not be flagged for replacement.
Applied to files:
packages/strategy-tests/Cargo.toml
📚 Learning: 2025-01-23T09:43:25.080Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2405
File: packages/wasm-sdk/src/lib.rs:13-17
Timestamp: 2025-01-23T09:43:25.080Z
Learning: The codebase uses tracing_wasm for WebAssembly tracing as it provides sufficient functionality for the project's needs.
Applied to files:
packages/strategy-tests/Cargo.toml
📚 Learning: 2025-01-23T09:23:32.740Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2405
File: packages/rs-sdk/src/sync.rs:88-95
Timestamp: 2025-01-23T09:23:32.740Z
Learning: The `block_on` function in `packages/rs-sdk/src/sync.rs` requires true blocking behavior, which is why a non-blocking WebAssembly implementation using `wasm_bindgen_futures::spawn_local` is not suitable.
Applied to files:
packages/wasm-dpp/Cargo.tomlpackages/wasm-dpp2/Cargo.toml
📚 Learning: 2024-10-17T08:52:54.300Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2248
File: packages/rs-drive-abci/src/main.rs:106-111
Timestamp: 2024-10-17T08:52:54.300Z
Learning: In this project, the environment variable `CARGO_PKG_RUST_VERSION` is defined and can be used safely with the `env!` macro.
Applied to files:
packages/wasm-dpp/Cargo.tomlCargo.tomlpackages/rs-dpp/Cargo.toml
📚 Learning: 2025-11-25T13:10:23.481Z
Learnt from: CR
Repo: dashpay/platform PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T13:10:23.481Z
Learning: Use WASM bindings to connect Rust and JavaScript code
Applied to files:
packages/wasm-dpp/Cargo.tomlpackages/wasm-dpp2/Cargo.toml
📚 Learning: 2025-01-23T09:23:32.740Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2405
File: packages/rs-sdk/src/sync.rs:88-95
Timestamp: 2025-01-23T09:23:32.740Z
Learning: The `block_on` function in `packages/rs-sdk/src/sync.rs` is currently only used in tests, and its WebAssembly implementation is deferred until there's a user request for it.
Applied to files:
packages/wasm-dpp/Cargo.tomlpackages/wasm-dpp2/Cargo.toml
📚 Learning: 2024-10-09T00:22:57.778Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2206
File: packages/rs-drive-abci/tests/strategy_tests/main.rs:1162-1162
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the Rust test file `packages/rs-drive-abci/tests/strategy_tests/main.rs`, specific protocol versions like `PROTOCOL_VERSION_1` are intentionally used in tests instead of `PROTOCOL_VERSION_LATEST`.
Applied to files:
Cargo.toml
📚 Learning: 2025-11-25T13:10:23.481Z
Learnt from: CR
Repo: dashpay/platform PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T13:10:23.481Z
Learning: Use Rust for core platform components (Drive, DAPI server, DPP implementation)
Applied to files:
Cargo.tomlpackages/wasm-dpp2/Cargo.toml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: Rust packages (drive-abci) / Linting
- GitHub Check: Rust packages (dapi-grpc) / Tests
- GitHub Check: Rust packages (wasm-dpp) / Unused dependencies
- GitHub Check: Rust packages (wasm-dpp) / Tests
- GitHub Check: Rust packages (wasm-dpp) / Linting
- GitHub Check: Rust packages (drive) / Unused dependencies
- GitHub Check: Rust packages (drive) / Linting
- GitHub Check: Rust packages (drive) / Tests
- GitHub Check: Rust packages (rs-dapi-client) / Tests
- GitHub Check: Rust packages (wasm-dpp2) / Tests
- GitHub Check: Rust packages (wasm-dpp2) / Unused dependencies
- GitHub Check: Rust packages (wasm-dpp2) / Linting
- GitHub Check: Build Docker images (Dashmate helper, dashmate-helper, dashmate-helper) / Build Dashmate helper image
- GitHub Check: Build Docker images (RS-DAPI, rs-dapi, rs-dapi) / Build RS-DAPI image
- GitHub Check: Build Docker images (Drive, drive, drive-abci, SDK_TEST_DATA=true
) / Build Drive image - GitHub Check: Build JS packages / Build JS
- GitHub Check: Rust crates security audit
- GitHub Check: Build rs-sdk-ffi for iOS targets (aarch64-apple-ios)
- GitHub Check: Build rs-sdk-ffi for iOS targets (aarch64-apple-ios-sim)
- GitHub Check: Swift SDK and Example build (warnings as errors)
🔇 Additional comments (15)
packages/strategy-tests/Cargo.toml (1)
15-17: LGTM!The dependency correctly points to the forked repository with the appropriate tag and preserves the
serdefeature. While the root[patch.crates-io]would already redirect this dependency, explicitly specifying the git source provides an additional layer of consistency enforcement.packages/rs-dpp/Cargo.toml (1)
51-54: LGTM! Explicit version pinning for bincode_derive.Both
bincodeandbincode_deriveare correctly specified with the git source. The explicit inclusion ofbincode_derive(as explained in thecargo-macheteignore section at line 337) ensures version consistency and prevents accidental updates to incompatible versions.packages/rs-platform-version/Cargo.toml (1)
12-12: LGTM!The dependency correctly points to the forked repository with the appropriate tag and version constraint. This is consistent with the workspace-wide migration to the forked bincode crate.
Cargo.toml (1)
50-54: LGTM! Proper use of patch section for workspace-wide dependency override.The
[patch.crates-io]section correctly overrides bothbincodeandbincode_deriveto use the forked repository with the valid tagv2.0.0-rc.3. This ensures consistent resolution across the entire workspace and aligns with the project's practice of using git repository references with tags.packages/wasm-dpp/Cargo.toml (1)
58-58: LGTM!The dependency correctly points to the forked repository with the appropriate tag and version constraint. The
serdefeature is intentionally omitted because wasm-dpp uses only the direct bincode encoding API (encode_to_vec), not serde-based serialization. This matches the pattern used in other packages likers-platform-versionthat have similar bincode usage.packages/wasm-drive-verify/Cargo.toml (1)
47-47: LGTM — bincode source updated to internal fork.The change to use the git-based fork aligns with the project's dependency management practices. Based on learnings, dependencies are managed using git repository references with tags rather than crates.io.
Minor observation: This file uses
version = "2.0.0-rc.3"without the=prefix, whereas other Cargo.toml files in this PR useversion = "=2.0.0-rc.3". Since the git tag pins the exact source anyway, this is functionally equivalent, but you may want to standardize for consistency.packages/rs-platform-serialization/Cargo.toml (1)
11-13: LGTM — bincode source correctly updated.The dependency now points to the internal fork with the same version constraint and serde feature preserved. This is appropriate for the serialization package. Based on learnings, this aligns with the project's practice of managing dependencies using git repository references with tags.
packages/rs-drive-abci/Cargo.toml (1)
17-19: LGTM — bincode fork reference correctly applied.The change updates the dependency source to the internal fork while preserving the exact version constraint and serde feature. This is consistent with the other package updates in this PR.
packages/simple-signer/Cargo.toml (1)
19-21: LGTM — bincode dependency updated consistently.The source change to the internal fork is correctly applied with the same version constraint and serde feature.
packages/rs-drive-proof-verifier/Cargo.toml (1)
35-37: LGTM — bincode fork reference correctly applied.The dependency source update is consistent with the other packages in this PR, preserving the exact version constraint and serde feature.
packages/rs-sdk-ffi/Cargo.toml (1)
30-32: LGTM!The bincode dependency migration to the dashpay fork is correctly implemented with the git source, tag, version constraint, and serde feature preserved. This aligns with the team's practice of managing dependencies using git repository references with tags. Based on learnings.
packages/rs-platform-value/Cargo.toml (1)
11-13: LGTM!The bincode dependency is correctly migrated to the dashpay fork with consistent formatting and preserved version/feature configuration.
packages/wasm-dpp2/Cargo.toml (2)
13-15: LGTM — formatting changes.The wasm-bindgen multiline reformatting and trailing comma in the dpp features list are minor stylistic updates with no functional impact.
Also applies to: 29-29
4-4: No issue here —edition = "2024"is valid and supported.Rust 2024 edition was released and stabilized in Rust 1.85. This setting is fully supported and requires no changes.
Likely an incorrect or invalid review comment.
packages/rs-drive/Cargo.toml (1)
17-19: LGTM!The bincode dependency is correctly migrated to the dashpay fork with the git source, tag, version constraint, and serde feature preserved. The formatting is consistent with the file's existing style.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/rs-dpp/src/identity/core_script.rs (1)
103-140: Critical bug:borrow_decodeincorrectly treats zero bytes as terminators.The manual buffer reading loop at line 115 uses
buf.iter().position(|&x| x == 0)to detect end-of-data, which incorrectly assumes zero bytes terminate the data. This is fundamentally wrong for binary script data:
- Script opcodes like
OP_0(0x00) are valid and common in scripts- Any script containing a zero byte will be silently truncated
- This differs from the
Decodeimpl (lines 95-101) which correctly usesVec<u8>::decodewith proper length-prefixed encodingThe
borrow_decodeshould mirror thedecodeimplementation:🐛 Proposed fix
impl<'de, C> BorrowDecode<'de, C> for CoreScript { fn borrow_decode<D: BorrowDecoder<'de, Context = C>>( decoder: &mut D, ) -> Result<Self, DecodeError> { - // Read the serialized bytes from the decoder into a Vec<u8> - let mut bytes = Vec::new(); - loop { - let buf_len = 1024; // Adjust the buffer size as needed - let mut buf = vec![0; buf_len]; - - match decoder.reader().read(&mut buf) { - Ok(()) => { - let read_bytes = buf.iter().position(|&x| x == 0).unwrap_or(buf.len()); - bytes.extend_from_slice(&buf[..read_bytes]); - if read_bytes < buf_len { - break; - } - } - Err(DecodeError::Io { inner, additional }) - if inner.kind() == std::io::ErrorKind::UnexpectedEof => - { - if additional > 0 { - return Err(DecodeError::Io { inner, additional }); - } else { - break; - } - } - Err(e) => return Err(e), - } - } - - // Convert Vec<u8> to Box<[u8]> and create a DashCoreScript instance - let dash_core_script = DashcoreScript(bytes); - - // Create a CoreScript instance using the decoded DashCoreScript - Ok(CoreScript(dash_core_script)) + let bytes = Vec::<u8>::borrow_decode(decoder)?; + Ok(CoreScript(ScriptBuf(bytes))) } }packages/rs-platform-serialization/src/features/impl_std.rs (1)
287-295: Remove the unnecessary String decode that creates asymmetric encoding/decoding.The
platform_versioned_decodeimplementation attempts to decode aStringand then callbincode::Decode::decode, but the correspondingplatform_encodeimplementation only callsbincode::Encode::encodeonce. This asymmetry means the decoder will read two values from the stream when only one was encoded, causing deserialization failures.The discarded
_stringdecode has no corresponding encode operation and should be removed.Suggested fix
impl PlatformVersionedDecode for PathBuf { fn platform_versioned_decode<D: Decoder<Context = ()>>( decoder: &mut D, _: &PlatformVersion, ) -> Result<Self, DecodeError> { - let _string = std::string::String::decode(decoder)?; bincode::Decode::decode(decoder) } }
🤖 Fix all issues with AI agents
In `@packages/rs-drive/Cargo.toml`:
- Line 17: The Cargo.toml currently pulls bincode = { version = "2.0.1",
features = ["serde"] } from crates.io while the PR claims an internal fork at
dashpay/bincode; either update the PR description to state you are using the
crates.io release or change this dependency to point at the intended git fork
(e.g., dashpay/bincode) so the code matches the PR narrative; additionally, if
you need strict parity across the repo, consider pinning the version exactly
(e.g., =2.0.1) instead of a permissive semver spec to prevent accidental
automatic upgrades.
In `@packages/rs-platform-value/Cargo.toml`:
- Line 11: The bincode dependency declaration currently uses crates.io (bincode
= { version = "2.0.1", features = ["serde"] }) but the PR intends to use the
dashpay fork; change this by either updating the dependency to point directly at
the dashpay/bincode git fork (replace the version-only spec for the bincode
dependency with a git reference and keep the serde feature) or add a
workspace-level [patch.crates-io] entry that redirects "bincode" to the dashpay
git repo so all workspace crates resolve to the fork; ensure the symbol
"bincode" and the "features = [\"serde\"]" stay intact and that the patch or git
URL follows the pattern used for other forked deps in the repo.
🧹 Nitpick comments (4)
packages/rs-dpp/src/document/extended_document/serialize.rs (1)
72-85: The context bound update looks correct.The change to
D: bincode::de::Decoder<Context = ()>aligns with the bincode 2.0.1 update requiring explicit context-bound decoders across the codebase.Pre-existing: Misleading error message and redundant conversion.
Line 81 says "Failed to serialize" but this is a decode operation. Also, the error chain first converts to
EncodeErrorthen toDecodeError, which is unnecessary.♻️ Suggested cleanup (optional)
Self::from_bytes(&bytes, platform_version) - .map_err(|e| { - EncodeError::OtherString(format!("Failed to serialize ExtendedDocument: {}", e)) - }) - .map_err(|e| bincode::error::DecodeError::OtherString(e.to_string())) + .map_err(|e| { + bincode::error::DecodeError::OtherString(format!("Failed to decode ExtendedDocument: {}", e)) + })packages/rs-drive-proof-verifier/src/types.rs (1)
309-317: Inconsistent decoder bound withContestedResources.The
ContestedResourceimplementation at line 311 usesD: bincode::de::Decoderwithout theContext = ()constraint, whileContestedResources(line 336) was updated to requireD: bincode::de::Decoder<Context = ()>. For consistency with the broader bincode 2.0.1 refactor, consider updating this implementation as well.♻️ Suggested fix for consistency
#[cfg(feature = "mocks")] impl PlatformVersionedDecode for ContestedResource { - fn platform_versioned_decode<D: bincode::de::Decoder>( + fn platform_versioned_decode<D: bincode::de::Decoder<Context = ()>>( decoder: &mut D, _platform_version: &platform_version::PlatformVersion, ) -> Result<Self, bincode::error::DecodeError> { Ok(ContestedResource(Value::decode(decoder)?)) } }packages/rs-dpp/src/core_types/validator_set/v0/mod.rs (1)
98-141: LGTM with optional simplification.The generic context migration for both
Decode<C>andBorrowDecode<'de, C>is correct and consistent with the PR-wide pattern. The decode logic properly handles all fields with appropriate error mapping.♻️ Optional: Remove redundant array copy
The intermediate
public_key_bytesarray andcopy_from_sliceat lines 122-124 and 172-174 are unnecessary sincebytesis already a[u8; 48]:// Decode the [u8; 48] directly - let mut public_key_bytes = [0u8; 48]; let bytes = <[u8; 48]>::decode(decoder)?; - public_key_bytes.copy_from_slice(&bytes); let threshold_public_key = - BlsPublicKey::try_from(public_key_bytes.as_slice()).map_err(|e| { + BlsPublicKey::try_from(bytes.as_slice()).map_err(|e| {Also applies to: 144-191
packages/rs-platform-serialization/src/de/mod.rs (1)
64-83: Documentation example may need update to reflect new bincode 2.0.1 signatures.The example code showing what a
#[derive(bincode::Decode)]generates still shows the old-style trait signature without the explicitContextparameter (line 65:fn decode<D: bincode::de::Decoder>). While line 75 correctly shows the updatedBorrowDecoder<'de, Context = ()>, theDecodeexample at line 65 appears outdated.Consider updating the documentation to reflect what bincode 2.0.1 actually generates, or add a note clarifying this is illustrative.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (39)
packages/rs-dapi/Cargo.tomlpackages/rs-dpp/Cargo.tomlpackages/rs-dpp/src/address_funds/fee_strategy/mod.rspackages/rs-dpp/src/address_funds/witness.rspackages/rs-dpp/src/block/epoch/mod.rspackages/rs-dpp/src/core_types/validator/v0/mod.rspackages/rs-dpp/src/core_types/validator_set/v0/mod.rspackages/rs-dpp/src/data_contract/associated_token/token_perpetual_distribution/distribution_function/encode.rspackages/rs-dpp/src/document/extended_document/serialize.rspackages/rs-dpp/src/identity/core_script.rspackages/rs-dpp/src/lib.rspackages/rs-dpp/src/tokens/gas_fees_paid_by.rspackages/rs-dpp/src/tokens/token_payment_info/mod.rspackages/rs-dpp/src/tokens/token_payment_info/v0/mod.rspackages/rs-dpp/src/tokens/token_pricing_schedule.rspackages/rs-drive-abci/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-drive-proof-verifier/src/types.rspackages/rs-drive/Cargo.tomlpackages/rs-platform-serialization-derive/src/derive_bincode_enum.rspackages/rs-platform-serialization-derive/src/derive_bincode_struct.rspackages/rs-platform-serialization/Cargo.tomlpackages/rs-platform-serialization/src/de/impl_tuples.rspackages/rs-platform-serialization/src/de/impls.rspackages/rs-platform-serialization/src/de/mod.rspackages/rs-platform-serialization/src/features/impl_alloc.rspackages/rs-platform-serialization/src/features/impl_std.rspackages/rs-platform-serialization/src/lib.rspackages/rs-platform-value/Cargo.tomlpackages/rs-platform-version/Cargo.tomlpackages/rs-platform-wallet/Cargo.tomlpackages/rs-platform-wallet/examples/basic_usage.rspackages/rs-platform-wallet/src/lib.rspackages/rs-sdk-ffi/Cargo.tomlpackages/simple-signer/Cargo.tomlpackages/strategy-tests/Cargo.tomlpackages/wasm-dpp/Cargo.tomlpackages/wasm-dpp2/Cargo.tomlpackages/wasm-drive-verify/Cargo.toml
✅ Files skipped from review due to trivial changes (1)
- packages/rs-dpp/src/tokens/token_payment_info/v0/mod.rs
🚧 Files skipped from review as they are similar to previous changes (6)
- packages/wasm-drive-verify/Cargo.toml
- packages/rs-platform-version/Cargo.toml
- packages/rs-dpp/Cargo.toml
- packages/wasm-dpp2/Cargo.toml
- packages/simple-signer/Cargo.toml
- packages/rs-sdk-ffi/Cargo.toml
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.rs: Rust code must passcargo clippy --workspacelinter checks
Rust code must be formatted usingcargo fmt --all
**/*.rs: Use 4-space indent for Rust files
Follow rustfmt defaults and keep code clippy-clean for Rust modules
Use snake_case for Rust module names
Use PascalCase for Rust type names
Use SCREAMING_SNAKE_CASE for Rust constants
Files:
packages/rs-dpp/src/tokens/gas_fees_paid_by.rspackages/rs-dpp/src/core_types/validator/v0/mod.rspackages/rs-drive-proof-verifier/src/types.rspackages/rs-dpp/src/data_contract/associated_token/token_perpetual_distribution/distribution_function/encode.rspackages/rs-platform-serialization/src/de/impl_tuples.rspackages/rs-platform-wallet/examples/basic_usage.rspackages/rs-dpp/src/address_funds/fee_strategy/mod.rspackages/rs-dpp/src/address_funds/witness.rspackages/rs-dpp/src/block/epoch/mod.rspackages/rs-platform-wallet/src/lib.rspackages/rs-dpp/src/core_types/validator_set/v0/mod.rspackages/rs-dpp/src/tokens/token_payment_info/mod.rspackages/rs-dpp/src/document/extended_document/serialize.rspackages/rs-platform-serialization/src/de/mod.rspackages/rs-dpp/src/lib.rspackages/rs-platform-serialization-derive/src/derive_bincode_struct.rspackages/rs-platform-serialization/src/features/impl_std.rspackages/rs-platform-serialization/src/lib.rspackages/rs-dpp/src/identity/core_script.rspackages/rs-dpp/src/tokens/token_pricing_schedule.rspackages/rs-platform-serialization-derive/src/derive_bincode_enum.rspackages/rs-platform-serialization/src/features/impl_alloc.rspackages/rs-platform-serialization/src/de/impls.rs
🧠 Learnings (36)
📓 Common learnings
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2431
File: packages/rs-drive/Cargo.toml:55-60
Timestamp: 2025-01-19T07:36:46.042Z
Learning: The grovedb dependencies in packages/rs-drive/Cargo.toml and related files are intentionally kept at specific revisions rather than using the latest stable version, with plans to update them at a later time.
Learnt from: lklimek
Repo: dashpay/platform PR: 2254
File: packages/rs-sdk/src/sdk.rs:585-585
Timestamp: 2024-10-18T15:39:51.172Z
Learning: The 'platform' project uses Rust version 1.80, so code in 'packages/rs-sdk' can use features available in Rust 1.80, such as the `abs_diff()` method.
Learnt from: CR
Repo: dashpay/platform PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T13:10:23.481Z
Learning: Use Rust for core platform components (Drive, DAPI server, DPP implementation)
Learnt from: lklimek
Repo: dashpay/platform PR: 2207
File: packages/rs-sdk/src/mock/requests.rs:0-0
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In Rust, when serializing `IndexMap<K, V>` with bincode, use `bincode::serde::encode_to_vec` and `bincode::serde::decode_from_slice` because `IndexMap` does not implement `bincode::Encode`.
Learnt from: lklimek
Repo: dashpay/platform PR: 2207
File: packages/rs-sdk/src/mock/requests.rs:0-0
Timestamp: 2024-10-04T14:09:58.852Z
Learning: In Rust, when serializing `IndexMap<K, V>` with bincode, use `bincode::serde::encode_to_vec` and `bincode::serde::decode_from_slice` because `IndexMap` does not implement `bincode::Encode`.
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2756
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_list/update_state_masternode_list/v0/mod.rs:11-11
Timestamp: 2025-09-03T16:37:11.605Z
Learning: In packages/rs-dpp/Cargo.toml, the abci feature already includes core_rpc_client, and core_rpc_client is defined as ["dep:dashcore-rpc"]. This means rs-drive-abci can access dashcore-rpc types through dpp when using the abci feature.
📚 Learning: 2024-10-09T00:22:57.778Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2207
File: packages/rs-sdk/src/mock/requests.rs:0-0
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In Rust, when serializing `IndexMap<K, V>` with bincode, use `bincode::serde::encode_to_vec` and `bincode::serde::decode_from_slice` because `IndexMap` does not implement `bincode::Encode`.
Applied to files:
packages/rs-dpp/src/tokens/gas_fees_paid_by.rspackages/rs-platform-value/Cargo.tomlpackages/rs-platform-serialization/Cargo.tomlpackages/rs-dpp/src/address_funds/fee_strategy/mod.rspackages/strategy-tests/Cargo.tomlpackages/rs-dpp/src/tokens/token_payment_info/mod.rspackages/rs-dpp/src/lib.rspackages/rs-platform-serialization-derive/src/derive_bincode_struct.rspackages/rs-drive-abci/Cargo.tomlpackages/rs-platform-serialization/src/lib.rspackages/rs-dpp/src/tokens/token_pricing_schedule.rspackages/rs-platform-serialization-derive/src/derive_bincode_enum.rs
📚 Learning: 2024-10-29T14:44:01.184Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2277
File: packages/rs-dapi-client/src/executor.rs:38-38
Timestamp: 2024-10-29T14:44:01.184Z
Learning: In `packages/rs-dapi-client/src/executor.rs`, for the structs `ExecutionError<E>` and `ExecutionResponse<R>`, only the serde derives (`Serialize`, `Deserialize`) should be conditional based on the "mocks" feature; the other derives (`Debug`, `Clone`, `Eq`, `PartialEq`) should always be present.
Applied to files:
packages/rs-dpp/src/tokens/gas_fees_paid_by.rspackages/rs-drive-proof-verifier/src/types.rspackages/rs-dpp/src/lib.rspackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-platform-serialization-derive/src/derive_bincode_struct.rspackages/rs-drive-abci/Cargo.tomlpackages/rs-platform-serialization/src/lib.rspackages/rs-platform-serialization-derive/src/derive_bincode_enum.rspackages/rs-platform-serialization/src/de/impls.rs
📚 Learning: 2024-11-20T10:01:50.837Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2257
File: packages/rs-drive-abci/src/platform_types/platform_state/v0/old_structures/mod.rs:94-94
Timestamp: 2024-11-20T10:01:50.837Z
Learning: In `packages/rs-drive-abci/src/platform_types/platform_state/v0/old_structures/mod.rs`, when converting with `PublicKey::try_from`, it's acceptable to use `.expect()` to handle potential conversion errors.
Applied to files:
packages/rs-dpp/src/tokens/gas_fees_paid_by.rspackages/rs-drive-proof-verifier/src/types.rspackages/rs-dpp/src/core_types/validator_set/v0/mod.rspackages/rs-platform-serialization/src/features/impl_std.rspackages/rs-platform-serialization/src/lib.rs
📚 Learning: 2024-10-18T15:39:51.172Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2254
File: packages/rs-sdk/src/sdk.rs:585-585
Timestamp: 2024-10-18T15:39:51.172Z
Learning: The 'platform' project uses Rust version 1.80, so code in 'packages/rs-sdk' can use features available in Rust 1.80, such as the `abs_diff()` method.
Applied to files:
packages/rs-platform-value/Cargo.tomlpackages/rs-platform-serialization/Cargo.tomlpackages/wasm-dpp/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-drive-abci/Cargo.tomlpackages/rs-platform-serialization/src/lib.rs
📚 Learning: 2025-01-19T07:36:46.042Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2431
File: packages/rs-drive/Cargo.toml:55-60
Timestamp: 2025-01-19T07:36:46.042Z
Learning: The grovedb dependencies in packages/rs-drive/Cargo.toml and related files are intentionally kept at specific revisions rather than using the latest stable version, with plans to update them at a later time.
Applied to files:
packages/rs-platform-value/Cargo.tomlpackages/rs-dapi/Cargo.tomlpackages/rs-drive-proof-verifier/src/types.rspackages/rs-platform-serialization/Cargo.tomlpackages/wasm-dpp/Cargo.tomlpackages/strategy-tests/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-drive-abci/Cargo.tomlpackages/rs-platform-wallet/Cargo.tomlpackages/rs-drive/Cargo.toml
📚 Learning: 2024-10-08T13:28:03.529Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2227
File: packages/rs-drive-abci/src/platform_types/platform_state/mod.rs:141-141
Timestamp: 2024-10-08T13:28:03.529Z
Learning: When converting `PlatformStateV0` to `PlatformStateForSavingV1` in `packages/rs-drive-abci/src/platform_types/platform_state/mod.rs`, only version `0` needs to be handled in the match on `platform_state_for_saving_structure_default` because the changes are retroactive.
Applied to files:
packages/rs-platform-value/Cargo.tomlpackages/rs-drive-proof-verifier/src/types.rspackages/rs-platform-serialization/Cargo.tomlpackages/rs-platform-serialization/src/de/impl_tuples.rspackages/rs-platform-wallet/src/lib.rspackages/rs-dpp/src/document/extended_document/serialize.rspackages/rs-platform-serialization/src/de/mod.rspackages/rs-platform-serialization-derive/src/derive_bincode_struct.rspackages/rs-drive-abci/Cargo.tomlpackages/rs-platform-serialization/src/features/impl_std.rspackages/rs-platform-serialization/src/lib.rspackages/rs-platform-serialization-derive/src/derive_bincode_enum.rspackages/rs-platform-serialization/src/features/impl_alloc.rspackages/rs-platform-serialization/src/de/impls.rs
📚 Learning: 2024-10-29T10:42:00.521Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2277
File: packages/rs-dapi-client/Cargo.toml:22-22
Timestamp: 2024-10-29T10:42:00.521Z
Learning: In `packages/rs-dapi-client/Cargo.toml`, `backon` will not work without the `tokio-sleep` feature in our setup, so it's unnecessary to declare `tokio-sleep` as a separate feature in the `[features]` section.
Applied to files:
packages/rs-platform-value/Cargo.tomlpackages/rs-dapi/Cargo.tomlpackages/rs-platform-serialization/Cargo.tomlpackages/strategy-tests/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-drive-abci/Cargo.tomlpackages/rs-drive/Cargo.toml
📚 Learning: 2024-12-05T09:29:38.918Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2375
File: packages/rs-drive-abci/Cargo.toml:61-63
Timestamp: 2024-12-05T09:29:38.918Z
Learning: In the `drive-abci` package, avoid adding unused dependencies like `hashbrown` to `Cargo.toml`. The team relies on CI to detect dependency version issues.
Applied to files:
packages/rs-platform-value/Cargo.tomlpackages/wasm-dpp/Cargo.tomlpackages/strategy-tests/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-drive-abci/Cargo.tomlpackages/rs-drive/Cargo.toml
📚 Learning: 2024-10-09T00:22:57.778Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2139
File: packages/rs-sdk/Cargo.toml:0-0
Timestamp: 2024-10-09T00:22:57.778Z
Learning: `bincode` is used in the `mocks` feature of the `rs-sdk`.
Applied to files:
packages/rs-platform-value/Cargo.tomlpackages/rs-platform-serialization/Cargo.tomlpackages/strategy-tests/Cargo.tomlpackages/rs-dpp/src/lib.rspackages/rs-drive-proof-verifier/Cargo.toml
📚 Learning: 2025-09-03T16:37:11.605Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2756
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_list/update_state_masternode_list/v0/mod.rs:11-11
Timestamp: 2025-09-03T16:37:11.605Z
Learning: In packages/rs-dpp/Cargo.toml, the abci feature already includes core_rpc_client, and core_rpc_client is defined as ["dep:dashcore-rpc"]. This means rs-drive-abci can access dashcore-rpc types through dpp when using the abci feature.
Applied to files:
packages/rs-dapi/Cargo.tomlpackages/rs-dpp/src/lib.rspackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-drive-abci/Cargo.tomlpackages/rs-platform-wallet/Cargo.tomlpackages/rs-drive/Cargo.toml
📚 Learning: 2025-10-15T14:45:30.856Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2716
File: packages/dashmate/src/test/constants/services.js:4-4
Timestamp: 2025-10-15T14:45:30.856Z
Learning: In the dashmate codebase (packages/dashmate), during the DAPI Rust migration (rs-dapi), the old service keys `dapi_api` and `dapi_core_streams` are intentionally kept in `generateEnvsFactory.js` for backward compatibility even though the test constants in `src/test/constants/services.js` have been updated to use `rs_dapi`. These deprecated keys will be removed in a future PR after the transition is complete.
Applied to files:
packages/rs-dapi/Cargo.tomlpackages/rs-platform-wallet/Cargo.toml
📚 Learning: 2025-03-11T09:39:23.071Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2489
File: packages/rs-dpp/Cargo.toml:32-32
Timestamp: 2025-03-11T09:39:23.071Z
Learning: In the Dash Platform project, dependencies are currently managed using Git repository references with tags (repo+tag format in Cargo.toml) rather than published crates, as the team is not currently publishing crates to crates.io.
Applied to files:
packages/rs-dapi/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-platform-wallet/Cargo.tomlpackages/rs-drive/Cargo.toml
📚 Learning: 2025-11-25T13:10:23.481Z
Learnt from: CR
Repo: dashpay/platform PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T13:10:23.481Z
Learning: Use Rust for core platform components (Drive, DAPI server, DPP implementation)
Applied to files:
packages/rs-dapi/Cargo.tomlpackages/rs-platform-wallet/Cargo.toml
📚 Learning: 2024-10-21T01:03:42.458Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2227
File: packages/rs-dpp/src/core_types/validator_set/v0/mod.rs:299-299
Timestamp: 2024-10-21T01:03:42.458Z
Learning: In the `test_serialize_deserialize_validator_set_v0` test within `packages/rs-dpp/src/core_types/validator_set/v0/mod.rs`, deterministic BLS keys cannot be easily used; therefore, using `BlsPublicKey::generate()` is acceptable.
Applied to files:
packages/rs-dpp/src/core_types/validator/v0/mod.rspackages/rs-dpp/src/core_types/validator_set/v0/mod.rs
📚 Learning: 2024-10-29T14:40:54.727Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2277
File: packages/rs-sdk/src/core/transaction.rs:0-0
Timestamp: 2024-10-29T14:40:54.727Z
Learning: In `packages/rs-sdk/src/platform/document_query.rs` and `packages/rs-sdk/src/core/transaction.rs`, certain places don't implement `IntoInner`, so direct error mappings cannot be simplified using `IntoInner`. A TODO comment has been added to address this in a future PR.
Applied to files:
packages/rs-drive-proof-verifier/src/types.rspackages/rs-platform-serialization/src/de/impl_tuples.rspackages/rs-dpp/src/document/extended_document/serialize.rspackages/rs-platform-serialization/src/features/impl_std.rspackages/rs-platform-serialization/src/lib.rspackages/rs-platform-serialization/src/features/impl_alloc.rspackages/rs-platform-serialization/src/de/impls.rs
📚 Learning: 2024-10-04T09:08:47.901Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2206
File: packages/rs-drive-abci/tests/strategy_tests/main.rs:1162-1162
Timestamp: 2024-10-04T09:08:47.901Z
Learning: In the Rust test file `packages/rs-drive-abci/tests/strategy_tests/main.rs`, specific protocol versions like `PROTOCOL_VERSION_1` are intentionally used in tests instead of `PROTOCOL_VERSION_LATEST`.
Applied to files:
packages/rs-drive-proof-verifier/src/types.rspackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-drive-abci/Cargo.toml
📚 Learning: 2024-11-20T16:05:40.200Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2257
File: packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving.rs:148-151
Timestamp: 2024-11-20T16:05:40.200Z
Learning: In `packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving.rs`, when converting public keys from `QuorumForSavingV0` to `VerificationQuorum`, it's acceptable to use `.expect()` for public key conversion, as the conversion has been verified and panics are acceptable in this context.
Applied to files:
packages/rs-drive-proof-verifier/src/types.rspackages/rs-dpp/src/core_types/validator_set/v0/mod.rs
📚 Learning: 2024-10-09T00:22:57.778Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2207
File: packages/rs-drive-proof-verifier/src/proof.rs:1646-1664
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the implementation of `FromProof<platform::GetContestedResourceIdentityVotesRequest>` in `packages/rs-drive-proof-verifier/src/proof.rs`, when matching `maybe_votes`, using `.expect()` on `v.into_iter().next()` is acceptable because the prior match arm `Some(v) if v.is_empty()` ensures that the map is not empty, preventing a panic.
Applied to files:
packages/rs-drive-proof-verifier/src/types.rs
📚 Learning: 2025-11-25T13:10:23.481Z
Learnt from: CR
Repo: dashpay/platform PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T13:10:23.481Z
Learning: Use custom serialization with `rs-platform-serialization`
Applied to files:
packages/rs-platform-serialization/Cargo.toml
📚 Learning: 2024-10-17T08:52:54.300Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2248
File: packages/rs-drive-abci/src/main.rs:106-111
Timestamp: 2024-10-17T08:52:54.300Z
Learning: In this project, the environment variable `CARGO_PKG_RUST_VERSION` is defined and can be used safely with the `env!` macro.
Applied to files:
packages/wasm-dpp/Cargo.toml
📚 Learning: 2025-01-23T09:23:32.740Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2405
File: packages/rs-sdk/src/sync.rs:88-95
Timestamp: 2025-01-23T09:23:32.740Z
Learning: The `block_on` function in `packages/rs-sdk/src/sync.rs` requires true blocking behavior, which is why a non-blocking WebAssembly implementation using `wasm_bindgen_futures::spawn_local` is not suitable.
Applied to files:
packages/wasm-dpp/Cargo.toml
📚 Learning: 2025-11-25T13:10:23.481Z
Learnt from: CR
Repo: dashpay/platform PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T13:10:23.481Z
Learning: Use WASM bindings to connect Rust and JavaScript code
Applied to files:
packages/wasm-dpp/Cargo.toml
📚 Learning: 2025-10-09T16:00:42.724Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2716
File: packages/rs-dash-event-bus/Cargo.toml:4-4
Timestamp: 2025-10-09T16:00:42.724Z
Learning: Rust edition 2024 was released and stabilized in Rust 1.85 on February 20, 2025. Using `edition = "2024"` in Cargo.toml is valid and supported.
Applied to files:
packages/wasm-dpp/Cargo.toml
📚 Learning: 2024-10-03T11:51:06.980Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2201
File: packages/rs-platform-version/src/version/v2.rs:1186-1188
Timestamp: 2024-10-03T11:51:06.980Z
Learning: In the `IdentityTransitionVersions` structure within `packages/rs-platform-version/src/version/v2.rs`, the field `credit_withdrawal` does not need the `identity_` prefix since it is already encompassed within identity state transitions.
Applied to files:
packages/rs-dpp/src/address_funds/fee_strategy/mod.rspackages/rs-platform-wallet/src/lib.rs
📚 Learning: 2024-11-20T20:43:41.185Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2257
File: packages/rs-drive-abci/tests/strategy_tests/masternodes.rs:212-220
Timestamp: 2024-11-20T20:43:41.185Z
Learning: In `packages/rs-drive-abci/tests/strategy_tests/masternodes.rs`, the pattern of generating a `PrivateKey`, converting it to bytes, and reconstructing a `BlsPrivateKey` from those bytes is intentional. Avoid suggesting to simplify this code in future reviews.
Applied to files:
packages/rs-dpp/src/address_funds/fee_strategy/mod.rspackages/rs-dpp/src/core_types/validator_set/v0/mod.rs
📚 Learning: 2025-01-23T09:43:25.080Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2405
File: packages/wasm-sdk/src/lib.rs:13-17
Timestamp: 2025-01-23T09:43:25.080Z
Learning: The codebase uses tracing_wasm for WebAssembly tracing as it provides sufficient functionality for the project's needs.
Applied to files:
packages/strategy-tests/Cargo.toml
📚 Learning: 2024-11-22T08:19:14.448Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2345
File: packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs:93-99
Timestamp: 2024-11-22T08:19:14.448Z
Learning: In `packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs`, the `insert_contract` method requires an owned `BlockInfo`, so cloning `block_info` is necessary when calling it.
Applied to files:
packages/rs-platform-wallet/src/lib.rs
📚 Learning: 2024-10-09T00:22:57.778Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2215
File: packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs:105-105
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In `run_block_proposal` in `packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs`, when retrieving `last_block_time_ms`, it's acceptable to use `platform_state` instead of `block_platform_state`, even after updating the protocol version.
Applied to files:
packages/rs-platform-wallet/src/lib.rs
📚 Learning: 2024-11-20T09:55:15.990Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2257
File: packages/rs-dpp/src/bls/native_bls.rs:45-49
Timestamp: 2024-11-20T09:55:15.990Z
Learning: The `PublicKey<Bls12381G2Impl>` library is external and cannot be modified. Suggestions to modify it are not applicable.
Applied to files:
packages/rs-dpp/src/core_types/validator_set/v0/mod.rs
📚 Learning: 2025-01-20T16:20:59.791Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2432
File: packages/rs-dpp/src/data_contract/associated_token/token_configuration/v0/mod.rs:222-225
Timestamp: 2025-01-20T16:20:59.791Z
Learning: In the Dash Platform codebase, TokenAmount from crate::balances::credits is compatible with u64 when used for token base supply.
Applied to files:
packages/rs-dpp/src/tokens/token_payment_info/mod.rspackages/rs-dpp/src/tokens/token_pricing_schedule.rs
📚 Learning: 2025-11-25T13:10:23.481Z
Learnt from: CR
Repo: dashpay/platform PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T13:10:23.481Z
Learning: Applies to **/swift-sdk/**/*.swift : Make DPP types public in Swift to ensure proper visibility across module boundaries
Applied to files:
packages/rs-dpp/src/lib.rs
📚 Learning: 2024-10-10T05:10:50.059Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2235
File: packages/rs-dpp/src/identity/identity_public_key/v0/methods/mod.rs:8-9
Timestamp: 2024-10-10T05:10:50.059Z
Learning: In the codebase, importing `Secp256k1` from `dashcore::key::Secp256k1` is acceptable.
Applied to files:
packages/rs-dpp/src/lib.rspackages/rs-platform-wallet/Cargo.toml
📚 Learning: 2024-10-29T14:16:00.141Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2277
File: packages/dapi-grpc/src/mock.rs:125-145
Timestamp: 2024-10-29T14:16:00.141Z
Learning: Using `serde_json` encoding produces deterministic output required to identify requests and responses by hash, therefore `serde_json` is used as the basic serialization algorithm for mocking.
Applied to files:
packages/rs-dpp/src/lib.rs
📚 Learning: 2024-11-15T14:39:23.704Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2332
File: packages/rs-drive-proof-verifier/src/error.rs:21-23
Timestamp: 2024-11-15T14:39:23.704Z
Learning: In the `packages/rs-drive-proof-verifier`, avoid suggesting size limits for `proof_bytes` in errors unless there's a specific need, as it may not be necessary.
Applied to files:
packages/rs-drive-proof-verifier/Cargo.toml
📚 Learning: 2025-01-20T16:20:59.791Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2432
File: packages/rs-dpp/src/data_contract/associated_token/token_configuration/v0/mod.rs:222-225
Timestamp: 2025-01-20T16:20:59.791Z
Learning: In the Dash Platform codebase, TokenAmount is defined as `type TokenAmount = u64` in balances/credits.rs, making it directly compatible with u64 values without any conversion needed.
Applied to files:
packages/rs-dpp/src/tokens/token_pricing_schedule.rs
🧬 Code graph analysis (10)
packages/rs-dpp/src/core_types/validator/v0/mod.rs (4)
packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts (1)
ValidatorV0(6018-6038)packages/rs-dpp/src/core_types/validator_set/v0/mod.rs (1)
decode(99-140)packages/rs-dpp/src/identity/core_script.rs (1)
decode(96-100)packages/rs-platform-serialization/src/de/mod.rs (1)
decode(14-19)
packages/rs-dpp/src/data_contract/associated_token/token_perpetual_distribution/distribution_function/encode.rs (4)
packages/rs-dpp/src/address_funds/witness.rs (2)
decode(57-77)borrow_decode(81-103)packages/rs-dpp/src/block/epoch/mod.rs (2)
decode(100-105)borrow_decode(109-114)packages/rs-dpp/src/core_types/validator/v0/mod.rs (1)
decode(85-133)packages/rs-platform-serialization/src/de/mod.rs (2)
decode(14-19)borrow_decode(25-32)
packages/rs-platform-serialization/src/de/impl_tuples.rs (4)
packages/rs-platform-serialization/src/de/impls.rs (23)
platform_versioned_borrow_decode(301-306)platform_versioned_borrow_decode(310-315)platform_versioned_borrow_decode(356-383)platform_versioned_borrow_decode(405-410)platform_versioned_borrow_decode(435-446)platform_versioned_borrow_decode(498-518)platform_versioned_borrow_decode(538-544)platform_versioned_borrow_decode(564-570)platform_versioned_borrow_decode(600-607)platform_versioned_borrow_decode(628-635)platform_versioned_borrow_decode(669-689)platform_versioned_decode(20-25)platform_versioned_decode(31-36)platform_versioned_decode(41-46)platform_versioned_decode(51-56)platform_versioned_decode(61-66)platform_versioned_decode(71-76)platform_versioned_decode(81-86)platform_versioned_decode(91-96)platform_versioned_decode(101-106)platform_versioned_decode(111-116)platform_versioned_decode(121-126)platform_versioned_decode(131-136)packages/rs-platform-serialization/src/de/mod.rs (1)
platform_versioned_borrow_decode(117-120)packages/rs-platform-serialization/src/features/impl_alloc.rs (15)
platform_versioned_borrow_decode(97-113)platform_versioned_borrow_decode(162-179)platform_versioned_borrow_decode(227-243)platform_versioned_borrow_decode(289-305)decoder(80-80)decoder(102-102)decoder(143-143)decoder(167-167)decoder(210-210)decoder(232-232)decoder(272-272)decoder(294-294)decoder(336-336)decoder(343-343)decoder(365-365)packages/rs-platform-serialization/src/features/impl_std.rs (4)
decoder(448-448)decoder(474-474)decoder(500-500)decoder(525-525)
packages/rs-platform-wallet/examples/basic_usage.rs (1)
packages/rs-platform-wallet/src/lib.rs (2)
new(48-53)network(325-327)
packages/rs-dpp/src/address_funds/witness.rs (1)
packages/rs-platform-serialization/src/de/mod.rs (2)
decode(14-19)borrow_decode(25-32)
packages/rs-dpp/src/core_types/validator_set/v0/mod.rs (2)
packages/rs-dpp/src/block/epoch/mod.rs (1)
decode(100-105)packages/rs-dpp/src/core_types/validator/v0/mod.rs (1)
decode(85-133)
packages/rs-platform-serialization/src/features/impl_std.rs (2)
packages/rs-platform-serialization/src/de/impls.rs (23)
platform_versioned_decode(20-25)platform_versioned_decode(31-36)platform_versioned_decode(41-46)platform_versioned_decode(51-56)platform_versioned_decode(61-66)platform_versioned_decode(71-76)platform_versioned_decode(81-86)platform_versioned_decode(91-96)platform_versioned_decode(101-106)platform_versioned_decode(111-116)platform_versioned_decode(121-126)platform_versioned_decode(131-136)platform_versioned_borrow_decode(301-306)platform_versioned_borrow_decode(310-315)platform_versioned_borrow_decode(356-383)platform_versioned_borrow_decode(405-410)platform_versioned_borrow_decode(435-446)platform_versioned_borrow_decode(498-518)platform_versioned_borrow_decode(538-544)platform_versioned_borrow_decode(564-570)platform_versioned_borrow_decode(600-607)platform_versioned_borrow_decode(628-635)platform_versioned_borrow_decode(669-689)packages/rs-platform-serialization/src/de/mod.rs (1)
platform_versioned_borrow_decode(117-120)
packages/rs-dpp/src/identity/core_script.rs (2)
packages/rs-dpp/src/block/epoch/mod.rs (2)
decode(100-105)borrow_decode(109-114)packages/rs-platform-serialization/src/de/mod.rs (2)
decode(14-19)borrow_decode(25-32)
packages/rs-platform-serialization/src/features/impl_alloc.rs (2)
packages/rs-platform-serialization/src/de/impls.rs (23)
platform_versioned_decode(20-25)platform_versioned_decode(31-36)platform_versioned_decode(41-46)platform_versioned_decode(51-56)platform_versioned_decode(61-66)platform_versioned_decode(71-76)platform_versioned_decode(81-86)platform_versioned_decode(91-96)platform_versioned_decode(101-106)platform_versioned_decode(111-116)platform_versioned_decode(121-126)platform_versioned_decode(131-136)platform_versioned_borrow_decode(301-306)platform_versioned_borrow_decode(310-315)platform_versioned_borrow_decode(356-383)platform_versioned_borrow_decode(405-410)platform_versioned_borrow_decode(435-446)platform_versioned_borrow_decode(498-518)platform_versioned_borrow_decode(538-544)platform_versioned_borrow_decode(564-570)platform_versioned_borrow_decode(600-607)platform_versioned_borrow_decode(628-635)platform_versioned_borrow_decode(669-689)packages/rs-platform-serialization/src/de/mod.rs (1)
platform_versioned_borrow_decode(117-120)
packages/rs-platform-serialization/src/de/impls.rs (2)
packages/rs-platform-serialization/src/de/mod.rs (2)
platform_versioned_decode(104-107)platform_versioned_borrow_decode(117-120)packages/rs-platform-serialization/src/features/impl_std.rs (2)
platform_versioned_borrow_decode(188-194)platform_versioned_borrow_decode(229-235)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
- GitHub Check: Rust packages (wasm-dpp2) / Tests
- GitHub Check: Rust packages (drive) / Tests
- GitHub Check: Rust packages (drive) / Formatting
- GitHub Check: Rust packages (drive) / Linting
- GitHub Check: Rust packages (wasm-dpp2) / Unused dependencies
- GitHub Check: Rust packages (drive-abci) / Unused dependencies
- GitHub Check: Rust packages (wasm-dpp2) / Linting
- GitHub Check: Rust packages (rs-dapi-client) / Tests
- GitHub Check: Rust packages (drive-abci) / Linting
- GitHub Check: Build Docker images (Drive, drive, drive-abci, SDK_TEST_DATA=true
) / Build Drive image - GitHub Check: Build Docker images (RS-DAPI, rs-dapi, rs-dapi) / Build RS-DAPI image
- GitHub Check: Build Docker images (Dashmate helper, dashmate-helper, dashmate-helper) / Build Dashmate helper image
- GitHub Check: Build JS packages / Build JS
- GitHub Check: Rust crates security audit
- GitHub Check: Build rs-sdk-ffi for iOS targets (aarch64-apple-ios)
- GitHub Check: Build rs-sdk-ffi for iOS targets (aarch64-apple-ios-sim)
- GitHub Check: Swift SDK and Example build (warnings as errors)
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@packages/rs-dpp/Cargo.toml`:
- Line 51: The Cargo.toml currently pins bincode = "=2.0.1" which pulls from
crates.io instead of the internal fork; update the dependency resolution so the
crate uses the dashpay/bincode fork either by replacing the version entry with a
git reference to the fork (bincode) or by adding a workspace-level
[patch.crates-io] entry that redirects the bincode crate to the dashpay/bincode
repo; ensure this change is applied for the bincode dependency referenced in
packages/rs-dpp/Cargo.toml and matches how other workspace Cargo.toml files were
patched.
In `@packages/rs-platform-version/Cargo.toml`:
- Around line 12-14: The workspace is still resolving bincode from crates.io;
add a [patch.crates-io] section to the workspace Cargo.toml to redirect bincode
to the dashpay fork by adding an entry like bincode = { git =
"https://github.com/dashpay/bincode", rev = "<commit-hash>" } under
[patch.crates-io], then ensure any local Cargo.toml dependencies that list
bincode (e.g., bincode = "=2.0.1") will be resolved via that patch so the forked
repository is used.
♻️ Duplicate comments (1)
packages/rs-platform-value/Cargo.toml (1)
11-11: Fork configuration missing for bincode dependency.This uses a crates.io version constraint instead of the dashpay/bincode fork mentioned in the PR objective.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (15)
packages/rs-dapi/Cargo.tomlpackages/rs-dpp/Cargo.tomlpackages/rs-drive-abci/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-drive/Cargo.tomlpackages/rs-platform-serialization/Cargo.tomlpackages/rs-platform-value/Cargo.tomlpackages/rs-platform-version/Cargo.tomlpackages/rs-platform-wallet/Cargo.tomlpackages/rs-sdk-ffi/Cargo.tomlpackages/simple-signer/Cargo.tomlpackages/strategy-tests/Cargo.tomlpackages/wasm-dpp/Cargo.tomlpackages/wasm-dpp2/Cargo.tomlpackages/wasm-drive-verify/Cargo.toml
🚧 Files skipped from review as they are similar to previous changes (8)
- packages/rs-drive-abci/Cargo.toml
- packages/rs-sdk-ffi/Cargo.toml
- packages/rs-drive/Cargo.toml
- packages/rs-platform-wallet/Cargo.toml
- packages/rs-platform-serialization/Cargo.toml
- packages/simple-signer/Cargo.toml
- packages/wasm-dpp2/Cargo.toml
- packages/strategy-tests/Cargo.toml
🧰 Additional context used
🧠 Learnings (21)
📓 Common learnings
Learnt from: lklimek
Repo: dashpay/platform PR: 2139
File: packages/rs-sdk/Cargo.toml:0-0
Timestamp: 2024-09-27T08:23:18.028Z
Learning: `bincode` is used in the `mocks` feature of the `rs-sdk`.
Learnt from: lklimek
Repo: dashpay/platform PR: 2139
File: packages/rs-sdk/Cargo.toml:0-0
Timestamp: 2024-10-09T00:22:57.778Z
Learning: `bincode` is used in the `mocks` feature of the `rs-sdk`.
Learnt from: lklimek
Repo: dashpay/platform PR: 2207
File: packages/rs-sdk/src/mock/requests.rs:0-0
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In Rust, when serializing `IndexMap<K, V>` with bincode, use `bincode::serde::encode_to_vec` and `bincode::serde::decode_from_slice` because `IndexMap` does not implement `bincode::Encode`.
Learnt from: lklimek
Repo: dashpay/platform PR: 2207
File: packages/rs-sdk/src/mock/requests.rs:0-0
Timestamp: 2024-10-04T14:09:58.852Z
Learning: In Rust, when serializing `IndexMap<K, V>` with bincode, use `bincode::serde::encode_to_vec` and `bincode::serde::decode_from_slice` because `IndexMap` does not implement `bincode::Encode`.
📚 Learning: 2025-01-19T07:36:46.042Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2431
File: packages/rs-drive/Cargo.toml:55-60
Timestamp: 2025-01-19T07:36:46.042Z
Learning: The grovedb dependencies in packages/rs-drive/Cargo.toml and related files are intentionally kept at specific revisions rather than using the latest stable version, with plans to update them at a later time.
Applied to files:
packages/rs-platform-version/Cargo.tomlpackages/rs-dapi/Cargo.tomlpackages/wasm-dpp/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/wasm-drive-verify/Cargo.tomlpackages/rs-platform-value/Cargo.tomlpackages/rs-dpp/Cargo.toml
📚 Learning: 2024-10-18T15:39:51.172Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2254
File: packages/rs-sdk/src/sdk.rs:585-585
Timestamp: 2024-10-18T15:39:51.172Z
Learning: The 'platform' project uses Rust version 1.80, so code in 'packages/rs-sdk' can use features available in Rust 1.80, such as the `abs_diff()` method.
Applied to files:
packages/rs-platform-version/Cargo.tomlpackages/wasm-dpp/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/wasm-drive-verify/Cargo.tomlpackages/rs-platform-value/Cargo.tomlpackages/rs-dpp/Cargo.toml
📚 Learning: 2024-12-05T09:29:38.918Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2375
File: packages/rs-drive-abci/Cargo.toml:61-63
Timestamp: 2024-12-05T09:29:38.918Z
Learning: In the `drive-abci` package, avoid adding unused dependencies like `hashbrown` to `Cargo.toml`. The team relies on CI to detect dependency version issues.
Applied to files:
packages/rs-platform-version/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/wasm-drive-verify/Cargo.tomlpackages/rs-platform-value/Cargo.toml
📚 Learning: 2024-10-08T13:28:03.529Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2227
File: packages/rs-drive-abci/src/platform_types/platform_state/mod.rs:141-141
Timestamp: 2024-10-08T13:28:03.529Z
Learning: When converting `PlatformStateV0` to `PlatformStateForSavingV1` in `packages/rs-drive-abci/src/platform_types/platform_state/mod.rs`, only version `0` needs to be handled in the match on `platform_state_for_saving_structure_default` because the changes are retroactive.
Applied to files:
packages/rs-platform-version/Cargo.tomlpackages/rs-platform-value/Cargo.toml
📚 Learning: 2024-10-29T10:42:00.521Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2277
File: packages/rs-dapi-client/Cargo.toml:22-22
Timestamp: 2024-10-29T10:42:00.521Z
Learning: In `packages/rs-dapi-client/Cargo.toml`, `backon` will not work without the `tokio-sleep` feature in our setup, so it's unnecessary to declare `tokio-sleep` as a separate feature in the `[features]` section.
Applied to files:
packages/rs-platform-version/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-platform-value/Cargo.tomlpackages/rs-dpp/Cargo.toml
📚 Learning: 2025-03-11T09:39:23.071Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2489
File: packages/rs-dpp/Cargo.toml:32-32
Timestamp: 2025-03-11T09:39:23.071Z
Learning: In the Dash Platform project, dependencies are currently managed using Git repository references with tags (repo+tag format in Cargo.toml) rather than published crates, as the team is not currently publishing crates to crates.io.
Applied to files:
packages/rs-platform-version/Cargo.tomlpackages/rs-dapi/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-platform-value/Cargo.tomlpackages/rs-dpp/Cargo.toml
📚 Learning: 2025-09-03T16:37:11.605Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2756
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_list/update_state_masternode_list/v0/mod.rs:11-11
Timestamp: 2025-09-03T16:37:11.605Z
Learning: In packages/rs-dpp/Cargo.toml, the abci feature already includes core_rpc_client, and core_rpc_client is defined as ["dep:dashcore-rpc"]. This means rs-drive-abci can access dashcore-rpc types through dpp when using the abci feature.
Applied to files:
packages/rs-platform-version/Cargo.tomlpackages/rs-dapi/Cargo.tomlpackages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-dpp/Cargo.toml
📚 Learning: 2025-10-15T14:45:30.856Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2716
File: packages/dashmate/src/test/constants/services.js:4-4
Timestamp: 2025-10-15T14:45:30.856Z
Learning: In the dashmate codebase (packages/dashmate), during the DAPI Rust migration (rs-dapi), the old service keys `dapi_api` and `dapi_core_streams` are intentionally kept in `generateEnvsFactory.js` for backward compatibility even though the test constants in `src/test/constants/services.js` have been updated to use `rs_dapi`. These deprecated keys will be removed in a future PR after the transition is complete.
Applied to files:
packages/rs-dapi/Cargo.tomlpackages/rs-dpp/Cargo.toml
📚 Learning: 2024-10-17T08:52:54.300Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2248
File: packages/rs-drive-abci/src/main.rs:106-111
Timestamp: 2024-10-17T08:52:54.300Z
Learning: In this project, the environment variable `CARGO_PKG_RUST_VERSION` is defined and can be used safely with the `env!` macro.
Applied to files:
packages/wasm-dpp/Cargo.tomlpackages/rs-dpp/Cargo.toml
📚 Learning: 2025-01-23T09:23:32.740Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2405
File: packages/rs-sdk/src/sync.rs:88-95
Timestamp: 2025-01-23T09:23:32.740Z
Learning: The `block_on` function in `packages/rs-sdk/src/sync.rs` requires true blocking behavior, which is why a non-blocking WebAssembly implementation using `wasm_bindgen_futures::spawn_local` is not suitable.
Applied to files:
packages/wasm-dpp/Cargo.toml
📚 Learning: 2025-11-25T13:10:23.481Z
Learnt from: CR
Repo: dashpay/platform PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T13:10:23.481Z
Learning: Use WASM bindings to connect Rust and JavaScript code
Applied to files:
packages/wasm-dpp/Cargo.tomlpackages/wasm-drive-verify/Cargo.toml
📚 Learning: 2025-10-09T16:00:42.724Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2716
File: packages/rs-dash-event-bus/Cargo.toml:4-4
Timestamp: 2025-10-09T16:00:42.724Z
Learning: Rust edition 2024 was released and stabilized in Rust 1.85 on February 20, 2025. Using `edition = "2024"` in Cargo.toml is valid and supported.
Applied to files:
packages/wasm-dpp/Cargo.toml
📚 Learning: 2024-11-15T14:39:23.704Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2332
File: packages/rs-drive-proof-verifier/src/error.rs:21-23
Timestamp: 2024-11-15T14:39:23.704Z
Learning: In the `packages/rs-drive-proof-verifier`, avoid suggesting size limits for `proof_bytes` in errors unless there's a specific need, as it may not be necessary.
Applied to files:
packages/rs-drive-proof-verifier/Cargo.toml
📚 Learning: 2024-10-09T00:22:57.778Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2206
File: packages/rs-drive-abci/tests/strategy_tests/main.rs:1162-1162
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the Rust test file `packages/rs-drive-abci/tests/strategy_tests/main.rs`, specific protocol versions like `PROTOCOL_VERSION_1` are intentionally used in tests instead of `PROTOCOL_VERSION_LATEST`.
Applied to files:
packages/rs-drive-proof-verifier/Cargo.toml
📚 Learning: 2024-09-27T08:23:18.028Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2139
File: packages/rs-sdk/Cargo.toml:0-0
Timestamp: 2024-09-27T08:23:18.028Z
Learning: `bincode` is used in the `mocks` feature of the `rs-sdk`.
Applied to files:
packages/rs-drive-proof-verifier/Cargo.tomlpackages/rs-platform-value/Cargo.toml
📚 Learning: 2024-10-29T14:44:01.184Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2277
File: packages/rs-dapi-client/src/executor.rs:38-38
Timestamp: 2024-10-29T14:44:01.184Z
Learning: In `packages/rs-dapi-client/src/executor.rs`, for the structs `ExecutionError<E>` and `ExecutionResponse<R>`, only the serde derives (`Serialize`, `Deserialize`) should be conditional based on the "mocks" feature; the other derives (`Debug`, `Clone`, `Eq`, `PartialEq`) should always be present.
Applied to files:
packages/rs-drive-proof-verifier/Cargo.toml
📚 Learning: 2024-10-09T00:22:57.778Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2207
File: packages/rs-sdk/src/mock/requests.rs:0-0
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In Rust, when serializing `IndexMap<K, V>` with bincode, use `bincode::serde::encode_to_vec` and `bincode::serde::decode_from_slice` because `IndexMap` does not implement `bincode::Encode`.
Applied to files:
packages/wasm-drive-verify/Cargo.tomlpackages/rs-platform-value/Cargo.toml
📚 Learning: 2025-09-03T19:33:21.688Z
Learnt from: thephez
Repo: dashpay/platform PR: 2754
File: packages/wasm-sdk/api-definitions.json:1285-1285
Timestamp: 2025-09-03T19:33:21.688Z
Learning: In packages/wasm-sdk/api-definitions.json, thephez prefers to keep the existing "ripemd160hash20bytes1234" placeholder for ECDSA_HASH160 data field in documentation examples rather than using a valid base64-encoded format, maintaining consistency with the previous documentation approach.
Applied to files:
packages/wasm-drive-verify/Cargo.toml
📚 Learning: 2025-11-25T13:10:23.481Z
Learnt from: CR
Repo: dashpay/platform PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T13:10:23.481Z
Learning: Use Rust for core platform components (Drive, DAPI server, DPP implementation)
Applied to files:
packages/rs-dpp/Cargo.toml
📚 Learning: 2025-11-25T13:10:47.943Z
Learnt from: CR
Repo: dashpay/platform PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T13:10:47.943Z
Learning: Applies to **/*.rs : Follow rustfmt defaults and keep code clippy-clean for Rust modules
Applied to files:
packages/rs-dpp/Cargo.toml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
- GitHub Check: Rust packages (rs-sdk-ffi) / Linting
- GitHub Check: Rust packages (drive) / Linting
- GitHub Check: Rust packages (drive) / Formatting
- GitHub Check: Rust packages (drive) / Unused dependencies
- GitHub Check: Rust packages (wasm-dpp2) / Linting
- GitHub Check: Rust packages (dpp) / Check each feature
- GitHub Check: Rust packages (drive-abci) / Linting
- GitHub Check: Rust packages (drive-abci) / Unused dependencies
- GitHub Check: Rust packages (drive-abci) / Tests
- GitHub Check: Rust packages (dpp) / Unused dependencies
- GitHub Check: Rust packages (drive-abci) / Check each feature
- GitHub Check: Rust packages (dpp) / Linting
- GitHub Check: Build Docker images (Dashmate helper, dashmate-helper, dashmate-helper) / Build Dashmate helper image
- GitHub Check: Build Docker images (RS-DAPI, rs-dapi, rs-dapi) / Build RS-DAPI image
- GitHub Check: Build Docker images (Drive, drive, drive-abci, SDK_TEST_DATA=true
) / Build Drive image - GitHub Check: Build JS packages / Build JS
- GitHub Check: Rust crates security audit
- GitHub Check: Build rs-sdk-ffi for iOS targets (aarch64-apple-ios-sim)
- GitHub Check: Build rs-sdk-ffi for iOS targets (aarch64-apple-ios)
🔇 Additional comments (4)
packages/rs-dapi/Cargo.toml (1)
90-91: LGTM! Git revision bump for Dash Core RPC dependencies.Both
dashcore-rpcanddash-spvare correctly updated to the same revision from therust-dashcorerepository. The revision points to thedeps/bincode-2.0.1branch, aligning with the PR's objective of forking and updating the bincode dependency.packages/wasm-drive-verify/Cargo.toml (1)
29-29: Verify bincode fork integration: Cargo.toml references crates.io but PR objectives mention dashpay/bincode fork.The upgrade from 2.0.0-rc.3 to 2.0.1 with exact pinning (
=) is appropriate and aligns with the breaking change requirement for version consistency. However, the PR objectives state that an internal fork atdashpay/bincodewas created with "original git history," yet this Cargo.toml references the crates.io version directly.Confirm one of the following:
- A workspace-level
[patch]section redirectsbincodeto thedashpay/bincodefork- The crates.io 2.0.1 release is acceptable and the fork is used elsewhere in the workspace
- The fork usage was superseded by the crates.io release
packages/rs-dpp/Cargo.toml (1)
27-38: LGTM on dashcore ecosystem updates.The revision updates for dashcore and related packages (key-wallet, key-wallet-manager, dash-spv, dashcore-rpc) are consistent, all pointing to the same commit
852431229405e91004cc891cb4f676eafed68812.packages/wasm-dpp/Cargo.toml (1)
58-58: No action required. The bincode dependency at crates.io version 2.0.1 is intentional per the commit history and no dashpay/bincode fork exists or is referenced in the codebase.Likely an incorrect or invalid review comment.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
|
@coderabbitai review all |
|
✅ Actions performedReview triggered.
|
Issue being fixed or feature implemented
bincodecrate has been abandoned in quite a bad style (github repo wiped, project moved somewhere where whole history is rewritten). We see it as a potential risk. As a first step to mitigate it, we switch to most recent version we trust, which is2.0.1.What was done?
Updated project to use
bincode 2.0.1.How Has This Been Tested?
Passed GHA
Breaking Changes
All dependencies should use the same version of bincode, otherwise build will fail.
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
New Features
Improvements
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.