Skip to content

Set bls_lagrange rand dependency to workspace. #462

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

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

gnattishness
Copy link
Member

Update to [email protected] and replace deprecated names.

Issue Addressed

Fixes #461

Proposed Changes

Use rand 0.9 and set to workspace version.

Additional Info

Its a very small change, understandable if you don't want to accept it :)

Copy link

cla-assistant bot commented Jul 31, 2025

CLA assistant check
All committers have signed the CLA.

@gnattishness gnattishness force-pushed the upgrade-bls_lagrange-rand branch from b576653 to 0922b2a Compare July 31, 2025 10:51
@gnattishness gnattishness force-pushed the upgrade-bls_lagrange-rand branch from 0922b2a to c0aaed1 Compare July 31, 2025 10:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the bls_lagrange crate to use [email protected] by setting the dependency to workspace version and replacing deprecated method names with their current equivalents.

  • Updates rand dependency from hardcoded "0.8.5" to workspace version
  • Replaces deprecated thread_rng() with rand::rng()
  • Updates deprecated method names: gen()random(), gen_range()random_range()

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
anchor/common/bls_lagrange/Cargo.toml Updates rand dependency to use workspace version
anchor/common/bls_lagrange/src/lib.rs Replaces deprecated rand method names with current equivalents
Comments suppressed due to low confidence (5)

anchor/common/bls_lagrange/src/lib.rs:30

  • The function rand::rng() does not exist in rand 0.9. The correct replacement for thread_rng() is rand::thread_rng().
    split_with_rng(key, threshold, ids, &mut rand::rng())

anchor/common/bls_lagrange/src/lib.rs:35

  • The method random() does not exist on RNG traits in rand 0.9. The correct method name is gen(), which remains unchanged from rand 0.8.
    let ikm = zeroize::Zeroizing::new(rng.random::<[u8; 32]>());

anchor/common/bls_lagrange/src/lib.rs:60

  • The method random_range() does not exist on RNG traits in rand 0.9. The correct method name is gen_range(), which remains unchanged from rand 0.8.
        let total = rng.random_range(2..=13);

anchor/common/bls_lagrange/src/lib.rs:61

  • The method random_range() does not exist on RNG traits in rand 0.9. The correct method name is gen_range(), which remains unchanged from rand 0.8.
        let threshold = rng.random_range(2..=total);

anchor/common/bls_lagrange/src/lib.rs:84

  • The method random_range() does not exist on RNG traits in rand 0.9. The correct method name is gen_range(), which remains unchanged from rand 0.8.
        let signers = rng.random_range(2..=total);

@dknopik
Copy link
Member

dknopik commented Aug 4, 2025

This breaks when building with feature = blsful, as we pass the RNG to a dependency which still uses rand 0.8.

However, we have been using the custom blst variant for a while now and I am open to just removing the blsful variant. Then we could merge this.

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