diff --git a/.circleci/config.yml b/.circleci/config.yml index 6131c59f57..699f077c73 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -137,7 +137,7 @@ commands: jobs: snarkvm: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - checkout @@ -147,7 +147,7 @@ jobs: algorithms: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -156,7 +156,7 @@ jobs: algorithms-profiler: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: # This runs a single test with profiler enabled @@ -166,7 +166,7 @@ jobs: circuit: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -175,7 +175,7 @@ jobs: circuit-account: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -185,7 +185,7 @@ jobs: # This checks that no `console` structs are used in core circuit logic. circuit-account-noconsole: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -195,7 +195,7 @@ jobs: circuit-algorithms: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -204,7 +204,7 @@ jobs: circuit-collections: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -214,7 +214,7 @@ jobs: # This checks that no `console` structs are used in core circuit logic. circuit-collections-noconsole: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -224,7 +224,7 @@ jobs: circuit-environment: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -233,7 +233,7 @@ jobs: circuit-network: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -242,7 +242,7 @@ jobs: circuit-program: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -251,7 +251,7 @@ jobs: circuit-types: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -260,7 +260,7 @@ jobs: circuit-types-address: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -269,7 +269,7 @@ jobs: circuit-types-boolean: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -278,7 +278,7 @@ jobs: circuit-types-field: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -287,7 +287,7 @@ jobs: circuit-types-group: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -296,7 +296,7 @@ jobs: circuit-types-integers: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -306,7 +306,7 @@ jobs: circuit-types-scalar: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -315,7 +315,7 @@ jobs: circuit-types-string: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -323,7 +323,7 @@ jobs: cache_key: snarkvm-circuit-types-string-cache console: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -332,7 +332,7 @@ jobs: console-account: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -341,7 +341,7 @@ jobs: console-algorithms: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -350,7 +350,7 @@ jobs: console-collections: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -359,7 +359,7 @@ jobs: console-network: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -368,7 +368,7 @@ jobs: console-network-environment: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -377,7 +377,7 @@ jobs: console-program: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -386,7 +386,7 @@ jobs: console-types: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -395,7 +395,7 @@ jobs: console-types-address: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -404,7 +404,7 @@ jobs: console-types-boolean: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -413,7 +413,7 @@ jobs: console-types-field: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -422,7 +422,7 @@ jobs: console-types-group: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -431,7 +431,7 @@ jobs: console-types-integers: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -440,7 +440,7 @@ jobs: console-types-scalar: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -449,7 +449,7 @@ jobs: console-types-string: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -458,7 +458,7 @@ jobs: curves: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -467,7 +467,7 @@ jobs: fields: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -476,7 +476,7 @@ jobs: ledger: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -485,7 +485,7 @@ jobs: ledger-with-rocksdb: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -495,7 +495,7 @@ jobs: ledger-with-valid-solutions: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -505,7 +505,7 @@ jobs: ledger-authority: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -514,7 +514,7 @@ jobs: ledger-block: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -523,7 +523,7 @@ jobs: ledger-committee: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -532,7 +532,7 @@ jobs: ledger-narwhal: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -541,7 +541,7 @@ jobs: ledger-narwhal-batch-certificate: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -550,7 +550,7 @@ jobs: ledger-narwhal-batch-header: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -559,7 +559,7 @@ jobs: ledger-narwhal-data: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -568,7 +568,7 @@ jobs: ledger-narwhal-subdag: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -577,7 +577,7 @@ jobs: ledger-narwhal-transmission: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -586,7 +586,7 @@ jobs: ledger-narwhal-transmission-id: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -595,7 +595,7 @@ jobs: ledger-puzzle: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -604,7 +604,7 @@ jobs: ledger-puzzle-epoch: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -613,7 +613,7 @@ jobs: ledger-query: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -622,7 +622,7 @@ jobs: ledger-store: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -632,7 +632,7 @@ jobs: ledger-test-helpers: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -641,7 +641,7 @@ jobs: parameters: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -650,7 +650,7 @@ jobs: synthesizer: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -660,7 +660,7 @@ jobs: synthesizer-integration: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -670,7 +670,7 @@ jobs: synthesizer-process: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -679,7 +679,7 @@ jobs: synthesizer-process-with-rocksdb: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -689,7 +689,7 @@ jobs: synthesizer-program: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -699,7 +699,7 @@ jobs: synthesizer-program-integration: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -709,7 +709,7 @@ jobs: synthesizer-program-integration-keccak: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -719,7 +719,7 @@ jobs: synthesizer-program-integration-psd: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -729,7 +729,7 @@ jobs: synthesizer-program-integration-sha: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -739,7 +739,7 @@ jobs: synthesizer-snark: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - run_serial: @@ -748,7 +748,7 @@ jobs: utilities: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -757,7 +757,7 @@ jobs: utilities-derives: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - run_serial: @@ -766,7 +766,7 @@ jobs: wasm: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - checkout @@ -784,7 +784,7 @@ jobs: check-fmt: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - checkout @@ -800,7 +800,7 @@ jobs: check-clippy: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: 2xlarge steps: - checkout @@ -817,7 +817,7 @@ jobs: check-all-targets: docker: - - image: cimg/rust:1.72.1 + - image: cimg/rust:1.76.0 # Attention - Change the MSRV in Cargo.toml and rust-toolchain as well resource_class: xlarge steps: - checkout diff --git a/Cargo.toml b/Cargo.toml index 55faaa164e..52106ffccf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ categories = [ include = [ "Cargo.toml", "vm", "README.md", "LICENSE.md" ] license = "Apache-2.0" edition = "2021" -rust-version = "1.72.1" +rust-version = "1.76.0" # Attention - Change the MSRV in rust-toolchain and in .circleci/config.yml as well [workspace] members = [ diff --git a/algorithms/src/msm/variable_base/batched.rs b/algorithms/src/msm/variable_base/batched.rs index b1f172d8a4..fe8b44c071 100644 --- a/algorithms/src/msm/variable_base/batched.rs +++ b/algorithms/src/msm/variable_base/batched.rs @@ -43,6 +43,7 @@ impl Ord for BucketPosition { } impl PartialOrd for BucketPosition { + #[allow(clippy::non_canonical_partial_ord_impl)] fn partial_cmp(&self, other: &Self) -> Option { self.bucket_index.partial_cmp(&other.bucket_index) } diff --git a/algorithms/src/snark/varuna/ahp/prover/round_functions/third.rs b/algorithms/src/snark/varuna/ahp/prover/round_functions/third.rs index bccfedfaac..95ba4d7f1a 100644 --- a/algorithms/src/snark/varuna/ahp/prover/round_functions/third.rs +++ b/algorithms/src/snark/varuna/ahp/prover/round_functions/third.rs @@ -153,9 +153,7 @@ impl AHPForR1CS { let fft_precomputation = &circuit.fft_precomputation; let ifft_precomputation = &circuit.ifft_precomputation; - for (_j, (&instance_combiner, assignment)) in - itertools::izip!(instance_combiners, assignments_i).enumerate() - { + for (&instance_combiner, assignment) in itertools::izip!(instance_combiners, assignments_i) { for (label, matrix_combiner) in itertools::izip!(matrix_labels, matrix_combiners) { let matrix_transpose = &matrix_transposes_i[label]; let combiner = circuit_combiner * instance_combiner * matrix_combiner; diff --git a/circuit/environment/src/traits/eject.rs b/circuit/environment/src/traits/eject.rs index 7eb9386f98..46fc73c6ed 100644 --- a/circuit/environment/src/traits/eject.rs +++ b/circuit/environment/src/traits/eject.rs @@ -69,7 +69,7 @@ impl Eject for Vec { fn eject_mode(&self) -> Mode { // TODO (howardwu): Determine if a default mode of `constant` is appropriate. // Retrieve the mode of the first circuit. - match self.get(0) { + match self.first() { Some(first) => Mode::combine(*first, self.iter().copied().skip(1)), // None => Mode::Constant, None => panic!("Attempted to eject the mode on an empty circuit"), @@ -123,7 +123,7 @@ impl, P> Eject for &[C] { fn eject_mode(&self) -> Mode { // TODO (howardwu): Determine if a default mode of `constant` is appropriate. // Retrieve the mode of the first circuit. - match self.get(0) { + match self.first() { Some(first) => Mode::combine(first.eject_mode(), self.iter().skip(1).map(Eject::eject_mode)), None => Mode::Constant, // None => panic!("Attempted to eject the mode on an empty circuit"), diff --git a/ledger/authority/src/serialize.rs b/ledger/authority/src/serialize.rs index 0abe9c49c7..ba87f9aac5 100644 --- a/ledger/authority/src/serialize.rs +++ b/ledger/authority/src/serialize.rs @@ -55,7 +55,7 @@ impl<'de, N: Network> Deserialize<'de> for Authority { "quorum" => Ok(Self::from_quorum( DeserializeExt::take_from_value::(&mut authority, "subdag").map_err(de::Error::custom)?, )), - _ => Err(error("Invalid authority type")).map_err(de::Error::custom), + _ => Err(de::Error::custom(error("Invalid authority type"))), } } false => FromBytesDeserializer::::deserialize_with_size_encoding(deserializer, "authority"), diff --git a/ledger/block/src/serialize.rs b/ledger/block/src/serialize.rs index d440b450b6..e485a1a43e 100644 --- a/ledger/block/src/serialize.rs +++ b/ledger/block/src/serialize.rs @@ -60,7 +60,7 @@ impl<'de, N: Network> Deserialize<'de> for Block { // Ensure the block hash matches. match block_hash == block.hash() { true => Ok(block), - false => Err(error("Mismatching block hash, possible data corruption")).map_err(de::Error::custom), + false => Err(de::Error::custom(error("Mismatching block hash, possible data corruption"))), } } false => FromBytesDeserializer::::deserialize_with_size_encoding(deserializer, "block"), diff --git a/ledger/block/src/transaction/fee/mod.rs b/ledger/block/src/transaction/fee/mod.rs index 5bd90737ee..da76ef96e7 100644 --- a/ledger/block/src/transaction/fee/mod.rs +++ b/ledger/block/src/transaction/fee/mod.rs @@ -78,7 +78,7 @@ impl Fee { pub fn payer(&self) -> Option> { // Retrieve the payer. match self.transition.outputs().last() { - Some(Output::Future(_, Some(future))) => match future.arguments().get(0) { + Some(Output::Future(_, Some(future))) => match future.arguments().first() { Some(Argument::Plaintext(Plaintext::Literal(Literal::Address(address), _))) => Some(*address), _ => None, }, diff --git a/ledger/block/src/transaction/serialize.rs b/ledger/block/src/transaction/serialize.rs index ec6aae1448..33830ee625 100644 --- a/ledger/block/src/transaction/serialize.rs +++ b/ledger/block/src/transaction/serialize.rs @@ -100,9 +100,7 @@ impl<'de, N: Network> Deserialize<'de> for Transaction { // Ensure the transaction ID matches. match id == transaction.id() { true => Ok(transaction), - false => { - Err(error("Mismatching transaction ID, possible data corruption")).map_err(de::Error::custom) - } + false => Err(de::Error::custom(error("Mismatching transaction ID, possible data corruption"))), } } false => FromBytesDeserializer::::deserialize_with_size_encoding(deserializer, "transaction"), diff --git a/ledger/block/src/transition/serialize.rs b/ledger/block/src/transition/serialize.rs index a9c1c31dae..fa7ebd38ee 100644 --- a/ledger/block/src/transition/serialize.rs +++ b/ledger/block/src/transition/serialize.rs @@ -67,7 +67,7 @@ impl<'de, N: Network> Deserialize<'de> for Transition { // Ensure the transition ID is correct. match id == *transition.id() { true => Ok(transition), - false => Err(error("Transition ID mismatch, possible data corruption")).map_err(de::Error::custom), + false => Err(de::Error::custom(error("Transition ID mismatch, possible data corruption"))), } } false => FromBytesDeserializer::::deserialize_with_size_encoding(deserializer, "transition"), diff --git a/ledger/narwhal/batch-header/src/serialize.rs b/ledger/narwhal/batch-header/src/serialize.rs index 6e86f014c8..ec9dbf2629 100644 --- a/ledger/narwhal/batch-header/src/serialize.rs +++ b/ledger/narwhal/batch-header/src/serialize.rs @@ -58,10 +58,10 @@ impl<'de, N: Network> Deserialize<'de> for BatchHeader { // Ensure that the batch ID matches the recovered header. match batch_id == batch_header.batch_id() { true => Ok(batch_header), - false => { - Err(error(format!("Batch ID mismatch: expected {batch_id}, got {}", batch_header.batch_id()))) - .map_err(de::Error::custom) - } + false => Err(de::Error::custom(error(format!( + "Batch ID mismatch: expected {batch_id}, got {}", + batch_header.batch_id() + )))), } } false => FromBytesDeserializer::::deserialize_with_size_encoding(deserializer, "batch header"), diff --git a/ledger/narwhal/data/src/lib.rs b/ledger/narwhal/data/src/lib.rs index 28508ecc54..18997c95a6 100644 --- a/ledger/narwhal/data/src/lib.rs +++ b/ledger/narwhal/data/src/lib.rs @@ -206,17 +206,17 @@ impl<'de, T: FromBytes + ToBytes + DeserializeOwned + Send + 'static> Deserializ // Decode from bech32m. let (hrp, data, variant) = bech32::decode(&encoding).map_err(de::Error::custom)?; if hrp != PREFIX { - return Err(error(format!("Invalid data HRP - {hrp}"))).map_err(de::Error::custom); + return Err(de::Error::custom(error(format!("Invalid data HRP - {hrp}")))); }; if data.is_empty() { - return Err(error("Invalid bech32m data (empty)")).map_err(de::Error::custom); + return Err(de::Error::custom(error("Invalid bech32m data (empty)"))); } if variant != bech32::Variant::Bech32m { - return Err(error("Invalid data - variant is not bech32m")).map_err(de::Error::custom); + return Err(de::Error::custom(error("Invalid data - variant is not bech32m"))); } Ok(Self::Buffer(Bytes::from(Vec::from_base32(&data).map_err(de::Error::custom)?))) } - _ => Err(error(format!("Invalid data type - {type_}"))).map_err(de::Error::custom), + _ => Err(de::Error::custom(error(format!("Invalid data type - {type_}")))), } } false => FromBytesDeserializer::::deserialize_with_size_encoding(deserializer, "data"), diff --git a/ledger/narwhal/transmission/src/serialize.rs b/ledger/narwhal/transmission/src/serialize.rs index 4657a7ff76..45b6f5a36e 100644 --- a/ledger/narwhal/transmission/src/serialize.rs +++ b/ledger/narwhal/transmission/src/serialize.rs @@ -61,7 +61,7 @@ impl<'de, N: Network> Deserialize<'de> for Transmission { DeserializeExt::take_from_value::(&mut transmission, "transmission") .map_err(de::Error::custom)?, )), - _ => Err(error("Invalid transmission type")).map_err(de::Error::custom), + _ => Err(de::Error::custom(error("Invalid transmission type"))), } } false => FromBytesDeserializer::::deserialize_with_size_encoding(deserializer, "transmission"), diff --git a/ledger/puzzle/src/solution/serialize.rs b/ledger/puzzle/src/solution/serialize.rs index a96034e56e..12ebd1b84d 100644 --- a/ledger/puzzle/src/solution/serialize.rs +++ b/ledger/puzzle/src/solution/serialize.rs @@ -51,7 +51,7 @@ impl<'de, N: Network> Deserialize<'de> for Solution { // Ensure the solution ID matches. match solution_id == solution.id() { true => Ok(solution), - false => Err(error("Mismatching solution ID, possible data corruption")).map_err(de::Error::custom), + false => Err(de::Error::custom(error("Mismatching solution ID, possible data corruption"))), } } false => FromBytesDeserializer::::deserialize_with_size_encoding(deserializer, "solution"), diff --git a/ledger/store/src/block/confirmed_tx_type/serialize.rs b/ledger/store/src/block/confirmed_tx_type/serialize.rs index 5e119b5c10..fdfd704b99 100644 --- a/ledger/store/src/block/confirmed_tx_type/serialize.rs +++ b/ledger/store/src/block/confirmed_tx_type/serialize.rs @@ -83,7 +83,7 @@ impl<'de, N: Network> Deserialize<'de> for ConfirmedTxType { .map_err(de::Error::custom)?; Ok(Self::RejectedExecute(index, rejected)) } - _ => Err(error("Invalid confirmed transaction type")).map_err(de::Error::custom), + _ => Err(de::Error::custom(error("Invalid confirmed transaction type"))), } } false => FromBytesDeserializer::::deserialize_with_size_encoding( diff --git a/rust-toolchain b/rust-toolchain index 22d6771a47..32a6ce3c71 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.72.1 +1.76.0 diff --git a/synthesizer/process/src/stack/authorization/mod.rs b/synthesizer/process/src/stack/authorization/mod.rs index 89637fb8d8..62d5bb513a 100644 --- a/synthesizer/process/src/stack/authorization/mod.rs +++ b/synthesizer/process/src/stack/authorization/mod.rs @@ -120,7 +120,7 @@ impl Authorization { impl Authorization { /// Returns the next `Request` in the authorization. pub fn peek_next(&self) -> Result> { - self.requests.read().get(0).cloned().ok_or_else(|| anyhow!("Failed to peek at the next request.")) + self.requests.read().front().cloned().ok_or_else(|| anyhow!("Failed to peek at the next request.")) } /// Returns the next `Request` from the authorization. diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 0dff0bbc18..60c2650540 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -404,7 +404,7 @@ impl CallTrait for Call { // Compute the transition commitment as `Hash(tvk)`. let candidate_tcm = A::hash_psd2(&[tvk.clone()]); // Ensure the transition commitment matches the computed transition commitment. - A::assert_eq(&tcm, &candidate_tcm); + A::assert_eq(&tcm, candidate_tcm); // Inject the input IDs (from the request) as `Mode::Public`. let input_ids = request .input_ids() diff --git a/synthesizer/program/src/import/mod.rs b/synthesizer/program/src/import/mod.rs index 46082a0e4d..3ff0f41250 100644 --- a/synthesizer/program/src/import/mod.rs +++ b/synthesizer/program/src/import/mod.rs @@ -66,7 +66,7 @@ impl Ord for Import { impl PartialOrd for Import { /// Ordering is determined by the NLD first, then the program name second. fn partial_cmp(&self, other: &Self) -> Option { - self.program_id.partial_cmp(&other.program_id) + Some(self.cmp(other)) } } diff --git a/utilities/src/bytes.rs b/utilities/src/bytes.rs index 9a7ba1d824..82eb310d8a 100644 --- a/utilities/src/bytes.rs +++ b/utilities/src/bytes.rs @@ -456,7 +456,7 @@ impl<'a, T: 'a + ToBytes> ToBytes for &'a T { } #[inline] -pub fn bits_from_bytes_le(bytes: &[u8]) -> impl Iterator + DoubleEndedIterator + '_ { +pub fn bits_from_bytes_le(bytes: &[u8]) -> impl DoubleEndedIterator + '_ { bytes.iter().flat_map(|byte| (0..8).map(move |i| (*byte >> i) & 1 == 1)) }