Skip to content

Conversation

@xdustinface
Copy link
Collaborator

@xdustinface xdustinface commented Dec 21, 2025

Some fixes required to get the docs build step in my CI overhaul PR to pass (#253). Some of it is also cosmetic/style changes to the docs while at it.

Summary by CodeRabbit

  • New Features

    • Added transaction broadcasting support to the Dash SPV FFI, allowing transactions to be sent to the Dash network via connected peers.
  • Documentation

    • Improved and standardized documentation formatting and examples across the codebase; expanded safety and ownership notes for key FFI and broadcast-related operations for clearer guidance.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 21, 2025

Walkthrough

Adds a new public FFI declaration for broadcasting a transaction and performs widespread documentation cleanups: consistent inline code formatting, doc-heading standardization, minor doc-fence fixes, and example/address formatting adjustments.

Changes

Cohort / File(s) Change Summary
FFI Broadcast Declaration
dash-spv-ffi/include/dash_spv_ffi.h, dash-spv-ffi/src/broadcast.rs
Introduced dash_spv_ffi_client_broadcast_transaction declaration and added module/docs describing purpose and safety (non-null client and tx_hex, hex-encoded tx).
FFI API Docs & Examples
dash-spv-ffi/FFI_API.md, dash-spv-ffi/src/config.rs
Enhanced API docs: added detailed broadcast function docs and formatted example addresses with code ticks; added explicit Safety notes.
Type & Code-Span Formatting (docs only)
dash-spv/src/client/core.rs, dash-spv/src/client/mod.rs, dash-spv/src/types.rs, dash/src/blockdata/transaction/mod.rs, dash/src/crypto/key.rs, dash/src/network/message_qrinfo.rs, dash/src/taproot.rs, hashes/src/hash_x11.rs, key-wallet-ffi/src/error.rs, key-wallet-ffi/src/managed_account.rs, key-wallet-ffi/src/wallet_manager.rs, key-wallet/src/managed_account/address_pool.rs, key-wallet/src/managed_account/managed_account_type.rs, key-wallet/src/account/account_type.rs, key-wallet-ffi/src/types.rs
Converted plain type references and trait bounds to inline code formatting (e.g., Arc<Mutex<T>>, Vec<bool>, Into<FFIError>) across doc comments; escaped bracketed path components.
Doc Heading & Example Standardization
dash-spv/src/logging.rs, dash-spv/src/sync/manager.rs, key-wallet/src/mnemonic.rs, key-wallet/src/wallet/backup.rs, key-wallet/src/wallet/initialization.rs
Changed doc headings from "# Example" to "# Examples" and adjusted example blocks wording for consistency.
Reference / Link Fixes (docs only)
dash/src/network/message_sml.rs, rpc-client/src/client.rs, rpc-json/src/lib.rs
Fixed doc links and reference syntax, replacing bracketed or implicit links with explicit inline code references where appropriate.
Minor Doc Cleanup
hashes/src/bincode_macros.rs, key-wallet-ffi/include/key_wallet_ffi.h
Removed orphaned doc fence/lines and escaped bracket characters in path examples; small doc formatting fixes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Focus review on:
    • dash-spv-ffi/include/dash_spv_ffi.h — ensure function signature and Safety comment match intended FFI contract.
    • dash-spv-ffi/src/broadcast.rs and dash-spv-ffi/FFI_API.md — verify docs accurately reflect any expectations (pointer ownership, hex format).
    • hashes/src/bincode_macros.rs — confirm doc fence/truncation changes didn't remove intended examples.
    • Spot-check representative files from each cohort for unintended content or formatting regressions.

Poem

🐰 With backticks snug and safety signed,
I hopped through docs to tidy each line.
A broadcast added, gentle and bright,
Examples plural, and links set right.
Hop, code, hop — the changelog's delight! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the primary objective of the PR: fixing documentation build issues. It is concise, clear, and specific enough to convey the main purpose.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/issues

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 49ff328 and f43e815.

📒 Files selected for processing (29)
  • dash-spv-ffi/FFI_API.md (3 hunks)
  • dash-spv-ffi/include/dash_spv_ffi.h (2 hunks)
  • dash-spv-ffi/src/broadcast.rs (1 hunks)
  • dash-spv-ffi/src/config.rs (1 hunks)
  • dash-spv/src/client/core.rs (2 hunks)
  • dash-spv/src/client/mod.rs (1 hunks)
  • dash-spv/src/logging.rs (1 hunks)
  • dash-spv/src/sync/manager.rs (1 hunks)
  • dash-spv/src/types.rs (3 hunks)
  • dash/src/blockdata/transaction/mod.rs (4 hunks)
  • dash/src/crypto/key.rs (3 hunks)
  • dash/src/network/message_qrinfo.rs (1 hunks)
  • dash/src/network/message_sml.rs (2 hunks)
  • dash/src/taproot.rs (1 hunks)
  • hashes/src/bincode_macros.rs (0 hunks)
  • hashes/src/hash_x11.rs (1 hunks)
  • key-wallet-ffi/include/key_wallet_ffi.h (1 hunks)
  • key-wallet-ffi/src/error.rs (1 hunks)
  • key-wallet-ffi/src/managed_account.rs (1 hunks)
  • key-wallet-ffi/src/types.rs (1 hunks)
  • key-wallet-ffi/src/wallet_manager.rs (1 hunks)
  • key-wallet/src/account/account_type.rs (1 hunks)
  • key-wallet/src/managed_account/address_pool.rs (1 hunks)
  • key-wallet/src/managed_account/managed_account_type.rs (1 hunks)
  • key-wallet/src/mnemonic.rs (2 hunks)
  • key-wallet/src/wallet/backup.rs (2 hunks)
  • key-wallet/src/wallet/initialization.rs (2 hunks)
  • rpc-client/src/client.rs (2 hunks)
  • rpc-json/src/lib.rs (2 hunks)
💤 Files with no reviewable changes (1)
  • hashes/src/bincode_macros.rs
✅ Files skipped from review due to trivial changes (3)
  • dash-spv/src/client/core.rs
  • dash/src/taproot.rs
  • dash-spv/src/sync/manager.rs
🚧 Files skipped from review as they are similar to previous changes (17)
  • rpc-json/src/lib.rs
  • dash/src/network/message_sml.rs
  • dash-spv-ffi/src/config.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/wallet_manager.rs
  • dash-spv/src/logging.rs
  • key-wallet/src/wallet/backup.rs
  • dash-spv-ffi/src/broadcast.rs
  • dash/src/crypto/key.rs
  • key-wallet-ffi/include/key_wallet_ffi.h
  • key-wallet/src/mnemonic.rs
  • key-wallet/src/wallet/initialization.rs
  • rpc-client/src/client.rs
  • dash/src/blockdata/transaction/mod.rs
  • dash/src/network/message_qrinfo.rs
  • hashes/src/hash_x11.rs
  • dash-spv/src/client/mod.rs
🧰 Additional context used
📓 Path-based instructions (6)
**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.rs: Never hardcode network parameters, addresses, or keys in Rust code
Use proper error types with thiserror crate and propagate errors appropriately in Rust code
Use tokio runtime for async operations in Rust code
Use conditional compilation with feature flags for optional features
Write unit tests for new functionality in Rust
Format Rust code with cargo fmt before committing
Ensure clippy passes with all warnings as errors on all Rust code

**/*.rs: Each crate keeps sources in src/; unit tests live alongside code with #[cfg(test)]
Maintain MSRV of 1.89 for Rust code
Format Rust code with rustfmt (see rustfmt.toml); run cargo fmt --all before commits
Lint Rust code with clippy; avoid unwrap()/expect() in library code; use error types (e.g., thiserror)
Use snake_case for function and variable names in Rust
Use UpperCamelCase for types and traits in Rust
Use SCREAMING_SNAKE_CASE for constants in Rust
Follow mixed editions (2021/2024) and crate-specific idioms; prefer async via tokio where applicable
Unit tests should be placed near code with descriptive names (e.g., test_parse_address_mainnet)
Use #[ignore] for network-dependent or long-running tests; run with -- --ignored flag
Never commit secrets or real keys; avoid logging sensitive data in Rust code
Keep test vectors deterministic in Rust test code

Files:

  • key-wallet/src/managed_account/managed_account_type.rs
  • dash-spv/src/types.rs
  • key-wallet-ffi/src/types.rs
  • key-wallet/src/managed_account/address_pool.rs
  • key-wallet-ffi/src/managed_account.rs
  • key-wallet/src/account/account_type.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/managed_account/managed_account_type.rs
  • key-wallet/src/managed_account/address_pool.rs
  • key-wallet/src/account/account_type.rs
key-wallet/**/managed_account/**/*.rs

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

Implement atomic state updates when processing transactions: update transactions, UTXOs, balances, and address usage state together

Files:

  • key-wallet/src/managed_account/managed_account_type.rs
  • key-wallet/src/managed_account/address_pool.rs
dash-spv/**/*.rs

📄 CodeRabbit inference engine (dash-spv/CLAUDE.md)

dash-spv/**/*.rs: Use async/await throughout the codebase, built on tokio runtime
Use Arc for trait objects to enable runtime polymorphism for NetworkManager and StorageManager
Use Tokio channels for inter-component message passing between async tasks
Maintain minimum Rust version (MSRV) of 1.89 and use only compatible syntax and features

Files:

  • dash-spv/src/types.rs
**/*-ffi/src/**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

Careful handling of memory safety at FFI boundaries in Rust code

Files:

  • key-wallet-ffi/src/types.rs
  • key-wallet-ffi/src/managed_account.rs
key-wallet/**/account/**/*.rs

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

Use enum-based type system for AccountType with specific variants (Standard, IdentityAuthentication, IdentityEncryption, MasternodeOperator, etc.) to provide compile-time safety and clear semantics

Files:

  • key-wallet/src/account/account_type.rs
🧠 Learnings (35)
📓 Common learnings
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: swift-dash-core-sdk/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:50.618Z
Learning: Applies to swift-dash-core-sdk/**/FFIBridge.swift : Add Swift wrapper in `FFIBridge.swift` when exposing new FFI functions
📚 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/src/managed_account/managed_account_type.rs
  • dash-spv/src/types.rs
  • key-wallet-ffi/src/types.rs
  • key-wallet/src/managed_account/address_pool.rs
  • key-wallet-ffi/src/managed_account.rs
  • key-wallet/src/account/account_type.rs
📚 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/src/managed_account/managed_account_type.rs
  • dash-spv/src/types.rs
  • key-wallet-ffi/src/types.rs
  • key-wallet/src/managed_account/address_pool.rs
  • key-wallet-ffi/src/managed_account.rs
  • key-wallet/src/account/account_type.rs
📚 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/src/managed_account/managed_account_type.rs
  • dash-spv/src/types.rs
  • key-wallet-ffi/src/managed_account.rs
  • key-wallet/src/account/account_type.rs
📚 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:

  • key-wallet/src/managed_account/managed_account_type.rs
  • key-wallet-ffi/src/types.rs
  • key-wallet/src/managed_account/address_pool.rs
  • key-wallet/src/account/account_type.rs
📚 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:

  • key-wallet/src/managed_account/managed_account_type.rs
  • dash-spv/src/types.rs
  • key-wallet/src/managed_account/address_pool.rs
  • key-wallet-ffi/src/managed_account.rs
  • key-wallet/src/account/account_type.rs
📚 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:

  • key-wallet/src/managed_account/managed_account_type.rs
  • key-wallet-ffi/src/types.rs
  • key-wallet/src/account/account_type.rs
📚 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/src/managed_account/managed_account_type.rs
  • key-wallet/src/managed_account/address_pool.rs
  • key-wallet/src/account/account_type.rs
📚 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:

  • key-wallet/src/managed_account/managed_account_type.rs
📚 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:

  • key-wallet/src/managed_account/managed_account_type.rs
📚 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/src/managed_account/managed_account_type.rs
  • key-wallet/src/managed_account/address_pool.rs
📚 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 : Use staged gap limit management with `GapLimitStage` tracking `last_used_index` and `used_indices` to enable efficient address discovery without loading entire chains into memory

Applied to files:

  • key-wallet/src/managed_account/managed_account_type.rs
  • key-wallet/src/managed_account/address_pool.rs
📚 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 : Generate addresses in batches using gap limit and staged generation instead of unbounded address generation to prevent memory and performance issues

Applied to files:

  • key-wallet/src/managed_account/managed_account_type.rs
  • key-wallet/src/managed_account/address_pool.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/**/*.rs : Use async/await throughout the codebase, built on tokio runtime

Applied to files:

  • dash-spv/src/types.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/**/*.rs : Maintain minimum Rust version (MSRV) of 1.89 and use only compatible syntax and features

Applied to files:

  • dash-spv/src/types.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 : Add cbindgen annotations for complex types in FFI functions

Applied to files:

  • dash-spv/src/types.rs
  • key-wallet-ffi/src/types.rs
  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv-ffi/FFI_API.md
📚 Learning: 2025-06-26T15:54:02.509Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T15:54:02.509Z
Learning: The `StorageManager` trait in `dash-spv/src/storage/mod.rs` uses `&mut self` methods but is also `Send + Sync`, and implementations often use interior mutability for concurrency. This can be confusing, so explicit documentation should clarify thread-safety expectations and the rationale for the API design.

Applied to files:

  • dash-spv/src/types.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 : Input strings in FFI functions are `*const c_char` (borrowed, not freed by C caller)

Applied to files:

  • dash-spv/src/types.rs
  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv-ffi/FFI_API.md
📚 Learning: 2025-12-01T08:00:50.618Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: swift-dash-core-sdk/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:50.618Z
Learning: Applies to swift-dash-core-sdk/**/*.rs : Implement new FFI functions in Rust with `#[no_mangle] extern "C"` annotation in dash-spv-ffi

Applied to files:

  • dash-spv/src/types.rs
  • key-wallet-ffi/src/managed_account.rs
  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv-ffi/FFI_API.md
📚 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:

  • dash-spv/src/types.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:

  • dash-spv/src/types.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 `#[no_mangle] extern "C"` attribute when implementing new FFI functions in Rust

Applied to files:

  • dash-spv/src/types.rs
  • dash-spv-ffi/FFI_API.md
📚 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 : Use Tokio channels for inter-component message passing between async tasks

Applied to files:

  • dash-spv/src/types.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/src/sync/**/*.rs : Implement sequential phase-based synchronization via SyncManager with phases progressing in order: Headers → Masternode List → Filter Headers → Filters → Blocks

Applied to files:

  • dash-spv/src/types.rs
📚 Learning: 2025-12-01T08:00:50.618Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: swift-dash-core-sdk/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:50.618Z
Learning: Applies to swift-dash-core-sdk/**/*.rs : Add appropriate type annotations for cbindgen when implementing FFI functions

Applied to files:

  • key-wallet-ffi/src/types.rs
📚 Learning: 2025-12-01T07:59:46.015Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:46.015Z
Learning: Applies to **/*-ffi/src/**/*.rs : Careful handling of memory safety at FFI boundaries in Rust code

Applied to files:

  • key-wallet-ffi/src/managed_account.rs
📚 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/**/transaction_checking/**/*.rs : Implement transaction classification and routing through `TransactionRouter` to avoid checking all accounts for every transaction

Applied to files:

  • key-wallet/src/account/account_type.rs
📚 Learning: 2025-06-26T15:47:37.438Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T15:47:37.438Z
Learning: Transaction IDs (txids) and block hashes in Dash are always 32 bytes and should be passed as fixed-size byte arrays in FFI interfaces, not as C strings, to avoid inefficiency and encoding issues.

Applied to files:

  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv-ffi/FFI_API.md
📚 Learning: 2025-06-26T15:46:56.854Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T15:46:56.854Z
Learning: Transaction IDs (txids) in Dash are always 32 bytes and should be passed as fixed-size byte arrays in FFI interfaces, not as C strings, to avoid inefficiency and encoding issues.

Applied to files:

  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv-ffi/FFI_API.md
📚 Learning: 2025-12-01T08:01:00.652Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: swift-dash-core-sdk/Examples/DashHDWalletExample/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:01:00.652Z
Learning: Applies to swift-dash-core-sdk/Examples/DashHDWalletExample/**/*.swift : Use DashSDK's public methods, not direct SPVClient access, when accessing SPV functionality in Swift code

Applied to files:

  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv-ffi/FFI_API.md
📚 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/tests/unit/**/*.rs : Add corresponding unit tests in `tests/unit/` for each new FFI function

Applied to files:

  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv-ffi/FFI_API.md
📚 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/tests/c_tests/**/*.{c,h} : Add corresponding C tests in `tests/c_tests/` for each new FFI function

Applied to files:

  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv-ffi/FFI_API.md
📚 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/src/client/**/*.rs : Use the DashSpvClient high-level API with proper configuration via ClientConfig for client initialization

Applied to files:

  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv-ffi/FFI_API.md
📚 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: When debugging FFI issues, check `dash_spv_ffi_get_last_error()` for error details

Applied to files:

  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv-ffi/FFI_API.md
📚 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 : All FFI types must have corresponding `_destroy()` functions for explicit memory management

Applied to files:

  • dash-spv-ffi/FFI_API.md
⏰ 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: Key Wallet Components Tests
  • GitHub Check: SPV Components Tests
  • GitHub Check: Core Components Tests
  • GitHub Check: fuzz (hashes_sha1)
  • GitHub Check: fuzz (dash_deserialize_address)
  • GitHub Check: fuzz (hashes_sha512)
  • GitHub Check: fuzz (hashes_cbor)
  • GitHub Check: fuzz (hashes_json)
  • GitHub Check: fuzz (dash_deserialize_script)
  • GitHub Check: fuzz (dash_deserialize_witness)
  • GitHub Check: fuzz (hashes_sha256)
  • GitHub Check: fuzz (dash_deserialize_block)
  • GitHub Check: fuzz (hashes_sha512_256)
  • GitHub Check: fuzz (dash_outpoint_string)
  • GitHub Check: fuzz (hashes_ripemd160)
  • GitHub Check: fuzz (dash_deserialize_amount)
  • GitHub Check: fuzz (dash_script_bytes_to_asm_fmt)
  • GitHub Check: fuzz (dash_deser_net_msg)
  • GitHub Check: Pre-commit (macos-latest)
  • GitHub Check: Pre-commit (ubuntu-latest)
🔇 Additional comments (12)
key-wallet/src/managed_account/address_pool.rs (1)

27-27: LGTM: Documentation formatting improvement.

The backtick-wrapped type reference improves rustdoc rendering clarity.

key-wallet-ffi/src/managed_account.rs (1)

5-5: LGTM: Documentation formatting improvement.

The backtick-wrapped type reference enhances documentation clarity.

key-wallet/src/managed_account/managed_account_type.rs (1)

62-83: LGTM: Consistent documentation formatting for provider key variants.

The backtick-wrapped derivation paths improve documentation readability across all four provider key types.

key-wallet/src/account/account_type.rs (1)

55-65: LGTM: Consistent documentation formatting for provider key variants.

The backtick-wrapped derivation paths align with the corresponding changes in managed_account_type.rs and improve documentation clarity.

dash-spv/src/types.rs (3)

12-12: LGTM: Thread-safety documentation formatting improvement.

The backtick-wrapped type references enhance clarity for developers understanding thread-safety patterns.


30-36: LGTM: Performance note documentation improvement.

The backtick-wrapped type references improve readability for concurrency design rationale.


243-243: LGTM: ChainState thread-safety documentation enhancement.

The backtick-wrapped type reference clarifies the typical usage pattern.

key-wallet-ffi/src/types.rs (1)

259-266: LGTM: FFI documentation formatting improvement.

The escaped brackets ensure correct markdown rendering of derivation paths in the FFI documentation, consistent with the related changes in the core library modules.

dash-spv-ffi/include/dash_spv_ffi.h (2)

612-612: LGTM! Documentation formatting improvement.

The change from quotes to backticks for socket address examples improves consistency and readability in technical documentation.


995-1007: Ensure all required supporting code is implemented for the new broadcast transaction FFI function.

The C header declaration is well-documented with appropriate safety annotations. However, per project standards, verify that corresponding implementations exist:

  1. Rust implementation in dash-spv-ffi/src/ with #[no_mangle] extern "C" annotation
  2. Unit tests in dash-spv-ffi/tests/unit/
  3. C tests in dash-spv-ffi/tests/c_tests/
  4. Swift wrapper in FFIBridge.swift
  5. Memory management: Ensure any returned types have corresponding _destroy() functions
dash-spv-ffi/FFI_API.md (2)

97-97: LGTM! Function reference table entry added correctly.

The table entry for dash_spv_ffi_client_broadcast_transaction is properly placed in the Transaction Management section with an accurate description.


788-794: LGTM! Detailed documentation is complete and consistent.

The detailed function documentation follows the established pattern and is consistent with the header file declaration. The Description and Safety sections provide clear guidance for FFI consumers.


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

Caution

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

⚠️ Outside diff range comments (1)
dash-spv-ffi/include/dash_spv_ffi.h (1)

995-1007: Add test coverage for the new FFI broadcast transaction function.

The new dash_spv_ffi_client_broadcast_transaction function is implemented in dash-spv-ffi/src/broadcast.rs but lacks corresponding tests. Based on project guidelines, add:

  • C tests in dash-spv-ffi/tests/c_tests/ (following patterns from test_basic.c)
  • Rust unit tests in dash-spv-ffi/tests/unit/ (following patterns from test_client_lifecycle.rs)

Tests should verify successful broadcast, error handling, and null pointer validation.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cefeaa9 and 49ff328.

📒 Files selected for processing (29)
  • dash-spv-ffi/FFI_API.md (3 hunks)
  • dash-spv-ffi/include/dash_spv_ffi.h (2 hunks)
  • dash-spv-ffi/src/broadcast.rs (1 hunks)
  • dash-spv-ffi/src/config.rs (1 hunks)
  • dash-spv/src/client/core.rs (2 hunks)
  • dash-spv/src/client/mod.rs (1 hunks)
  • dash-spv/src/logging.rs (1 hunks)
  • dash-spv/src/sync/manager.rs (1 hunks)
  • dash-spv/src/types.rs (3 hunks)
  • dash/src/blockdata/transaction/mod.rs (4 hunks)
  • dash/src/crypto/key.rs (3 hunks)
  • dash/src/network/message_qrinfo.rs (1 hunks)
  • dash/src/network/message_sml.rs (2 hunks)
  • dash/src/taproot.rs (1 hunks)
  • hashes/src/bincode_macros.rs (0 hunks)
  • hashes/src/hash_x11.rs (1 hunks)
  • key-wallet-ffi/include/key_wallet_ffi.h (1 hunks)
  • key-wallet-ffi/src/error.rs (1 hunks)
  • key-wallet-ffi/src/managed_account.rs (1 hunks)
  • key-wallet-ffi/src/types.rs (1 hunks)
  • key-wallet-ffi/src/wallet_manager.rs (1 hunks)
  • key-wallet/src/account/account_type.rs (1 hunks)
  • key-wallet/src/managed_account/address_pool.rs (1 hunks)
  • key-wallet/src/managed_account/managed_account_type.rs (1 hunks)
  • key-wallet/src/mnemonic.rs (2 hunks)
  • key-wallet/src/wallet/backup.rs (2 hunks)
  • key-wallet/src/wallet/initialization.rs (2 hunks)
  • rpc-client/src/client.rs (2 hunks)
  • rpc-json/src/lib.rs (2 hunks)
💤 Files with no reviewable changes (1)
  • hashes/src/bincode_macros.rs
🧰 Additional context used
📓 Path-based instructions (9)
**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.rs: Never hardcode network parameters, addresses, or keys in Rust code
Use proper error types with thiserror crate and propagate errors appropriately in Rust code
Use tokio runtime for async operations in Rust code
Use conditional compilation with feature flags for optional features
Write unit tests for new functionality in Rust
Format Rust code with cargo fmt before committing
Ensure clippy passes with all warnings as errors on all Rust code

**/*.rs: Each crate keeps sources in src/; unit tests live alongside code with #[cfg(test)]
Maintain MSRV of 1.89 for Rust code
Format Rust code with rustfmt (see rustfmt.toml); run cargo fmt --all before commits
Lint Rust code with clippy; avoid unwrap()/expect() in library code; use error types (e.g., thiserror)
Use snake_case for function and variable names in Rust
Use UpperCamelCase for types and traits in Rust
Use SCREAMING_SNAKE_CASE for constants in Rust
Follow mixed editions (2021/2024) and crate-specific idioms; prefer async via tokio where applicable
Unit tests should be placed near code with descriptive names (e.g., test_parse_address_mainnet)
Use #[ignore] for network-dependent or long-running tests; run with -- --ignored flag
Never commit secrets or real keys; avoid logging sensitive data in Rust code
Keep test vectors deterministic in Rust test code

Files:

  • key-wallet/src/wallet/backup.rs
  • key-wallet/src/wallet/initialization.rs
  • dash-spv/src/logging.rs
  • key-wallet/src/mnemonic.rs
  • hashes/src/hash_x11.rs
  • key-wallet/src/account/account_type.rs
  • rpc-json/src/lib.rs
  • dash-spv-ffi/src/broadcast.rs
  • dash/src/network/message_sml.rs
  • key-wallet/src/managed_account/address_pool.rs
  • dash-spv/src/client/core.rs
  • key-wallet-ffi/src/wallet_manager.rs
  • dash-spv/src/types.rs
  • key-wallet-ffi/src/managed_account.rs
  • dash-spv/src/sync/manager.rs
  • dash/src/blockdata/transaction/mod.rs
  • dash-spv/src/client/mod.rs
  • dash/src/taproot.rs
  • rpc-client/src/client.rs
  • key-wallet/src/managed_account/managed_account_type.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/types.rs
  • dash-spv-ffi/src/config.rs
  • dash/src/network/message_qrinfo.rs
  • dash/src/crypto/key.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/wallet/backup.rs
  • key-wallet/src/wallet/initialization.rs
  • key-wallet/src/mnemonic.rs
  • key-wallet/src/account/account_type.rs
  • key-wallet/src/managed_account/address_pool.rs
  • key-wallet/src/managed_account/managed_account_type.rs
dash-spv/**/*.rs

📄 CodeRabbit inference engine (dash-spv/CLAUDE.md)

dash-spv/**/*.rs: Use async/await throughout the codebase, built on tokio runtime
Use Arc for trait objects to enable runtime polymorphism for NetworkManager and StorageManager
Use Tokio channels for inter-component message passing between async tasks
Maintain minimum Rust version (MSRV) of 1.89 and use only compatible syntax and features

Files:

  • dash-spv/src/logging.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/types.rs
  • dash-spv/src/sync/manager.rs
  • dash-spv/src/client/mod.rs
key-wallet/**/account/**/*.rs

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

Use enum-based type system for AccountType with specific variants (Standard, IdentityAuthentication, IdentityEncryption, MasternodeOperator, etc.) to provide compile-time safety and clear semantics

Files:

  • key-wallet/src/account/account_type.rs
**/*-ffi/src/**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

Careful handling of memory safety at FFI boundaries in Rust code

Files:

  • dash-spv-ffi/src/broadcast.rs
  • key-wallet-ffi/src/wallet_manager.rs
  • key-wallet-ffi/src/managed_account.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/types.rs
  • dash-spv-ffi/src/config.rs
dash-spv-ffi/src/**/*.rs

📄 CodeRabbit inference engine (dash-spv-ffi/CLAUDE.md)

dash-spv-ffi/src/**/*.rs: Use #[no_mangle] extern "C" attribute when implementing new FFI functions in Rust
All FFI types must have corresponding _destroy() functions for explicit memory management
Rust strings must be returned as *const c_char with caller responsibility to free using dash_string_free
Input strings in FFI functions are *const c_char (borrowed, not freed by C caller)
Add cbindgen annotations for complex types in FFI functions
Use thread-local storage for error propagation via dash_spv_ffi_get_last_error() function

Files:

  • dash-spv-ffi/src/broadcast.rs
  • dash-spv-ffi/src/config.rs
key-wallet/**/managed_account/**/*.rs

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

Implement atomic state updates when processing transactions: update transactions, UTXOs, balances, and address usage state together

Files:

  • key-wallet/src/managed_account/address_pool.rs
  • key-wallet/src/managed_account/managed_account_type.rs
dash-spv/src/client/**/*.rs

📄 CodeRabbit inference engine (dash-spv/CLAUDE.md)

Use the DashSpvClient high-level API with proper configuration via ClientConfig for client initialization

Files:

  • dash-spv/src/client/core.rs
  • dash-spv/src/client/mod.rs
dash-spv/src/sync/**/*.rs

📄 CodeRabbit inference engine (dash-spv/CLAUDE.md)

Implement sequential phase-based synchronization via SyncManager with phases progressing in order: Headers → Masternode List → Filter Headers → Filters → Blocks

Files:

  • dash-spv/src/sync/manager.rs
🧠 Learnings (48)
📓 Common learnings
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T15:47:37.438Z
Learning: Transaction IDs (txids) and block hashes in Dash are always 32 bytes and should be passed as fixed-size byte arrays in FFI interfaces, not as C strings, to avoid inefficiency and encoding issues.
📚 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:

  • key-wallet/src/wallet/backup.rs
  • key-wallet/src/mnemonic.rs
  • key-wallet/src/account/account_type.rs
  • key-wallet/src/managed_account/managed_account_type.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/types.rs
  • dash/src/crypto/key.rs
📚 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/src/wallet/backup.rs
  • key-wallet/src/wallet/initialization.rs
  • key-wallet/src/account/account_type.rs
  • key-wallet/src/managed_account/address_pool.rs
  • key-wallet-ffi/src/wallet_manager.rs
  • dash-spv/src/types.rs
  • key-wallet-ffi/src/managed_account.rs
  • key-wallet/src/managed_account/managed_account_type.rs
  • key-wallet-ffi/src/types.rs
  • dash/src/crypto/key.rs
📚 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/src/wallet/initialization.rs
  • key-wallet/src/account/account_type.rs
  • key-wallet/src/managed_account/address_pool.rs
  • key-wallet-ffi/src/wallet_manager.rs
  • key-wallet/src/managed_account/managed_account_type.rs
  • key-wallet-ffi/src/types.rs
  • dash/src/crypto/key.rs
📚 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:

  • key-wallet/src/wallet/initialization.rs
  • key-wallet/src/account/account_type.rs
  • key-wallet/src/managed_account/address_pool.rs
  • key-wallet/src/managed_account/managed_account_type.rs
  • key-wallet-ffi/src/types.rs
  • dash/src/crypto/key.rs
📚 Learning: 2025-12-01T08:00:50.618Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: swift-dash-core-sdk/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:50.618Z
Learning: Applies to swift-dash-core-sdk/**/*.rs : Implement new FFI functions in Rust with `#[no_mangle] extern "C"` annotation in dash-spv-ffi

Applied to files:

  • dash-spv/src/logging.rs
  • dash-spv-ffi/src/broadcast.rs
  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv/src/client/core.rs
  • dash-spv/src/types.rs
  • dash/src/blockdata/transaction/mod.rs
  • key-wallet-ffi/src/error.rs
  • dash-spv-ffi/src/config.rs
  • dash/src/crypto/key.rs
  • dash-spv-ffi/FFI_API.md
📚 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 : Input strings in FFI functions are `*const c_char` (borrowed, not freed by C caller)

Applied to files:

  • dash-spv/src/logging.rs
  • dash-spv-ffi/src/broadcast.rs
  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv/src/types.rs
  • key-wallet-ffi/src/error.rs
  • dash-spv-ffi/src/config.rs
  • dash-spv-ffi/FFI_API.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/**/tests/**/*.rs : Use deterministic testing with known test vectors and fixed seeds for reproducible results

Applied to files:

  • key-wallet/src/mnemonic.rs
📚 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/src/account/account_type.rs
  • key-wallet/src/managed_account/address_pool.rs
  • dash-spv/src/types.rs
  • key-wallet-ffi/src/managed_account.rs
  • key-wallet/src/managed_account/managed_account_type.rs
  • key-wallet-ffi/src/types.rs
  • dash/src/crypto/key.rs
📚 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/src/account/account_type.rs
  • key-wallet-ffi/src/wallet_manager.rs
  • dash-spv/src/types.rs
  • key-wallet-ffi/src/managed_account.rs
  • key-wallet/src/managed_account/managed_account_type.rs
  • key-wallet-ffi/src/types.rs
📚 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:

  • key-wallet/src/account/account_type.rs
  • key-wallet/src/managed_account/address_pool.rs
  • key-wallet-ffi/src/wallet_manager.rs
  • dash-spv/src/types.rs
  • key-wallet-ffi/src/managed_account.rs
  • key-wallet/src/managed_account/managed_account_type.rs
  • key-wallet-ffi/src/types.rs
📚 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/**/transaction_checking/**/*.rs : Implement transaction classification and routing through `TransactionRouter` to avoid checking all accounts for every transaction

Applied to files:

  • key-wallet/src/account/account_type.rs
  • key-wallet-ffi/src/types.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 : Add cbindgen annotations for complex types in FFI functions

Applied to files:

  • dash-spv-ffi/src/broadcast.rs
  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv/src/types.rs
  • dash-spv/src/client/mod.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/types.rs
  • dash-spv-ffi/src/config.rs
  • dash-spv-ffi/FFI_API.md
📚 Learning: 2025-06-26T15:54:02.509Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T15:54:02.509Z
Learning: The `StorageManager` trait in `dash-spv/src/storage/mod.rs` uses `&mut self` methods but is also `Send + Sync`, and implementations often use interior mutability for concurrency. This can be confusing, so explicit documentation should clarify thread-safety expectations and the rationale for the API design.

Applied to files:

  • dash-spv-ffi/src/broadcast.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/types.rs
  • dash-spv/src/sync/manager.rs
  • dash-spv/src/client/mod.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/tests/unit/**/*.rs : Add corresponding unit tests in `tests/unit/` for each new FFI function

Applied to files:

  • dash-spv-ffi/src/broadcast.rs
  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv-ffi/src/config.rs
  • dash-spv-ffi/FFI_API.md
📚 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/src/client/**/*.rs : Use the DashSpvClient high-level API with proper configuration via ClientConfig for client initialization

Applied to files:

  • dash-spv-ffi/src/broadcast.rs
  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/mod.rs
  • dash-spv-ffi/src/config.rs
  • dash-spv-ffi/FFI_API.md
📚 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 `#[no_mangle] extern "C"` attribute when implementing new FFI functions in Rust

Applied to files:

  • dash-spv-ffi/src/broadcast.rs
  • dash-spv/src/types.rs
  • key-wallet-ffi/src/error.rs
  • dash-spv-ffi/src/config.rs
  • dash-spv-ffi/FFI_API.md
📚 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 : Use Tokio channels for inter-component message passing between async tasks

Applied to files:

  • dash-spv-ffi/src/broadcast.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/mod.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/**/*.rs : Maintain minimum Rust version (MSRV) of 1.89 and use only compatible syntax and features

Applied to files:

  • dash-spv-ffi/src/broadcast.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/types.rs
  • dash-spv/src/client/mod.rs
  • dash-spv-ffi/src/config.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 : Rust strings must be returned as `*const c_char` with caller responsibility to free using `dash_string_free`

Applied to files:

  • dash-spv-ffi/src/broadcast.rs
  • dash-spv/src/types.rs
  • dash-spv-ffi/src/config.rs
📚 Learning: 2025-06-26T15:46:56.854Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T15:46:56.854Z
Learning: Transaction IDs (txids) in Dash are always 32 bytes and should be passed as fixed-size byte arrays in FFI interfaces, not as C strings, to avoid inefficiency and encoding issues.

Applied to files:

  • dash-spv-ffi/src/broadcast.rs
  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv-ffi/FFI_API.md
📚 Learning: 2025-06-26T15:47:37.438Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T15:47:37.438Z
Learning: Transaction IDs (txids) and block hashes in Dash are always 32 bytes and should be passed as fixed-size byte arrays in FFI interfaces, not as C strings, to avoid inefficiency and encoding issues.

Applied to files:

  • dash-spv-ffi/src/broadcast.rs
  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv-ffi/FFI_API.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/**/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/src/managed_account/address_pool.rs
  • key-wallet/src/managed_account/managed_account_type.rs
📚 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 : Generate addresses in batches using gap limit and staged generation instead of unbounded address generation to prevent memory and performance issues

Applied to files:

  • key-wallet/src/managed_account/address_pool.rs
  • key-wallet/src/managed_account/managed_account_type.rs
📚 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 : Use staged gap limit management with `GapLimitStage` tracking `last_used_index` and `used_indices` to enable efficient address discovery without loading entire chains into memory

Applied to files:

  • key-wallet/src/managed_account/address_pool.rs
  • key-wallet/src/managed_account/managed_account_type.rs
📚 Learning: 2025-12-01T08:01:00.652Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: swift-dash-core-sdk/Examples/DashHDWalletExample/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:01:00.652Z
Learning: Applies to swift-dash-core-sdk/Examples/DashHDWalletExample/**/*.swift : Use DashSDK's public methods, not direct SPVClient access, when accessing SPV functionality in Swift code

Applied to files:

  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv-ffi/FFI_API.md
📚 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/tests/c_tests/**/*.{c,h} : Add corresponding C tests in `tests/c_tests/` for each new FFI function

Applied to files:

  • dash-spv-ffi/include/dash_spv_ffi.h
📚 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: When debugging FFI issues, check `dash_spv_ffi_get_last_error()` for error details

Applied to files:

  • dash-spv-ffi/include/dash_spv_ffi.h
  • dash-spv-ffi/FFI_API.md
📚 Learning: 2025-06-26T16:02:42.390Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T16:02:42.390Z
Learning: Passing exclusive mutable references to network and storage managers into the sync manager in async Rust can lead to borrow checker issues or runtime contention if concurrent access is needed elsewhere. It's advisable to document this architectural tradeoff and consider refactoring to interior mutability or message passing for shared access as the codebase evolves.

Applied to files:

  • dash-spv/src/client/core.rs
  • key-wallet-ffi/src/wallet_manager.rs
  • dash-spv/src/sync/manager.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/**/*.rs : Use async/await throughout the codebase, built on tokio runtime

Applied to files:

  • dash-spv/src/client/core.rs
  • dash-spv/src/types.rs
  • dash-spv/src/sync/manager.rs
  • dash-spv/src/client/mod.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/src/sync/**/*.rs : Implement sequential phase-based synchronization via SyncManager with phases progressing in order: Headers → Masternode List → Filter Headers → Filters → Blocks

Applied to files:

  • dash-spv/src/client/core.rs
  • dash-spv/src/types.rs
  • dash-spv/src/sync/manager.rs
  • dash-spv/src/client/mod.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/**/*.rs : Use Arc<dyn TraitName> for trait objects to enable runtime polymorphism for NetworkManager and StorageManager

Applied to files:

  • dash-spv/src/client/core.rs
  • dash-spv/src/client/mod.rs
📚 Learning: 2025-12-01T08:00:50.618Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: swift-dash-core-sdk/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:50.618Z
Learning: Applies to swift-dash-core-sdk/**/*.swift : Use actors for state management in SPVClient to ensure thread safety

Applied to files:

  • dash-spv/src/client/core.rs
📚 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/src/wallet_manager.rs
  • key-wallet-ffi/include/key_wallet_ffi.h
📚 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:

  • dash-spv/src/types.rs
  • dash-spv/src/client/mod.rs
  • dash-spv-ffi/src/config.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 : All FFI types must have corresponding `_destroy()` functions for explicit memory management

Applied to files:

  • dash-spv/src/types.rs
  • dash-spv-ffi/FFI_API.md
📚 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/src/validation/**/*.rs : Implement three validation modes: ValidationMode::None (no validation), ValidationMode::Basic (structure and timestamp validation), and ValidationMode::Full (complete PoW and chain validation)

Applied to files:

  • dash-spv/src/client/mod.rs
📚 Learning: 2025-12-01T08:01:18.174Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-01T08:01:18.174Z
Learning: Applies to **/*.rs : Follow mixed editions (2021/2024) and crate-specific idioms; prefer async via `tokio` where applicable

Applied to files:

  • rpc-client/src/client.rs
📚 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:

  • key-wallet/src/managed_account/managed_account_type.rs
📚 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:

  • key-wallet/src/managed_account/managed_account_type.rs
  • dash/src/crypto/key.rs
📚 Learning: 2025-12-01T07:59:46.015Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:46.015Z
Learning: Applies to **/*-ffi/src/**/*.rs : Careful handling of memory safety at FFI boundaries in Rust code

Applied to files:

  • key-wallet-ffi/src/error.rs
📚 Learning: 2025-12-01T07:59:46.015Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:46.015Z
Learning: Applies to **/*.rs : Use proper error types with thiserror crate and propagate errors appropriately in Rust code

Applied to files:

  • key-wallet-ffi/src/error.rs
📚 Learning: 2025-06-26T15:49:53.811Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T15:49:53.811Z
Learning: In Rust FFI code, using thread-local storage for error reporting is unsafe in multi-threaded contexts, as callbacks may execute on different threads than the caller, leading to lost or invisible errors. FFI error handling should use global, thread-safe storage or return errors directly via return values or out parameters.

Applied to files:

  • key-wallet-ffi/src/error.rs
📚 Learning: 2025-12-01T08:00:50.618Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: swift-dash-core-sdk/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:50.618Z
Learning: Applies to swift-dash-core-sdk/**/*.swift : Log FFI errors before converting them to Swift errors

Applied to files:

  • key-wallet-ffi/src/error.rs
📚 Learning: 2025-12-01T08:00:50.618Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: swift-dash-core-sdk/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:50.618Z
Learning: Applies to swift-dash-core-sdk/**/*.swift : Convert FFI errors to Swift errors via `DashSDKError` at FFI boundary

Applied to files:

  • key-wallet-ffi/src/error.rs
📚 Learning: 2025-12-01T08:00:50.618Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: swift-dash-core-sdk/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:50.618Z
Learning: Applies to swift-dash-core-sdk/**/*.rs : Add appropriate type annotations for cbindgen when implementing FFI functions

Applied to files:

  • key-wallet-ffi/src/types.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/src/network/**/*.rs : Use DNS-first peer discovery with automatic DNS seeds (dnsseed.dash.org, testnet-seed.dashdot.io) when no explicit peers are configured; implement immediate startup with 10-second delay only for subsequent peer searches

Applied to files:

  • dash-spv-ffi/src/config.rs
📚 Learning: 2025-12-01T08:00:50.618Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: swift-dash-core-sdk/CLAUDE.md:0-0
Timestamp: 2025-12-01T08:00:50.618Z
Learning: When making changes to Rust FFI in dash-spv-ffi, rebuild with `cargo build --release` and run Swift tests to verify integration

Applied to files:

  • dash-spv-ffi/FFI_API.md
⏰ 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: Core Components Tests
  • GitHub Check: SPV Components Tests
  • GitHub Check: RPC Tests (stable, true)
  • GitHub Check: fuzz (dash_deserialize_address)
  • GitHub Check: fuzz (hashes_cbor)
  • GitHub Check: fuzz (hashes_ripemd160)
  • GitHub Check: fuzz (hashes_json)
  • GitHub Check: fuzz (dash_deserialize_block)
  • GitHub Check: fuzz (dash_outpoint_string)
  • GitHub Check: fuzz (dash_script_bytes_to_asm_fmt)
  • GitHub Check: fuzz (hashes_sha512)
  • GitHub Check: fuzz (hashes_sha512_256)
  • GitHub Check: fuzz (hashes_sha256)
  • GitHub Check: fuzz (dash_deserialize_script)
  • GitHub Check: fuzz (dash_deserialize_witness)
  • GitHub Check: fuzz (hashes_sha1)
  • GitHub Check: fuzz (dash_deserialize_amount)
  • GitHub Check: fuzz (dash_deser_net_msg)
  • GitHub Check: Pre-commit (macos-latest)
  • GitHub Check: Pre-commit (ubuntu-latest)
🔇 Additional comments (32)
dash/src/network/message_qrinfo.rs (1)

148-148: Documentation improvement—type clarity for field.

The inline code formatting for Vec<bool> adds explicit type information to the field documentation, improving clarity for readers. This aligns well with the struct's actual field definition on line 157.

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

16-16: Documentation formatting aligns with Rust conventions.

The heading changes from "# Example" to "# Examples" follow standard Rust documentation conventions and contribute to the broader documentation consistency effort in this PR. The changes are cosmetic and have no behavioral impact.

Also applies to: 42-42


29-32: Error handling is well-structured.

Both backup() and restore() functions properly propagate errors with contextual messages using map_err(), avoiding panics and following library code best practices. The function signatures correctly return Result<T, Error>.

Also applies to: 50-54

key-wallet/src/managed_account/address_pool.rs (1)

27-27: Documentation formatting improvement approved.

Backtick-formatting the Vec<u8> type reference in the doc comment enhances readability and aligns with documentation best practices. This cosmetic change is consistent with the PR's goal of standardizing code formatting in documentation.

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

217-217: Documentation heading standardization looks good.

The change from "Example" to "Examples" correctly reflects the plural form, as both doc comments contain multiple example scenarios or steps within their code blocks. This follows standard Rust documentation conventions.

Also applies to: 259-259

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

150-150: Documentation header standardization looks good.

The changes from "# Example" to "# Examples" align with standard Rust documentation conventions and resolve formatting expectations in the docs build. Both code examples are syntactically correct, properly feature-gated, and clearly demonstrate the APIs.

Also applies to: 197-197

dash/src/network/message_sml.rs (1)

16-16: Documentation URLs correctly formatted for Rust doc generation.

The angle-bracket wrapping of URLs (<https://...> instead of bare https://...) is the standard Rust doc comment convention for generating proper hyperlinks in rendered documentation. This change aligns with the PR's stated goal of fixing docs build issues and improving consistency across the codebase.

Also applies to: 31-31

key-wallet/src/managed_account/managed_account_type.rs (1)

62-62: LGTM! Documentation formatting improved.

Wrapping the derivation paths in backticks improves documentation readability and aligns with Rust documentation conventions for inline code formatting.

Also applies to: 68-68, 74-74, 80-80

rpc-json/src/lib.rs (2)

546-546: LGTM! Documentation formatting improved.

The conversion from implicit inline links to inline code formatting for field names is the correct approach and improves documentation clarity.


623-623: LGTM! Proper intra-doc link formatting.

The update to use [Self::into_filter] follows Rust documentation best practices for referencing methods on the same type.

rpc-client/src/client.rs (2)

108-108: LGTM! More accurate code block annotation.

Changing from norust to text is semantically correct since the block contains a diagram illustrating argument/default alignment, not code.


674-674: LGTM! Proper intra-doc link formatting.

The update to use [Self::unlock_unspent] creates a proper clickable link in rustdoc and follows Rust documentation conventions.

key-wallet-ffi/include/key_wallet_ffi.h (1)

68-82: Documentation escaping in auto-generated header looks correct.

The bracket escaping (\[key_index\]) fixes rustdoc/markdown rendering issues where [...] would be interpreted as link syntax. Since this header is generated by cbindgen from Rust source comments, the fix in the Rust source propagates correctly here.

dash-spv/src/client/mod.rs (1)

26-30: LGTM!

Wrapping the Arc<...> types in backticks follows standard rustdoc conventions and improves documentation readability by rendering them as inline code.

key-wallet-ffi/src/managed_account.rs (1)

4-5: LGTM!

The backtick formatting for Arc<ManagedAccount> ensures proper code rendering in rustdoc.

dash-spv/src/sync/manager.rs (1)

307-307: LGTM!

Using "# Examples" (plural) follows the Rust API Guidelines convention for documentation section headings.

dash-spv-ffi/src/broadcast.rs (1)

5-11: LGTM!

The added # Safety documentation properly documents the pointer validity requirements for this unsafe FFI function, following Rust FFI best practices. The description accurately reflects the function's purpose.

key-wallet-ffi/src/types.rs (1)

259-266: LGTM! Documentation formatting improvements.

The documentation updates correctly format the derivation path examples with inline code backticks for better readability. The escaped bracket notation \[key_index\] properly renders in generated documentation.

hashes/src/hash_x11.rs (1)

127-127: LGTM! Proper intra-doc link formatting.

The backticks around Midstate create a proper documentation link, improving the generated docs.

dash/src/crypto/key.rs (1)

648-648: LGTM! Consistent inline code formatting.

The documentation updates properly format KeyPair type references with backticks across multiple doc comments, improving consistency and readability in generated documentation.

Also applies to: 709-709, 770-770

dash-spv-ffi/src/config.rs (1)

128-130: LGTM! Improved code example formatting.

The documentation correctly formats socket address examples with inline code backticks, making them more visually distinct in the rendered documentation.

key-wallet-ffi/src/error.rs (1)

86-86: LGTM! Proper inline code formatting for trait bound.

The backticks around Into<FFIError> correctly format the trait bound as inline code in the macro documentation.

dash-spv/src/logging.rs (1)

77-77: LGTM! Documentation heading consistency.

The change from "Example" to "Examples" follows Rust documentation conventions, which prefer the plural form even for single examples.

key-wallet-ffi/src/wallet_manager.rs (1)

36-36: LGTM! Improved type reference formatting.

The backticks around Arc<RwLock<WalletManager>> properly format the complex type as inline code, improving readability in the generated documentation.

dash-spv/src/types.rs (1)

12-12: LGTM! Comprehensive documentation formatting improvements.

The updates consistently format type references (Arc<RwLock>, Arc<Mutex>, Arc<RwLock<ChainState>>) with inline code backticks throughout the module documentation, significantly improving readability and maintaining consistency with documentation conventions.

Also applies to: 30-36, 243-243

key-wallet/src/account/account_type.rs (1)

55-65: LGTM! Documentation formatting improvements.

The addition of inline code formatting for the derivation paths improves readability and consistency across the documentation.

dash-spv/src/client/core.rs (1)

112-129: LGTM! Consistent inline code formatting.

The backtick formatting for Arc<Mutex<T>> and Arc<Mutex<SyncManager>> improves documentation readability and follows Rust documentation conventions.

dash-spv-ffi/include/dash_spv_ffi.h (1)

612-612: LGTM! Improved code example formatting.

The backtick formatting for socket address examples improves documentation clarity.

dash/src/blockdata/transaction/mod.rs (2)

55-55: LGTM! Documentation formatting improvements.

The backtick formatting for code references (function names, types) improves documentation clarity and follows Rust documentation conventions.


235-260: LGTM! Consistent inline code formatting.

The backtick formatting for EcdsaSighashType and Self::signature_hash() improves documentation readability and aligns with standard Rust documentation practices.

dash-spv-ffi/FFI_API.md (2)

97-97: LGTM! Function table updated correctly.

The Transaction Management section properly includes the new broadcast function with an appropriate description.


788-794: LGTM! Comprehensive function documentation.

The detailed documentation for dash_spv_ffi_client_broadcast_transaction includes:

  • Clear description of functionality
  • Explicit safety requirements
  • Module attribution

This aligns well with the documentation pattern for other FFI functions.

@QuantumExplorer QuantumExplorer merged commit 4ff67ba into v0.41-dev Dec 22, 2025
25 checks passed
@QuantumExplorer QuantumExplorer deleted the docs/issues branch December 22, 2025 03:26
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