Skip to content

fix(rpc-json): disable key-wallet default features#596

Merged
xdustinface merged 1 commit intov0.42-devfrom
fix/rpc-key-wallet-defaults
Mar 30, 2026
Merged

fix(rpc-json): disable key-wallet default features#596
xdustinface merged 1 commit intov0.42-devfrom
fix/rpc-key-wallet-defaults

Conversation

@shumkov
Copy link
Copy Markdown
Collaborator

@shumkov shumkov commented Mar 30, 2026

Summary

Add default-features = false to key-wallet dep in rpc-json with explicit getrandom + serde features.

rpc-json only needs key-wallet for type definitions and serde — it doesn't use the wallet manager or SPV. Without this fix, any crate depending on dashcore-rpc transitively enables key-wallet's manager default feature which pulls in tokio, inflating WASM builds unnecessarily (e.g. platform's wasm-sdk).

Changes

  • rpc-json/Cargo.toml: default-features = false, features=["serde", "getrandom"]

Testing

  • cargo check --workspace passes
  • cargo test -p dashcore-rpc-json --all-features --no-run passes

Summary by CodeRabbit

  • Chores
    • Updated internal dependency configurations to optimize feature flags.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 35743f0f-14ed-4286-bf98-1a0d8352201c

📥 Commits

Reviewing files that changed from the base of the PR and between 55bfdec and 13fa6f6.

📒 Files selected for processing (1)
  • rpc-json/Cargo.toml
✅ Files skipped from review due to trivial changes (1)
  • rpc-json/Cargo.toml

📝 Walkthrough

Walkthrough

The key-wallet dependency in rpc-json/Cargo.toml was updated to disable default features and explicitly enable the getrandom and serde features instead of relying on default feature activation.

Changes

Cohort / File(s) Summary
Cargo Dependency Configuration
rpc-json/Cargo.toml
Updated key-wallet dependency to disable default features (default-features = false) and explicitly enable getrandom and serde features.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A tiny tweak, so neat and small,
Default features, now off we call,
With getrandom bright and serde true,
The wallet hops with freshly tuned brew! ✨

🚥 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 pull request title clearly and specifically describes the main change: disabling default features for the key-wallet dependency in rpc-json, which is the primary modification in 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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/rpc-key-wallet-defaults

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.

Copy link
Copy Markdown
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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@dash-spv-ffi/src/config.rs`:
- Around line 169-184: This PR introduces an unrelated FFI API addition (the
function dash_spv_ffi_config_clear_peers operating on FFIClientConfig /
ClientConfig and touching cfg.peers) that should be split into a separate,
focused change; remove or revert the dash_spv_ffi_config_clear_peers addition
from this branch (or move it to a new branch/PR) and open a dedicated PR for the
FFI feature, or alternatively retitle/recategorize this PR to include the ffi
change so it matches pr-title.yml policies.

In `@dash-spv-ffi/tests/test_config.rs`:
- Around line 97-119: Update the test to exercise both networks and assert setup
calls succeed: for each FFINetwork variant (Testnet and Mainnet) call
dash_spv_ffi_config_new and assert it returns a non-null config, call
dash_spv_ffi_config_add_peer for each peer and assert the return equals
FFIErrorCode::Success, then call dash_spv_ffi_config_clear_peers and assert
success (including the second clear on an already-empty config), and finally
call dash_spv_ffi_config_destroy; reference dash_spv_ffi_config_new,
dash_spv_ffi_config_add_peer, dash_spv_ffi_config_clear_peers and
dash_spv_ffi_config_destroy when making these changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 668767a7-8bf3-4e98-bf68-c9f62abd44fd

📥 Commits

Reviewing files that changed from the base of the PR and between 472131a and 55bfdec.

📒 Files selected for processing (4)
  • dash-spv-ffi/FFI_API.md
  • dash-spv-ffi/src/config.rs
  • dash-spv-ffi/tests/test_config.rs
  • rpc-json/Cargo.toml

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.05%. Comparing base (472131a) to head (13fa6f6).
⚠️ Report is 1 commits behind head on v0.42-dev.

Additional details and impacted files
@@              Coverage Diff              @@
##           v0.42-dev     #596      +/-   ##
=============================================
- Coverage      67.06%   67.05%   -0.02%     
=============================================
  Files            318      318              
  Lines          67026    67026              
=============================================
- Hits           44950    44941       -9     
- Misses         22076    22085       +9     
Flag Coverage Δ
core 75.21% <ø> (ø)
ffi 34.26% <ø> (ø)
rpc 19.92% <ø> (ø)
spv 83.73% <ø> (-0.07%) ⬇️
wallet 66.97% <ø> (ø)
see 5 files with indirect coverage changes

rpc-json only needs key-wallet for types and serde. With default-features,
it pulls in the manager module (tokio) which inflates WASM builds that
depend on dashcore-rpc transitively.

Add default-features = false with explicit getrandom + serde features.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@shumkov shumkov force-pushed the fix/rpc-key-wallet-defaults branch from 55bfdec to 13fa6f6 Compare March 30, 2026 05:22
@github-actions github-actions bot added the ready-for-review CodeRabbit has approved this PR label Mar 30, 2026
@xdustinface xdustinface merged commit 2369fc6 into v0.42-dev Mar 30, 2026
38 checks passed
@xdustinface xdustinface deleted the fix/rpc-key-wallet-defaults branch March 30, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review CodeRabbit has approved this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants