diff --git a/crates/l2/common/src/state_diff.rs b/crates/l2/common/src/state_diff.rs index d87752f04d..7a2667f783 100644 --- a/crates/l2/common/src/state_diff.rs +++ b/crates/l2/common/src/state_diff.rs @@ -59,7 +59,7 @@ pub enum StateDiffError { EVMError(#[from] EvmError), } -#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)] pub struct AccountStateDiff { pub new_balance: Option, pub nonce_diff: u16, diff --git a/crates/l2/sequencer/block_producer/payload_builder.rs b/crates/l2/sequencer/block_producer/payload_builder.rs index 1dd82159d1..ea2fcd92fe 100644 --- a/crates/l2/sequencer/block_producer/payload_builder.rs +++ b/crates/l2/sequencer/block_producer/payload_builder.rs @@ -324,7 +324,10 @@ fn get_account_diffs_in_tx( bytecode_hash: None, }; - modified_accounts.insert(*address, account_state_diff); + // If account state diff is NOT empty + if account_state_diff != AccountStateDiff::default() { + modified_accounts.insert(*address, account_state_diff); + } } // Then if there is any storage change, we add it to the account state diff diff --git a/crates/l2/sequencer/l1_committer.rs b/crates/l2/sequencer/l1_committer.rs index 3457bd6791..bc9c29f839 100644 --- a/crates/l2/sequencer/l1_committer.rs +++ b/crates/l2/sequencer/l1_committer.rs @@ -361,6 +361,11 @@ impl L1Committer { }; let Ok((bundle, latest_blob_size)) = result else { + if block_to_commit_number == first_block_of_batch { + return Err(CommitterError::InternalError( + "Not enough blob space for a single block batch".to_string(), + )); + } warn!( "Batch size limit reached. Any remaining blocks will be processed in the next batch." );