diff --git a/src/eth/primitives/block.rs b/src/eth/primitives/block.rs index 1d6748fe6..013bcbba3 100644 --- a/src/eth/primitives/block.rs +++ b/src/eth/primitives/block.rs @@ -77,8 +77,8 @@ impl Block { &self.header.hash } - /// Compact block execution changes removing all intermediate changes, keeping only the last value for each modified nonce, balance, bytecode and slot. - pub fn compact_execution_changes(&self) -> Vec { + /// Compact accounts changes removing intermediate values, keeping only the last modified nonce, balance, bytecode and slots. + pub fn compact_account_changes(&self) -> Vec { let mut block_compacted_changes: HashMap = HashMap::new(); for transaction in &self.transactions { for transaction_changes in transaction.execution.changes.clone().into_iter() { diff --git a/src/eth/storage/inmemory/inmemory_permanent.rs b/src/eth/storage/inmemory/inmemory_permanent.rs index df97d5605..882efd598 100644 --- a/src/eth/storage/inmemory/inmemory_permanent.rs +++ b/src/eth/storage/inmemory/inmemory_permanent.rs @@ -285,7 +285,7 @@ impl PermanentStorage for InMemoryPermanentStorage { let mut state = self.lock_write().await; // check conflicts before persisting any state changes - let account_changes = block.compact_execution_changes(); + let account_changes = block.compact_account_changes(); if let Some(conflicts) = Self::check_conflicts(&state, &account_changes).await { return Err(StorageError::Conflict(conflicts)); } @@ -308,7 +308,7 @@ impl PermanentStorage for InMemoryPermanentStorage { } // save block execution changes - Self::save_account_changes(&mut state, *block.number(), block.compact_execution_changes()).await; + Self::save_account_changes(&mut state, *block.number(), block.compact_account_changes()).await; Ok(()) } diff --git a/src/eth/storage/postgres/postgres.rs b/src/eth/storage/postgres/postgres.rs index 2057719e8..8144e134f 100644 --- a/src/eth/storage/postgres/postgres.rs +++ b/src/eth/storage/postgres/postgres.rs @@ -462,7 +462,7 @@ impl PermanentStorage for Postgres { .await .context("failed to insert block")?; - let account_changes = block.compact_execution_changes(); + let account_changes = block.compact_account_changes(); for transaction in block.transactions { let is_success = transaction.is_success();