Skip to content

Commit 0445c2e

Browse files
committed
do not insert empty account diffs
1 parent 784dbde commit 0445c2e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

crates/l2/common/src/state_diff.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub enum StateDiffError {
5959
EVMError(#[from] EvmError),
6060
}
6161

62-
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
62+
#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)]
6363
pub struct AccountStateDiff {
6464
pub new_balance: Option<U256>,
6565
pub nonce_diff: u16,

crates/l2/sequencer/block_producer/payload_builder.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,10 @@ fn get_account_diffs_in_tx(
327327
bytecode_hash: None,
328328
};
329329

330-
modified_accounts.insert(*address, account_state_diff);
330+
// If account state diff is NOT empty
331+
if account_state_diff != AccountStateDiff::default() {
332+
modified_accounts.insert(*address, account_state_diff);
333+
}
331334
}
332335

333336
// Then if there is any storage change, we add it to the account state diff

0 commit comments

Comments
 (0)