Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ executors:
# The default docker image used in the main-workflow
rust-docker:
docker:
- image: cimg/rust:1.88.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well
- image: cimg/rust:1.92.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well

commands:
check_windows:
Expand All @@ -50,17 +50,17 @@ commands:
Write-Host "rustup not found, installing..."
$rustupPath = "$env:TEMP\rustup-init.exe"
Invoke-WebRequest -Uri "https://win.rustup.rs/" -OutFile $rustupPath
& $rustupPath -y --default-toolchain "1.88.0-x86_64-pc-windows-msvc" --no-modify-path --profile minimal
& $rustupPath -y --default-toolchain "1.92.0-x86_64-pc-windows-msvc" --no-modify-path --profile minimal
} else {
Write-Host "rustup already installed, ensuring toolchain 1.88.0-x86_64-pc-windows-msvc is present..."
rustup toolchain install 1.88.0-x86_64-pc-windows-msvc
Write-Host "rustup already installed, ensuring toolchain 1.92.0-x86_64-pc-windows-msvc is present..."
rustup toolchain install 1.92.0-x86_64-pc-windows-msvc
}

# Put cargo/rustup first in PATH for this step and subsequent steps
$Env:Path = "$Env:USERPROFILE\.cargo\bin;$Env:Path"

# Select the toolchain
rustup default 1.88.0-x86_64-pc-windows-msvc
rustup default 1.92.0-x86_64-pc-windows-msvc

# Verify the installation.
cargo --version --verbose
Expand Down Expand Up @@ -90,7 +90,7 @@ commands:
parameters:
cache_key:
type: string
default: v4.2.0-rust-1.88.0-snarkvm-cache
default: v4.2.0-rust-1.92.0-snarkvm-cache

steps:
- run:
Expand Down Expand Up @@ -143,8 +143,8 @@ commands:

- restore_cache:
keys:
- v4.2.0-rust-1.88.0-deps-{{ checksum "Cargo.lock" }}-
- v4.2.0-rust-1.88.0-deps-
- v4.2.0-rust-1.92.0-deps-{{ checksum "Cargo.lock" }}-
- v4.2.0-rust-1.92.0-deps-

- restore_cache:
keys:
Expand All @@ -155,11 +155,11 @@ commands:
parameters:
cache_key:
type: string
default: v4.2.0-rust-1.88.0-snarkvm-cache
default: v4.2.0-rust-1.92.0-snarkvm-cache
steps:
- run: set +e
- save_cache:
key: v4.2.0-rust-1.88.0-deps-{{ checksum "Cargo.lock" }}-{{ epoch }}
key: v4.2.0-rust-1.92.0-deps-{{ checksum "Cargo.lock" }}-{{ epoch }}
paths:
- /home/circleci/.cache/sccache
- /home/circleci/.cargo/registry
Expand Down Expand Up @@ -193,7 +193,7 @@ commands:
steps:
- checkout
- setup_environment:
cache_key: v4.2.0-rust-1.88.0-<< parameters.workspace_member >><< parameters.cache_key_suffix >>-cache
cache_key: v4.2.0-rust-1.92.0-<< parameters.workspace_member >><< parameters.cache_key_suffix >>-cache


- run:
Expand Down Expand Up @@ -397,7 +397,7 @@ commands:
path: target/nextest/ci

- clear_environment:
cache_key: v4.2.0-rust-1.88.0-<< parameters.workspace_member >><< parameters.cache_key_suffix >>-cache
cache_key: v4.2.0-rust-1.92.0-<< parameters.workspace_member >><< parameters.cache_key_suffix >>-cache


install_rust_nightly:
Expand Down Expand Up @@ -1018,7 +1018,7 @@ jobs:
steps:
- checkout
- setup_environment:
cache_key: v4.2.0-rust-1.88.0-snarkvm-wasm-cache
cache_key: v4.2.0-rust-1.92.0-snarkvm-wasm-cache
- run:
no_output_timeout: 30m
command: |
Expand All @@ -1035,7 +1035,7 @@ jobs:
# Run the tests
cd wasm && wasm-pack test --node
- clear_environment:
cache_key: v4.2.0-rust-1.88.0-snarkvm-wasm-cache
cache_key: v4.2.0-rust-1.92.0-snarkvm-wasm-cache

check-fmt:
executor: rust-docker
Expand All @@ -1044,21 +1044,21 @@ jobs:
- checkout
- install_rust_nightly
- setup_environment:
cache_key: v4.2.0-rust-1.88.0-snarkvm-fmt-cache
cache_key: v4.2.0-rust-1.92.0-snarkvm-fmt-cache
- run:
name: Check style
no_output_timeout: 35m
command: cargo +nightly fmt --all -- --check
- clear_environment:
cache_key: v4.2.0-rust-1.88.0-snarkvm-fmt-cache
cache_key: v4.2.0-rust-1.92.0-snarkvm-fmt-cache

check-unused-dependencies:
executor: rust-docker
resource_class: << pipeline.parameters.medium >>
steps:
- checkout
- setup_environment:
cache_key: v4.2.0-rust-1.88.0-machete-cache
cache_key: v4.2.0-rust-1.92.0-machete-cache
- run:
name: Check for unused dependencies
no_output_timeout: 10m
Expand All @@ -1069,23 +1069,23 @@ jobs:
fi
cargo machete
- clear_environment:
cache_key: v4.2.0-rust-1.88.0-machete-cache
cache_key: v4.2.0-rust-1.92.0-machete-cache

check-cargo-audit:
executor: rust-docker
resource_class: << pipeline.parameters.medium >>
steps:
- checkout
- setup_environment:
cache_key: v4.2.0-rust-1.88.0-cargo-audit-cache
cache_key: v4.2.0-rust-1.92.0-cargo-audit-cache
- run:
name: Check for security vulnerabilities
no_output_timeout: 10m
command: |
cargo install cargo-audit@0.21.2 --locked
cargo audit -D warnings
- clear_environment:
cache_key: v4.2.0-rust-1.88.0-cargo-audit-cache
cache_key: v4.2.0-rust-1.92.0-cargo-audit-cache

check-cargo-semver-checks:
executor: rust-docker
Expand All @@ -1094,23 +1094,23 @@ jobs:
- checkout:
method: full
- setup_environment:
cache_key: v4.2.0-rust-1.88.0-cargo-semver-checks-cache
cache_key: v4.2.0-rust-1.92.0-cargo-semver-checks-cache
- run:
name: Check for semver violations
no_output_timeout: 15m
command: |
bash ./.circleci/semver-checks.sh

- clear_environment:
cache_key: v4.2.0-rust-1.88.0-cargo-semver-checks-cache
cache_key: v4.2.0-rust-1.92.0-cargo-semver-checks-cache

check-clippy:
executor: rust-docker
resource_class: << pipeline.parameters.xlarge >>
steps:
- checkout
- setup_environment:
cache_key: v4.2.0-rust-1.88.0-snarkvm-clippy-cache
cache_key: v4.2.0-rust-1.92.0-snarkvm-clippy-cache
- run:
name: Check Clippy (default features)
timeout: 20m
Expand All @@ -1122,21 +1122,21 @@ jobs:
command: |
cargo clippy --workspace --all-targets --all-features -- -D warnings
- clear_environment:
cache_key: v4.2.0-rust-1.88.0-snarkvm-clippy-cache
cache_key: v4.2.0-rust-1.92.0-snarkvm-clippy-cache

check-all-targets:
executor: rust-docker
resource_class: << pipeline.parameters.small >>
steps:
- checkout
- setup_environment:
cache_key: v4.2.0-rust-1.88.0-snarkvm-all-targets-cache
cache_key: v4.2.0-rust-1.92.0-snarkvm-all-targets-cache
- run:
name: Check all targets
no_output_timeout: 35m
command: cargo check --release --workspace --all-targets
- clear_environment:
cache_key: v4.2.0-rust-1.88.0-snarkvm-all-targets-cache
cache_key: v4.2.0-rust-1.92.0-snarkvm-all-targets-cache

verify-windows:
executor:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ categories = [
include = [ "Cargo.toml", "vm", "README.md", "LICENSE.md" ]
license = "Apache-2.0"
edition = "2024"
rust-version = "1.88.0" # Attention - Change the MSRV in rust-toolchain and in .circleci/config.yml as well
rust-version = "1.92.0" # Attention - Change the MSRV in rust-toolchain and in .circleci/config.yml as well

[workspace]
members = [
Expand Down
3 changes: 3 additions & 0 deletions algorithms/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

#![warn(unsafe_code)]
#![allow(clippy::module_inception)]
#![allow(clippy::manual_is_multiple_of)]
#![allow(mismatched_lifetime_syntaxes)]
#![allow(clippy::unused_enumerate_index)]
#![allow(clippy::type_complexity)]
#![cfg_attr(test, allow(clippy::assertions_on_result_states))]

Expand Down
2 changes: 1 addition & 1 deletion algorithms/src/msm/variable_base/batched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ impl Ord for BucketPosition {
}
}

#[allow(clippy::non_canonical_partial_ord_impl)]
impl PartialOrd for BucketPosition {
#[allow(clippy::non_canonical_partial_ord_impl)]
fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
self.bucket_index.partial_cmp(&other.bucket_index)
}
Expand Down
4 changes: 2 additions & 2 deletions algorithms/src/polycommit/kzg10/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,12 @@ impl<E: PairingEngine> KZG10<E> {
if enforced_degree_bounds.binary_search(&bound).is_err() {
Err(PCError::UnsupportedDegreeBound(bound))
} else if bound < p.degree() || bound > max_degree {
return Err(PCError::IncorrectDegreeBound {
Err(PCError::IncorrectDegreeBound {
poly_degree: p.degree(),
degree_bound: p.degree_bound().unwrap(),
max_degree,
label: p.label().to_string(),
});
})
} else {
Ok(())
}
Expand Down
8 changes: 4 additions & 4 deletions algorithms/src/snark/varuna/ahp/ahp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ impl<F: PrimeField, SM: SNARKMode> AHPForR1CS<F, SM> {
.max_by_key(|d| d.size())
.ok_or(anyhow!("could not find max domain"))?;
let mut max_non_zero_domain = Some(new_candidate);
if let Some(max_candidate) = max_candidate {
if max_candidate.size() > new_candidate.size() {
max_non_zero_domain = Some(max_candidate);
}
if let Some(max_candidate) = max_candidate
&& max_candidate.size() > new_candidate.size()
{
max_non_zero_domain = Some(max_candidate);
}
Ok(NonZeroDomains { max_non_zero_domain, domain_a, domain_b, domain_c })
}
Expand Down
1 change: 1 addition & 0 deletions circuit/account/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.

#![forbid(unsafe_code)]
#![allow(mismatched_lifetime_syntaxes)]
#![allow(clippy::too_many_arguments)]

extern crate snarkvm_console_account as console;
Expand Down
2 changes: 1 addition & 1 deletion circuit/algorithms/src/keccak/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl<E: Environment, const TYPE: u8, const VARIANT: usize> Hash for Keccak<E, TY
// and the bit rate is the width (1600 in our case) minus the capacity.
let bitrate = PERMUTATION_WIDTH - 2 * VARIANT;
debug_assert!(bitrate < PERMUTATION_WIDTH, "The bitrate must be less than the permutation width");
debug_assert!(bitrate % 8 == 0, "The bitrate must be a multiple of 8");
debug_assert!(bitrate.is_multiple_of(8), "The bitrate must be a multiple of 8");

// Ensure the input is not empty.
if input.is_empty() {
Expand Down
2 changes: 2 additions & 0 deletions circuit/environment/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
// limitations under the License.

#![forbid(unsafe_code)]
#![allow(clippy::cloned_ref_to_slice_refs)]
#![allow(mismatched_lifetime_syntaxes)]
#![allow(clippy::type_complexity)]

extern crate snarkvm_console_network as console;
Expand Down
2 changes: 1 addition & 1 deletion circuit/program/src/data/literal/cast/boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ mod tests {
mode: Mode,
_: &mut TestRng,
) -> (console_root::types::Boolean<MainnetV0>, Boolean<Circuit>) {
(console_root::types::Boolean::new(i % 2 == 0), Boolean::new(mode, i % 2 == 0))
(console_root::types::Boolean::new(i.is_multiple_of(2)), Boolean::new(mode, i.is_multiple_of(2)))
}

impl_check_cast!(cast, Boolean<Circuit>, console_root::types::Boolean::<MainnetV0>);
Expand Down
2 changes: 1 addition & 1 deletion circuit/program/src/data/literal/cast_lossy/boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ mod tests {
mode: Mode,
_: &mut TestRng,
) -> (console_root::types::Boolean<MainnetV0>, Boolean<Circuit>) {
(console_root::types::Boolean::new(i % 2 == 0), Boolean::new(mode, i % 2 == 0))
(console_root::types::Boolean::new(i.is_multiple_of(2)), Boolean::new(mode, i.is_multiple_of(2)))
}

check_cast_lossy!(cast_lossy, Boolean<Circuit>, console_root::types::Boolean::<MainnetV0>);
Expand Down
2 changes: 2 additions & 0 deletions circuit/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
// limitations under the License.

#![forbid(unsafe_code)]
#![allow(mismatched_lifetime_syntaxes)]
#![allow(clippy::cloned_ref_to_slice_refs)]
#![allow(clippy::too_many_arguments)]
#![cfg_attr(test, allow(clippy::assertions_on_result_states))]

Expand Down
2 changes: 2 additions & 0 deletions circuit/types/address/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
// limitations under the License.

#![forbid(unsafe_code)]
#![allow(mismatched_lifetime_syntaxes)]
#![allow(clippy::cloned_ref_to_slice_refs)]
#![cfg_attr(test, allow(clippy::assertions_on_result_states))]

extern crate snarkvm_console_types_address as console;
Expand Down
1 change: 1 addition & 0 deletions circuit/types/boolean/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#![forbid(unsafe_code)]
#![allow(clippy::too_many_arguments)]
#![allow(mismatched_lifetime_syntaxes)]
#![cfg_attr(test, allow(clippy::assertions_on_result_states))]

extern crate snarkvm_console_types_boolean as console;
Expand Down
1 change: 1 addition & 0 deletions circuit/types/field/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.

#![forbid(unsafe_code)]
#![allow(mismatched_lifetime_syntaxes)]
#![allow(clippy::too_many_arguments)]
#![cfg_attr(test, allow(clippy::assertions_on_result_states))]

Expand Down
1 change: 1 addition & 0 deletions circuit/types/group/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.

#![forbid(unsafe_code)]
#![allow(mismatched_lifetime_syntaxes)]
#![allow(clippy::too_many_arguments)]
#![cfg_attr(test, allow(clippy::assertions_on_result_states))]

Expand Down
2 changes: 2 additions & 0 deletions circuit/types/integers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
// limitations under the License.

#![forbid(unsafe_code)]
#![allow(clippy::cloned_ref_to_slice_refs)]
#![allow(mismatched_lifetime_syntaxes)]
#![allow(clippy::too_many_arguments)]
#![cfg_attr(test, allow(clippy::assertions_on_result_states))]

Expand Down
1 change: 1 addition & 0 deletions circuit/types/scalar/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.

#![forbid(unsafe_code)]
#![allow(mismatched_lifetime_syntaxes)]
#![allow(clippy::too_many_arguments)]
#![cfg_attr(test, allow(clippy::assertions_on_result_states))]

Expand Down
2 changes: 1 addition & 1 deletion circuit/types/string/src/helpers/from_bits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl<E: Environment> StringType<E> {
fn inject_size_in_bytes(mode: Mode, bits: &[Boolean<E>]) -> Field<E> {
// Ensure the bits are byte-aligned.
let num_bits = bits.len();
if num_bits % 8 != 0 {
if !num_bits.is_multiple_of(8) {
E::halt(format!("Attempted to instantiate a {num_bits}-bit string, which is not byte-aligned"))
}

Expand Down
1 change: 1 addition & 0 deletions circuit/types/string/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.

#![forbid(unsafe_code)]
#![allow(mismatched_lifetime_syntaxes)]
#![cfg_attr(test, allow(clippy::assertions_on_result_states))]

extern crate snarkvm_console_types_string as console;
Expand Down
1 change: 1 addition & 0 deletions console/account/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.

#![forbid(unsafe_code)]
#![allow(mismatched_lifetime_syntaxes)]
#![allow(clippy::too_many_arguments)]
#![warn(clippy::cast_possible_truncation)]
#![cfg_attr(test, allow(clippy::assertions_on_result_states))]
Expand Down
Loading