Skip to content
Merged
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
2 changes: 1 addition & 1 deletion bins/revme/src/cmd/statetest/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
8 changes: 6 additions & 2 deletions crates/primitives/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 7 additions & 2 deletions crates/primitives/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion crates/revm/src/db/states/transition_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion crates/revm/src/inspector/eip3155.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl<DB: Database> Inspector<DB> for TracerEip3155 {

fn step(&mut self, interp: &mut Interpreter, context: &mut EvmContext<DB>) {
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 {
Expand Down