diff --git a/bins/revme/src/cmd/statetest/runner.rs b/bins/revme/src/cmd/statetest/runner.rs index c9f8aede3a..dcf8fcc3a5 100644 --- a/bins/revme/src/cmd/statetest/runner.rs +++ b/bins/revme/src/cmd/statetest/runner.rs @@ -361,7 +361,7 @@ pub fn execute_test_suite( .build(); let mut evm = Evm::builder() .with_db(&mut state) - .modify_env(|e| *e = env.clone()) + .modify_env(|e| e.clone_from(&env)) .with_spec_id(spec_id) .build(); diff --git a/crates/primitives/src/env.rs b/crates/primitives/src/env.rs index 9d0bc100a1..99b5557149 100644 --- a/crates/primitives/src/env.rs +++ b/crates/primitives/src/env.rs @@ -172,8 +172,12 @@ impl Env { // ensure the total blob gas spent is at most equal to the limit // assert blob_gas_used <= MAX_BLOB_GAS_PER_BLOCK - if self.tx.blob_hashes.len() > MAX_BLOB_NUMBER_PER_BLOCK as usize { - return Err(InvalidTransaction::TooManyBlobs); + let num_blobs = self.tx.blob_hashes.len(); + if num_blobs > MAX_BLOB_NUMBER_PER_BLOCK as usize { + return Err(InvalidTransaction::TooManyBlobs { + have: num_blobs, + max: MAX_BLOB_NUMBER_PER_BLOCK as usize, + }); } } } else { diff --git a/crates/primitives/src/result.rs b/crates/primitives/src/result.rs index 516ce25160..659c4fe357 100644 --- a/crates/primitives/src/result.rs +++ b/crates/primitives/src/result.rs @@ -242,7 +242,10 @@ pub enum InvalidTransaction { /// `to` must be present BlobCreateTransaction, /// Transaction has more then [`crate::MAX_BLOB_NUMBER_PER_BLOCK`] blobs - TooManyBlobs, + TooManyBlobs { + max: usize, + have: usize, + }, /// Blob transaction contains a versioned hash with an incorrect version BlobVersionNotSupported, /// EOF TxCreate transaction is not supported before Prague hardfork. @@ -339,7 +342,9 @@ impl fmt::Display for InvalidTransaction { } Self::EmptyBlobs => write!(f, "empty blobs"), Self::BlobCreateTransaction => write!(f, "blob create transaction"), - Self::TooManyBlobs => write!(f, "too many blobs"), + Self::TooManyBlobs { max, have } => { + write!(f, "too many blobs, have {have}, max {max}") + } Self::BlobVersionNotSupported => write!(f, "blob version not supported"), Self::EofInitcodesNotSupported => write!(f, "EOF initcodes not supported"), Self::EofCrateShouldHaveToAddress => write!(f, "EOF crate should have `to` address"), diff --git a/crates/revm/src/db/states/transition_account.rs b/crates/revm/src/db/states/transition_account.rs index 1dc6bc33dd..599bc290b0 100644 --- a/crates/revm/src/db/states/transition_account.rs +++ b/crates/revm/src/db/states/transition_account.rs @@ -85,7 +85,7 @@ impl TransitionAccount { /// Update new values of transition. Don't override old values. /// Both account info and old storages need to be left intact. pub fn update(&mut self, other: Self) { - self.info = other.info.clone(); + self.info.clone_from(&other.info); self.status = other.status; // if transition is from some to destroyed drop the storage. diff --git a/crates/revm/src/inspector/eip3155.rs b/crates/revm/src/inspector/eip3155.rs index b5331157dc..aec20ffd8f 100644 --- a/crates/revm/src/inspector/eip3155.rs +++ b/crates/revm/src/inspector/eip3155.rs @@ -191,7 +191,7 @@ impl Inspector for TracerEip3155 { fn step(&mut self, interp: &mut Interpreter, context: &mut EvmContext) { self.gas_inspector.step(interp, context); - self.stack = interp.stack.data().clone(); + self.stack.clone_from(interp.stack.data()); self.memory = if self.include_memory { Some(hex::encode_prefixed(interp.shared_memory.context_memory())) } else {