Skip to content

Conversation

@lklimek
Copy link
Contributor

@lklimek lklimek commented Jan 14, 2026

We need to replace abandoned bincode crate with some fork of it. In this PR, we update our code base to work with bincode v2.0.1.

In future, we will replace bincode with one of its forks, but for now we will stick to original bincode until there is a stable candidate for replacement.

Summary by CodeRabbit

  • Chores

    • Updated bincode serialization library to stable 2.0.1 across the workspace.
  • New Features

    • Decoding interfaces generalized to support contextualized decoding across wallet, address, hash and key types (improves flexibility for serialized data handling).
  • Documentation

    • Serialization docs updated to reflect bincode 2.0 compatibility and expanded serialized wallet contents.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

This PR updates bincode dependencies from rc pre-release versions to stable 2.0.1 across multiple crates and generalizes many bincode Decode/BorrowDecode implementations to accept a generic Context type parameter C, adjusting decoder trait bounds and related method signatures.

Changes

Cohort / File(s) Summary
Dependency version updates
dash-network/Cargo.toml, dash/Cargo.toml, hashes/Cargo.toml, key-wallet-manager/Cargo.toml, key-wallet/Cargo.toml, rpc-json/Cargo.toml
Replace =2.0.0-rc.3 with "2.0.1" for bincode/bincode_derive (preserve optional/feature flags); minor Cargo.toml formatting tweak in one feature list.
Macro changes: bincode trait generation
hashes/src/bincode_macros.rs, hashes/src/internal_macros.rs
Macro-generated impls now emit impl<C> bincode::Decode<C> and impl<'de, C> bincode::BorrowDecode<'de, C>, and require Decoder<Context = C> / BorrowDecoder<'de, Context = C>.
Dash: address decode impls
dash/src/address.rs
Address and AddressType Decode/BorrowDecode impls parameterized as Decode<C>/BorrowDecode<'de, C> and decoder bounds updated to include Context = C.
Key wallet: BIP32 / SLIP-10 / BLS derivations
key-wallet/src/bip32.rs, key-wallet/src/derivation_bls_bip32.rs, key-wallet/src/derivation_slip10.rs
ExtendedPrivKey/ExtendedPubKey, ExtendedBLS*, ExtendedEd25519* and DerivationPath decoding impls generalized to Decode<C>/BorrowDecode<'de,C>; decoder bounds and internal decode calls updated accordingly.
Key wallet: wallet types
key-wallet/src/mnemonic.rs, key-wallet/src/wallet/root_extended_keys.rs
Mnemonic, RootExtendedPrivKey, RootExtendedPubKey Decode/BorrowDecode impls now generic over Context C; qualified decode calls adjusted to <Self as Decode<C>>::decode.
Docs: import wallet FFI
key-wallet-ffi/IMPORT_WALLET_FFI.md
Update bincode version reference to 2.0 and expand serialized wallet contents checklist (added transaction history and other wallet metadata).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • pankcuf

Poem

🐰 A nibble of bytes, a contextual breeze,
Decoders now stretch with elegant ease,
From RC to stable we hop on the way,
Types carry context and brighten the day,
Hooray — small changes, big tidy ballet! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'build(deps): bump bincode to 2.0.1' clearly and specifically describes the main change in the pull request, which is updating the bincode dependency to version 2.0.1 across multiple crates.

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


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
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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
hashes/src/bincode_macros.rs (1)

43-58: Use core::convert::TryInto for no_std compatibility.

The macro uses std::convert::TryInto at line 46, which is unavailable in no_std builds. This breaks compatibility when the bincode feature is enabled without the std feature. Change to core::convert::TryInto to match the approach used in other hash implementations (sha256, sha1, sha512, ripemd160) across the crate.

🧹 Nitpick comments (1)
dash/src/address.rs (1)

902-933: Consider extracting the match logic to reduce duplication.

Both Decode<C> and BorrowDecode<'de, C> for AddressType contain identical match logic for converting u8 to AddressType. This is acceptable but could be extracted into a helper method if desired.

♻️ Optional refactor to reduce duplication
+impl AddressType {
+    fn from_u8(val: u8) -> Result<Self, bincode::error::DecodeError> {
+        match val {
+            0 => Ok(AddressType::P2pkh),
+            1 => Ok(AddressType::P2sh),
+            2 => Ok(AddressType::P2wpkh),
+            3 => Ok(AddressType::P2wsh),
+            4 => Ok(AddressType::P2tr),
+            _ => Err(bincode::error::DecodeError::OtherString("invalid address type".to_string())),
+        }
+    }
+}
+
 #[cfg(feature = "bincode")]
 impl<C> bincode::Decode<C> for AddressType {
     fn decode<D: bincode::de::Decoder<Context = C>>(
         decoder: &mut D,
     ) -> Result<Self, bincode::error::DecodeError> {
         let val = u8::decode(decoder)?;
-        match val {
-            0 => Ok(AddressType::P2pkh),
-            1 => Ok(AddressType::P2sh),
-            2 => Ok(AddressType::P2wpkh),
-            3 => Ok(AddressType::P2wsh),
-            4 => Ok(AddressType::P2tr),
-            _ => Err(bincode::error::DecodeError::OtherString("invalid address type".to_string())),
-        }
+        Self::from_u8(val)
     }
 }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c8ad7ba and 7dc9936.

📒 Files selected for processing (15)
  • dash-network/Cargo.toml
  • dash/Cargo.toml
  • dash/src/address.rs
  • hashes/Cargo.toml
  • hashes/src/bincode_macros.rs
  • hashes/src/internal_macros.rs
  • key-wallet-ffi/IMPORT_WALLET_FFI.md
  • key-wallet-manager/Cargo.toml
  • key-wallet/Cargo.toml
  • key-wallet/src/bip32.rs
  • key-wallet/src/derivation_bls_bip32.rs
  • key-wallet/src/derivation_slip10.rs
  • key-wallet/src/mnemonic.rs
  • key-wallet/src/wallet/root_extended_keys.rs
  • rpc-json/Cargo.toml
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

**/*.rs: MSRV (Minimum Supported Rust Version) is 1.89; ensure compatibility with this version for all builds
Unit tests should live alongside code with #[cfg(test)] annotation; integration tests use the tests/ directory
Use snake_case for function and variable names
Use UpperCamelCase for types and traits
Use SCREAMING_SNAKE_CASE for constants
Format code with rustfmt before commits; ensure cargo fmt --all is run
Run cargo clippy --workspace --all-targets -- -D warnings for linting; avoid warnings in CI
Prefer async/await via tokio for asynchronous operations

**/*.rs: Never hardcode network parameters, addresses, or keys in Rust code
Use proper error types (thiserror) and propagate errors appropriately in Rust
Use tokio runtime for async operations in Rust
Use conditional compilation with feature flags for optional features
Write unit tests for new functionality in Rust
Format code using cargo fmt
Run clippy with all features and all targets, treating warnings as errors
Never log or expose private keys in any code
Always validate inputs from untrusted sources in Rust
Use secure random number generation for keys

Files:

  • dash/src/address.rs
  • hashes/src/internal_macros.rs
  • key-wallet/src/derivation_slip10.rs
  • key-wallet/src/wallet/root_extended_keys.rs
  • key-wallet/src/bip32.rs
  • hashes/src/bincode_macros.rs
  • key-wallet/src/derivation_bls_bip32.rs
  • key-wallet/src/mnemonic.rs
key-wallet/**/*.rs

📄 CodeRabbit inference engine (key-wallet/CLAUDE.md)

key-wallet/**/*.rs: Separate immutable structures (Account, Wallet) containing only identity information from mutable wrappers (ManagedAccount, ManagedWalletInfo) with state management
Never serialize or log private keys in production; use public keys or key fingerprints for identification instead
Always validate network consistency when deriving or validating addresses; never mix mainnet and testnet operations
Use BTreeMap for ordered data (accounts, transactions) and HashMap for lookups (address mappings); apply memory management strategies for old transaction data
Apply atomic state updates when managing watch-only wallets: validate that external signatures match expected pubkeys and never attempt signing operations
Use the ? operator for error propagation, provide context in error messages, never panic in library code, and return Result<T> for all fallible operations

Files:

  • key-wallet/src/derivation_slip10.rs
  • key-wallet/src/wallet/root_extended_keys.rs
  • key-wallet/src/bip32.rs
  • key-wallet/src/derivation_bls_bip32.rs
  • key-wallet/src/mnemonic.rs
🧠 Learnings (25)
📚 Learning: 2025-12-22T17:59:51.097Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-22T17:59:51.097Z
Learning: Applies to **/*.rs : MSRV (Minimum Supported Rust Version) is 1.89; ensure compatibility with this version for all builds

Applied to files:

  • rpc-json/Cargo.toml
  • hashes/Cargo.toml
  • dash-network/Cargo.toml
  • key-wallet/Cargo.toml
📚 Learning: 2025-08-21T04:45:50.436Z
Learnt from: QuantumExplorer
Repo: dashpay/rust-dashcore PR: 108
File: key-wallet/src/gap_limit.rs:291-295
Timestamp: 2025-08-21T04:45:50.436Z
Learning: The rust-dashcore project uses Rust 1.89 as evidenced by rust-version = "1.89" in dash-spv/Cargo.toml. Modern Rust features like Option::is_none_or (stabilized in 1.82) can be used safely.

Applied to files:

  • rpc-json/Cargo.toml
  • hashes/Cargo.toml
  • dash-network/Cargo.toml
  • key-wallet/Cargo.toml
  • dash/Cargo.toml
  • key-wallet-manager/Cargo.toml
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Use `BTreeMap` for ordered data (accounts, transactions) and `HashMap` for lookups (address mappings); apply memory management strategies for old transaction data

Applied to files:

  • rpc-json/Cargo.toml
  • key-wallet-ffi/IMPORT_WALLET_FFI.md
  • hashes/Cargo.toml
  • key-wallet/Cargo.toml
  • key-wallet/src/wallet/root_extended_keys.rs
  • key-wallet/src/bip32.rs
  • key-wallet/src/mnemonic.rs
  • key-wallet-manager/Cargo.toml
📚 Learning: 2025-12-16T09:03:55.811Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: Applies to dash-spv/**/*.rs : Maintain minimum Rust version (MSRV) of 1.89 and use only compatible syntax and features

Applied to files:

  • rpc-json/Cargo.toml
  • hashes/Cargo.toml
  • dash-network/Cargo.toml
  • key-wallet/Cargo.toml
  • dash/Cargo.toml
  • key-wallet-manager/Cargo.toml
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/bip32/**/*.rs : Cache intermediate key derivation results and batch derive child keys when possible to optimize derivation performance

Applied to files:

  • rpc-json/Cargo.toml
  • key-wallet/Cargo.toml
  • key-wallet/src/derivation_slip10.rs
  • key-wallet/src/wallet/root_extended_keys.rs
  • key-wallet/src/bip32.rs
  • key-wallet/src/derivation_bls_bip32.rs
  • key-wallet/src/mnemonic.rs
  • key-wallet-manager/Cargo.toml
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/address_pool/**/*.rs : Support multiple `KeySource` variants (Private, Public, NoKeySource) to enable both full wallets and watch-only wallets with the same interface

Applied to files:

  • rpc-json/Cargo.toml
  • key-wallet-ffi/IMPORT_WALLET_FFI.md
  • key-wallet/Cargo.toml
  • key-wallet/src/derivation_slip10.rs
  • key-wallet/src/wallet/root_extended_keys.rs
  • key-wallet/src/bip32.rs
  • key-wallet/src/derivation_bls_bip32.rs
  • key-wallet-manager/Cargo.toml
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Add cbindgen annotations for complex types in FFI functions

Applied to files:

  • rpc-json/Cargo.toml
  • hashes/Cargo.toml
  • dash/src/address.rs
  • key-wallet/Cargo.toml
  • key-wallet/src/bip32.rs
  • dash/Cargo.toml
  • key-wallet-manager/Cargo.toml
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Never serialize or log private keys in production; use public keys or key fingerprints for identification instead

Applied to files:

  • rpc-json/Cargo.toml
  • key-wallet/Cargo.toml
  • key-wallet-manager/Cargo.toml
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Use the `?` operator for error propagation, provide context in error messages, never panic in library code, and return `Result<T>` for all fallible operations

Applied to files:

  • rpc-json/Cargo.toml
  • key-wallet/Cargo.toml
  • key-wallet/src/wallet/root_extended_keys.rs
  • key-wallet/src/bip32.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Use thread-local storage for error propagation via `dash_spv_ffi_get_last_error()` function

Applied to files:

  • rpc-json/Cargo.toml
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Rust strings must be returned as `*const c_char` with caller responsibility to free using `dash_string_free`

Applied to files:

  • rpc-json/Cargo.toml
📚 Learning: 2025-08-21T05:01:58.949Z
Learnt from: QuantumExplorer
Repo: dashpay/rust-dashcore PR: 108
File: key-wallet-ffi/src/wallet_manager.rs:270-318
Timestamp: 2025-08-21T05:01:58.949Z
Learning: In the key-wallet-ffi design, wallets retrieved from the wallet manager via lookup functions should return const pointers (*const FFIWallet) to enforce read-only access and prevent unintended modifications. The wallet manager should control wallet lifecycle and mutations through specific APIs rather than allowing external mutation of retrieved wallet references.

Applied to files:

  • key-wallet-ffi/IMPORT_WALLET_FFI.md
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Apply atomic state updates when managing watch-only wallets: validate that external signatures match expected pubkeys and never attempt signing operations

Applied to files:

  • key-wallet-ffi/IMPORT_WALLET_FFI.md
  • key-wallet/Cargo.toml
  • key-wallet-manager/Cargo.toml
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Maintain backward compatibility for serialized wallets and monitor for new DIPs affecting wallet structure when updating derivation paths

Applied to files:

  • key-wallet-ffi/IMPORT_WALLET_FFI.md
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/managed_account/**/*.rs : Implement atomic state updates when processing transactions: update transactions, UTXOs, balances, and address usage state together

Applied to files:

  • key-wallet-ffi/IMPORT_WALLET_FFI.md
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Separate immutable structures (`Account`, `Wallet`) containing only identity information from mutable wrappers (`ManagedAccount`, `ManagedWalletInfo`) with state management

Applied to files:

  • key-wallet-ffi/IMPORT_WALLET_FFI.md
  • key-wallet/Cargo.toml
  • key-wallet/src/wallet/root_extended_keys.rs
  • key-wallet/src/bip32.rs
  • key-wallet/src/derivation_bls_bip32.rs
  • key-wallet/src/mnemonic.rs
  • key-wallet-manager/Cargo.toml
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/account/**/*.rs : Use enum-based type system for `AccountType` with specific variants (Standard, IdentityAuthentication, IdentityEncryption, MasternodeOperator, etc.) to provide compile-time safety and clear semantics

Applied to files:

  • key-wallet-ffi/IMPORT_WALLET_FFI.md
  • key-wallet/src/wallet/root_extended_keys.rs
  • key-wallet/src/bip32.rs
  • key-wallet/src/derivation_bls_bip32.rs
  • key-wallet/src/mnemonic.rs
📚 Learning: 2025-12-30T22:00:57.000Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-30T22:00:57.000Z
Learning: Applies to **/*.rs : Use conditional compilation with feature flags for optional features

Applied to files:

  • hashes/Cargo.toml
  • dash-network/Cargo.toml
  • key-wallet/Cargo.toml
📚 Learning: 2025-12-30T22:00:57.000Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-30T22:00:57.000Z
Learning: Applies to **/*.rs : Never hardcode network parameters, addresses, or keys in Rust code

Applied to files:

  • hashes/Cargo.toml
📚 Learning: 2025-12-16T09:03:55.811Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: Run 'cargo fmt --check' to verify formatting, 'cargo clippy --all-targets --all-features -- -D warnings' for linting, and 'cargo check --all-features' to verify all features compile

Applied to files:

  • dash-network/Cargo.toml
  • key-wallet/Cargo.toml
📚 Learning: 2025-06-15T16:42:18.187Z
Learnt from: QuantumExplorer
Repo: dashpay/rust-dashcore PR: 74
File: key-wallet-ffi/src/lib_tests.rs:41-48
Timestamp: 2025-06-15T16:42:18.187Z
Learning: In key-wallet-ffi, the HDWallet::derive_xpriv method returns Result<String, KeyWalletError>, not an ExtPrivKey wrapper. When unwrapped, it yields a String that can have .is_empty() called on it.

Applied to files:

  • key-wallet/src/derivation_slip10.rs
📚 Learning: 2025-12-16T09:03:55.811Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: Applies to dash-spv/tests/**/*.rs : Organize tests into unit tests (in-module), integration tests (tests/ directory), real network tests (with live Dash Core nodes), and performance benchmarks

Applied to files:

  • dash/Cargo.toml
  • key-wallet-manager/Cargo.toml
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/address_pool/**/*.rs : Pre-generate addresses in batches (typically 20-100) and store them in pools; only derive on-demand when the pool is exhausted

Applied to files:

  • key-wallet-manager/Cargo.toml
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/tests/**/*.rs : Use deterministic testing with known test vectors and fixed seeds for reproducible results

Applied to files:

  • key-wallet-manager/Cargo.toml
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/tests/**/*.rs : Organize unit tests by functionality: separate test files for BIP32, mnemonics, addresses, derivation paths, and PSBT operations

Applied to files:

  • key-wallet-manager/Cargo.toml
🧬 Code graph analysis (4)
key-wallet/src/bip32.rs (3)
dash/src/address.rs (4)
  • decode (867-875)
  • decode (903-915)
  • borrow_decode (880-888)
  • borrow_decode (920-932)
key-wallet/src/derivation_bls_bip32.rs (4)
  • decode (532-555)
  • decode (588-613)
  • borrow_decode (560-564)
  • borrow_decode (618-622)
key-wallet/src/mnemonic.rs (2)
  • decode (74-85)
  • borrow_decode (90-100)
hashes/src/bincode_macros.rs (7)
dash/src/address.rs (4)
  • decode (867-875)
  • decode (903-915)
  • borrow_decode (880-888)
  • borrow_decode (920-932)
key-wallet/src/derivation_bls_bip32.rs (4)
  • decode (532-555)
  • decode (588-613)
  • borrow_decode (560-564)
  • borrow_decode (618-622)
key-wallet/src/derivation_slip10.rs (6)
  • decode (180-237)
  • decode (328-382)
  • decode (527-538)
  • decode (559-579)
  • borrow_decode (584-588)
  • borrow_decode (593-597)
key-wallet/src/mnemonic.rs (2)
  • decode (74-85)
  • borrow_decode (90-100)
dash/src/blockdata/script/borrowed.rs (1)
  • bytes (167-169)
dash/src/crypto/key.rs (1)
  • from_byte_array (400-402)
hashes/src/lib.rs (1)
  • from_byte_array (227-227)
key-wallet/src/derivation_bls_bip32.rs (3)
key-wallet/src/bip32.rs (8)
  • decode (379-401)
  • decode (502-524)
  • decode (960-964)
  • decode (1581-1587)
  • decode (1873-1879)
  • borrow_decode (406-428)
  • borrow_decode (529-551)
  • borrow_decode (969-973)
key-wallet/src/mnemonic.rs (2)
  • decode (74-85)
  • borrow_decode (90-100)
key-wallet/src/wallet/root_extended_keys.rs (4)
  • decode (174-191)
  • decode (310-326)
  • borrow_decode (196-202)
  • borrow_decode (331-337)
key-wallet/src/mnemonic.rs (1)
dash/src/address.rs (4)
  • decode (867-875)
  • decode (903-915)
  • borrow_decode (880-888)
  • borrow_decode (920-932)
⏰ 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). (11)
  • GitHub Check: fuzz (dash_script_bytes_to_asm_fmt)
  • GitHub Check: fuzz (dash_deser_net_msg)
  • GitHub Check: fuzz (hashes_sha512)
  • GitHub Check: fuzz (hashes_sha1)
  • GitHub Check: fuzz (dash_deserialize_block)
  • GitHub Check: fuzz (dash_deserialize_script)
  • GitHub Check: fuzz (dash_deserialize_amount)
  • GitHub Check: fuzz (hashes_cbor)
  • GitHub Check: fuzz (hashes_sha256)
  • GitHub Check: fuzz (hashes_sha512_256)
  • GitHub Check: Address Sanitizer
🔇 Additional comments (26)
hashes/Cargo.toml (1)

38-38: LGTM!

The bincode dependency is correctly updated from pre-release 2.0.0-rc.3 to stable 2.0.1 while preserving the optional flag.

key-wallet/Cargo.toml (1)

39-40: LGTM!

Both bincode and bincode_derive are correctly updated to 2.0.1 in tandem, maintaining version alignment between the main crate and its derive macro companion.

key-wallet-ffi/IMPORT_WALLET_FFI.md (1)

87-92: LGTM!

Documentation correctly updated to reflect bincode format version 2.0. Using "2.0" rather than the specific patch version is appropriate for documentation as it indicates API compatibility with the 2.x series.

dash-network/Cargo.toml (1)

17-22: LGTM!

Dependencies are correctly updated:

  • serde reformatted for readability (no functional change)
  • bincode and bincode_derive both updated to 2.0.1 with existing flags preserved (optional, default-features = false)
rpc-json/Cargo.toml (1)

31-31: LGTM!

The bincode dependency is correctly updated to 2.0.1 with the serde feature preserved. The change from an exact version pin (=2.0.0-rc.3) to standard semver (2.0.1) is appropriate when moving from a pre-release to a stable version.

dash/Cargo.toml (1)

64-78: LGTM!

The bincode dependency updates from pre-release 2.0.0-rc.3 to stable 2.0.1 are correct. Removing the exact version pinning (=) is appropriate now that bincode 2.0 is stable, allowing compatible patch updates.

key-wallet-manager/Cargo.toml (1)

16-25: LGTM!

Consistent bincode version bump to 2.0.1 aligning with the workspace-wide update.

key-wallet/src/bip32.rs (5)

377-402: LGTM!

The Decode<C> implementation for ExtendedPrivKey correctly adds the generic context parameter to match bincode 2.0.1 API. The decoding logic is unchanged and properly handles field-by-field decoding with appropriate error conversion for the private key bytes.


404-429: LGTM!

The BorrowDecode<'de, C> implementation for ExtendedPrivKey correctly updates the trait signature. The implementation properly duplicates the decode logic since secp256k1::SecretKey doesn't support zero-copy borrowing from the decoder.


500-525: LGTM!

The Decode<C> implementation for ExtendedPubKey correctly follows the same pattern, with proper handling of the 33-byte compressed public key format.


527-552: LGTM!

The BorrowDecode<'de, C> implementation for ExtendedPubKey is consistent with the codebase pattern.


958-974: LGTM!

The Decode<C> and BorrowDecode<'de, C> implementations for DerivationPath correctly delegate to the underlying Vec<ChildNumber> decode, which handles the context propagation automatically.

key-wallet/src/mnemonic.rs (1)

72-101: LGTM!

The Decode<C> and BorrowDecode<'de, C> implementations for Mnemonic correctly add the generic context parameter. The parsing logic appropriately uses bip39_crate::Mnemonic::parse which auto-detects language, with clear error messages for invalid mnemonics.

key-wallet/src/derivation_bls_bip32.rs (2)

530-565: LGTM!

The Decode<C> and BorrowDecode<'de, C> implementations for ExtendedBLSPrivKey correctly add the generic context parameter. The BorrowDecode implementation appropriately delegates to Decode using fully-qualified syntax <Self as bincode::Decode<C>>::decode(decoder), which is the correct pattern when the underlying type (BlsSecretKey) doesn't support zero-copy borrowing.


586-623: LGTM!

The Decode<C> and BorrowDecode<'de, C> implementations for ExtendedBLSPubKey follow the same consistent pattern. The public key decoding correctly uses SerializationFormat::Modern for BLS key deserialization with appropriate error handling.

hashes/src/internal_macros.rs (2)

150-158: LGTM!

The Decode<C> implementation correctly adds the generic context parameter and updates the decoder bound to Decoder<Context = C>. The internal call to <[u8; $bits / 8]>::decode(decoder) will work because bincode 2.0.1's primitive array implementations also use the contextual Decode<C> trait.


160-173: LGTM!

The BorrowDecode<'de, C> implementation correctly adds the context parameter and updates the decoder bound. The borrowed decoding path properly uses bincode::BorrowDecode::borrow_decode(decoder)? to obtain the borrowed slice.

key-wallet/src/derivation_slip10.rs (3)

526-539: LGTM!

The Decode<C> implementation for ExtendedEd25519PrivKey correctly introduces the context parameter. The nested type decoding calls (Network::decode, Fingerprint::decode, etc.) will work correctly as these types are updated elsewhere in the PR to support Decode<C>.


558-580: LGTM!

The Decode<C> implementation for ExtendedEd25519PubKey follows the same correct pattern. Error handling with DecodeError::OtherString for the VerifyingKey::from_bytes conversion is appropriate.


583-598: LGTM!

Both BorrowDecode<'de, C> implementations correctly delegate to their respective Decode<C> implementations using the explicit trait path <Self as bincode::Decode<C>>::decode(decoder). This is the idiomatic pattern when the borrowed decode doesn't need special handling for borrowed data.

key-wallet/src/wallet/root_extended_keys.rs (4)

173-192: LGTM!

The Decode<C> implementation for RootExtendedPrivKey correctly adds the context parameter. The error handling for invalid private key bytes using DecodeError::OtherString is appropriate.


195-203: LGTM!

The BorrowDecode<'de, C> implementation correctly delegates to Decode<C>. The comment explaining why borrowing isn't used (secp256k1::SecretKey doesn't support borrowing) is helpful.


309-327: LGTM!

The Decode<C> implementation for RootExtendedPubKey follows the same correct pattern with proper error handling for public key validation.


330-338: LGTM!

The BorrowDecode<'de, C> implementation correctly delegates to Decode<C>, consistent with the private key implementation.

dash/src/address.rs (1)

866-889: LGTM!

The Decode<C> and BorrowDecode<'de, C> implementations for Address correctly add the context parameter. The string-based serialization approach is maintained, with proper error handling via DecodeError::OtherString.

hashes/src/bincode_macros.rs (1)

35-41: LGTM!

The Decode<C> implementation in the macro correctly adds the context parameter and updates the decoder bound. The decoding of the fixed-length byte array via <[u8; $len]>::decode(decoder)? works correctly with bincode 2.0.1.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@xdustinface xdustinface changed the base branch from v0.42-dev to master January 14, 2026 15:20
@xdustinface
Copy link
Collaborator

@lklimek Can you rebase this on master? I will create the fix release there and then merge it back into the dev branch.

@lklimek lklimek force-pushed the deps/bincode-2.0.1 branch from d363101 to 38a77c8 Compare January 15, 2026 07:41
@xdustinface xdustinface merged commit 53d699c into master Jan 15, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants