Skip to content

feat: bump rust-dashcore to mempool support (1af96dd)#3390

Open
lklimek wants to merge 13 commits intov3.1-devfrom
feat/mempool-support
Open

feat: bump rust-dashcore to mempool support (1af96dd)#3390
lklimek wants to merge 13 commits intov3.1-devfrom
feat/mempool-support

Conversation

@lklimek
Copy link
Contributor

@lklimek lklimek commented Mar 19, 2026

Summary

Bump rust-dashcore to c451a1c6 (on top of PR #558 mempool support) for dash-evo-tool integration.

  • Bump all 6 rust-dashcore rev pins from 42eb1d69c451a1c6
  • Remove "std" feature from rs-dpp dashcore dependency (eliminated upstream)
  • Fix wasm-dpp2 macro rename (impl_wasm_conversionsimpl_wasm_conversions_serde)
  • Clean up accidentally included test code from cherry-pick conflict

rust-dashcore changes included

Based on aa86b74f (before PR #3376) to avoid RPITIT Send regression.

Test plan

  • cargo check --all-features --workspace passes
  • wasm-dpp2 compiles
  • Full workspace test suite

🤖 Co-authored by Claudius the Magnificent AI Agent

Summary by CodeRabbit

  • New Features

    • Added instant send UTXO marking capability to wallet operations.
  • Improvements

    • Enhanced masternode service address handling with optional configuration support.
    • Improved wallet transaction checking with mutable state updates.
    • Optimized validator construction to handle optional service addresses gracefully.
  • Chores

    • Updated dependencies to mempool support branch for enhanced blockchain operations.
    • Consolidated wallet manager dependencies and structure.
    • Refactored internal fetch operations for improved code maintainability.
    • Updated test fixtures for masternode state management.

lklimek and others added 3 commits March 11, 2026 12:46
Update all rust-dashcore dependencies (dashcore, dash-spv, dash-spv-ffi,
key-wallet, key-wallet-manager, dashcore-rpc) to commit 9959201593826d.
Also unify rs-platform-encryption which was pinned to a different older rev.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove `create_unsigned_payment_transaction`, `FeeLevel`, and
`TransactionError` usage — all removed from the upstream
WalletInfoInterface trait in rust-dashcore v0.42-dev.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…HRTB Send issue

Move the retry + closure logic from the default methods of Fetch,
FetchMany, and FetchUnproved traits into standalone async fn helpers.
This breaks the HRTB Send inference chain that prevents tokio::spawn
from proving the resulting future is Send, without changing any call
sites or removing #[async_trait].

Also remove stale #[async_trait::async_trait] from the bare
FetchMany impl for ContenderWithSerializedDocument.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

📝 Walkthrough

Walkthrough

Dependency versions are pinned to a feature branch (feat/mempool-support) across five crates. The key-wallet-manager crate is removed and replaced throughout the workspace with key-wallet via type aliases. The masternode state service field becomes optional (Option<SocketAddr>), cascading through conversions and tests. SDK fetch implementations are refactored to extract async helpers.

Changes

Cohort / File(s) Summary
Dependency Migration to Feature Branch
Cargo.toml, packages/rs-dpp/Cargo.toml, packages/rs-platform-wallet/Cargo.toml
Switched dashcore, dash-spv, dash-spv-ffi, key-wallet, and dashcore-rpc from pinned git rev to feat/mempool-support branch. Removed key-wallet-manager dependency entirely; updated feature definitions to depend on key-wallet instead.
Re-export Path Updates
packages/rs-dpp/src/lib.rs, packages/rs-platform-wallet/src/lib.rs, packages/rs-platform-wallet/examples/basic_usage.rs
Updated public re-exports to alias key_wallet as key_wallet_manager; changed import paths from key_wallet_manager::wallet_manager to key_wallet::manager.
Masternode Service Optionality
packages/rs-drive-abci/src/platform_types/masternode/v0/mod.rs, packages/rs-drive-abci/src/platform_types/validator/v0/mod.rs
Changed MasternodeStateV0.service type from SocketAddr to Option<SocketAddr>. Updated From conversions and validator construction to handle the optional field.
Masternode State Test Fixtures
packages/rs-drive-abci/src/execution/.../update_masternode_identities/update_operator_identity/v0/mod.rs, packages/rs-drive-abci/src/execution/.../update_masternode_list/update_state_masternode_list/v0/mod.rs, packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs, packages/rs-drive-abci/tests/strategy_tests/masternode_list_item_helpers.rs, packages/rs-drive-abci/tests/strategy_tests/masternodes.rs
Updated all test initializations to wrap SocketAddr values in Some(...); adjusted IP-change logic to extract/set service via expect() and optional wrapping.
Platform Wallet Interface Expansion
packages/rs-platform-wallet/src/platform_wallet_info/wallet_info_interface.rs, packages/rs-platform-wallet/src/platform_wallet_info/wallet_transaction_checker.rs
Added mark_instant_send_utxos method to WalletInfoInterface; updated check_core_transaction signature to accept mutable wallet and new update_balance parameter.
SDK Fetch Logic Extraction
packages/rs-sdk/src/platform/fetch.rs, packages/rs-sdk/src/platform/fetch_many.rs, packages/rs-sdk/src/platform/fetch_unproved.rs
Extracted inline retry/async-closure implementations into standalone helper functions (fetch_with_metadata_and_proof_impl, fetch_many_with_metadata_and_proof_impl, fetch_unproved_with_settings_impl); added Send trait bounds for spawn safety.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 Hops with glee through branch-new paths,
From wallet walls to masternodes' baths,
Options bloom where addresses stood tall,
Helpers extracted—refactoring's call!
Mempool-bound, the future's made bright.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately reflects the main objective: bumping rust-dashcore dependencies to a branch with mempool support. The title is specific and directly related to the primary changes throughout the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/mempool-support

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lklimek lklimek force-pushed the feat/mempool-support branch from 422ecb4 to 6d9efa9 Compare March 19, 2026 12:40
Update all 6 rust-dashcore workspace dependencies to commit
1af96dd02f12576ba0727476e39ff78aca0a1e13 which adds MempoolManager
(8th parallel sync manager) with bloom filter based mempool monitoring.

Remove "std" feature from rs-dpp dashcore dependency as it was
eliminated upstream.

Adapt to upstream API changes:
- Network::Dash renamed to Network::Mainnet
- DMNState.service changed from SocketAddr to Option<SocketAddr>
- WalletInfoInterface gained mark_instant_send_utxos method
- WalletTransactionChecker::check_core_transaction gained update_balance param

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lklimek lklimek force-pushed the feat/mempool-support branch from 6d9efa9 to 2414799 Compare March 19, 2026 12:48
lklimek and others added 2 commits March 19, 2026 13:59
…_serde

Cherry-pick wasm-dpp2 portion of 9a6d805 to fix compilation on
the pre-#3376 base. The macro was renamed upstream but wasm-dpp2
callers were not updated on this branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The cherry-pick of 6d9efa9 included 548 lines of unrelated test code
in consensus_params_update/mod.rs due to --theirs conflict resolution.
Restore the file to its base branch state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lklimek
Copy link
Contributor Author

lklimek commented Mar 19, 2026

Human-reviewed, on top of some old commit as v3.1-dev breaks dash-evo-tool

@lklimek lklimek marked this pull request as ready for review March 19, 2026 13:19
Copy link
Collaborator

@thepastaclaw thepastaclaw left a comment

Choose a reason for hiding this comment

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

Code Review

A thorough dependency bump with consistent Network::Dash→Network::Mainnet rename across 53 files and correct Option adaptation in most paths. The two substantive issues are: (1) the incremental validator-set update path silently ignores service removal (Some(None)), creating a divergence from fresh validator-set construction that could cause inconsistent state after restart; and (2) the SocketAddr→Option change in MasternodeStateV0 breaks bincode serialization format for persisted PlatformState without a versioned migration, acknowledged by the PR's 2 known snapshot test failures.

Reviewed commit: 2af8cac

🟡 4 suggestion(s) | 💬 2 nitpick(s)

1 additional finding

🟡 suggestion: platform_http_port changes never trigger validator set update

packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_list/update_state_masternode_list/v0/mod.rs (lines 144-147)

The condition at lines 144-147 checks pose_ban_height, service, and platform_p2p_port but does NOT include platform_http_port. The update_masternode_in_validator_sets function (line 75-76) correctly handles platform_http_port changes, but for HTTP-port-only diffs this code path is never reached. The comment on line 142 says "these 3 fields are the only fields useful for validators" but platform_http_port is a 4th validator-relevant field that's handled inside the function but gated out at the call site.

💡 Suggested change
                    if state_diff.pose_ban_height.is_some()
                        || state_diff.service.is_some()
                        || state_diff.platform_p2p_port.is_some()
                        || state_diff.platform_http_port.is_some()
                    {
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_list/update_state_masternode_list/v0/mod.rs`:
- [SUGGESTION] lines 67-69: Some(None) service diff leaves stale validator IP/port and diverges from fresh construction
  When `dmn_state_diff.service` is `Some(None)` (service address removed by Core), the pattern `if let Some(Some(address))` at line 67 silently skips the update. The validator retains its old `node_ip` and `core_port`. Meanwhile, `ValidatorV0::new_validator_if_masternode_in_state()` (validator/v0/mod.rs:40) returns `None` for masternodes with `service: None`, so any fresh validator-set construction would exclude this masternode.

This creates an asymmetry: incrementally-updated sets retain the validator with stale data, while rebuilt sets (e.g., after restart or new quorum construction) exclude it. If a node restarts while a quorum is active, its validator set could differ from live nodes that processed the diff incrementally.

Since upstream rust-dashcore now explicitly allows `service: None` for masternodes, this path is reachable in production. Consider removing the member from the validator set when `Some(None)` is received.
- [SUGGESTION] lines 144-147: platform_http_port changes never trigger validator set update
  The condition at lines 144-147 checks `pose_ban_height`, `service`, and `platform_p2p_port` but does NOT include `platform_http_port`. The `update_masternode_in_validator_sets` function (line 75-76) correctly handles `platform_http_port` changes, but for HTTP-port-only diffs this code path is never reached. The comment on line 142 says "these 3 fields are the only fields useful for validators" but `platform_http_port` is a 4th validator-relevant field that's handled inside the function but gated out at the call site.

In `packages/rs-drive-abci/src/platform_types/masternode/v0/mod.rs`:
- [SUGGESTION] lines 97-101: SocketAddr → Option<SocketAddr> breaks bincode serialization format without migration
  Changing `service` from `SocketAddr` to `Option<SocketAddr>` in `MasternodeStateV0` (line 101) breaks binary compatibility. `MasternodeStateV0` is part of the serialization chain: `PlatformStateForSaving` (V0 and V1) → `Masternode::V0(MasternodeV0)` → `MasternodeStateV0`. Both `PlatformStateForSavingV0` and `PlatformStateForSavingV1` contain `BTreeMap<Bytes32, Masternode>` which includes this struct.

Bincode encodes `Option<T>` with a leading discriminant byte that bare `T` does not have, so previously-serialized platform state will fail to deserialize. The PR acknowledges 2 snapshot test failures (`should_deserialize_state_stored_in_version_0_from_testnet` and `should_deserialize_state_stored_in_version_8_from_devnet`).

If this ships alongside a mandatory re-sync or consensus upgrade that discards old state, this is acceptable. If nodes must read pre-existing persisted state, a `MasternodeStateV1` or a new `PlatformStateForSavingV2` with migration logic is needed. Please confirm intended upgrade path.

In `packages/rs-drive-abci/tests/strategy_tests/masternodes.rs`:
- [SUGGESTION] lines 249-253: No tests exercise service: None path
  All test masternode generators construct `service: Some(SocketAddr::from_str(...).unwrap())` (line 250), and the IP update path uses `.expect("service address")` (line 356). There are zero tests with `service: None` anywhere in the test suite. This leaves the new `Option<SocketAddr>` behavior untested in: validator creation (`new_validator_if_masternode_in_state` returning None), validator set updates (the `Some(None)` diff path), and serialization round-trips. Adding at least one test that creates a masternode with `service: None` would validate the new code path.

Comment on lines +67 to 69
if let Some(Some(address)) = dmn_state_diff.service {
validator.node_ip = address.ip().to_string();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

🟡 Suggestion: Some(None) service diff leaves stale validator IP/port and diverges from fresh construction

When dmn_state_diff.service is Some(None) (service address removed by Core), the pattern if let Some(Some(address)) at line 67 silently skips the update. The validator retains its old node_ip and core_port. Meanwhile, ValidatorV0::new_validator_if_masternode_in_state() (validator/v0/mod.rs:40) returns None for masternodes with service: None, so any fresh validator-set construction would exclude this masternode.

This creates an asymmetry: incrementally-updated sets retain the validator with stale data, while rebuilt sets (e.g., after restart or new quorum construction) exclude it. If a node restarts while a quorum is active, its validator set could differ from live nodes that processed the diff incrementally.

Since upstream rust-dashcore now explicitly allows service: None for masternodes, this path is reachable in production. Consider removing the member from the validator set when Some(None) is received.

💡 Suggested change
Suggested change
if let Some(Some(address)) = dmn_state_diff.service {
validator.node_ip = address.ip().to_string();
}
if let Some(maybe_address) = dmn_state_diff.service {
match maybe_address {
Some(address) => {
validator.node_ip = address.ip().to_string();
validator.core_port = address.port();
}
None => {
// Service removed — remove validator from set
// to match new_validator_if_masternode_in_state behavior
validator_set.members_mut().remove(pro_tx_hash);
return;
}
}
}

source: ['claude-general', 'codex-general', 'claude-security-auditor', 'codex-security-auditor', 'claude-rust-quality', 'codex-rust-quality']

🤖 Fix this with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_list/update_state_masternode_list/v0/mod.rs`:
- [SUGGESTION] lines 67-69: Some(None) service diff leaves stale validator IP/port and diverges from fresh construction
  When `dmn_state_diff.service` is `Some(None)` (service address removed by Core), the pattern `if let Some(Some(address))` at line 67 silently skips the update. The validator retains its old `node_ip` and `core_port`. Meanwhile, `ValidatorV0::new_validator_if_masternode_in_state()` (validator/v0/mod.rs:40) returns `None` for masternodes with `service: None`, so any fresh validator-set construction would exclude this masternode.

This creates an asymmetry: incrementally-updated sets retain the validator with stale data, while rebuilt sets (e.g., after restart or new quorum construction) exclude it. If a node restarts while a quorum is active, its validator set could differ from live nodes that processed the diff incrementally.

Since upstream rust-dashcore now explicitly allows `service: None` for masternodes, this path is reachable in production. Consider removing the member from the validator set when `Some(None)` is received.

Comment on lines 98 to +101
pub struct MasternodeStateV0 {
/// Masternode's network service address.
#[bincode(with_serde)]
pub service: SocketAddr,
pub service: Option<SocketAddr>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

🟡 Suggestion: SocketAddr → Option breaks bincode serialization format without migration

Changing service from SocketAddr to Option<SocketAddr> in MasternodeStateV0 (line 101) breaks binary compatibility. MasternodeStateV0 is part of the serialization chain: PlatformStateForSaving (V0 and V1) → Masternode::V0(MasternodeV0)MasternodeStateV0. Both PlatformStateForSavingV0 and PlatformStateForSavingV1 contain BTreeMap<Bytes32, Masternode> which includes this struct.

Bincode encodes Option<T> with a leading discriminant byte that bare T does not have, so previously-serialized platform state will fail to deserialize. The PR acknowledges 2 snapshot test failures (should_deserialize_state_stored_in_version_0_from_testnet and should_deserialize_state_stored_in_version_8_from_devnet).

If this ships alongside a mandatory re-sync or consensus upgrade that discards old state, this is acceptable. If nodes must read pre-existing persisted state, a MasternodeStateV1 or a new PlatformStateForSavingV2 with migration logic is needed. Please confirm intended upgrade path.

source: ['claude-general', 'claude-security-auditor', 'claude-rust-quality', 'claude-ffi-engineer']

🤖 Fix this with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `packages/rs-drive-abci/src/platform_types/masternode/v0/mod.rs`:
- [SUGGESTION] lines 97-101: SocketAddr → Option<SocketAddr> breaks bincode serialization format without migration
  Changing `service` from `SocketAddr` to `Option<SocketAddr>` in `MasternodeStateV0` (line 101) breaks binary compatibility. `MasternodeStateV0` is part of the serialization chain: `PlatformStateForSaving` (V0 and V1) → `Masternode::V0(MasternodeV0)` → `MasternodeStateV0`. Both `PlatformStateForSavingV0` and `PlatformStateForSavingV1` contain `BTreeMap<Bytes32, Masternode>` which includes this struct.

Bincode encodes `Option<T>` with a leading discriminant byte that bare `T` does not have, so previously-serialized platform state will fail to deserialize. The PR acknowledges 2 snapshot test failures (`should_deserialize_state_stored_in_version_0_from_testnet` and `should_deserialize_state_stored_in_version_8_from_devnet`).

If this ships alongside a mandatory re-sync or consensus upgrade that discards old state, this is acceptable. If nodes must read pre-existing persisted state, a `MasternodeStateV1` or a new `PlatformStateForSavingV2` with migration logic is needed. Please confirm intended upgrade path.

Comment on lines +67 to 68
if let Some(Some(address)) = dmn_state_diff.service {
validator.node_ip = address.ip().to_string();
Copy link
Collaborator

Choose a reason for hiding this comment

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

💬 Nitpick: core_port not updated when service address changes

When service changes to a new address (e.g., from 1.2.3.4:1234 to 5.6.7.8:5678), only node_ip is updated at line 68 (validator.node_ip = address.ip().to_string()) but core_port is not updated from address.port(). The validator's core_port field will become stale if a masternode changes its service port. This is pre-existing (not introduced by this PR), but the refactoring here is a good opportunity to fix it.

💡 Suggested change
Suggested change
if let Some(Some(address)) = dmn_state_diff.service {
validator.node_ip = address.ip().to_string();
if let Some(Some(address)) = dmn_state_diff.service {
validator.node_ip = address.ip().to_string();
validator.core_port = address.port();
}

source: ['claude-rust-quality']

Comment on lines 249 to +253
state: DMNState {
service: SocketAddr::from_str(format!("1.0.{}.{}:1234", i / 256, i % 256).as_str())
.unwrap(),
service: Some(
SocketAddr::from_str(format!("1.0.{}.{}:1234", i / 256, i % 256).as_str())
.unwrap(),
),
Copy link
Collaborator

Choose a reason for hiding this comment

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

🟡 Suggestion: No tests exercise service: None path

All test masternode generators construct service: Some(SocketAddr::from_str(...).unwrap()) (line 250), and the IP update path uses .expect("service address") (line 356). There are zero tests with service: None anywhere in the test suite. This leaves the new Option<SocketAddr> behavior untested in: validator creation (new_validator_if_masternode_in_state returning None), validator set updates (the Some(None) diff path), and serialization round-trips. Adding at least one test that creates a masternode with service: None would validate the new code path.

source: ['claude-general', 'claude-rust-quality']

🤖 Fix this with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `packages/rs-drive-abci/tests/strategy_tests/masternodes.rs`:
- [SUGGESTION] lines 249-253: No tests exercise service: None path
  All test masternode generators construct `service: Some(SocketAddr::from_str(...).unwrap())` (line 250), and the IP update path uses `.expect("service address")` (line 356). There are zero tests with `service: None` anywhere in the test suite. This leaves the new `Option<SocketAddr>` behavior untested in: validator creation (`new_validator_if_masternode_in_state` returning None), validator set updates (the `Some(None)` diff path), and serialization round-trips. Adding at least one test that creates a masternode with `service: None` would validate the new code path.

[dependencies]
# Cryptography
dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "2bd764fdc071828939d9dc8dd872c39bae906b04" }
dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "9959201593826def0ad1f6db51b2ceb95b68a1ca" }
Copy link
Collaborator

Choose a reason for hiding this comment

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

💬 Nitpick: rs-platform-encryption dashcore rev diverges from workspace

This crate pins dashcore to rev 9959201... while all 6 workspace-level deps use 1af96dd.... Since this is a workspace member (root Cargo.toml line 45), Cargo unifies the dep — Cargo.lock confirms only one dashcore entry at 1af96dd. The local rev is effectively ignored but misleading to anyone reading the manifest. Consider switching to dashcore = { workspace = true } for consistency.

💡 Suggested change
Suggested change
dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "9959201593826def0ad1f6db51b2ceb95b68a1ca" }
dashcore = { workspace = true }

source: ['claude-general', 'claude-rust-quality']

Adds notify_wallet_addresses_changed() to DashSpvClient for triggering
mempool bloom filter rebuild when wallets are added or addresses
registered after initial SPV connection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Collaborator

@thepastaclaw thepastaclaw left a comment

Choose a reason for hiding this comment

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

Code Review

Incremental review of 1 new commit (d9de0fd) since prior review at 2af8cac. This push bumps the rust-dashcore workspace rev from 1af96dd0 to c451a1c6 (filter rebuild API). The change touches only Cargo.toml -- 6 lines swapping the git rev hash for all 6 workspace dependencies. No code changes, no new API adaptations. Prior findings status: All 5 prior findings from the initial review remain applicable -- they concern code logic (service Option handling, core_port updates, test coverage) that is untouched by this rev bump. In particular, the rs-platform-encryption/Cargo.toml rev divergence nitpick (finding d09a8c70d24f) is still present -- it remains pinned to 9959201 while the workspace now uses c451a1c6. No new findings from this push.

Reviewed commit: d9de0fd

lklimek and others added 2 commits March 20, 2026 11:55
Updates rust-dashcore from c451a1c6 to b03252af which includes:
- bloom filter staleness detection via monitor_revision polling
- key-wallet-manager merged into key-wallet (upstream #503)
- IS lock deduplication fix
- transaction status events

Adapts platform to the key-wallet-manager → key-wallet merge by
re-exporting key_wallet as key_wallet_manager for backward compat.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Collaborator

@thepastaclaw thepastaclaw left a comment

Choose a reason for hiding this comment

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

Code Review

The incremental delta cleanly removes the key-wallet-manager workspace dependency after it was merged into key-wallet upstream. The backward-compatibility alias (pub use key_wallet as key_wallet_manager) preserves crate-level naming but silently changes internal module paths, and the README wasn't updated to match. The now-empty manager feature flag is a no-op that should be cleaned up. No blocking issues.

Reviewed commit: be2082b

🟡 3 suggestion(s) | 💬 1 nitpick(s)

2 additional findings

🟡 suggestion: README uses stale module paths and lists removed dependency

packages/rs-platform-wallet/README.md (lines 24-25)

The code example on line 24 imports key_wallet_manager::wallet_manager::WalletManager, but key-wallet-manager was merged into key-wallet and the wallet_manager module was renamed to manager. The actual example file (basic_usage.rs) was correctly updated to use key_wallet::manager::WalletManager.

Lines 108 and 113 also reference key-wallet-manager as a separate dependency, which no longer exists in the workspace.

Note: The README is not modified in this PR, but this is newly broken by the key-wallet-manager removal in this PR's incremental commit.

💡 Suggested change
Update line 24 to:
```rust
use key_wallet::manager::WalletManager;

And update lines 108 and 113 to remove references to key-wallet-manager as a standalone dependency.


</details>

</details>
<details>
<summary>💬 <b>nitpick:</b> build_ios.sh references non-existent key-wallet-manager directory/crate</summary>

`packages/rs-sdk-ffi/build_ios.sh (lines 81-98)`

Line 81 includes `$RUST_DASHCORE_DIR/key-wallet-manager/src` in the hash computation and line 98 tries to `cargo clean -p key-wallet-manager`. Both are harmless due to `2>/dev/null`/`|| true`, but they're dead references now that key-wallet-manager was merged into key-wallet upstream. Pre-existing issue, not introduced by this delta.

*Pre-existing issue, not introduced by this PR.*

<details>
<summary>💡 Suggested change</summary>

```suggestion
Remove `key-wallet-manager` from both the `find` path list (line 81) and the `cargo clean` loop (line 98).
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `packages/rs-platform-wallet/README.md`:
- [SUGGESTION] lines 24-25: README uses stale module paths and lists removed dependency
  The code example on line 24 imports `key_wallet_manager::wallet_manager::WalletManager`, but `key-wallet-manager` was merged into `key-wallet` and the `wallet_manager` module was renamed to `manager`. The actual example file (`basic_usage.rs`) was correctly updated to use `key_wallet::manager::WalletManager`.

Lines 108 and 113 also reference `key-wallet-manager` as a separate dependency, which no longer exists in the workspace.

*Note: The README is not modified in this PR, but this is newly broken by the `key-wallet-manager` removal in this PR's incremental commit.*

In `packages/rs-platform-wallet/Cargo.toml`:
- [SUGGESTION] line 36: Empty `manager = []` feature is a no-op
  The `manager` feature was changed from `["key-wallet-manager"]` to `[]` but is still in `default`. It now only gates the `key_wallet_manager` backward-compat alias in `lib.rs` via `#[cfg(feature = "manager")]`. However, the example (`basic_usage.rs`) is also cfg-gated on this feature yet imports directly from `key_wallet` (which is unconditional), so the gate is misleading.

Consider either:
1. Removing the `manager` feature entirely and making the re-export unconditional, or
2. Having `manager` gate something meaningful (e.g., `manager = ["key-wallet/manager"]` if such a feature exists upstream).

In `packages/rs-platform-encryption/Cargo.toml`:
- [SUGGESTION] line 11: rs-platform-encryption pins a divergent dashcore rev, causing duplicate compilation
  This crate pins dashcore to rev `9959201` via a direct git dependency instead of using `workspace = true`. The workspace now points to `b03252af`. Cargo.lock shows 7 entries at the old rev alongside 23 at the new rev — meaning dashcore, dashcore-private, and dashcore_hashes each compile twice.

This is a **pre-existing issue** not introduced by this PR, but the gap widened with this bump. Aligning the rev (or switching to `dashcore.workspace = true`) would eliminate the duplicate builds.

lklimek and others added 2 commits March 20, 2026 13:41
Co-authored-by: Pasta Lil Claw <pasta+claw@dashboost.org>
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	packages/rs-drive-abci/src/config.rs
#	packages/rs-platform-wallet/src/platform_wallet_info/wallet_info_interface.rs
@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

📖 Book Preview built successfully.

Download the preview from the workflow artifacts.
To view locally: download the artifact, unzip, and open index.html.

Updated at 2026-03-23T10:50:27.990Z

@lklimek lklimek changed the base branch from refactor/sdk-rpitit-fetch-traits to v3.1-dev March 23, 2026 10:50
@github-actions github-actions bot added this to the v3.1.0 milestone Mar 23, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
packages/rs-drive-abci/src/platform_types/masternode/v0/mod.rs (1)

97-101: ⚠️ Potential issue | 🟠 Major

This V0 shape change still needs an upgrade story.

Changing service from SocketAddr to Option<SocketAddr> changes the bincode layout of an existing V0 type. Previously persisted platform-state snapshots will deserialize against a different wire format unless this rollout is explicitly resync-only. Please version the stored state or add migration logic before merge, and document the intended upgrade path.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/rs-drive-abci/src/platform_types/masternode/v0/mod.rs` around lines
97 - 101, You changed MasternodeStateV0.service from SocketAddr to
Option<SocketAddr>, which breaks bincode wire format for persisted V0 snapshots;
add an explicit migration path: keep a legacy struct (e.g.,
MasternodeStateV0Legacy with service: SocketAddr), implement a custom
Deserialize for MasternodeStateV0 that first attempts to decode the new shape
and on failure decodes the legacy shape and converts it into the new shape
(service -> Some(service)), and update any platform-state version identifier or
add a stored schema version constant and document the upgrade/migration behavior
(include symbols MasternodeStateV0 and MasternodeStateV0Legacy in
comments/docs).
packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_list/update_state_masternode_list/v0/mod.rs (1)

67-69: ⚠️ Potential issue | 🟠 Major

Service removals still leave stale validator endpoints.

DMNStateDiff.service = Some(None) now means Core explicitly removed the address, but this branch ignores that case and leaves the old validator entry intact. That makes incrementally updated validator sets diverge from freshly rebuilt ones, which now drop validators whose service is None; even when an address is present, core_port is still left stale.

Suggested patch
         validator_sets
             .iter_mut()
             .for_each(|(_quorum_hash, validator_set)| {
+                if matches!(dmn_state_diff.service, Some(None)) {
+                    validator_set.members_mut().remove(pro_tx_hash);
+                    return;
+                }
+
                 if let Some(validator) = validator_set.members_mut().get_mut(pro_tx_hash) {
                     if let Some(maybe_ban_height) = dmn_state_diff.pose_ban_height {
                         // the ban_height was changed
                         validator.is_banned = maybe_ban_height.is_some();
                     }
                     if let Some(Some(address)) = dmn_state_diff.service {
                         validator.node_ip = address.ip().to_string();
+                        validator.core_port = address.port();
                     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_list/update_state_masternode_list/v0/mod.rs`
around lines 67 - 69, The branch only handles Some(Some(address)) and leaves
stale endpoints when dmn_state_diff.service == Some(None); update the logic in
update_state_masternode_list so it matches on dmn_state_diff.service with three
cases: None (leave unchanged), Some(Some(address)) — set validator.node_ip =
address.ip().to_string() and set validator.core_port = address.port() (or the
correct field from address), and Some(None) — clear the endpoint by setting
validator.node_ip to an empty string and validator.core_port to a
zero/None-equivalent so the removed service is not left stale. Ensure you
reference dmn_state_diff.service, address.ip()/address.port(), validator.node_ip
and validator.core_port when making the changes.
🧹 Nitpick comments (2)
Cargo.toml (1)

50-54: Consider pinning to a specific rev before merging to a release branch.

Using branch = "feat/mempool-support" results in non-deterministic builds—different builds at different times may pull different commits. While this is acceptable for active development, Cargo best practices recommend pinning to a specific commit hash (rev = "...") for reproducible builds before merging to stable or release branches. Branch tracking is suitable for ongoing integration work but should be replaced with rev pinning to ensure build determinism in releases.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Cargo.toml` around lines 50 - 54, The Cargo.toml currently depends on the
remote branch feat/mempool-support for the dashcore-related crates (dashcore,
dash-spv, dash-spv-ffi, key-wallet, dashcore-rpc), which makes builds
non-deterministic; update each dependency entry to pin to a specific commit by
replacing the branch = "feat/mempool-support" with rev = "<commit-hash>" (use
the exact commit SHA you intend to track for each of dashcore, dash-spv,
dash-spv-ffi, key-wallet, and dashcore-rpc) so Cargo pulls a fixed revision for
reproducible builds before merging to the release branch.
packages/rs-sdk/src/platform/fetch_many.rs (1)

296-303: Rename object_type or pass the element type into the helper.

O is the FetchMany container type, so this field now logs the map/container type rather than the fetched item type. That makes the trace metadata misleading during debugging. Either rename it to container_type, or pass std::any::type_name::<Self>() down if you still want the element type.

🪵 Minimal honest-field rename
-        let object_type = std::any::type_name::<O>().to_string();
+        let container_type = std::any::type_name::<O>();
         tracing::trace!(
             request = ?request,
             response = ?response,
             ?address,
             retries,
-            object_type,
+            container_type,
             "fetched objects from platform"
         );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/rs-sdk/src/platform/fetch_many.rs` around lines 296 - 303, The trace
currently computes let object_type = std::any::type_name::<O>().to_string() but
O is the FetchMany container type, so rename this variable to container_type
(and update its usage in the tracing::trace! call) to avoid misleading metadata;
locate the declaration of object_type in fetch_many.rs and change both the
variable name and the trace field name from object_type to container_type (or
alternatively replace the type_name::<O>() call with
std::any::type_name::<Self>() if you prefer logging the element type).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In
`@packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_list/update_state_masternode_list/v0/mod.rs`:
- Around line 67-69: The branch only handles Some(Some(address)) and leaves
stale endpoints when dmn_state_diff.service == Some(None); update the logic in
update_state_masternode_list so it matches on dmn_state_diff.service with three
cases: None (leave unchanged), Some(Some(address)) — set validator.node_ip =
address.ip().to_string() and set validator.core_port = address.port() (or the
correct field from address), and Some(None) — clear the endpoint by setting
validator.node_ip to an empty string and validator.core_port to a
zero/None-equivalent so the removed service is not left stale. Ensure you
reference dmn_state_diff.service, address.ip()/address.port(), validator.node_ip
and validator.core_port when making the changes.

In `@packages/rs-drive-abci/src/platform_types/masternode/v0/mod.rs`:
- Around line 97-101: You changed MasternodeStateV0.service from SocketAddr to
Option<SocketAddr>, which breaks bincode wire format for persisted V0 snapshots;
add an explicit migration path: keep a legacy struct (e.g.,
MasternodeStateV0Legacy with service: SocketAddr), implement a custom
Deserialize for MasternodeStateV0 that first attempts to decode the new shape
and on failure decodes the legacy shape and converts it into the new shape
(service -> Some(service)), and update any platform-state version identifier or
add a stored schema version constant and document the upgrade/migration behavior
(include symbols MasternodeStateV0 and MasternodeStateV0Legacy in
comments/docs).

---

Nitpick comments:
In `@Cargo.toml`:
- Around line 50-54: The Cargo.toml currently depends on the remote branch
feat/mempool-support for the dashcore-related crates (dashcore, dash-spv,
dash-spv-ffi, key-wallet, dashcore-rpc), which makes builds non-deterministic;
update each dependency entry to pin to a specific commit by replacing the branch
= "feat/mempool-support" with rev = "<commit-hash>" (use the exact commit SHA
you intend to track for each of dashcore, dash-spv, dash-spv-ffi, key-wallet,
and dashcore-rpc) so Cargo pulls a fixed revision for reproducible builds before
merging to the release branch.

In `@packages/rs-sdk/src/platform/fetch_many.rs`:
- Around line 296-303: The trace currently computes let object_type =
std::any::type_name::<O>().to_string() but O is the FetchMany container type, so
rename this variable to container_type (and update its usage in the
tracing::trace! call) to avoid misleading metadata; locate the declaration of
object_type in fetch_many.rs and change both the variable name and the trace
field name from object_type to container_type (or alternatively replace the
type_name::<O>() call with std::any::type_name::<Self>() if you prefer logging
the element type).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 01300bfe-7ab1-4b3b-895f-87b4aed3ec89

📥 Commits

Reviewing files that changed from the base of the PR and between 89a1036 and 19f9f69.

⛔ Files ignored due to path filters (4)
  • .yarn/cache/@unrs-resolver-binding-darwin-arm64-npm-1.11.1-c78d4bd2cb-10.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/@unrs-resolver-binding-linux-x64-gnu-npm-1.11.1-93a00570de-10.zip is excluded by !**/.yarn/**, !**/*.zip
  • .yarn/cache/fsevents-patch-19706e7e35-10.zip is excluded by !**/.yarn/**, !**/*.zip
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (18)
  • Cargo.toml
  • packages/rs-dpp/Cargo.toml
  • packages/rs-dpp/src/lib.rs
  • packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/update_operator_identity/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_list/update_state_masternode_list/v0/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/mod.rs
  • packages/rs-drive-abci/src/platform_types/masternode/v0/mod.rs
  • packages/rs-drive-abci/src/platform_types/validator/v0/mod.rs
  • packages/rs-drive-abci/tests/strategy_tests/masternode_list_item_helpers.rs
  • packages/rs-drive-abci/tests/strategy_tests/masternodes.rs
  • packages/rs-platform-wallet/Cargo.toml
  • packages/rs-platform-wallet/examples/basic_usage.rs
  • packages/rs-platform-wallet/src/lib.rs
  • packages/rs-platform-wallet/src/platform_wallet_info/wallet_info_interface.rs
  • packages/rs-platform-wallet/src/platform_wallet_info/wallet_transaction_checker.rs
  • packages/rs-sdk/src/platform/fetch.rs
  • packages/rs-sdk/src/platform/fetch_many.rs
  • packages/rs-sdk/src/platform/fetch_unproved.rs

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.

3 participants