-
Notifications
You must be signed in to change notification settings - Fork 44
chore: clean dpp clippy #2764
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
chore: clean dpp clippy #2764
Conversation
WalkthroughGeneral lint-suppression and doc-formatting edits across crates; widened several validation collectors from Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller
participant DocumentTypeModule as DocumentType::try_from_schema
participant V0 as DocumentTypeV0::try_from_schema
participant V1 as DocumentTypeV1::try_from_schema
Caller->>DocumentTypeModule: try_from_schema(schema, &mut impl Extend...)
alt version == 0
DocumentTypeModule->>V0: try_from_schema(..., &mut impl Extend...)
V0-->>DocumentTypeModule: Result<DocumentTypeV0,...>
DocumentTypeModule-->>Caller: DocumentType::V0(...)
else version == 1
DocumentTypeModule->>V1: try_from_schema(..., &mut impl Extend...)
V1-->>DocumentTypeModule: Result<DocumentTypeV1,...>
DocumentTypeModule-->>Caller: DocumentType::V1(...)
end
Note over DocumentTypeModule: validation_operations now accepts any Extend<ProtocolValidationOperation>
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
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: 1
🧹 Nitpick comments (30)
packages/rs-dpp/src/identity/state_transition/asset_lock_proof/mod.rs (2)
166-176
: Optional: collapse to a single expression for brevity.Keeps intent clear and removes the local variable.
pub fn type_from_raw_value(value: &Value) -> Option<AssetLockProofType> { - let proof_type_res = value.get_integer::<u8>("type"); - - match proof_type_res { - Ok(proof_type_int) => { - let proof_type = AssetLockProofType::try_from(proof_type_int); - proof_type.ok() - } - Err(_) => None, - } + value + .get_integer::<u8>("type") + .ok() + .and_then(|i| AssetLockProofType::try_from(i).ok()) }
135-138
: Optional: derive Copy for the small C-like enum.This can reduce moves and is a common clippy suggestion for simple enums.
+#[derive(Copy, Clone)] pub enum AssetLockProofType { Instant = 0, Chain = 1, }
packages/rs-dpp/src/fee/fee_result/refunds.rs (5)
161-164
: Consider overflow-safe accumulationIf Credits is a fixed-size integer (e.g., u64), summing across many epochs can overflow in release builds. Prefer saturating or checked accumulation to avoid wraparound.
Apply this diff to use saturating addition without changing the method’s signature:
- let credits = credits_per_epoch.values().sum(); + let credits: Credits = credits_per_epoch + .values() + .copied() + .fold(0 as Credits, |acc, v| acc.saturating_add(v));
125-128
: Use saturating_add when merging per-epoch creditsAlign overflow handling with the previous comment by avoiding potential wrap on addition here as well.
- .and_modify(|base_credits| *base_credits += credits) + .and_modify(|base_credits| *base_credits = base_credits.saturating_add(credits))
141-143
: Compare identifiers by bytes to avoid cross-type Eq surprisesBe explicit and consistent with get(...as_bytes()) usage.
- if identifier == identity_id { + if identifier == *identity_id.as_bytes() { return None; }
55-56
: Tighten overflow error messageThe source type isn’t necessarily u64; keep the message generic.
- let epoch_index : u16 = encoded_epoch_index.try_into().map_err(|_| ProtocolError::Overflow("can't fit u64 epoch index from StorageRemovalPerEpochByIdentifier to u16 EpochIndex"))?; + let epoch_index: u16 = encoded_epoch_index + .try_into() + .map_err(|_| ProtocolError::Overflow("can't fit epoch index into u16 EpochIndex"))?;
21-23
: Polish docs grammar and punctuationMinor wording improvements for clarity.
-/// There are additional work and storage required to process refunds -/// To protect system from the spam and unnecessary work -/// a dust refund limit is used +/// There is additional work and storage required to process refunds. +/// To protect the system from spam and unnecessary work, +/// a dust refund limit is used.packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/v0_methods.rs (1)
52-54
: Remove redundant clone to stay clippy-clean and match the other site
public_key.clone()
is unnecessary ifInto<IdentityPublicKeyInCreation>
is implemented for&IdentityPublicKey
(as used in mod.rs). UseInto::into
directly to avoid allocations.Apply:
- .values() - .map(|public_key| public_key.clone().into()) + .values() + .map(Into::into)packages/rs-drive-proof-verifier/src/proof.rs (5)
92-98
: Fix return docs for maybe_from_proof()Docs mention a tuple but the function returns Result<Option, Error>. Align bullets with the signature.
- /// * `Ok(Some(object, metadata))` when the requested object was found in the proof. - /// * `Ok(None)` when the requested object was not found in the proof; this can be interpreted as proof of non-existence. - /// For collections, returns Ok(None) if none of the requested objects were found. + /// * `Ok(Some(object))` when the requested object was found in the proof. + /// * `Ok(None)` when the requested object was not found in the proof; this can be interpreted as proof of non-existence. + /// For collections, returns `Ok(None)` if none of the requested objects were found.
122-128
: Fix return docs for maybe_from_proof_with_metadata()The Ok variant returns (Option, ResponseMetadata, Proof), not an Option of a tuple.
- /// * `Ok(Some((object, metadata)))` when the requested object was found in the proof. - /// * `Ok(None)` when the requested object was not found in the proof; this can be interpreted as proof of non-existence. - /// For collections, returns Ok(None) if none of the requested objects were found. + /// * `Ok((Some(object), metadata, proof))` when the requested object was found in the proof. + /// * `Ok((None, metadata, proof))` when the requested object was not found in the proof; this can be interpreted as proof of non-existence. + /// For collections, returns `Ok((None, metadata, proof))` if none of the requested objects were found.
155-157
: Align documented error with implementationCode returns Error::NotFound; docs say Error::DocumentMissingInProof.
- /// * `Err(Error::DocumentMissingInProof)` when the requested object was not found in the proof. + /// * `Err(Error::NotFound)` when the requested object was not found in the proof.
189-191
: Correct tuple shape in from_proof_with_metadata() docsReturn type is Result<(Self, ResponseMetadata), Error>.
- /// * `Ok(Some(object, metadata))` when the requested object was found in the proof. - /// * `Err(Error::DocumentMissingInProof)` when the requested object was not found in the proof. + /// * `Ok((object, metadata))` when the requested object was found in the proof. + /// * `Err(Error::NotFound)` when the requested object was not found in the proof.
229-231
: Correct tuple shape in from_proof_with_metadata_and_proof() docsReturn type is Result<(Self, ResponseMetadata, Proof), Error>.
- /// * `Ok(Some(object, metadata, proof))` when the requested object was found in the proof. - /// * `Err(Error::DocumentMissingInProof)` when the requested object was not found in the proof. + /// * `Ok((object, metadata, proof))` when the requested object was found in the proof. + /// * `Err(Error::NotFound)` when the requested object was not found in the proof.packages/rs-dpp/src/lib.rs (1)
6-6
: Scopeclippy::result_large_err
to specific items
Remove the crate-level#![allow(clippy::result_large_err)]
inpackages/rs-dpp/src/lib.rs
and apply#[allow(clippy::result_large_err)]
only on the functions or modules that return large‐errorResult
types—this narrows the suppression to just the necessary code paths and prevents masking other warnings.packages/rs-drive-proof-verifier/src/lib.rs (1)
3-3
: OK to allow result_large_err at crate levelGiven large error enums, this is reasonable. Revisit later to localize if we refactor error types.
packages/strategy-tests/src/operations.rs (4)
586-595
: Avoid potential panic on invalid weights in choose_weighted_choice()WeightedIndex::new(...) can error when all weights are zero. Handle the error instead of unwrap.
- let dist = WeightedIndex::new(weights).unwrap(); + let dist = match WeightedIndex::new(weights) { + Ok(d) => d, + Err(_) => return ResourceVoteChoice::Abstain, + };
88-90
: Fix copy/paste in error text (TokenOp serialization)Message says “DocumentOp” while serializing TokenOp.
- bincode::encode_to_vec(document_op, config).map_err(|e| { - PlatformSerializationError(format!("unable to serialize DocumentOp: {}", e)) - }) + bincode::encode_to_vec(document_op, config).map_err(|e| { + PlatformSerializationError(format!("unable to serialize TokenOp: {}", e)) + })
106-110
: Fix copy/paste in error text (TokenOp deserialization)Message says “DocumentOp” while deserializing TokenOp.
- bincode::borrow_decode_from_slice(data, config) - .map_err(|e| { - PlatformDeserializationError(format!("unable to deserialize DocumentOp: {}", e)) - })? + bincode::borrow_decode_from_slice(data, config).map_err(|e| { + PlatformDeserializationError(format!("unable to deserialize TokenOp: {}", e)) + })?
298-301
: Fix copy/paste in error text (Operation deserialization)Should reference Operation, not DocumentOp.
- bincode::borrow_decode_from_slice(data, config) - .map_err(|e| { - PlatformDeserializationError(format!("unable to deserialize DocumentOp: {}", e)) - })? + bincode::borrow_decode_from_slice(data, config).map_err(|e| { + PlatformDeserializationError(format!("unable to deserialize Operation: {}", e)) + })?packages/rs-dpp/src/errors/consensus/consensus_error.rs (1)
30-31
: OK to allow large_enum_variant on ConsensusErrorPublic error enums often aggregate data; documenting the rationale inline would help future readers.
packages/rs-drive-abci/src/lib.rs (1)
12-14
: Crate-level allows acknowledgedKeeping clippy clean is good; consider localizing these allows over time to avoid masking unrelated warnings.
packages/rs-dpp/src/errors/protocol_error.rs (1)
45-45
: Consider boxing large payload variants instead of suppressing ClippyAllowing
large_enum_variant
is fine short-term, but boxing heavy fields (where practical) can reduce move costs and improve memory footprint forProtocolError
.packages/rs-dapi-client/src/dump.rs (1)
106-109
: Prefer splitting by::
and sanitize generics for filesystem safetyType names can include generics (
<...>
) and module paths; consider:
- Split by
"::"
(not':'
) to avoid empty segments.- Strip generics and sanitize characters to ensure safe filenames on all platforms.
Apply this minimal change within the current method:
- req_type.rsplit(':').next().unwrap_or(req_type).to_string() + req_type.rsplit("::").next().unwrap_or(req_type).to_string()If you want stronger sanitization:
fn request_type() -> String { let req_type = std::any::type_name::<T>(); let base = req_type.rsplit("::").next().unwrap_or(req_type); let base_no_generics = base.split('<').next().unwrap_or(base); base_no_generics .chars() .map(|c| match c { 'A'..='Z' | 'a'..='z' | '0'..='9' | '-' | '_' => c, _ => '-', }) .collect() }packages/rs-dpp/src/errors/consensus/basic/basic_error.rs (1)
106-106
: Large enum variant suppression: acceptable, but consider targeted boxingKeeping Clippy clean via
allow
is okay, though boxing the few largest variants would reduce move size and keep the enum lean.packages/rs-dpp/src/state_transition/mod.rs (1)
307-309
: Name the magic number for readability
268435456
is opaque; consider a named constant to document intent (e.g., upper bound for test builds).Example:
const TEST_PROTOCOL_VERSION_UPPER_BOUND: ProtocolVersion = 268_435_456; if active_version_range.contains(&_platform_version.protocol_version) || _platform_version.protocol_version > TEST_PROTOCOL_VERSION_UPPER_BOUND { /* ... */ }packages/rs-dpp/src/system_data_contracts.rs (1)
171-196
: PassingPlatformVersion
by value: OK; length assertions are brittleThe pass-by-value updates look consistent. Consider asserting structural invariants instead of exact byte lengths to reduce test fragility across harmless encoding tweaks.
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v0/mod.rs (1)
64-65
: Scope lint allows and address the no-op expression instead.Function-wide allows are broader than needed. You can:
- Drop
clippy::ptr_arg
unless Clippy actually flags a specific param here.- Localize
clippy::unnecessary_operation
to the small cfg block, or remove the cause.Minimal change without altering behavior:
- #[allow(clippy::ptr_arg)] - #[allow(clippy::unnecessary_operation)] + // keep function clean; handle the specific lint at the callsite belowThen wrap the no-op creation under the cfg with a localized allow or make the intent explicit:
#[cfg(not(feature = "validation"))] if full_validation { #[allow(clippy::unnecessary_operation)] { // keep the breadcrumb without returning to avoid test fallout let _ = ProtocolError::CorruptedCodeExecution( "validation is not enabled but is being called on try_from_schema".to_string(), ); } }packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs (1)
80-81
: Narrow lint allowances; fix the root cause.Same as V0: avoid function-wide
clippy::ptr_arg
andclippy::unnecessary_operation
. Prefer a localized allow (or explicitlet _ = ...;
) inside the#[cfg(not(feature = "validation"))]
branch to silence the no-op expression only.packages/rs-dpp/src/data_contract/associated_token/token_perpetual_distribution/distribution_function/mod.rs (1)
122-126
: Tighten phrasing in docs for defaults and offset behavior.Suggest minor wording tweaks for clarity and tone.
- /// If this is provided before this number we give out the distribution start amount every interval. + /// If set, emissions before this offset use `distribution_start_amount` each interval. - /// !!!Very important!!! -> This will default to 128 is default if not set. - /// This means that after 128 cycles we will be distributing trailing_distribution_interval_amount per interval. + /// Defaults to 128 if not set. + /// After 128 cycles, the function emits `trailing_distribution_interval_amount` per interval.packages/rs-dpp/src/data_contract/document_type/mod.rs (1)
91-91
: Allowing large enum variant is fine; keep an eye on move/copy costs.Given V1/V0 carry sizable structures, the allow makes sense. If perf hotspots appear, consider boxing heavy fields inside variants to shrink enum size.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (29)
packages/rs-dapi-client/src/dump.rs
(1 hunks)packages/rs-dpp/src/data_contract/associated_token/token_perpetual_distribution/distribution_function/mod.rs
(3 hunks)packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v0/mod.rs
(1 hunks)packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs
(1 hunks)packages/rs-dpp/src/data_contract/document_type/methods/mod.rs
(1 hunks)packages/rs-dpp/src/data_contract/document_type/mod.rs
(1 hunks)packages/rs-dpp/src/data_contract/document_type/property/mod.rs
(2 hunks)packages/rs-dpp/src/data_contract/extra/drive_api_tests.rs
(1 hunks)packages/rs-dpp/src/errors/consensus/basic/basic_error.rs
(1 hunks)packages/rs-dpp/src/errors/consensus/consensus_error.rs
(1 hunks)packages/rs-dpp/src/errors/protocol_error.rs
(1 hunks)packages/rs-dpp/src/fee/fee_result/refunds.rs
(1 hunks)packages/rs-dpp/src/identity/identity_public_key/random.rs
(11 hunks)packages/rs-dpp/src/identity/state_transition/asset_lock_proof/mod.rs
(1 hunks)packages/rs-dpp/src/lib.rs
(1 hunks)packages/rs-dpp/src/state_transition/mod.rs
(2 hunks)packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/methods/v0/mod.rs
(1 hunks)packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/mod.rs
(1 hunks)packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/v0_methods.rs
(1 hunks)packages/rs-dpp/src/system_data_contracts.rs
(1 hunks)packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/check_for_desired_protocol_upgrade/mod.rs
(1 hunks)packages/rs-drive-abci/src/execution/platform_events/withdrawals/update_broadcasted_withdrawal_statuses/mod.rs
(1 hunks)packages/rs-drive-abci/src/lib.rs
(1 hunks)packages/rs-drive-proof-verifier/src/lib.rs
(1 hunks)packages/rs-drive-proof-verifier/src/proof.rs
(2 hunks)packages/strategy-tests/src/lib.rs
(1 hunks)packages/strategy-tests/src/operations.rs
(1 hunks)packages/wasm-dpp/src/identity/identity.rs
(1 hunks)packages/wasm-drive-verify/src/lib.rs
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.rs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.rs
: Format Rust code with cargo fmt
Run Clippy linter for Rust code
**/*.rs
: Use 4-space indentation for Rust files
Format Rust code with rustfmt defaults
Keep Rust code clippy-clean (no warnings)
In Rust, modules use snake_case, types use PascalCase, constants use SCREAMING_SNAKE_CASE
Files:
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs
packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/mod.rs
packages/rs-drive-abci/src/execution/platform_events/withdrawals/update_broadcasted_withdrawal_statuses/mod.rs
packages/rs-dpp/src/errors/consensus/consensus_error.rs
packages/strategy-tests/src/lib.rs
packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/methods/v0/mod.rs
packages/rs-drive-proof-verifier/src/proof.rs
packages/rs-drive-abci/src/lib.rs
packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/check_for_desired_protocol_upgrade/mod.rs
packages/rs-dpp/src/errors/protocol_error.rs
packages/rs-drive-proof-verifier/src/lib.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v0/mod.rs
packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/v0_methods.rs
packages/strategy-tests/src/operations.rs
packages/rs-dpp/src/lib.rs
packages/rs-dpp/src/errors/consensus/basic/basic_error.rs
packages/wasm-dpp/src/identity/identity.rs
packages/rs-dapi-client/src/dump.rs
packages/rs-dpp/src/identity/state_transition/asset_lock_proof/mod.rs
packages/rs-dpp/src/state_transition/mod.rs
packages/rs-dpp/src/data_contract/extra/drive_api_tests.rs
packages/rs-dpp/src/fee/fee_result/refunds.rs
packages/rs-dpp/src/data_contract/associated_token/token_perpetual_distribution/distribution_function/mod.rs
packages/rs-dpp/src/data_contract/document_type/property/mod.rs
packages/wasm-drive-verify/src/lib.rs
packages/rs-dpp/src/identity/identity_public_key/random.rs
packages/rs-dpp/src/data_contract/document_type/mod.rs
packages/rs-dpp/src/data_contract/document_type/methods/mod.rs
packages/rs-dpp/src/system_data_contracts.rs
packages/**
📄 CodeRabbit inference engine (AGENTS.md)
Place all source packages under packages/* (JS/TS packages and Rust crates)
Files:
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs
packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/mod.rs
packages/rs-drive-abci/src/execution/platform_events/withdrawals/update_broadcasted_withdrawal_statuses/mod.rs
packages/rs-dpp/src/errors/consensus/consensus_error.rs
packages/strategy-tests/src/lib.rs
packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/methods/v0/mod.rs
packages/rs-drive-proof-verifier/src/proof.rs
packages/rs-drive-abci/src/lib.rs
packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/check_for_desired_protocol_upgrade/mod.rs
packages/rs-dpp/src/errors/protocol_error.rs
packages/rs-drive-proof-verifier/src/lib.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v0/mod.rs
packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/v0_methods.rs
packages/strategy-tests/src/operations.rs
packages/rs-dpp/src/lib.rs
packages/rs-dpp/src/errors/consensus/basic/basic_error.rs
packages/wasm-dpp/src/identity/identity.rs
packages/rs-dapi-client/src/dump.rs
packages/rs-dpp/src/identity/state_transition/asset_lock_proof/mod.rs
packages/rs-dpp/src/state_transition/mod.rs
packages/rs-dpp/src/data_contract/extra/drive_api_tests.rs
packages/rs-dpp/src/fee/fee_result/refunds.rs
packages/rs-dpp/src/data_contract/associated_token/token_perpetual_distribution/distribution_function/mod.rs
packages/rs-dpp/src/data_contract/document_type/property/mod.rs
packages/wasm-drive-verify/src/lib.rs
packages/rs-dpp/src/identity/identity_public_key/random.rs
packages/rs-dpp/src/data_contract/document_type/mod.rs
packages/rs-dpp/src/data_contract/document_type/methods/mod.rs
packages/rs-dpp/src/system_data_contracts.rs
**/*.{js,jsx,ts,tsx,rs}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{js,jsx,ts,tsx,rs}
: Use LF line endings in source files
Ensure a final newline at end of source files
Files:
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs
packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/mod.rs
packages/rs-drive-abci/src/execution/platform_events/withdrawals/update_broadcasted_withdrawal_statuses/mod.rs
packages/rs-dpp/src/errors/consensus/consensus_error.rs
packages/strategy-tests/src/lib.rs
packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/methods/v0/mod.rs
packages/rs-drive-proof-verifier/src/proof.rs
packages/rs-drive-abci/src/lib.rs
packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/check_for_desired_protocol_upgrade/mod.rs
packages/rs-dpp/src/errors/protocol_error.rs
packages/rs-drive-proof-verifier/src/lib.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v0/mod.rs
packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/v0_methods.rs
packages/strategy-tests/src/operations.rs
packages/rs-dpp/src/lib.rs
packages/rs-dpp/src/errors/consensus/basic/basic_error.rs
packages/wasm-dpp/src/identity/identity.rs
packages/rs-dapi-client/src/dump.rs
packages/rs-dpp/src/identity/state_transition/asset_lock_proof/mod.rs
packages/rs-dpp/src/state_transition/mod.rs
packages/rs-dpp/src/data_contract/extra/drive_api_tests.rs
packages/rs-dpp/src/fee/fee_result/refunds.rs
packages/rs-dpp/src/data_contract/associated_token/token_perpetual_distribution/distribution_function/mod.rs
packages/rs-dpp/src/data_contract/document_type/property/mod.rs
packages/wasm-drive-verify/src/lib.rs
packages/rs-dpp/src/identity/identity_public_key/random.rs
packages/rs-dpp/src/data_contract/document_type/mod.rs
packages/rs-dpp/src/data_contract/document_type/methods/mod.rs
packages/rs-dpp/src/system_data_contracts.rs
🧠 Learnings (22)
📓 Common learnings
Learnt from: QuantumExplorer
PR: dashpay/platform#2257
File: packages/rs-drive-abci/src/mimic/test_quorum.rs:159-164
Timestamp: 2024-11-20T16:16:01.830Z
Learning: QuantumExplorer prefers not to receive auto-generated messages asking to post on social media.
📚 Learning: 2024-11-20T10:01:50.837Z
Learnt from: QuantumExplorer
PR: dashpay/platform#2257
File: packages/rs-drive-abci/src/platform_types/platform_state/v0/old_structures/mod.rs:94-94
Timestamp: 2024-11-20T10:01:50.837Z
Learning: In `packages/rs-drive-abci/src/platform_types/platform_state/v0/old_structures/mod.rs`, when converting with `PublicKey::try_from`, it's acceptable to use `.expect()` to handle potential conversion errors.
Applied to files:
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v0/mod.rs
packages/rs-dpp/src/state_transition/mod.rs
📚 Learning: 2024-10-09T00:22:57.778Z
Learnt from: shumkov
PR: dashpay/platform#2201
File: packages/rs-platform-version/src/version/v2.rs:1186-1188
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the `IdentityTransitionVersions` structure within `packages/rs-platform-version/src/version/v2.rs`, the field `credit_withdrawal` does not need the `identity_` prefix since it is already encompassed within identity state transitions.
Applied to files:
packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/mod.rs
packages/rs-drive-abci/src/execution/platform_events/withdrawals/update_broadcasted_withdrawal_statuses/mod.rs
packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/methods/v0/mod.rs
packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/v0_methods.rs
packages/rs-dpp/src/state_transition/mod.rs
📚 Learning: 2024-10-06T16:11:34.946Z
Learnt from: QuantumExplorer
PR: dashpay/platform#2215
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs:19-30
Timestamp: 2024-10-06T16:11:34.946Z
Learning: In the Rust file `packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs`, within the `create_owner_identity_v1` function, the `add_public_keys` method of the `Identity` struct cannot fail and does not require explicit error handling.
Applied to files:
packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/mod.rs
packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/v0_methods.rs
packages/rs-dpp/src/errors/consensus/basic/basic_error.rs
packages/wasm-dpp/src/identity/identity.rs
📚 Learning: 2025-09-07T22:20:55.315Z
Learnt from: CR
PR: dashpay/platform#0
File: AGENTS.md:0-0
Timestamp: 2025-09-07T22:20:55.315Z
Learning: Applies to **/*.rs : Keep Rust code clippy-clean (no warnings)
Applied to files:
packages/rs-dpp/src/errors/consensus/consensus_error.rs
packages/strategy-tests/src/lib.rs
packages/rs-drive-abci/src/lib.rs
packages/rs-drive-proof-verifier/src/lib.rs
packages/rs-dpp/src/lib.rs
packages/rs-dpp/src/errors/consensus/basic/basic_error.rs
📚 Learning: 2025-09-07T22:18:50.851Z
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-07T22:18:50.851Z
Learning: Applies to **/*.rs : Run Clippy linter for Rust code
Applied to files:
packages/strategy-tests/src/lib.rs
packages/rs-drive-abci/src/lib.rs
packages/rs-drive-proof-verifier/src/lib.rs
packages/rs-dpp/src/lib.rs
📚 Learning: 2024-10-08T13:28:03.529Z
Learnt from: QuantumExplorer
PR: dashpay/platform#2227
File: packages/rs-drive-abci/src/platform_types/platform_state/mod.rs:141-141
Timestamp: 2024-10-08T13:28:03.529Z
Learning: When converting `PlatformStateV0` to `PlatformStateForSavingV1` in `packages/rs-drive-abci/src/platform_types/platform_state/mod.rs`, only version `0` needs to be handled in the match on `platform_state_for_saving_structure_default` because the changes are retroactive.
Applied to files:
packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/methods/v0/mod.rs
packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/check_for_desired_protocol_upgrade/mod.rs
packages/rs-dpp/src/state_transition/mod.rs
packages/rs-dpp/src/data_contract/document_type/mod.rs
packages/rs-dpp/src/system_data_contracts.rs
📚 Learning: 2025-04-11T09:08:05.652Z
Learnt from: pauldelucia
PR: dashpay/platform#2523
File: packages/rs-drive/src/drive/contract/update/update_contract/v1/update_description/v1/mod.rs:147-151
Timestamp: 2025-04-11T09:08:05.652Z
Learning: Description length validation for data contracts is already handled in the data contract validation process, specifically in packages/rs-dpp/src/data_contract/methods/validate_update/v0/mod.rs.
Applied to files:
packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/methods/v0/mod.rs
packages/rs-dpp/src/data_contract/document_type/methods/mod.rs
📚 Learning: 2024-12-05T09:29:38.918Z
Learnt from: shumkov
PR: dashpay/platform#2375
File: packages/rs-drive-abci/Cargo.toml:61-63
Timestamp: 2024-12-05T09:29:38.918Z
Learning: In the `drive-abci` package, avoid adding unused dependencies like `hashbrown` to `Cargo.toml`. The team relies on CI to detect dependency version issues.
Applied to files:
packages/rs-drive-abci/src/lib.rs
📚 Learning: 2024-10-06T16:18:07.994Z
Learnt from: QuantumExplorer
PR: dashpay/platform#2215
File: packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs:119-120
Timestamp: 2024-10-06T16:18:07.994Z
Learning: In the `run_block_proposal` function in `packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs`, it's acceptable to pass `platform_state` to `perform_events_on_first_block_of_protocol_change`, even if `block_platform_state` has been updated.
Applied to files:
packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/check_for_desired_protocol_upgrade/mod.rs
packages/rs-dpp/src/state_transition/mod.rs
📚 Learning: 2024-10-04T09:08:47.901Z
Learnt from: shumkov
PR: dashpay/platform#2206
File: packages/rs-drive-abci/tests/strategy_tests/main.rs:1162-1162
Timestamp: 2024-10-04T09:08:47.901Z
Learning: In the Rust test file `packages/rs-drive-abci/tests/strategy_tests/main.rs`, specific protocol versions like `PROTOCOL_VERSION_1` are intentionally used in tests instead of `PROTOCOL_VERSION_LATEST`.
Applied to files:
packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/check_for_desired_protocol_upgrade/mod.rs
packages/rs-dpp/src/state_transition/mod.rs
📚 Learning: 2024-11-22T08:19:14.448Z
Learnt from: shumkov
PR: dashpay/platform#2345
File: packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs:93-99
Timestamp: 2024-11-22T08:19:14.448Z
Learning: In `packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs`, the `insert_contract` method requires an owned `BlockInfo`, so cloning `block_info` is necessary when calling it.
Applied to files:
packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/check_for_desired_protocol_upgrade/mod.rs
📚 Learning: 2024-11-20T16:05:40.200Z
Learnt from: QuantumExplorer
PR: dashpay/platform#2257
File: packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving.rs:148-151
Timestamp: 2024-11-20T16:05:40.200Z
Learning: In `packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving.rs`, when converting public keys from `QuorumForSavingV0` to `VerificationQuorum`, it's acceptable to use `.expect()` for public key conversion, as the conversion has been verified and panics are acceptable in this context.
Applied to files:
packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/v0_methods.rs
packages/wasm-dpp/src/identity/identity.rs
📚 Learning: 2025-08-05T13:55:39.147Z
Learnt from: thephez
PR: dashpay/platform#2718
File: packages/wasm-sdk/index.html:0-0
Timestamp: 2025-08-05T13:55:39.147Z
Learning: The get_identity_keys_with_proof_info function in the Rust WASM bindings does not support the "search" key request type and lacks the searchPurposeMap parameter. When proof mode is enabled with keyRequestType === 'search', the implementation falls back to the non-proof version (get_identity_keys) to maintain functionality.
Applied to files:
packages/wasm-dpp/src/identity/identity.rs
📚 Learning: 2024-10-04T14:16:05.798Z
Learnt from: lklimek
PR: dashpay/platform#2207
File: packages/rs-drive-proof-verifier/src/proof.rs:1646-1664
Timestamp: 2024-10-04T14:16:05.798Z
Learning: In the implementation of `FromProof<platform::GetContestedResourceIdentityVotesRequest>` in `packages/rs-drive-proof-verifier/src/proof.rs`, when matching `maybe_votes`, using `.expect()` on `v.into_iter().next()` is acceptable because the prior match arm `Some(v) if v.is_empty()` ensures that the map is not empty, preventing a panic.
Applied to files:
packages/rs-dpp/src/identity/state_transition/asset_lock_proof/mod.rs
📚 Learning: 2024-10-06T16:17:34.571Z
Learnt from: QuantumExplorer
PR: dashpay/platform#2215
File: packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs:105-105
Timestamp: 2024-10-06T16:17:34.571Z
Learning: In `run_block_proposal` in `packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs`, when retrieving `last_block_time_ms`, it's acceptable to use `platform_state` instead of `block_platform_state`, even after updating the protocol version.
Applied to files:
packages/rs-dpp/src/state_transition/mod.rs
📚 Learning: 2025-01-15T08:09:59.365Z
Learnt from: shumkov
PR: dashpay/platform#2422
File: packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs:152-163
Timestamp: 2025-01-15T08:09:59.365Z
Learning: In the `transition_to_version_8` function, errors from `grove_get_path_query` when retrieving active contested resource votes are intentionally logged and ignored (returning `Ok(())`) to allow the protocol upgrade to proceed despite query failures.
Applied to files:
packages/rs-dpp/src/state_transition/mod.rs
📚 Learning: 2024-11-25T01:17:02.001Z
Learnt from: QuantumExplorer
PR: dashpay/platform#2347
File: packages/rs-drive/tests/query_tests.rs:438-460
Timestamp: 2024-11-25T01:17:02.001Z
Learning: In Rust test files (`packages/rs-drive/tests/query_tests.rs`), when code is used only in tests, defining explicit enums for fields (like the `status` field in the `Withdrawal` struct) may not be necessary; using primitive types is acceptable.
Applied to files:
packages/rs-dpp/src/data_contract/extra/drive_api_tests.rs
📚 Learning: 2025-07-23T08:31:42.268Z
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.
Applied to files:
packages/wasm-drive-verify/src/lib.rs
📚 Learning: 2025-07-23T08:31:42.268Z
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.
Applied to files:
packages/wasm-drive-verify/src/lib.rs
📚 Learning: 2025-07-23T08:31:42.268Z
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().
Applied to files:
packages/wasm-drive-verify/src/lib.rs
📚 Learning: 2024-09-29T13:13:54.230Z
Learnt from: shumkov
PR: dashpay/platform#2182
File: packages/rs-platform-version/src/version/drive_abci_versions.rs:116-121
Timestamp: 2024-09-29T13:13:54.230Z
Learning: Adding Rust doc comments to structs and fields is recommended to enhance clarity and documentation.
Applied to files:
packages/rs-dpp/src/identity/identity_public_key/random.rs
packages/rs-dpp/src/data_contract/document_type/methods/mod.rs
🧬 Code graph analysis (1)
packages/rs-dpp/src/data_contract/document_type/property/mod.rs (1)
packages/rs-dpp/src/data_contract/document_type/methods/mod.rs (1)
max_size
(141-156)
⏰ 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: Rust packages (rs-dapi-client) / Unused dependencies
- GitHub Check: Rust packages (rs-dapi-client) / Check each feature
- GitHub Check: Rust packages (rs-dapi-client) / Linting
- GitHub Check: Rust packages (rs-dapi-client) / Tests
- GitHub Check: Rust packages (drive-abci) / Formatting
- GitHub Check: Rust packages (drive-abci) / Unused dependencies
- GitHub Check: Rust packages (drive-abci) / Tests
- GitHub Check: Rust packages (drive-abci) / Linting
- GitHub Check: Rust packages (drive-abci) / Check each feature
- GitHub Check: Rust packages (drive) / Tests
- GitHub Check: Rust packages (wasm-dpp) / Unused dependencies
- GitHub Check: Rust packages (wasm-dpp) / Tests
- GitHub Check: Rust packages (wasm-dpp) / Formatting
- GitHub Check: Rust packages (drive) / Linting
- GitHub Check: Rust packages (wasm-dpp) / Linting
- GitHub Check: Build Docker images (Dashmate helper, dashmate-helper, dashmate-helper) / Build Dashmate helper image
- GitHub Check: Build Docker images (DAPI, dapi, dapi) / Build DAPI image
- GitHub Check: Build Docker images (Drive, drive, drive-abci) / Build Drive image
- GitHub Check: Build JS packages / Build JS
- GitHub Check: build-wasm-sdk
🔇 Additional comments (19)
packages/rs-dpp/src/identity/state_transition/asset_lock_proof/mod.rs (1)
171-173
: Nice clippy-friendly simplification with .ok().This cleanly maps Result->Option without changing behavior.
packages/rs-dpp/src/fee/fee_result/refunds.rs (1)
161-163
: Idiomatic accumulation via values().sum() looks goodCleaner, clippy-friendly, and keeps intent clear.
packages/wasm-dpp/src/identity/identity.rs (1)
91-92
: Good clippy cleanup: prefer values() over iterating K/V pairsSwitching to
.values().cloned()
removes needless tuple destructuring and keeps order consistent with the map’s iteration. Behavior unchanged.packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/mod.rs (1)
101-103
: Iterating over values is cleaner and equivalentUsing
.values().map(|public_key| public_key.into())
is concise and avoids unused key bindings. Semantics preserved.packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/v0_methods.rs (1)
66-69
: No ordering issue:identity.public_keys()
uses aBTreeMap
, which guarantees a deterministic, key-sorted iteration order—zipping these iterators remains aligned.packages/strategy-tests/src/lib.rs (1)
1-1
: OK to allow result_large_err in tests crateAcceptable for test utilities with big error enums.
packages/strategy-tests/src/operations.rs (1)
620-632
: Allowing large enum variant here is appropriateThis enum is a serialization shim; the allow keeps clippy clean without affecting runtime code.
packages/rs-dpp/src/state_transition/state_transitions/contract/data_contract_create_transition/methods/v0/mod.rs (1)
23-24
: Doc wording tweak LGTMMinor formatting improvement; no behavior change.
packages/rs-dapi-client/src/dump.rs (1)
108-108
: LGTM: rsplit is the right tool hereSwitching to
rsplit
avoids allocating an intermediate Vec; behavior remains the same.packages/wasm-drive-verify/src/lib.rs (2)
2-3
: LGTM: crate-level Clippy allowances are reasonable for WASM bindingsThese lints often trigger in FFI/JS-interop surfaces; allowing them at crate level keeps builds warning-free.
108-108
: Comment clarityThe note about avoiding prelude imports is helpful and avoids accidental wildcard imports.
packages/rs-dpp/src/data_contract/extra/drive_api_tests.rs (1)
151-151
: LGTM: contains_key() is clearer for presence checksUsing
contains_key
reads better than comparingget(...).is_some()
and avoids constructing anOption
.Also applies to: 157-157, 163-163, 169-169
packages/rs-dpp/src/state_transition/mod.rs (1)
298-299
: LGTM: underscore parameter avoids unused warnings under feature gatesRenaming to
_platform_version
is a clean way to silence conditional unused warnings.Also applies to: 307-309, 316-317
packages/rs-dpp/src/identity/identity_public_key/random.rs (1)
78-78
: Docs-only reflow: looks goodIndentation/wording tweaks improve rustdoc readability without affecting APIs.
Also applies to: 84-84, 124-124, 130-130, 161-161, 167-167, 209-209, 215-215, 254-254, 260-260, 314-314, 380-380, 407-407, 439-439
packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/check_for_desired_protocol_upgrade/mod.rs (1)
21-22
: Docs formatting LGTM.Continuation lines under Returns read cleaner and are consistent with surrounding style.
packages/rs-drive-abci/src/execution/platform_events/withdrawals/update_broadcasted_withdrawal_statuses/mod.rs (1)
31-31
: Docs indentation tweak looks good.No behavioral change; comment now renders as intended.
packages/rs-dpp/src/data_contract/document_type/property/mod.rs (1)
309-309
: Safe to use u32::div_ceil with MSRV 1.89 Confirmed div_ceil was stabilized in Rust 1.73 and the repo’s MSRV is 1.89 (doc.rust-lang.org)packages/rs-dpp/src/data_contract/associated_token/token_perpetual_distribution/distribution_function/mod.rs (1)
527-542
: Nice: fenced ASCII diagram renders properly now.The added code fence ensures consistent formatting in rustdoc.
packages/rs-dpp/src/data_contract/document_type/methods/mod.rs (1)
215-218
: Docs clarification LGTM.The note about block heights being ignored on broadcast is clearer and consistent.
Also applies to: 220-221, 223-223
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: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs (1)
98-103
: Remove no-op to_string; either signal in debug or handle the error explicitlyThis expression has no effect and likely exists only to silence tests. Prefer a debug assertion (non-breaking in release) to surface misuse during development.
#[cfg(not(feature = "validation"))] if full_validation { - // TODO we are silently dropping this error when we shouldn't be - // but returning this error causes tests to fail; investigate more. - "validation is not enabled but is being called on try_from_schema".to_string(); + // Signal in debug builds without breaking release behavior. + debug_assert!( + !full_validation, + "validation feature is disabled but full_validation=true in try_from_schema(V1)" + ); }
🧹 Nitpick comments (6)
packages/rs-dpp/src/data_contract/document_type/class_methods/create_document_types_from_document_schemas/v0/mod.rs (1)
21-23
: Refactor remaining validation_operations to use impl Extend
Several methods in packages/rs-dpp (e.g. in data_contract//serialization, data_contract//methods/schema, and document_type/**) still accept&mut Vec<ProtocolValidationOperation>
and callvalidation_operations.push(…)
; please generalize their signatures to&mut impl Extend<ProtocolValidationOperation>
and replacepush
calls withextend
.packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v0/mod.rs (2)
81-86
: Avoid no-op string; surface a warning in non-validation builds.Silently dropping full_validation is risky for misuse detection. Emit a debug-only warning instead.
Apply:
- "validation is not enabled but is being called on try_from_schema".to_string(); + #[cfg(debug_assertions)] + eprintln!( + "validation requested for try_from_schema but 'validation' feature is disabled" + );
113-116
: Minor: prefer array literal over std::iter::once for single item extend.Slightly shorter; same semantics. Safe on stable.
For each occurrence:
- validation_operations.extend(std::iter::once( - ProtocolValidationOperation::DocumentTypeSchemaValidationForSize(schema_size), - )); + validation_operations.extend([ + ProtocolValidationOperation::DocumentTypeSchemaValidationForSize(schema_size), + ]);- validation_operations.extend(std::iter::once( - ProtocolValidationOperation::DocumentTypeSchemaValidationForSize(schema_size), - )); + validation_operations.extend([ + ProtocolValidationOperation::DocumentTypeSchemaValidationForSize(schema_size), + ]);- validation_operations.extend(std::iter::once( - ProtocolValidationOperation::DocumentTypeSchemaPropertyValidation( - property_values.values().len() as u64, - ), - )); + validation_operations.extend([ProtocolValidationOperation::DocumentTypeSchemaPropertyValidation( + property_values.values().len() as u64, + )]);- validation_operations.extend(std::iter::once( - ProtocolValidationOperation::DocumentTypeSchemaIndexValidation( - index.properties.len() as u64, - index.unique, - ), - )); + validation_operations.extend([ProtocolValidationOperation::DocumentTypeSchemaIndexValidation( + index.properties.len() as u64, + index.unique, + )]);Also applies to: 122-125, 201-206, 303-309
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs (3)
85-86
: Typo in parameter name: data_contact_config → data_contract_configPurely a readability nit; consider renaming for consistency with the type.
725-725
: Fix test names: “should_no_be_” → “should_not_be_”Minor grammar/readability improvement for test names.
- fn should_no_be_empty() { + fn should_not_be_empty() { @@ - fn should_no_be_longer_than_64_chars() { + fn should_not_be_longer_than_64_chars() { @@ - fn should_no_be_alphanumeric() { + fn should_not_be_alphanumeric() {Also applies to: 767-767, 811-811
828-837
: Optional: Test V1 as well for the “space in name” caseThis test targets V0; consider adding an analogous V1 test to keep coverage symmetric with V1 API changes.
I can draft a V1 variant mirroring this case if helpful.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
packages/rs-dpp/src/data_contract/document_type/class_methods/create_document_types_from_document_schemas/v0/mod.rs
(1 hunks)packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/mod.rs
(1 hunks)packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v0/mod.rs
(5 hunks)packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs
(4 hunks)packages/rs-dpp/src/state_transition/mod.rs
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/rs-dpp/src/state_transition/mod.rs
🧰 Additional context used
📓 Path-based instructions (3)
**/*.rs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.rs
: Format Rust code with cargo fmt
Run Clippy linter for Rust code
**/*.rs
: Use 4-space indentation for Rust files
Format Rust code with rustfmt defaults
Keep Rust code clippy-clean (no warnings)
In Rust, modules use snake_case, types use PascalCase, constants use SCREAMING_SNAKE_CASE
Files:
packages/rs-dpp/src/data_contract/document_type/class_methods/create_document_types_from_document_schemas/v0/mod.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v0/mod.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/mod.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs
packages/**
📄 CodeRabbit inference engine (AGENTS.md)
Place all source packages under packages/* (JS/TS packages and Rust crates)
Files:
packages/rs-dpp/src/data_contract/document_type/class_methods/create_document_types_from_document_schemas/v0/mod.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v0/mod.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/mod.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs
**/*.{js,jsx,ts,tsx,rs}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{js,jsx,ts,tsx,rs}
: Use LF line endings in source files
Ensure a final newline at end of source files
Files:
packages/rs-dpp/src/data_contract/document_type/class_methods/create_document_types_from_document_schemas/v0/mod.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v0/mod.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/mod.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs
🧠 Learnings (2)
📓 Common learnings
Learnt from: QuantumExplorer
PR: dashpay/platform#2257
File: packages/rs-drive-abci/src/mimic/test_quorum.rs:159-164
Timestamp: 2024-11-20T16:16:01.830Z
Learning: QuantumExplorer prefers not to receive auto-generated messages asking to post on social media.
📚 Learning: 2025-04-11T09:08:05.652Z
Learnt from: pauldelucia
PR: dashpay/platform#2523
File: packages/rs-drive/src/drive/contract/update/update_contract/v1/update_description/v1/mod.rs:147-151
Timestamp: 2025-04-11T09:08:05.652Z
Learning: Description length validation for data contracts is already handled in the data contract validation process, specifically in packages/rs-dpp/src/data_contract/methods/validate_update/v0/mod.rs.
Applied to files:
packages/rs-dpp/src/data_contract/document_type/class_methods/create_document_types_from_document_schemas/v0/mod.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: Rust packages (wasm-dpp) / Detect immutable structure changes
- GitHub Check: Rust packages (wasm-dpp) / Formatting
- GitHub Check: Rust packages (wasm-dpp) / Tests
- GitHub Check: Rust packages (dpp) / Unused dependencies
- GitHub Check: Rust packages (dpp) / Formatting
- GitHub Check: Rust packages (dash-sdk) / Linting
- GitHub Check: Rust packages (dpp) / Check each feature
- GitHub Check: Rust packages (dpp) / Tests
- GitHub Check: Rust packages (dpp) / Linting
- GitHub Check: Rust packages (dash-sdk) / Check each feature
- GitHub Check: Rust packages (dash-sdk) / Unused dependencies
- GitHub Check: Rust packages (dash-sdk) / Tests
- GitHub Check: Rust packages (rs-sdk-ffi) / Unused dependencies
- GitHub Check: Rust packages (rs-sdk-ffi) / Linting
- GitHub Check: Rust packages (rs-sdk-ffi) / Tests
- GitHub Check: Build Docker images (Dashmate helper, dashmate-helper, dashmate-helper) / Build Dashmate helper image
- GitHub Check: Build Docker images (Drive, drive, drive-abci) / Build Drive image
- GitHub Check: Build Docker images (DAPI, dapi, dapi) / Build DAPI image
- GitHub Check: Build JS packages / Build JS
- GitHub Check: build-wasm-sdk
🔇 Additional comments (4)
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/mod.rs (1)
49-51
: Signature change to &mut impl Extend is appropriate.Keeps API surface clippy-clean and compatible with existing Vec call sites.
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v0/mod.rs (1)
72-73
: V0 try_from_schema now takes impl Extend — good.Matches the top-level dispatcher and avoids tying to Vec.
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs (2)
130-133
: Nice: switched to Extend via extend(std::iter::once(...))This aligns with the generalized parameter and keeps Clippy happy.
Also applies to: 139-142
320-326
: Consistent use of Extend here looks goodMatches the new signature and avoids Vec-specific APIs.
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs
Show resolved
Hide resolved
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: 1
♻️ Duplicate comments (1)
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs (1)
218-223
: Leftover push fixed — resolves the earlier build break with validation feature.
🧹 Nitpick comments (11)
packages/rs-platform-wallet/examples/basic_usage.rs (3)
9-9
: Prefer .into() over .to_string() for String conversionsSlightly more idiomatic and Clippy-friendly when the constructor accepts Into.
- let platform_wallet = PlatformWalletInfo::new(wallet_id, "My Platform Wallet".to_string()); + let platform_wallet = PlatformWalletInfo::new(wallet_id, "My Platform Wallet".into());
11-11
: Use Display formatting for &strUse {} instead of {:?} for clearer output (and to keep Clippy quiet on style nits).
- println!("Created wallet: {:?}", platform_wallet.name()); + println!("Created wallet: {}", platform_wallet.name());
16-19
: Avoid direct field access if not part of the stable APIIf identity_manager is intended to remain an internal detail, consider exposing a read-only accessor on PlatformWalletInfo instead of accessing the field directly in examples.
packages/rs-drive-abci/tests/strategy_tests/token_tests.rs (4)
475-476
: Fix stale inline comment: block_count is 60, not 30.Apply:
- block_count, // block count is 30 + block_count, // block count is 60
487-492
: Unused read-lock variable; make intent explicit or remove.
counter
isn’t read, which triggers an unused-variable lint. If the goal is to hold the read guard duringfetch_versions_with_counter
, rename to an underscored guard; otherwise, drop the line.Apply one of:
- Keep the guard (preferred if intentional):
- let counter = platform.drive.cache.protocol_versions_counter.read(); + // Hold a read guard intentionally while fetching versions to keep snapshot stable. + let _versions_counter_guard = platform.drive.cache.protocol_versions_counter.read();
- Or remove entirely if unnecessary:
- let counter = platform.drive.cache.protocol_versions_counter.read();
Note: the same pattern appears later (Lines 1005–1010, 1280–1292, 1383–1399, 1602–1618, 1981–1997, 2200–2216). Consider applying consistently.
631-633
: Update math in comment to match the asserted value (222).The explanatory comment says 250, but the test asserts 222. Reflect integer division in the note to avoid confusion.
Apply:
- // They should get 2 * 1000 * 4 / 36 - // This is equal to 250 + // They should get 2 * 1000 * 4 / 36 + // This equals 222 (integer division)
759-763
: Same stale inline comment here: block_count is 60, not 30.Apply:
- block_count, // block count is 30 + block_count, // block count is 60packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs (4)
86-86
: Nit: typo in parameter name — use data_contract_config.Use “contract” rather than “contact” for consistency across the codebase.
725-725
: Nit: test name grammar.Rename to
should_not_be_empty
for clarity.
768-768
: Nit: test name grammar.Rename to
should_not_be_longer_than_64_chars
.
811-811
: Nit: test name grammar.Rename to
should_not_be_alphanumeric
(the test asserts non-alphanumeric names are invalid).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs
(5 hunks)packages/rs-drive-abci/tests/strategy_tests/token_tests.rs
(1 hunks)packages/rs-platform-wallet/examples/basic_usage.rs
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.rs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.rs
: Format Rust code with cargo fmt
Run Clippy linter for Rust code
**/*.rs
: Use 4-space indentation for Rust files
Format Rust code with rustfmt defaults
Keep Rust code clippy-clean (no warnings)
In Rust, modules use snake_case, types use PascalCase, constants use SCREAMING_SNAKE_CASE
Files:
packages/rs-platform-wallet/examples/basic_usage.rs
packages/rs-drive-abci/tests/strategy_tests/token_tests.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs
packages/**
📄 CodeRabbit inference engine (AGENTS.md)
Place all source packages under packages/* (JS/TS packages and Rust crates)
Files:
packages/rs-platform-wallet/examples/basic_usage.rs
packages/rs-drive-abci/tests/strategy_tests/token_tests.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs
**/*.{js,jsx,ts,tsx,rs}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{js,jsx,ts,tsx,rs}
: Use LF line endings in source files
Ensure a final newline at end of source files
Files:
packages/rs-platform-wallet/examples/basic_usage.rs
packages/rs-drive-abci/tests/strategy_tests/token_tests.rs
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs
packages/*/tests/**
📄 CodeRabbit inference engine (AGENTS.md)
Place unit/integration tests alongside each package under packages//tests
Files:
packages/rs-drive-abci/tests/strategy_tests/token_tests.rs
packages/*/tests/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
Rust unit/integration tests must not perform network calls; mock dependencies
Files:
packages/rs-drive-abci/tests/strategy_tests/token_tests.rs
🧠 Learnings (7)
📓 Common learnings
Learnt from: QuantumExplorer
PR: dashpay/platform#2227
File: packages/rs-drive-abci/src/platform_types/platform_state/mod.rs:141-141
Timestamp: 2024-10-08T13:28:03.529Z
Learning: When converting `PlatformStateV0` to `PlatformStateForSavingV1` in `packages/rs-drive-abci/src/platform_types/platform_state/mod.rs`, only version `0` needs to be handled in the match on `platform_state_for_saving_structure_default` because the changes are retroactive.
Learnt from: QuantumExplorer
PR: dashpay/platform#2257
File: packages/rs-drive-abci/src/mimic/test_quorum.rs:159-164
Timestamp: 2024-11-20T16:16:01.830Z
Learning: QuantumExplorer prefers not to receive auto-generated messages asking to post on social media.
📚 Learning: 2024-10-08T13:28:03.529Z
Learnt from: QuantumExplorer
PR: dashpay/platform#2227
File: packages/rs-drive-abci/src/platform_types/platform_state/mod.rs:141-141
Timestamp: 2024-10-08T13:28:03.529Z
Learning: When converting `PlatformStateV0` to `PlatformStateForSavingV1` in `packages/rs-drive-abci/src/platform_types/platform_state/mod.rs`, only version `0` needs to be handled in the match on `platform_state_for_saving_structure_default` because the changes are retroactive.
Applied to files:
packages/rs-platform-wallet/examples/basic_usage.rs
packages/rs-drive-abci/tests/strategy_tests/token_tests.rs
📚 Learning: 2024-10-04T09:08:47.901Z
Learnt from: shumkov
PR: dashpay/platform#2206
File: packages/rs-drive-abci/tests/strategy_tests/main.rs:1162-1162
Timestamp: 2024-10-04T09:08:47.901Z
Learning: In the Rust test file `packages/rs-drive-abci/tests/strategy_tests/main.rs`, specific protocol versions like `PROTOCOL_VERSION_1` are intentionally used in tests instead of `PROTOCOL_VERSION_LATEST`.
Applied to files:
packages/rs-drive-abci/tests/strategy_tests/token_tests.rs
📚 Learning: 2024-11-20T20:43:41.185Z
Learnt from: QuantumExplorer
PR: dashpay/platform#2257
File: packages/rs-drive-abci/tests/strategy_tests/masternodes.rs:212-220
Timestamp: 2024-11-20T20:43:41.185Z
Learning: In `packages/rs-drive-abci/tests/strategy_tests/masternodes.rs`, the pattern of generating a `PrivateKey`, converting it to bytes, and reconstructing a `BlsPrivateKey` from those bytes is intentional. Avoid suggesting to simplify this code in future reviews.
Applied to files:
packages/rs-drive-abci/tests/strategy_tests/token_tests.rs
📚 Learning: 2024-10-04T09:07:11.452Z
Learnt from: shumkov
PR: dashpay/platform#2206
File: packages/rs-drive-abci/tests/strategy_tests/main.rs:89-89
Timestamp: 2024-10-04T09:07:11.452Z
Learning: In tests located in the `packages/rs-drive-abci/tests` directory, the team prefers to use specific protocol versions (e.g., `PROTOCOL_VERSION_1`) instead of `PROTOCOL_VERSION_LATEST`.
Applied to files:
packages/rs-drive-abci/tests/strategy_tests/token_tests.rs
📚 Learning: 2024-10-06T16:17:34.571Z
Learnt from: QuantumExplorer
PR: dashpay/platform#2215
File: packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs:105-105
Timestamp: 2024-10-06T16:17:34.571Z
Learning: In `run_block_proposal` in `packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs`, when retrieving `last_block_time_ms`, it's acceptable to use `platform_state` instead of `block_platform_state`, even after updating the protocol version.
Applied to files:
packages/rs-drive-abci/tests/strategy_tests/token_tests.rs
📚 Learning: 2024-10-06T16:18:07.994Z
Learnt from: QuantumExplorer
PR: dashpay/platform#2215
File: packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs:119-120
Timestamp: 2024-10-06T16:18:07.994Z
Learning: In the `run_block_proposal` function in `packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs`, it's acceptable to pass `platform_state` to `perform_events_on_first_block_of_protocol_change`, even if `block_platform_state` has been updated.
Applied to files:
packages/rs-drive-abci/tests/strategy_tests/token_tests.rs
🧬 Code graph analysis (1)
packages/rs-drive-abci/tests/strategy_tests/token_tests.rs (1)
packages/rs-drive-abci/tests/strategy_tests/execution.rs (1)
run_chain_for_strategy
(51-784)
⏰ 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: Rust packages (drive-abci) / Check each feature
- GitHub Check: Rust packages (drive-abci) / Unused dependencies
- GitHub Check: Rust packages (drive-abci) / Formatting
- GitHub Check: Rust packages (drive-abci) / Linting
- GitHub Check: Rust packages (drive) / Unused dependencies
- GitHub Check: Rust packages (drive) / Tests
- GitHub Check: Rust packages (drive) / Linting
- GitHub Check: Rust packages (wasm-dpp) / Tests
- GitHub Check: Rust packages (wasm-dpp) / Unused dependencies
- GitHub Check: Rust packages (wasm-dpp) / Formatting
- GitHub Check: Rust packages (wasm-dpp) / Linting
- GitHub Check: Rust packages (dpp) / Unused dependencies
- GitHub Check: Rust packages (dpp) / Linting
- GitHub Check: Rust packages (dpp) / Check each feature
- GitHub Check: Rust packages (dpp) / Tests
- GitHub Check: Build Docker images (Drive, drive, drive-abci) / Build Drive image
- GitHub Check: Build Docker images (DAPI, dapi, dapi) / Build DAPI image
- GitHub Check: Build Docker images (Dashmate helper, dashmate-helper, dashmate-helper) / Build Dashmate helper image
- GitHub Check: Build JS packages / Build JS
- GitHub Check: build-wasm-sdk
🔇 Additional comments (5)
packages/rs-platform-wallet/examples/basic_usage.rs (1)
9-9
: Good: removed unnecessary mutThis resolves the Clippy needless_mut lint; variable isn’t mutated.
packages/rs-drive-abci/tests/strategy_tests/token_tests.rs (1)
473-473
: Nice: simplified destructuring with..
to avoid unused bindings.This removes noise and keeps tests clippy-clean without changing behavior.
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs (3)
130-133
: Correct switch from push(...) to extend(once(...)) — aligns with the new signature.Also applies to: 139-142
320-325
: LGTM: index validation op now uses extend(once(...)).
88-90
: Signature change verified—no remaining Vec-specificpush
calls onvalidation_operations
.
packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v1/mod.rs
Show resolved
Hide resolved
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
🧹 Nitpick comments (8)
packages/rs-drive-abci/src/execution/types/unpaid_epoch/v0/mod.rs (3)
74-99
: Same for setters: narrow or justify the dead_code suppressionApply the same #[expect(dead_code, reason = "...")] or targeted gating to this trait.
152-166
: Use alias types in impl for resilience and clarityMatch the trait signatures by using BlockHeight/CoreBlockHeight instead of bare u64/u32. This prevents churn if the aliases change later.
Apply:
- fn set_start_block_height(&mut self, start_block_height: u64) { + fn set_start_block_height(&mut self, start_block_height: BlockHeight) { self.start_block_height = start_block_height; } - fn set_next_epoch_start_block_height(&mut self, next_epoch_start_block_height: u64) { + fn set_next_epoch_start_block_height(&mut self, next_epoch_start_block_height: BlockHeight) { self.next_epoch_start_block_height = next_epoch_start_block_height; } - fn set_start_block_core_height(&mut self, start_block_core_height: u32) { + fn set_start_block_core_height(&mut self, start_block_core_height: CoreBlockHeight) { self.start_block_core_height = start_block_core_height; } - fn set_next_epoch_start_block_core_height(&mut self, next_epoch_start_block_core_height: u32) { + fn set_next_epoch_start_block_core_height(&mut self, next_epoch_start_block_core_height: CoreBlockHeight) { self.next_epoch_start_block_core_height = next_epoch_start_block_core_height; }
49-71
: Use#[expect(dead_code, reason = "...")]
instead of a blanketallow
Rust 1.81 stabilized theexpect
lint (RFC 2383), and your MSRV is 1.89 (github.com). Add a descriptive reason to ensure unused getters trigger warnings when they become used; if this is only needed in tests, scope it withcfg_attr(test, allow(dead_code))
.packages/rs-drive-abci/src/platform_types/validator_set/v0/mod.rs (2)
18-19
: Trait-level dead_code allow: prefer #[expect(...)] or tighter scopingIf this trait is kept for forward compatibility, add a reason via #[expect(dead_code, reason = "...")] or limit the scope (module/test cfg). This keeps clippy clean without masking unrelated items.
24-25
: Remove unnecessary#[allow(dead_code)]
onto_update_owned
Drop the#[allow(dead_code)]
onfn to_update_owned(self) -> ValidatorSetUpdate
inpackages/rs-drive-abci/src/platform_types/validator_set/v0/mod.rs:24
, since it’s invoked by the wrapper’sto_update_owned
.packages/rs-drive-abci/src/execution/types/block_fees/v0/mod.rs (3)
17-21
: Dead-code suppression: switch to #[expect(...)] with reason or gateSame note here—prefer #[expect(dead_code, reason = "...")] or cfg_attr to avoid blanket suppression.
34-50
: Repeat: narrow or justify the dead_code allowance on gettersConsider #[expect(dead_code, reason = "...")] for traceability.
53-63
: Repeat: narrow or justify the dead_code allowance on settersApply #[expect(dead_code, reason = "...")] or gate under cfgs.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_list/update_state_masternode_list/v0/mod.rs
(2 hunks)packages/rs-drive-abci/src/execution/types/block_fees/v0/mod.rs
(3 hunks)packages/rs-drive-abci/src/execution/types/unpaid_epoch/v0/mod.rs
(2 hunks)packages/rs-drive-abci/src/platform_types/validator_set/v0/mod.rs
(1 hunks)packages/wasm-drive-verify/src/lib.rs
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_list/update_state_masternode_list/v0/mod.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/wasm-drive-verify/src/lib.rs
🧰 Additional context used
📓 Path-based instructions (3)
**/*.rs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.rs
: Format Rust code with cargo fmt
Run Clippy linter for Rust code
**/*.rs
: Use 4-space indentation for Rust files
Format Rust code with rustfmt defaults
Keep Rust code clippy-clean (no warnings)
In Rust, modules use snake_case, types use PascalCase, constants use SCREAMING_SNAKE_CASE
Files:
packages/rs-drive-abci/src/execution/types/unpaid_epoch/v0/mod.rs
packages/rs-drive-abci/src/platform_types/validator_set/v0/mod.rs
packages/rs-drive-abci/src/execution/types/block_fees/v0/mod.rs
packages/**
📄 CodeRabbit inference engine (AGENTS.md)
Place all source packages under packages/* (JS/TS packages and Rust crates)
Files:
packages/rs-drive-abci/src/execution/types/unpaid_epoch/v0/mod.rs
packages/rs-drive-abci/src/platform_types/validator_set/v0/mod.rs
packages/rs-drive-abci/src/execution/types/block_fees/v0/mod.rs
**/*.{js,jsx,ts,tsx,rs}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{js,jsx,ts,tsx,rs}
: Use LF line endings in source files
Ensure a final newline at end of source files
Files:
packages/rs-drive-abci/src/execution/types/unpaid_epoch/v0/mod.rs
packages/rs-drive-abci/src/platform_types/validator_set/v0/mod.rs
packages/rs-drive-abci/src/execution/types/block_fees/v0/mod.rs
🧠 Learnings (4)
📓 Common learnings
Learnt from: QuantumExplorer
PR: dashpay/platform#2257
File: packages/rs-drive-abci/src/mimic/test_quorum.rs:159-164
Timestamp: 2024-11-20T16:16:01.830Z
Learning: QuantumExplorer prefers not to receive auto-generated messages asking to post on social media.
📚 Learning: 2025-05-28T16:22:26.334Z
Learnt from: QuantumExplorer
PR: dashpay/platform#2644
File: packages/rs-drive/src/cache/system_contracts.rs:18-19
Timestamp: 2025-05-28T16:22:26.334Z
Learning: In packages/rs-drive/src/cache/system_contracts.rs, the `active_since_protocol_version` field in `ActiveSystemDataContract` struct is intentionally added for future use, not current implementation. QuantumExplorer confirmed this is "meant for later" when questioned about the `#[allow(unused)]` attribute.
Applied to files:
packages/rs-drive-abci/src/execution/types/unpaid_epoch/v0/mod.rs
📚 Learning: 2024-10-08T13:28:03.529Z
Learnt from: QuantumExplorer
PR: dashpay/platform#2227
File: packages/rs-drive-abci/src/platform_types/platform_state/mod.rs:141-141
Timestamp: 2024-10-08T13:28:03.529Z
Learning: When converting `PlatformStateV0` to `PlatformStateForSavingV1` in `packages/rs-drive-abci/src/platform_types/platform_state/mod.rs`, only version `0` needs to be handled in the match on `platform_state_for_saving_structure_default` because the changes are retroactive.
Applied to files:
packages/rs-drive-abci/src/platform_types/validator_set/v0/mod.rs
📚 Learning: 2024-10-21T01:03:42.458Z
Learnt from: QuantumExplorer
PR: dashpay/platform#2227
File: packages/rs-dpp/src/core_types/validator_set/v0/mod.rs:299-299
Timestamp: 2024-10-21T01:03:42.458Z
Learning: In the `test_serialize_deserialize_validator_set_v0` test within `packages/rs-dpp/src/core_types/validator_set/v0/mod.rs`, deterministic BLS keys cannot be easily used; therefore, using `BlsPublicKey::generate()` is acceptable.
Applied to files:
packages/rs-drive-abci/src/platform_types/validator_set/v0/mod.rs
🧬 Code graph analysis (1)
packages/rs-drive-abci/src/platform_types/validator_set/v0/mod.rs (1)
packages/rs-drive-abci/src/platform_types/validator_set/mod.rs (2)
to_update
(10-10)to_update
(16-20)
⏰ 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). (14)
- GitHub Check: Rust packages (dpp) / Linting
- GitHub Check: Rust packages (dpp) / Check each feature
- GitHub Check: Rust packages (dash-sdk) / Check each feature
- GitHub Check: Rust packages (dash-sdk) / Tests
- GitHub Check: Rust packages (dash-sdk) / Unused dependencies
- GitHub Check: Rust packages (rs-dapi-client) / Unused dependencies
- GitHub Check: Rust packages (dash-sdk) / Linting
- GitHub Check: Rust packages (dash-sdk) / Formatting
- GitHub Check: Rust packages (rs-dapi-client) / Linting
- GitHub Check: Rust packages (rs-dapi-client) / Formatting
- GitHub Check: Rust packages (rs-dapi-client) / Check each feature
- GitHub Check: Build Docker images (Drive, drive, drive-abci) / Build Drive image
- GitHub Check: Build JS packages / Build JS
- GitHub Check: build-wasm-sdk
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.
Self Reviewed.
Issue being fixed or feature implemented
The purpose of this PR is to clean DPP of Clippy issues.
What was done?
Cleaned DPP of Clippy issues.
How Has This Been Tested?
CI
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
New Features
Refactor
Style
Chores
Tests