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
1 change: 0 additions & 1 deletion basic_bootloader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#![feature(allocator_api)]
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
#![feature(array_chunks)]
#![feature(get_mut_unchecked)]
#![feature(const_type_id)]
#![feature(vec_push_within_capacity)]
Expand Down
1 change: 0 additions & 1 deletion basic_system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
#![feature(allocator_api)]
#![feature(array_chunks)]
#![feature(get_mut_unchecked)]
#![feature(const_type_id)]
#![feature(vec_push_within_capacity)]
Expand Down
2 changes: 1 addition & 1 deletion basic_system/src/system_functions/bn254_ecmul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn bn254_ecmul_as_system_function_inner<
*dst = *src;
}

let mut it = buffer.array_chunks::<32>();
let mut it = buffer.as_chunks::<32>().0.iter();
let serialized_result = unsafe {
let x0 = it.next().unwrap_unchecked();
let y0 = it.next().unwrap_unchecked();
Expand Down
2 changes: 1 addition & 1 deletion basic_system/src/system_functions/bn254_pairing_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn bn254_pairing_check_inner<A: Allocator>(
for (dst, src) in buffer.iter_mut().zip(&mut src_iter) {
*dst = *src;
}
let mut it = buffer.array_chunks::<32>();
let mut it = buffer.as_chunks::<32>().0.iter();
unsafe {
let mut g1_x = *it.next().unwrap_unchecked();
let mut g1_y = *it.next().unwrap_unchecked();
Expand Down
2 changes: 1 addition & 1 deletion basic_system/src/system_functions/ecrecover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn ecrecover_as_system_function_inner<

// follow https://github.com/ethereum/go-ethereum/blob/aadcb886753079d419f966a3bc990f708f8d1c3b/core/vm/contracts.go#L188

let mut it = buffer.array_chunks::<32>();
let mut it = buffer.as_chunks::<32>().0.iter();
let recovered_pubkey_bytes = unsafe {
let digest = it.next().unwrap_unchecked();
let v = it.next().unwrap_unchecked();
Expand Down
2 changes: 1 addition & 1 deletion basic_system/src/system_functions/p256_verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fn p256_verify_as_system_function_inner<
*dst = *src;
}

let mut it = buffer.array_chunks::<32>();
let mut it = buffer.as_chunks::<32>().0.iter();
let is_valid = unsafe {
let digest = it.next().unwrap_unchecked();
let r = it.next().unwrap_unchecked();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ impl UsizeSerializable for KZGCommitmentAndProof {
} else {
#[allow(clippy::needless_return)]
return ExactSizeChain::new(
self.commitment.array_chunks::<{ core::mem::size_of::<usize>() }>().map(|chunk| usize::from_le_bytes(*chunk)),
self.proof.array_chunks::<{ core::mem::size_of::<usize>() }>().map(|chunk| usize::from_le_bytes(*chunk)),
self.commitment.as_chunks::<{ core::mem::size_of::<usize>() }>().0.iter().map(|chunk| usize::from_le_bytes(*chunk)),
self.proof.as_chunks::<{ core::mem::size_of::<usize>() }>().0.iter().map(|chunk| usize::from_le_bytes(*chunk)),
);
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ pub fn evaluate_blob_polynomial(data: &[u8], x: &crypto::bls12_381::Fr) -> crypt
[MaybeUninit::uninit(); ELEMENTS_PER_4844_BLOB];
let mut poly_iter = poly.iter_mut();

let chunks = data.array_chunks::<BLOB_CHUNK_SIZE>();
let remainder = chunks.remainder();
let (chunks, remainder) = data.as_chunks::<BLOB_CHUNK_SIZE>();
for chunk in chunks {
poly_iter
.next()
Expand Down
2 changes: 1 addition & 1 deletion callable_oracles/src/hash_to_prime/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ pub fn create_entropy(source: &[u8]) -> [u8; 64] {
use crypto::blake2s::Blake2s256;
assert!(MAX_ENTROPY_BYTES <= 64);
let mut entropy = [0u8; 64];
for (idx, dst) in entropy.array_chunks_mut::<32>().enumerate() {
for (idx, dst) in entropy.as_chunks_mut::<32>().0.iter_mut().enumerate() {
let mut hasher = Blake2s256::new();
hasher.update(&(idx as u32).to_le_bytes());
hasher.update(&source);
Expand Down
2 changes: 0 additions & 2 deletions callable_oracles/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#![cfg_attr(all(not(feature = "evaluate"), not(test)), no_std)]
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
#![feature(array_chunks)]
#![feature(iter_array_chunks)]
#![allow(clippy::new_without_default)]
#![allow(clippy::needless_lifetimes)]
#![allow(clippy::needless_borrow)]
Expand Down
1 change: 0 additions & 1 deletion crypto/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![cfg_attr(not(test), no_std)]
#![feature(array_chunks)]
#![allow(static_mut_refs)]
#![allow(clippy::uninit_assumed_init)]
#![allow(clippy::new_without_default)]
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2025-05-23"
channel = "nightly-2026-01-22"
8 changes: 4 additions & 4 deletions supporting_crates/solidity_abi/src/impls/byte_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ impl<'a> SolidityCodableReflectionRef<'a> for BytesRef<'a> {
if local_head.len() < 32 {
return Err(());
}
let tail_offset = local_head.array_chunks::<32>().next().unwrap();
let tail_offset = local_head.as_chunks::<32>().0.iter().next().unwrap();
let tail_offset = U256::from_be_bytes(*tail_offset);
let tail_offset = u256_to_usize_checked(&tail_offset)?;
let (_, local_tail) = source.split_at_checked(tail_offset).ok_or(())?;
if local_tail.len() < 32 {
return Err(());
}
let len = local_tail.array_chunks::<32>().next().unwrap();
let len = local_tail.as_chunks::<32>().0.iter().next().unwrap();
let len = U256::from_be_bytes(*len);
let len = u256_to_usize_checked(&len)?;
let (_, bytes_body) = local_tail.split_at_checked(32).ok_or(())?;
Expand All @@ -87,14 +87,14 @@ impl<'a> SolidityCodableReflectionRefMut<'a> for BytesRefMut<'a> {
if local_head.len() < 32 {
return Err(());
}
let tail_offset = local_head.array_chunks::<32>().next().unwrap();
let tail_offset = local_head.as_chunks::<32>().0.iter().next().unwrap();
let tail_offset = U256::from_be_bytes(*tail_offset);
let tail_offset = u256_to_usize_checked(&tail_offset)?;
let (_, local_tail) = source.split_at_mut_checked(tail_offset).ok_or(())?;
if local_tail.len() < 32 {
return Err(());
}
let len = local_tail.array_chunks::<32>().next().unwrap();
let len = local_tail.as_chunks::<32>().0.iter().next().unwrap();
let len = U256::from_be_bytes(*len);
let len = u256_to_usize_checked(&len)?;
let (_, bytes_body) = local_tail.split_at_mut_checked(32).ok_or(())?;
Expand Down
8 changes: 4 additions & 4 deletions supporting_crates/solidity_abi/src/impls/codable_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ impl<'a, T: SolidityCodable + 'a, const N: usize> SolidityCodableReflectionRef<'
return Err(());
}
let array_source = if T::IS_DYNAMIC {
let tail_offset = local_head.array_chunks::<32>().next().unwrap();
let tail_offset = local_head.as_chunks::<32>().0.iter().next().unwrap();
let tail_offset = U256::from_be_bytes(*tail_offset);
let tail_offset = u256_to_usize_checked(&tail_offset)?;
let (_, local_tail) = source.split_at_checked(tail_offset).ok_or(())?;
if local_tail.len() < 32 {
return Err(());
}
let len = local_tail.array_chunks::<32>().next().unwrap();
let len = local_tail.as_chunks::<32>().0.iter().next().unwrap();
let len = U256::from_be_bytes(*len);
let len = u256_to_usize_checked(&len)?;
let (_, body) = local_tail.split_at_checked(32).ok_or(())?;
Expand Down Expand Up @@ -142,14 +142,14 @@ impl<'a, T: SolidityCodable + 'a, const N: usize> SolidityCodableReflectionRefMu
return Err(());
}
let array_source = if T::IS_DYNAMIC {
let tail_offset = local_head.array_chunks::<32>().next().unwrap();
let tail_offset = local_head.as_chunks::<32>().0.iter().next().unwrap();
let tail_offset = U256::from_be_bytes(*tail_offset);
let tail_offset = u256_to_usize_checked(&tail_offset)?;
let (_, local_tail) = source.split_at_mut_checked(tail_offset).ok_or(())?;
if local_tail.len() < 32 {
return Err(());
}
let len = local_tail.array_chunks::<32>().next().unwrap();
let len = local_tail.as_chunks::<32>().0.iter().next().unwrap();
let len = U256::from_be_bytes(*len);
let len = u256_to_usize_checked(&len)?;
let (_, body) = local_tail.split_at_mut_checked(32).ok_or(())?;
Expand Down
8 changes: 4 additions & 4 deletions supporting_crates/solidity_abi/src/impls/codable_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ impl<'a, T: SolidityCodable + 'a> SolidityCodableReflectionRef<'a> for SliceRef<
if local_head.len() < 32 {
return Err(());
}
let tail_offset = local_head.array_chunks::<32>().next().unwrap();
let tail_offset = local_head.as_chunks::<32>().0.iter().next().unwrap();
let tail_offset = U256::from_be_bytes(*tail_offset);
let tail_offset = u256_to_usize_checked(&tail_offset)?;
let (_, local_tail) = source.split_at_checked(tail_offset).ok_or(())?;
if local_tail.len() < 32 {
return Err(());
}
let len = local_tail.array_chunks::<32>().next().unwrap();
let len = local_tail.as_chunks::<32>().0.iter().next().unwrap();
let len = U256::from_be_bytes(*len);
let len = u256_to_usize_checked(&len)?;
let (_, body) = local_tail.split_at_checked(32).ok_or(())?;
Expand Down Expand Up @@ -141,14 +141,14 @@ impl<'a, T: SolidityCodable + 'a> SolidityCodableReflectionRefMut<'a> for SliceR
if local_head.len() < 32 {
return Err(());
}
let tail_offset = local_head.array_chunks::<32>().next().unwrap();
let tail_offset = local_head.as_chunks::<32>().0.iter().next().unwrap();
let tail_offset = U256::from_be_bytes(*tail_offset);
let tail_offset = u256_to_usize_checked(&tail_offset)?;
let (_, local_tail) = source.split_at_mut_checked(tail_offset).ok_or(())?;
if local_tail.len() < 32 {
return Err(());
}
let len = local_tail.array_chunks::<32>().next().unwrap();
let len = local_tail.as_chunks::<32>().0.iter().next().unwrap();
let len = U256::from_be_bytes(*len);
let len = u256_to_usize_checked(&len)?;
let (_, body) = local_tail.split_at_mut_checked(32).ok_or(())?;
Expand Down
8 changes: 4 additions & 4 deletions supporting_crates/solidity_abi/src/impls/string_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ impl<'a> SolidityCodableReflectionRef<'a> for SolidityStringRef<'a> {
if local_head.len() < 32 {
return Err(());
}
let tail_offset = local_head.array_chunks::<32>().next().unwrap();
let tail_offset = local_head.as_chunks::<32>().0.iter().next().unwrap();
let tail_offset = U256::from_be_bytes(*tail_offset);
let tail_offset = u256_to_usize_checked(&tail_offset)?;
let (_, local_tail) = source.split_at_checked(tail_offset).ok_or(())?;
if local_tail.len() < 32 {
return Err(());
}
let len = local_tail.array_chunks::<32>().next().unwrap();
let len = local_tail.as_chunks::<32>().0.iter().next().unwrap();
let len = U256::from_be_bytes(*len);
let len = u256_to_usize_checked(&len)?;
let (_, bytes_body) = local_tail.split_at_checked(32).ok_or(())?;
Expand All @@ -66,14 +66,14 @@ impl<'a> SolidityCodableReflectionRefMut<'a> for SolidityStringRefMut<'a> {
if local_head.len() < 32 {
return Err(());
}
let tail_offset = local_head.array_chunks::<32>().next().unwrap();
let tail_offset = local_head.as_chunks::<32>().0.iter().next().unwrap();
let tail_offset = U256::from_be_bytes(*tail_offset);
let tail_offset = u256_to_usize_checked(&tail_offset)?;
let (_, local_tail) = source.split_at_mut_checked(tail_offset).ok_or(())?;
if local_tail.len() < 32 {
return Err(());
}
let len = local_tail.array_chunks::<32>().next().unwrap();
let len = local_tail.as_chunks::<32>().0.iter().next().unwrap();
let len = U256::from_be_bytes(*len);
let len = u256_to_usize_checked(&len)?;
let (_, bytes_body) = local_tail.split_at_mut_checked(32).ok_or(())?;
Expand Down
10 changes: 5 additions & 5 deletions supporting_crates/solidity_abi/src/impls/uint_x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ macro_rules! uint_impl {
if local_head.len() < 32 {
return Err(());
}
let source = local_head.array_chunks::<32>().next().unwrap();
let source = local_head.as_chunks::<32>().0.iter().next().unwrap();
let new = Self { source };
*head_offset += 32;

Expand All @@ -42,7 +42,7 @@ macro_rules! uint_impl {
if local_head.len() < 32 {
return Err(());
}
let source = local_head.array_chunks_mut::<32>().next().unwrap();
let source = local_head.as_chunks_mut::<32>().0.iter_mut().next().unwrap();
let new = Self { source };
*head_offset += 32;

Expand Down Expand Up @@ -137,7 +137,7 @@ impl<'a> SolidityCodableReflectionRef<'a> for AddressRef<'a> {
if local_head.len() < 32 {
return Err(());
}
let source = local_head.array_chunks::<32>().next().unwrap();
let source = local_head.as_chunks::<32>().0.iter().next().unwrap();
let new = Self { source };
*head_offset += 32;

Expand All @@ -151,7 +151,7 @@ impl<'a> SolidityCodableReflectionRefMut<'a> for AddressRefMut<'a> {
if local_head.len() < 32 {
return Err(());
}
let source = local_head.array_chunks_mut::<32>().next().unwrap();
let source = local_head.as_chunks_mut::<32>().0.iter_mut().next().unwrap();
let new = Self { source };
*head_offset += 32;

Expand Down Expand Up @@ -241,7 +241,7 @@ impl<'a> SolidityCodableReflectionRefWritable<'a> for AddressRefMut<'a> {
// if local_head.len() < 32 {
// return Err(());
// }
// let source = local_head.array_chunks::<32>().next().unwrap();
// let source = local_head.as_chunks::<32>().0.iter().next().unwrap();
// let new = Self { source };
// *head_offset += 32;

Expand Down
1 change: 0 additions & 1 deletion supporting_crates/solidity_abi/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![cfg_attr(not(test), no_std)]
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
#![feature(array_chunks)]
#![feature(allocator_api)]
#![allow(clippy::result_unit_err)]
#![allow(clippy::needless_lifetimes)]
Expand Down
1 change: 0 additions & 1 deletion system_hooks/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![cfg_attr(target_arch = "riscv32", no_std)]
#![feature(allocator_api)]
#![feature(array_chunks)]
#![feature(get_mut_unchecked)]
#![feature(const_type_id)]
#![feature(vec_push_within_capacity)]
Expand Down
6 changes: 3 additions & 3 deletions tests/binary_checker/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(array_chunks)]

#[cfg(test)]
mod tests {
use std::{io::Read, path::PathBuf, str::FromStr};
Expand All @@ -17,7 +15,9 @@ mod tests {
assert!(binary.len() % 4 == 0);

binary
.array_chunks()
.as_chunks()
.0
.iter()
.map(|el| u32::from_le_bytes(*el))
.collect()
}
Expand Down
1 change: 0 additions & 1 deletion tests/instances/eth_runner/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(slice_as_array)]
#![recursion_limit = "1024"]

use clap::{Parser, Subcommand};
Expand Down
2 changes: 1 addition & 1 deletion tests/rig/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ fn run_prover(csr_reads: &[u32]) {
let mut buffer = vec![];
file.read_to_end(&mut buffer).expect("must read the file");
let mut binary = vec![];
for el in buffer.array_chunks::<4>() {
for el in buffer.as_chunks::<4>().0.iter() {
binary.push(u32::from_le_bytes(*el));
}

Expand Down
2 changes: 0 additions & 2 deletions tests/rig/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
#![feature(allocator_api)]
#![feature(array_chunks)]
//!
//! This crate contains infrastructure to write ZKsync OS integration tests.
//! It contains `Chain` - in memory chain state structure with methods to run blocks, change state
Expand Down
3 changes: 2 additions & 1 deletion tests/rig/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use crate::chain::BlockContext;
use crate::Chain;
use alloy::consensus::BlobTransactionSidecar;
use alloy::consensus::SidecarBuilder;
use alloy::consensus::SimpleCoder;
use alloy::consensus::TxEip1559;
Expand Down Expand Up @@ -320,7 +321,7 @@ pub fn calldata_for_forwarder(target: alloy::primitives::Address, input: &[u8])
/// * `[u8; 32]` - The versioned hash of the blob
pub fn get_alloy_4844_blob_versioned_hash(data: &[u8]) -> [u8; 32] {
// Create a blob sidecar using Alloy's SimpleCoder (handles encoding internally)
let blob_sidecar = SidecarBuilder::<SimpleCoder>::from_slice(data)
let blob_sidecar: BlobTransactionSidecar = SidecarBuilder::<SimpleCoder>::from_slice(data)
.build()
.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion zk_ee/src/common_structs/history_map/element_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl<V, A: Allocator + Clone> ElementPool<V, A> {
match self.head {
None => {
// Allocate
let raw = Box::into_raw(Box::new_in(
let (raw, _) = Box::into_raw_with_allocator(Box::new_in(
HistoryRecord {
touch_ss_id: snapshot_id,
value,
Expand Down
4 changes: 0 additions & 4 deletions zk_ee/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
#![cfg_attr(not(feature = "serde"), no_std)]
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
#![feature(const_type_id)]
#![feature(allocator_api)]
#![feature(array_chunks)]
#![feature(associated_type_defaults)]
#![feature(get_mut_unchecked)]
#![feature(array_windows)]
#![feature(vec_push_within_capacity)]
#![feature(slice_from_ptr_range)]
#![feature(never_type)]
Expand Down
Loading
Loading