-
Notifications
You must be signed in to change notification settings - Fork 9
build(deps): bump bincode to 2.0.1 #356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughThis 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ 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. Comment |
There was a problem hiding this 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: Usecore::convert::TryIntoforno_stdcompatibility.The macro uses
std::convert::TryIntoat line 46, which is unavailable inno_stdbuilds. This breaks compatibility when thebincodefeature is enabled without thestdfeature. Change tocore::convert::TryIntoto 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>andBorrowDecode<'de, C>forAddressTypecontain identical match logic for convertingu8toAddressType. 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
📒 Files selected for processing (15)
dash-network/Cargo.tomldash/Cargo.tomldash/src/address.rshashes/Cargo.tomlhashes/src/bincode_macros.rshashes/src/internal_macros.rskey-wallet-ffi/IMPORT_WALLET_FFI.mdkey-wallet-manager/Cargo.tomlkey-wallet/Cargo.tomlkey-wallet/src/bip32.rskey-wallet/src/derivation_bls_bip32.rskey-wallet/src/derivation_slip10.rskey-wallet/src/mnemonic.rskey-wallet/src/wallet/root_extended_keys.rsrpc-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 thetests/directory
Usesnake_casefor function and variable names
UseUpperCamelCasefor types and traits
UseSCREAMING_SNAKE_CASEfor constants
Format code withrustfmtbefore commits; ensurecargo fmt --allis run
Runcargo clippy --workspace --all-targets -- -D warningsfor linting; avoid warnings in CI
Preferasync/awaitviatokiofor 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.rshashes/src/internal_macros.rskey-wallet/src/derivation_slip10.rskey-wallet/src/wallet/root_extended_keys.rskey-wallet/src/bip32.rshashes/src/bincode_macros.rskey-wallet/src/derivation_bls_bip32.rskey-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
UseBTreeMapfor ordered data (accounts, transactions) andHashMapfor 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 returnResult<T>for all fallible operations
Files:
key-wallet/src/derivation_slip10.rskey-wallet/src/wallet/root_extended_keys.rskey-wallet/src/bip32.rskey-wallet/src/derivation_bls_bip32.rskey-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.tomlhashes/Cargo.tomldash-network/Cargo.tomlkey-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.tomlhashes/Cargo.tomldash-network/Cargo.tomlkey-wallet/Cargo.tomldash/Cargo.tomlkey-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.tomlkey-wallet-ffi/IMPORT_WALLET_FFI.mdhashes/Cargo.tomlkey-wallet/Cargo.tomlkey-wallet/src/wallet/root_extended_keys.rskey-wallet/src/bip32.rskey-wallet/src/mnemonic.rskey-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.tomlhashes/Cargo.tomldash-network/Cargo.tomlkey-wallet/Cargo.tomldash/Cargo.tomlkey-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.tomlkey-wallet/Cargo.tomlkey-wallet/src/derivation_slip10.rskey-wallet/src/wallet/root_extended_keys.rskey-wallet/src/bip32.rskey-wallet/src/derivation_bls_bip32.rskey-wallet/src/mnemonic.rskey-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.tomlkey-wallet-ffi/IMPORT_WALLET_FFI.mdkey-wallet/Cargo.tomlkey-wallet/src/derivation_slip10.rskey-wallet/src/wallet/root_extended_keys.rskey-wallet/src/bip32.rskey-wallet/src/derivation_bls_bip32.rskey-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.tomlhashes/Cargo.tomldash/src/address.rskey-wallet/Cargo.tomlkey-wallet/src/bip32.rsdash/Cargo.tomlkey-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.tomlkey-wallet/Cargo.tomlkey-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.tomlkey-wallet/Cargo.tomlkey-wallet/src/wallet/root_extended_keys.rskey-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.mdkey-wallet/Cargo.tomlkey-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.mdkey-wallet/Cargo.tomlkey-wallet/src/wallet/root_extended_keys.rskey-wallet/src/bip32.rskey-wallet/src/derivation_bls_bip32.rskey-wallet/src/mnemonic.rskey-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.mdkey-wallet/src/wallet/root_extended_keys.rskey-wallet/src/bip32.rskey-wallet/src/derivation_bls_bip32.rskey-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.tomldash-network/Cargo.tomlkey-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.tomlkey-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.tomlkey-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.3to stable2.0.1while preserving theoptionalflag.key-wallet/Cargo.toml (1)
39-40: LGTM!Both
bincodeandbincode_deriveare correctly updated to2.0.1in 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:
serdereformatted for readability (no functional change)bincodeandbincode_deriveboth updated to2.0.1with existing flags preserved (optional,default-features = false)rpc-json/Cargo.toml (1)
31-31: LGTM!The bincode dependency is correctly updated to
2.0.1with theserdefeature 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.3to stable2.0.1are 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.1aligning with the workspace-wide update.key-wallet/src/bip32.rs (5)
377-402: LGTM!The
Decode<C>implementation forExtendedPrivKeycorrectly 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 forExtendedPrivKeycorrectly updates the trait signature. The implementation properly duplicates the decode logic sincesecp256k1::SecretKeydoesn't support zero-copy borrowing from the decoder.
500-525: LGTM!The
Decode<C>implementation forExtendedPubKeycorrectly follows the same pattern, with proper handling of the 33-byte compressed public key format.
527-552: LGTM!The
BorrowDecode<'de, C>implementation forExtendedPubKeyis consistent with the codebase pattern.
958-974: LGTM!The
Decode<C>andBorrowDecode<'de, C>implementations forDerivationPathcorrectly delegate to the underlyingVec<ChildNumber>decode, which handles the context propagation automatically.key-wallet/src/mnemonic.rs (1)
72-101: LGTM!The
Decode<C>andBorrowDecode<'de, C>implementations forMnemoniccorrectly add the generic context parameter. The parsing logic appropriately usesbip39_crate::Mnemonic::parsewhich auto-detects language, with clear error messages for invalid mnemonics.key-wallet/src/derivation_bls_bip32.rs (2)
530-565: LGTM!The
Decode<C>andBorrowDecode<'de, C>implementations forExtendedBLSPrivKeycorrectly add the generic context parameter. TheBorrowDecodeimplementation appropriately delegates toDecodeusing 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>andBorrowDecode<'de, C>implementations forExtendedBLSPubKeyfollow the same consistent pattern. The public key decoding correctly usesSerializationFormat::Modernfor 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 toDecoder<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 contextualDecode<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 usesbincode::BorrowDecode::borrow_decode(decoder)?to obtain the borrowed slice.key-wallet/src/derivation_slip10.rs (3)
526-539: LGTM!The
Decode<C>implementation forExtendedEd25519PrivKeycorrectly 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 supportDecode<C>.
558-580: LGTM!The
Decode<C>implementation forExtendedEd25519PubKeyfollows the same correct pattern. Error handling withDecodeError::OtherStringfor theVerifyingKey::from_bytesconversion is appropriate.
583-598: LGTM!Both
BorrowDecode<'de, C>implementations correctly delegate to their respectiveDecode<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 forRootExtendedPrivKeycorrectly adds the context parameter. The error handling for invalid private key bytes usingDecodeError::OtherStringis appropriate.
195-203: LGTM!The
BorrowDecode<'de, C>implementation correctly delegates toDecode<C>. The comment explaining why borrowing isn't used (secp256k1::SecretKey doesn't support borrowing) is helpful.
309-327: LGTM!The
Decode<C>implementation forRootExtendedPubKeyfollows the same correct pattern with proper error handling for public key validation.
330-338: LGTM!The
BorrowDecode<'de, C>implementation correctly delegates toDecode<C>, consistent with the private key implementation.dash/src/address.rs (1)
866-889: LGTM!The
Decode<C>andBorrowDecode<'de, C>implementations forAddresscorrectly add the context parameter. The string-based serialization approach is maintained, with proper error handling viaDecodeError::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.
|
@lklimek Can you rebase this on |
Co-authored-by: Kevin Rombach <[email protected]>
d363101 to
38a77c8
Compare
We need to replace abandoned
bincodecrate 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
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.