Skip to content

Conversation

@xdustinface
Copy link
Collaborator

@xdustinface xdustinface commented Dec 27, 2025

This updates the hooks to their latest versions and fixes some issues discovered by the typos update.

Summary by CodeRabbit

  • Chores

    • Updated pre-commit tool revisions to newer releases.
  • Documentation

    • Fixed multiple typos and improved wording in docs, comments, and tests.
  • Refactor

    • Small internal identifier rename and minor code cleanup for consistency.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 27, 2025

📝 Walkthrough

Walkthrough

Updates consist of pre-commit hook revision bumps, a local variable rename in embedded Rust, and several documentation/test comment typo fixes across the repository. No functional, API, or control-flow changes.

Changes

Cohort / File(s) Summary
Configuration Updates
.pre-commit-config.yaml
Bumps three external pre-commit tool revisions: pre-commit-hooks v4.5.0 → v6.0.0, actionlint v1.7.8 → v1.7.9, typos v1.16.23 → v1.40.0. Only revision strings changed; no hook additions/removals or argument changes.
Embedded code rename
dash/embedded/src/main.rs
Renamed local buffer variable from buf_ful to buf_full and updated its use in Secp256k1::preallocated_new. No logic, behavior, or API changes.
Doc comment fixes
dash/src/consensus/encode.rs, dash/src/network/message.rs, internals/src/hex/buf_encoder.rs, rpc-client/src/client.rs
Fixed typos in documentation/comments: "Failling" → "Failing", "tham" → "than", "implementtions" → "implementations", "heigts" → "heights". No code changes.
Test comment fixes
dash/src/serialize.rs, key-wallet/src/psbt/serialize.rs
Corrected test comment text: "dumb script leafs" → "dumb script leaves" (two occurrences). No behavioral changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Tiny bumps and typos mended,
buf_ful hopped and found its end-ed;
Leaves not leafs, words in line,
Cleaned comments, tidy shine —
A rabbit cheers: small fixes, splendid! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ 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 accurately describes the main change: updating pre-commit hooks to latest versions, which is reflected in the .pre-commit-config.yaml file with version bumps for three tools.
✨ 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 chore/update-pre-commit

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b1af45a and 12fb0b9.

📒 Files selected for processing (8)
  • .pre-commit-config.yaml
  • dash/embedded/src/main.rs
  • dash/src/consensus/encode.rs
  • dash/src/network/message.rs
  • dash/src/serialize.rs
  • internals/src/hex/buf_encoder.rs
  • key-wallet/src/psbt/serialize.rs
  • rpc-client/src/client.rs
🚧 Files skipped from review as they are similar to previous changes (6)
  • dash/src/serialize.rs
  • dash/embedded/src/main.rs
  • rpc-client/src/client.rs
  • dash/src/consensus/encode.rs
  • .pre-commit-config.yaml
  • dash/src/network/message.rs
🧰 Additional context used
📓 Path-based instructions (4)
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/psbt/serialize.rs
**/*.{rs,toml}

📄 CodeRabbit inference engine (CLAUDE.md)

Never hardcode network parameters, addresses, or keys

Files:

  • key-wallet/src/psbt/serialize.rs
  • internals/src/hex/buf_encoder.rs
**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.rs: Use proper error types (thiserror) and propagate errors appropriately
Use tokio runtime for async operations
Use conditional compilation with feature flags for optional features
Write unit tests for new functionality
Use secure random number generation for keys
Never log or expose private keys
Code must target Rust 1.89 minimum supported version (MSRV)
Format code using cargo fmt
Pass clippy linting without warnings

**/*.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

Files:

  • key-wallet/src/psbt/serialize.rs
  • internals/src/hex/buf_encoder.rs
**/{dash-network,dash-spv,key-wallet}/**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

Use async/await for async operations in network and wallet modules

Files:

  • key-wallet/src/psbt/serialize.rs
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-22T17:59:51.097Z
Learning: Update docs and CHANGELOG if changes are user-facing
📚 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/psbt/serialize.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/**/tests/**/*.rs : Organize unit tests by functionality: separate test files for BIP32, mnemonics, addresses, derivation paths, and PSBT operations

Applied to files:

  • key-wallet/src/psbt/serialize.rs
⏰ 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: fuzz (hashes_sha1)
  • GitHub Check: fuzz (hashes_sha512_256)
  • GitHub Check: fuzz (hashes_sha256)
  • GitHub Check: fuzz (hashes_sha512)
  • GitHub Check: fuzz (hashes_cbor)
  • GitHub Check: fuzz (hashes_ripemd160)
  • GitHub Check: fuzz (dash_deserialize_address)
  • GitHub Check: fuzz (dash_deser_net_msg)
  • GitHub Check: fuzz (dash_deserialize_amount)
  • GitHub Check: fuzz (dash_deserialize_block)
  • GitHub Check: fuzz (dash_script_bytes_to_asm_fmt)
  • GitHub Check: fuzz (dash_deserialize_witness)
  • GitHub Check: fuzz (dash_deserialize_script)
  • GitHub Check: fuzz (dash_outpoint_string)
  • GitHub Check: Pre-commit (ubuntu-latest)
  • GitHub Check: Pre-commit (macos-latest)
  • GitHub Check: Core Components Tests
  • GitHub Check: SPV Components Tests
  • GitHub Check: Key Wallet Components Tests
  • GitHub Check: RPC Tests (stable, true)
🔇 Additional comments (2)
key-wallet/src/psbt/serialize.rs (1)

426-426: LGTM! Typo corrected.

The plural "leaves" is grammatically correct.

internals/src/hex/buf_encoder.rs (1)

39-39: LGTM! Typo corrected.

The spelling "implementations" is correct.


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

🧹 Nitpick comments (1)
dash/src/consensus/encode.rs (1)

414-414: Partial typo fix completed; consider fixing remaining typo.

The correction from "Failling" to "Failing" is good, but "obide" should be "abide" for grammatical correctness. The complete phrase should read: "Failing to abide by this requirement..."

🔎 Suggested additional fix
-    /// Failing to obide to this requirement might lead to memory exhaustion caused by malicious
+    /// Failing to abide by this requirement might lead to memory exhaustion caused by malicious
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3884314 and b1af45a.

📒 Files selected for processing (8)
  • .pre-commit-config.yaml
  • dash/embedded/src/main.rs
  • dash/src/consensus/encode.rs
  • dash/src/network/message.rs
  • dash/src/serialize.rs
  • internals/src/hex/buf_encoder.rs
  • key-wallet/src/psbt/serialize.rs
  • rpc-client/src/client.rs
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{rs,toml}

📄 CodeRabbit inference engine (CLAUDE.md)

Never hardcode network parameters, addresses, or keys

Files:

  • rpc-client/src/client.rs
  • dash/src/serialize.rs
  • dash/src/consensus/encode.rs
  • key-wallet/src/psbt/serialize.rs
  • dash/embedded/src/main.rs
  • internals/src/hex/buf_encoder.rs
  • dash/src/network/message.rs
**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.rs: Use proper error types (thiserror) and propagate errors appropriately
Use tokio runtime for async operations
Use conditional compilation with feature flags for optional features
Write unit tests for new functionality
Use secure random number generation for keys
Never log or expose private keys
Code must target Rust 1.89 minimum supported version (MSRV)
Format code using cargo fmt
Pass clippy linting without warnings

**/*.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

Files:

  • rpc-client/src/client.rs
  • dash/src/serialize.rs
  • dash/src/consensus/encode.rs
  • key-wallet/src/psbt/serialize.rs
  • dash/embedded/src/main.rs
  • internals/src/hex/buf_encoder.rs
  • dash/src/network/message.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/psbt/serialize.rs
**/{dash-network,dash-spv,key-wallet}/**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

Use async/await for async operations in network and wallet modules

Files:

  • key-wallet/src/psbt/serialize.rs
🧠 Learnings (11)
📓 Common learnings
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-22T17:59:51.097Z
Learning: Run pre-PR checks: `cargo fmt`, `cargo clippy`, `cargo test` (workspace) before submitting pull requests
📚 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 : Format code with `rustfmt` before commits; ensure `cargo fmt --all` is run

Applied to files:

  • .pre-commit-config.yaml
📚 Learning: 2025-12-22T17:59:37.849Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/*.rs : Pass clippy linting without warnings

Applied to files:

  • .pre-commit-config.yaml
📚 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 **/tests/**/*.rs : Use descriptive test names (e.g., `test_parse_address_mainnet`)

Applied to files:

  • dash/src/serialize.rs
  • key-wallet/src/psbt/serialize.rs
📚 Learning: 2025-02-25T06:19:32.230Z
Learnt from: QuantumExplorer
Repo: dashpay/rust-dashcore PR: 51
File: dash/src/sml/masternode_list_entry/hash.rs:7-12
Timestamp: 2025-02-25T06:19:32.230Z
Learning: The `consensus_encode` method on `MasternodeListEntry` writing to a `Vec` buffer cannot fail, so using `.expect()` is appropriate rather than propagating the error with the `?` operator.

Applied to files:

  • dash/src/consensus/encode.rs
📚 Learning: 2025-12-22T17:59:37.849Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/*.rs : Use proper error types (thiserror) and propagate errors appropriately

Applied to files:

  • dash/src/consensus/encode.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/src/consensus/encode.rs
  • dash/embedded/src/main.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/src/consensus/encode.rs
  • dash/embedded/src/main.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/**/tests/**/*.rs : Organize unit tests by functionality: separate test files for BIP32, mnemonics, addresses, derivation paths, and PSBT operations

Applied to files:

  • key-wallet/src/psbt/serialize.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/embedded/src/main.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:

  • dash/embedded/src/main.rs
⏰ 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: fuzz (hashes_sha512)
  • GitHub Check: fuzz (hashes_sha256)
  • GitHub Check: fuzz (dash_deserialize_address)
  • GitHub Check: fuzz (dash_deserialize_block)
  • GitHub Check: fuzz (dash_deserialize_script)
  • GitHub Check: fuzz (hashes_cbor)
  • GitHub Check: fuzz (hashes_sha512_256)
  • GitHub Check: fuzz (hashes_json)
  • GitHub Check: fuzz (dash_script_bytes_to_asm_fmt)
  • GitHub Check: fuzz (dash_deserialize_amount)
  • GitHub Check: fuzz (dash_outpoint_string)
  • GitHub Check: RPC Tests (stable, true)
  • GitHub Check: fuzz (dash_deserialize_witness)
  • GitHub Check: fuzz (dash_deser_net_msg)
  • GitHub Check: fuzz (hashes_ripemd160)
  • GitHub Check: SPV Components Tests
  • GitHub Check: Core Components Tests
  • GitHub Check: Pre-commit (ubuntu-latest)
  • GitHub Check: Pre-commit (macos-latest)
🔇 Additional comments (6)
key-wallet/src/psbt/serialize.rs (1)

426-426: LGTM!

The typo correction from "leafs" to "leaves" is grammatically correct and improves the documentation clarity.

dash/src/serialize.rs (1)

294-294: LGTM!

Consistent typo correction from "leafs" to "leaves" improves documentation.

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

1419-1419: LGTM!

Typo correction from "heigts" to "heights" improves documentation clarity.

internals/src/hex/buf_encoder.rs (1)

39-39: LGTM!

Typo correction from "implementtions" to "implementations" improves documentation.

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

44-44: LGTM!

Typo correction from "tham" to "than" improves documentation clarity.

dash/embedded/src/main.rs (1)

44-45: LGTM!

The variable name typo correction from buf_ful to buf_full improves code readability. No functional changes.

@xdustinface xdustinface force-pushed the chore/update-pre-commit branch from b1af45a to 12fb0b9 Compare December 28, 2025 10:36
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.

2 participants