Skip to content
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(platform): make bls sig compatibility an optional feature #2440

Merged
merged 4 commits into from
Jan 24, 2025

Conversation

QuantumExplorer
Copy link
Member

@QuantumExplorer QuantumExplorer commented Jan 24, 2025

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added optional BLS signature support for validator and quorum configurations.
    • Introduced new versioning for signature verification quorum sets.
  • Refactor

    • Updated dependency management in Cargo configuration to use specific versions for ciborium.
    • Restructured module organization for signature verification quorum sets.
    • Enhanced conditional compilation for feature flags.
  • Chores

    • Modified Dockerfile build process for more controlled compilation.
    • Updated import paths and module structures.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@QuantumExplorer QuantumExplorer added this to the v2.0.0 milestone Jan 24, 2025
Copy link
Contributor

coderabbitai bot commented Jan 24, 2025

Walkthrough

This pull request introduces modifications to the Dockerfile and several Rust modules in the rs-drive-abci package, focusing on enhancing the build process and improving the handling of signature verification quorum sets. The changes primarily involve conditional compilation for BLS signatures, versioning of quorum set structures, and refining dependency management. The modifications aim to provide more flexibility in feature configuration and improve the overall structure of the platform's signature verification components.

Changes

File Change Summary
Dockerfile Modified build process for drive-abci, enhancing sccache configuration and security for environment variables.
packages/rs-drive-abci/Cargo.toml Updated dependencies, made bls-signatures optional, added features to drive dependency, modified mocks feature.
packages/rs-drive-abci/src/platform_types/platform_state/v0/old_structures/mod.rs Added conditional BLS signature fields to OldStructureValidatorSetV0 and ValidatorV0 structs.
packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/mod.rs Updated import paths, added new enum variant V2 for quorum set saving.
packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v0.rs Removed old QuorumConfigForSavingV0, updated QuorumForSavingV0 to conditionally include public_key.
packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v1.rs Added conditional previous_quorums field to SignatureVerificationQuorumSetForSavingV1, introduced PreviousPastQuorumsForSavingV1.
packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v2.rs Introduced SignatureVerificationQuorumSetForSavingV2 for improved quorum serialization.
packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/mod.rs Renamed module to for_saving_v0, added for_saving_v2 and quorum_config_for_saving_v0 modules.
packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/quorum_config_for_saving_v0.rs Introduced new QuorumConfigForSavingV0 struct with conversion implementations.
packages/rs-dpp/Cargo.toml Updated ciborium dependency from Git reference to version 0.2.2.
packages/rs-dpp/src/util/cbor_value/canonical.rs Simplified to_bytes method in CborCanonicalMap struct for serialization.
packages/rs-drive/Cargo.toml Updated ciborium dependency from Git reference to version 0.2.2, fixed authors' section syntax.
packages/rs-platform-value/Cargo.toml Updated ciborium dependency from Git reference to version 0.2.2.
packages/rs-sdk/Cargo.toml Updated ciborium dependency from Git reference to version 0.2.2.

Possibly related PRs

  • feat(sdk)!: allow setting CA cert #1924: The main PR modifies the Dockerfile for the drive-abci application, which is related to the changes in the DapiClient structure and methods in this PR, as both involve updates to handling configurations and dependencies that may affect the build and runtime behavior of the SDK.
  • ci: improve caching #2329: This PR focuses on improving caching mechanisms in CI processes, which is relevant to the main PR's changes in the Dockerfile that enhance the build process and caching logic.
  • feat(sdk)!: ban addresses failed in sdk #2351: The changes in this PR regarding the banning of addresses in the SDK are related to the main PR's focus on improving the handling of environment variables and configurations, as both involve enhancing the SDK's functionality and security.

Suggested reviewers

  • QuantumExplorer

Poem

🐰 Hopping through code with glee,
Quorum sets dance, features set free!
BLS signatures bloom and grow,
Rust's magic makes our build-flow glow 🌟
A rabbit's tale of versioned delight! 🚀


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e776b6 and e7d487c.

📒 Files selected for processing (2)
  • Dockerfile (4 hunks)
  • packages/rs-drive-abci/Cargo.toml (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • Dockerfile
  • packages/rs-drive-abci/Cargo.toml
⏰ Context from checks skipped due to timeout of 90000ms (19)
  • GitHub Check: Rust packages (wasm-dpp) / Detect immutable structure changes
  • GitHub Check: Rust packages (drive-abci) / Tests
  • GitHub Check: Rust packages (drive-abci) / Unused dependencies
  • GitHub Check: Rust packages (drive-abci) / Check each feature
  • GitHub Check: Rust packages (drive-abci) / Linting
  • GitHub Check: Rust packages (drive) / Tests
  • GitHub Check: Rust packages (drive) / Unused dependencies
  • GitHub Check: Rust packages (drive) / Linting
  • GitHub Check: Rust packages (dpp) / Tests
  • GitHub Check: Rust packages (dpp) / Check each feature
  • GitHub Check: Rust packages (dpp) / Linting
  • GitHub Check: Rust packages (dash-sdk) / Tests
  • GitHub Check: Rust packages (dash-sdk) / Check each feature
  • GitHub Check: Rust packages (dash-sdk) / Unused dependencies
  • GitHub Check: Rust packages (dash-sdk) / Linting
  • GitHub Check: Build Docker images (Drive, drive, drive-abci) / Build Drive image
  • 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 JS packages / Build JS

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (8)
packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v2.rs (1)

14-19: Consider adding Rust doc comments to clarify intent.
Though this struct adequately fixes the oversight, a docstring further explaining how it differs from V1 would improve maintainability.

packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v0.rs (1)

104-104: Conditional BLS public key field is well-structured.
This approach gracefully toggles signature support. Consider adding a doc comment explaining behavior when bls-signatures is disabled.

packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/quorum_config_for_saving_v0.rs (1)

6-12: Consider struct field visibility
QuorumConfigForSavingV0 fields are private. If you need to read or modify these fields externally, consider making them public or providing dedicated accessors.

packages/rs-drive-abci/src/platform_types/platform_state/v0/old_structures/mod.rs (1)

Line range hint 51-67: Graceful error handling
The expect(...) call when converting threshold_public_key assumes no corruption. Consider returning an error or logging a warning for robustness if unexpected data is encountered.

packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v1.rs (2)

Line range hint 19-40: Optional previous info
Wrapping previous_quorums in an Option behind a feature gate is neat. Consider how modules that rely on older quorums behave if the feature is disabled.


51-61: Data visibility
When bls-signatures is off, you discard the previous_quorums. A log message or metric could help detect data unavailability situations.

packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/mod.rs (2)

6-8: Multiple saved-set versions
Bringing in SignatureVerificationQuorumSetForSavingV2 acknowledges ongoing versioning. Ensure you have a migration strategy across versions.


148-150: Collapsing V2 into V0
When converting back, V2 is mapped to V0. If there's a reason for discarding version distinctions at runtime, add documentation for clarity.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd1527d and 68e6581.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • Dockerfile (1 hunks)
  • packages/rs-drive-abci/Cargo.toml (2 hunks)
  • packages/rs-drive-abci/src/platform_types/platform_state/v0/old_structures/mod.rs (6 hunks)
  • packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/mod.rs (3 hunks)
  • packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v0.rs (4 hunks)
  • packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v1.rs (4 hunks)
  • packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v2.rs (1 hunks)
  • packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/mod.rs (1 hunks)
  • packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/quorum_config_for_saving_v0.rs (1 hunks)
🧰 Additional context used
📓 Learnings (7)
packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/mod.rs (1)
Learnt from: QuantumExplorer
PR: dashpay/platform#2257
File: packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v1.rs:17-19
Timestamp: 2024-11-20T09:56:20.579Z
Learning: In the `SignatureVerificationQuorumSetForSavingV1` struct, the use of `V0` versions for the `config` and `previous_quorums` fields (`QuorumConfigForSavingV0` and `PreviousPastQuorumsForSavingV0`) is intentional.
packages/rs-drive-abci/Cargo.toml (1)
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.
packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v0.rs (2)
Learnt from: QuantumExplorer
PR: dashpay/platform#2257
File: packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v1.rs:17-19
Timestamp: 2024-11-20T09:56:20.579Z
Learning: In the `SignatureVerificationQuorumSetForSavingV1` struct, the use of `V0` versions for the `config` and `previous_quorums` fields (`QuorumConfigForSavingV0` and `PreviousPastQuorumsForSavingV0`) is intentional.
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.
packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v1.rs (1)
Learnt from: QuantumExplorer
PR: dashpay/platform#2257
File: packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v1.rs:17-19
Timestamp: 2024-11-20T09:56:20.579Z
Learning: In the `SignatureVerificationQuorumSetForSavingV1` struct, the use of `V0` versions for the `config` and `previous_quorums` fields (`QuorumConfigForSavingV0` and `PreviousPastQuorumsForSavingV0`) is intentional.
packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/mod.rs (1)
Learnt from: QuantumExplorer
PR: dashpay/platform#2257
File: packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v1.rs:17-19
Timestamp: 2024-11-20T09:56:20.579Z
Learning: In the `SignatureVerificationQuorumSetForSavingV1` struct, the use of `V0` versions for the `config` and `previous_quorums` fields (`QuorumConfigForSavingV0` and `PreviousPastQuorumsForSavingV0`) is intentional.
packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/quorum_config_for_saving_v0.rs (1)
Learnt from: QuantumExplorer
PR: dashpay/platform#2257
File: packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v1.rs:17-19
Timestamp: 2024-11-20T09:56:20.579Z
Learning: In the `SignatureVerificationQuorumSetForSavingV1` struct, the use of `V0` versions for the `config` and `previous_quorums` fields (`QuorumConfigForSavingV0` and `PreviousPastQuorumsForSavingV0`) is intentional.
packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v2.rs (1)
Learnt from: QuantumExplorer
PR: dashpay/platform#2257
File: packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v1.rs:17-19
Timestamp: 2024-11-20T09:56:20.579Z
Learning: In the `SignatureVerificationQuorumSetForSavingV1` struct, the use of `V0` versions for the `config` and `previous_quorums` fields (`QuorumConfigForSavingV0` and `PreviousPastQuorumsForSavingV0`) is intentional.
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Rust packages (drive-abci) / Unused dependencies
  • GitHub Check: Rust packages (drive-abci) / Tests
  • GitHub Check: Rust packages (drive-abci) / Check each feature
  • GitHub Check: Rust packages (drive-abci) / Linting
  • GitHub Check: Build Docker images (Drive, drive, drive-abci) / Build Drive image
  • 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 JS packages / Build JS
🔇 Additional comments (21)
packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v2.rs (4)

10-13: Good explanation of the versioning rationale.
The inline comment clearly states why a new version was introduced and how it addresses the old library usage. No issues found.


21-25: Straightforward variant implementation.
This From trait ensures the V2 variant is properly encapsulated. Looks good.


27-41: Conversion logic from V0 to V2 is consistent.
Mapping fields into new types with map for optional values is clean and concise. Nice work.


43-57: Reverse conversion preserves data seamlessly.
Using symmetrical From conversions back to V0 preserves fields. No immediate concerns.

packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v0.rs (4)

1-2: Verify that referencing QuorumConfigForSavingV0 aligns with the new modules.
While the usage of V0 config in multiple versions is stated to be intentional, confirm no duplication or merge conflicts arise with future expansions.


116-116: Use of .expect() is consistent with known design.
Per prior learnings, this intentional panic is acceptable given verified conversions.


121-122: Fallback to default public key for non-BLS builds.
Ensure this default is acceptable for any internal logic that expects a valid public key when signatures are actually used.


136-136: Conversion back to bls_signatures::PublicKey is appropriate.
Again, .expect() usage aligns with the guaranteed convertibility.

packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/mod.rs (1)

1-4: Versioned module structure is clear.
Introducing for_saving_v2 and reorganizing these modules helps clarify the evolution of quorum set logic. Nicely done.

packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/quorum_config_for_saving_v0.rs (3)

1-5: Use consistent serialization approach
You're mixing bincode::Encode with dpp::platform_serialization::de::Decode. Ensure there's no hidden mismatch or versioning conflict.


14-23: Straightforward conversion
The field mapping between QuorumConfig and QuorumConfigForSavingV0 is direct and maintains consistency.


25-34: Field order consistency
The reverse conversion follows a consistent field order, reducing potential confusion when converting back to QuorumConfig.

packages/rs-drive-abci/src/platform_types/platform_state/v0/old_structures/mod.rs (3)

35-41: Conditional field usage
Using #[cfg(feature = "bls-signatures")] for threshold_public_key and defaulting to extra fields otherwise is a good approach for forward compatibility. Ensure that toggling this feature doesn't conflict with existing data.


Line range hint 78-98: Optional public key
Embedding an optional bls_signatures::PublicKey is fine. Verify that your testing covers both with and without the bls-signatures feature to ensure no regression.


111-112: Fallback consistency
When bls-signatures is disabled, the public key is set to None. Please verify there are no code paths that incorrectly assume a public key is always present.

packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving_v1.rs (2)

1-9: Guarded imports
The #[cfg(feature = "bls-signatures")] gating helps keep the code clean. Validate all gating points to ensure the build remains consistent in both modes.


100-142: Smooth version transitions
PreviousPastQuorumsForSavingV1 and its From implementations are consistent. No immediate issues spotted.

packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/mod.rs (2)

125-126: Introducing V2
Adding V2 is logical for enhanced functionality. Confirm you have end-to-end handling (serialization, deserialization, tests) for this new version.


133-133: Jump from V0 to V2
Skipping V1 when converting SignatureVerificationQuorumSet::V0 to SignatureVerificationQuorumSetForSaving::V2 is unusual. Double-check there's no missing conversion logic.

packages/rs-drive-abci/Cargo.toml (1)

109-109: Verify the necessity of bls-signatures in mocks feature.

The mocks feature includes bls-signatures, which means it will always be compiled when mocks are enabled, potentially conflicting with the goal of making BLS signatures optional.

Do you need BLS signatures for all mocks, or should it be a separate mock feature? Consider splitting it into a separate bls-mocks feature if BLS-specific mocking is needed.

Dockerfile (1)

467-467: LGTM! Good improvement to feature flag handling.

The changes correctly implement the optional feature strategy by:

  1. Disabling default features in both release and non-release profiles
  2. Explicitly enabling only required features (console,grovedbg) in non-release profile

Also applies to: 470-470

packages/rs-drive-abci/Cargo.toml Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/rs-dpp/Cargo.toml (1)

Line range hint 89-89: Review the feature flag dependencies on BLS signatures

The feature flags structure makes BLS signatures optional as intended, but several features depend on it:

  • message-signature-verification
  • core-types
  • random-public-keys

This means that enabling any of these features will implicitly enable BLS signatures. Consider documenting this dependency chain in the README or module documentation.

Also applies to: 90-90, 91-91, 92-92, 93-93, 94-94, 95-95, 96-96, 97-97, 98-98, 99-99, 100-100, 101-101, 102-102, 103-103, 104-104, 105-105, 106-106, 107-107, 108-108, 109-109, 110-110, 111-111, 112-112, 113-113, 114-114, 115-115, 116-116, 117-117, 118-118, 119-119, 120-120, 121-121, 122-122, 123-123, 124-124, 125-125, 126-126, 127-127, 128-128, 129-129, 130-130, 131-131, 132-132, 133-133, 134-134, 135-135, 136-136

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e78494b and 3e776b6.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • packages/rs-dpp/Cargo.toml (1 hunks)
  • packages/rs-dpp/src/util/cbor_value/canonical.rs (1 hunks)
  • packages/rs-drive-abci/Cargo.toml (3 hunks)
  • packages/rs-drive/Cargo.toml (1 hunks)
  • packages/rs-platform-value/Cargo.toml (1 hunks)
  • packages/rs-sdk/Cargo.toml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/rs-drive-abci/Cargo.toml
⏰ Context from checks skipped due to timeout of 90000ms (20)
  • GitHub Check: Rust packages (wasm-dpp) / Formatting
  • GitHub Check: Rust packages (wasm-dpp) / Detect immutable structure changes
  • 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) / Formatting
  • GitHub Check: Rust packages (drive-abci) / Check each feature
  • GitHub Check: Rust packages (drive) / Unused dependencies
  • GitHub Check: Rust packages (drive) / Tests
  • GitHub Check: Rust packages (drive) / Linting
  • GitHub Check: Rust packages (dpp) / Tests
  • GitHub Check: Rust packages (dpp) / Linting
  • GitHub Check: Rust packages (dpp) / Check each feature
  • GitHub Check: Rust packages (dash-sdk) / Tests
  • GitHub Check: Rust packages (dash-sdk) / Check each feature
  • GitHub Check: Rust packages (dash-sdk) / Linting
  • 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
🔇 Additional comments (6)
packages/rs-dpp/src/util/cbor_value/canonical.rs (1)

117-117: Double-check behavior for null values
Removing custom serializer options might alter how nulls or undefined values are handled. Please verify that this default behavior still meets the project's serialization requirements.

packages/rs-platform-value/Cargo.toml (1)

12-12: Dependency version pin looks good
Switching from a Git reference to a stable version helps ensure reproducible builds. No issues found.

packages/rs-sdk/Cargo.toml (1)

27-27: Consistent with other crates
Thank you for aligning this dependency with the unified version approach. This improves consistency across the repository.

packages/rs-drive/Cargo.toml (1)

39-39: Maintains optional usage
Continuing to keep ciborium optional offers flexibility in feature sets. This approach aligns well with the rest of the changes.

packages/rs-dpp/Cargo.toml (2)

24-24: Verify compatibility with ciborium v0.2.2

The change from a Git dependency to a versioned dependency is good practice, but we should verify that v0.2.2 maintains the required functionality from the feat-ser-null-as-undefined branch.

Run this script to check the changelog and compare implementations:

✅ Verification successful

Verified: ciborium v0.2.2 includes the null serialization feature

The versioned dependency is compatible with the feature branch implementation. The serialize_null_as_undefined functionality is fully implemented and extensively tested in v0.2.2, which was published on January 24, 2024.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Compare ciborium implementations and check for breaking changes

# Check if the version exists and get its publish date
curl -s https://crates.io/api/v1/crates/ciborium/0.2.2 | jq '.version.created_at'

# Get the feature branch commit history
git clone https://github.com/qrayven/ciborium /tmp/ciborium
cd /tmp/ciborium
git checkout feat-ser-null-as-undefined
git log --oneline feat-ser-null-as-undefined

Length of output: 476


Script:

#!/bin/bash
# Check implementation and changes in v0.2.2

# Get v0.2.2 release info
curl -s https://api.github.com/repos/enarx/ciborium/releases/tags/v0.2.2 | jq -r '.body'

# Search for null serialization in both implementations
cd /tmp/ciborium
# Check feature branch implementation
git grep -A 5 -B 5 "null" .

# Get the main branch for v0.2.2
git fetch origin
git checkout v0.2.2
git grep -A 5 -B 5 "null" .

Length of output: 65891


Line range hint 89-89: Verify feature combinations for breaking changes

The feature flag combinations look good, but we should verify that making BLS signatures optional doesn't break any existing functionality when BLS features are disabled. Key areas to check:

  • Default features don't include BLS signatures
  • Feature combinations that previously relied on BLS signatures still work without them

Run this script to analyze feature flag dependencies:

Also applies to: 137-137, 138-138, 139-139, 140-140, 141-141, 142-142, 143-143, 144-144, 145-145, 146-146, 147-147, 148-148, 149-149, 150-150, 151-151, 152-152, 153-153, 154-154, 155-155, 156-156, 157-157, 158-158, 159-159, 160-160, 161-161, 162-162, 163-163, 164-164, 165-165, 166-166, 167-167, 168-168, 169-169, 170-170, 171-171, 172-172, 173-173, 174-174, 175-175, 176-176, 177-177, 178-178, 179-179, 180-180, 181-181, 182-182, 183-183, 184-184, 185-185, 186-186, 187-187, 188-188, 189-189, 190-190, 191-191, 192-192, 193-193, 194-194, 195-195, 196-196, 197-197, 198-198, 199-199, 200-200, 201-201, 202-202, 203-203, 204-204, 205-205, 206-206, 207-207, 208-208, 209-209, 210-210, 211-211, 212-212, 213-213, 214-214, 215-215, 216-216, 217-217, 218-218, 219-219, 220-220, 221-221, 222-222, 223-223, 224-224, 225-225, 226-226, 227-227, 228-228, 229-229, 230-230, 231-231, 232-232, 233-233, 234-234, 235-235, 236-236, 237-237, 238-238, 239-239, 240-240, 241-241, 242-242, 243-243, 244-244, 245-245, 246-246, 247-247, 248-248, 249-249, 250-250, 251-251, 252-252, 253-253, 254-254, 255-255, 256-256, 257-257, 258-258, 259-259, 260-260, 261-261, 262-262, 263-263, 264-264, 265-265, 266-266, 267-267, 268-268, 269-269, 270-270, 271-271, 272-272, 273-273, 274-274, 275-275, 276-276, 277-277, 278-278, 279-279, 280-280, 281-281, 282-282, 283-283, 284-284, 285-285, 286-286, 287-287, 288-288, 289-289, 290-290, 291-291, 292-292, 293-293, 294-294, 295-295, 296-296, 297-297, 298-298, 299-299, 300-300, 301-301, 302-302, 303-303, 304-304, 305-305, 306-306, 307-307, 308-308, 309-309, 310-310, 311-311, 312-312, 313-313, 314-314, 315-315, 316-316, 317-317, 318-318, 319-319, 320-320, 321-321, 322-322, 323-323, 324-324, 325-325, 326-326, 327-327, 328-328, 329-329, 330-330, 331-331, 332-332, 333-333, 334-334, 335-335, 336-336, 337-337, 338-338, 339-339, 340-340, 341-341, 342-342, 343-343, 344-344, 345-345, 346-346, 347-347, 348-348, 349-349, 350-350, 351-351, 352-352, 353-353, 354-354, 355-355, 356-356, 357-357, 358-358, 359-359, 360-360, 361-361, 362-362, 363-363, 364-364, 365-365, 366-366, 367-367, 368-368, 369-369, 370-370, 371-371, 372-372, 373-373, 374-374, 375-375, 376-376, 377-377, 378-378, 379-379, 380-380, 381-381, 382-382, 383-383, 384-384, 385-385, 386-386, 387-387, 388-388, 389-389, 390-390, 391-391, 392-392, 393-393, 394-394, 395-395, 396-396, 397-397, 398-398, 399-399, 400-400, 401-401, 402-402, 403-403, 404-404, 405-405, 406-406, 407-407, 408-408, 409-409, 410-410, 411-411, 412-412, 413-413, 414-414, 415-415, 416-416, 417-417, 418-418, 419-419, 420-420, 421-421, 422-422, 423-423, 424-424, 425-425, 426-426, 427-427, 428-428, 429-429, 430-430, 431-431, 432-432, 433-433, 434-434, 435-435, 436-436, 437-437, 438-438, 439-439, 440-440, 441-441, 442-442, 443-443, 444-444, 445-445, 446-446, 447-447, 448-448, 449-449, 450-450, 451-451, 452-452, 453-453, 454-454, 455-455, 456-456, 457-457, 458-458, 459-459, 460-460, 461-461, 462-462, 463-463, 464-464, 465-465, 466-466, 467-467, 468-468, 469-469, 470-470, 471-471, 472-472, 473-473, 474-474, 475-475, 476-476, 477-477, 478-478, 479-479, 480-480, 481-481, 482-482, 483-483, 484-484, 485-485, 486-486, 487-487, 488-488, 489-489, 490-490, 491-491, 492-492, 493-493, 494-494, 495-495, 496-496, 497-497, 498-498, 499-499, 500-500, 501-501, 502-502, 503-503, 504-504, 505-505, 506-506, 507-507, 508-508, 509-509, 510-510, 511-511, 512-512, 513-513, 514-514, 515-515, 516-516, 517-517, 518-518, 519-519, 520-520, 521-521, 522-522, 523-523, 524-524, 525-525, 526-526, 527-527, 528-528, 529-529, 530-530, 531-531, 532-532, 533-533, 534-534, 535-535, 536-536, 537-537, 538-538, 539-539, 540-540, 541-541, 542-542, 543-543, 544-544, 545-545, 546-546, 547-547, 548-548, 549-549, 550-550, 551-551, 552-552, 553-553, 554-554, 555-555, 556-556, 557-557, 558-558, 559-559, 560-560, 561-561, 562-562, 563-563, 564-564, 565-565, 566-566, 567-567, 568-568, 569-569, 570-570, 571-571, 572-572, 573-573, 574-574, 575-575, 576-576, 577-577, 578-578, 579-579, 580-580, 581-581, 582-582, 583-583, 584-584, 585-585, 586-586, 587-587, 588-588, 589-589, 590-590, 591-591, 592-592, 593-593, 594-594, 595-595, 596-596, 597-597, 598-598, 599-599, 600-600, 601-601, 602-602, 603-603, 604-604, 605-605, 606-606, 607-607, 608-608, 609-609, 610-610, 611-611, 612-612, 613-613, 614-614, 615-615, 616-616, 617-617, 618-618, 619-619, 620-620, 621-621, 622-622, 623-623, 624-624, 625-625, 626-626, 627-627, 628-628, 629-629, 630-630, 631-631, 632-632, 633-633, 634-634, 635-635, 636-636, 637-637, 638-638, 639-639, 640-640, 641-641, 642-642, 643-643, 644-644, 645-645, 646-646, 647-647, 648-648, 649-649, 650-650, 651-651, 652-652, 653-653, 654-654, 655-655, 656-656, 657-657, 658-658, 659-659, 660-660, 661-661, 662-662, 663-663, 664-664, 665-665, 666-666, 667-667, 668-668, 669-669, 670-670, 671-671, 672-672, 673-673, 674-674, 675-675, 676-676, 677-677, 678-678, 679-679, 680-680, 681-681, 682-682, 683-683, 684-684, 685-685, 686-686, 687-687, 688-688, 689-689, 690-690, 691-691, 692-692, 693-693, 694-694, 695-695, 696-696, 697-697, 698-698, 699-699, 700-700, 701-701, 702-702, 703-703, 704-704, 705-705, 706-706, 707-707, 708-708, 709-709, 710-710, 711-711, 712-712, 713-713, 714-714, 715-715, 716-716, 717-717, 718-718, 719-719, 720-720, 721-721, 722-722, 723-723, 724-724, 725-725, 726-726, 727-727, 728-728, 729-729, 730-730, 731-731, 732-732, 733-733, 734-734, 735-735, 736-736, 737-737, 738-738, 739-739, 740-740, 741-741, 742-742, 743-743, 744-744, 745-745, 746-746, 747-747, 748-748, 749-749, 750-750, 751-751, 752-752, 753-753, 754-754, 755-755, 756-756, 757-757, 758-758, 759-759, 760-760, 761-761, 762-762, 763-763, 764-764, 765-765, 766-766, 767-767, 768-768, 769-769, 770-770, 771-771, 772-772, 773-773, 774-774, 775-775, 776-776, 777-777, 778-778, 779-779, 780-780, 781-781, 782-782, 783-783, 784-784, 785-785, 786-786, 787-787, 788-788, 789-789, 790-790, 791-791, 792-792, 793-793, 794-794, 795-795, 796-796, 797-797, 798-798, 799-799, 800-800, 801-801, 802-802, 803-803, 804-804, 805-805, 806-806, 807-807, 808-808, 809-809, 810-810, 811-811, 812-812, 813-813, 814-814, 815-815, 816-816, 817-817, 818-818, 819-819, 820-820, 821-821, 822-822, 823-823, 824-824, 825-825, 826-826, 827-827, 828-828, 829-829, 830-830, 831-831, 832-832, 833-833, 834-834, 835-835, 836-836, 837-837, 838-838, 839-839, 840-840, 841-841, 842-842, 843-843, 844-844, 845-845, 846-846, 847-847, 848-848, 849-849, 850-850, 851-851, 852-852, 853-853, 854-854, 855-855, 856-856, 857-857, 858-858, 859-859, 860-860, 861-861, 862-862, 863-863, 864-864, 865-865, 866-866, 867-867, 868-868, 869-869, 870-870, 871-871, 872-872, 873-873, 874-874, 875-875, 876-876, 877-877, 878-878, 879-879, 880-880, 881-881, 882-882, 883-883, 884-884, 885-885, 886-886, 887-887, 888-888, 889-889, 890-890, 891-891, 892-892, 893-893, 894-894, 895-895, 896-896, 897-897, 898-898, 899-899, 900-900, 901-901, 902-902, 903-903, 904-904, 905-905, 906-906, 907-907, 908-908, 909-909, 910-910, 911-911, 912-912, 913-913, 914-914, 915-915, 916-916, 917-917, 918-918, 919-919, 920-920, 921-921, 922-922, 923-923, 924-924, 925-925, 926-926, 927-927, 928-928, 929-929, 930-930, 931-931, 932-932, 933-933, 934-934, 935-935, 936-936, 937-937, 938-938, 939-939, 940-940, 941-941, 942-942, 943-943, 944-944, 945-945, 946-946, 947-947, 948-948, 949-949, 950-950, 951-951, 952-952, 953-953, 954-954, 955-955, 956-956, 957-957, 958-958, 959-959, 960-960, 961-961, 962-962, 963-963, 964-964, 965-965, 966-966, 967-967, 968-968, 969-969, 970-970, 971-971, 972-972, 973-973, 974-974, 975-975, 976-976, 977-977, 978-978, 979-979, 980-980, 981-981, 982-982, 983-983, 984-984, 985-985, 986-986, 987-987, 988-988, 989-989, 990-990, 991-991, 992-992, 993-993, 994-994, 995-995, 996-996, 997-997, 998-998, 999-999, 1000-1000

✅ Verification successful

BLS signatures are properly optional with clean feature separation

The verification confirms that making BLS signatures optional is safe:

  • BLS is not included in default features
  • All BLS functionality is properly feature-gated with appropriate fallbacks
  • Disabling BLS features returns clear "not supported" errors rather than breaking functionality
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Analyze feature flag dependencies and test different feature combinations

# Find all files that might be affected by BLS feature flag
rg -l "cfg\(feature\s*=\s*\"bls-signatures\"" 

# Find all files that might be using BLS-related functionality
rg -l "bls|signature|verify" 

Length of output: 56732


Script:

#!/bin/bash

# Check default features in Cargo.toml
echo "=== Checking default features in Cargo.toml ==="
rg -A 10 "^\[features\]" packages/rs-dpp/Cargo.toml

# Look for any unconditional BLS usage (not wrapped in cfg feature)
echo -e "\n=== Checking for unconditional BLS usage ==="
rg "bls" -B 2 -A 2 --no-filename packages/rs-dpp/src/ | grep -v "cfg(feature"

# Examine feature flag patterns
echo -e "\n=== Examining BLS feature flag patterns ==="
rg "#\[cfg\(feature\s*=\s*\"bls-signatures\"\)\]" -B 2 -A 2

Length of output: 33457

@QuantumExplorer
Copy link
Member Author

Approved your changes @shumkov

@shumkov shumkov merged commit cbddb8d into v2.0-dev Jan 24, 2025
63 of 64 checks passed
@shumkov shumkov deleted the feat/removeBLSSigsCompletely branch January 24, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants