From d02804c42321c252ed1d7d2906377ccd32b09b8a Mon Sep 17 00:00:00 2001 From: tomg10 Date: Wed, 18 Dec 2024 23:55:29 +0100 Subject: [PATCH] fixes --- .../l1_recovery/src/l1_fetcher/types/v1.rs | 28 ++----------------- core/node/l1_recovery/src/lib.rs | 2 -- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/core/node/l1_recovery/src/l1_fetcher/types/v1.rs b/core/node/l1_recovery/src/l1_fetcher/types/v1.rs index ae7d12e47fa5..d6a49c227562 100644 --- a/core/node/l1_recovery/src/l1_fetcher/types/v1.rs +++ b/core/node/l1_recovery/src/l1_fetcher/types/v1.rs @@ -94,20 +94,8 @@ impl TryFrom<ðabi::Token> for V1 { }; for initial_calldata in initial_changes_calldata[4..].chunks(64) { - let mut t = initial_calldata.array_chunks::<32>(); - let key = *t.next().ok_or_else(|| { - ParseError::InvalidCommitBlockInfo("initialStorageChangesKey".to_string()) - })?; - let value = *t.next().ok_or_else(|| { - ParseError::InvalidCommitBlockInfo("initialStorageChangesValue".to_string()) - })?; - - if t.next().is_some() { - return Err(ParseError::InvalidCommitBlockInfo( - "initialStorageChangesMulti".to_string(), - )); - } - + let key: [u8; 32] = initial_calldata[..32].try_into().unwrap(); + let value: [u8; 32] = initial_calldata[32..].try_into().unwrap(); let key = U256::from_little_endian(&key); let _ = blk.initial_storage_changes.insert(key, value); } @@ -123,17 +111,7 @@ impl TryFrom<ðabi::Token> for V1 { repeated_calldata[6], repeated_calldata[7], ]); - let mut t = repeated_calldata[8..].array_chunks::<32>(); - let value = *t.next().ok_or_else(|| { - ParseError::InvalidCommitBlockInfo("repeatedStorageChanges".to_string()) - })?; - - if t.next().is_some() { - return Err(ParseError::InvalidCommitBlockInfo( - "repeatedStorageChanges".to_string(), - )); - } - + let value: [u8; 32] = repeated_calldata[8..].try_into().unwrap(); blk.repeated_storage_changes.insert(index, value); } diff --git a/core/node/l1_recovery/src/lib.rs b/core/node/l1_recovery/src/lib.rs index 5667b9874891..2fbc51fdc77c 100644 --- a/core/node/l1_recovery/src/lib.rs +++ b/core/node/l1_recovery/src/lib.rs @@ -1,5 +1,3 @@ -#![feature(array_chunks)] -#![feature(iter_next_chunk)] mod processor; mod storage;