diff --git a/bin/citrea/tests/e2e/sequencer_behaviour.rs b/bin/citrea/tests/e2e/sequencer_behaviour.rs index 9a74689be..6f4359ec8 100644 --- a/bin/citrea/tests/e2e/sequencer_behaviour.rs +++ b/bin/citrea/tests/e2e/sequencer_behaviour.rs @@ -306,7 +306,7 @@ async fn transaction_failing_on_l1_is_removed_from_mempool() -> Result<(), anyho assert_eq!(block.transactions.len(), 0); assert!(tx_from_mempool.is_none()); - assert_eq!(soft_confirmation.txs.unwrap().len(), 1); // TODO: if we can also remove the tx from soft confirmation, that'd be very efficient + assert_eq!(soft_confirmation.txs.unwrap().len(), 0); wait_for_l2_block(&full_node_test_client, block.header.number.unwrap(), None).await; diff --git a/crates/sequencer/src/sequencer.rs b/crates/sequencer/src/sequencer.rs index 41aacf04a..51afb283f 100644 --- a/crates/sequencer/src/sequencer.rs +++ b/crates/sequencer/src/sequencer.rs @@ -443,18 +443,25 @@ where &mut signed_batch, ) { (Ok(()), mut batch_workspace) => { - let evm_txs_count = txs_to_run.len(); - let call_txs = CallMessage { txs: txs_to_run }; - let raw_message = - as EncodeCall>>::encode_call(call_txs); - let signed_blob = self.make_blob(raw_message, &mut batch_workspace)?; - let txs = vec![signed_blob.clone()]; + let mut txs = vec![]; + let mut tx_receipts = vec![]; - let (batch_workspace, tx_receipts) = self.stf.apply_soft_confirmation_txs( - self.fork_manager.active_fork(), - txs.clone(), - batch_workspace, - ); + let evm_txs_count = txs_to_run.len(); + if evm_txs_count > 0 { + let call_txs = CallMessage { txs: txs_to_run }; + let raw_message = + as EncodeCall>>::encode_call( + call_txs, + ); + let signed_blob = self.make_blob(raw_message, &mut batch_workspace)?; + txs.push(signed_blob); + + (batch_workspace, tx_receipts) = self.stf.apply_soft_confirmation_txs( + self.fork_manager.active_fork(), + txs.clone(), + batch_workspace, + ); + } // create the unsigned batch with the txs then sign th sc let unsigned_batch = UnsignedSoftConfirmationBatch::new(