diff --git a/bus-mapping/src/circuit_input_builder.rs b/bus-mapping/src/circuit_input_builder.rs index 8f6e1d6a0c..b92ef9cb34 100644 --- a/bus-mapping/src/circuit_input_builder.rs +++ b/bus-mapping/src/circuit_input_builder.rs @@ -460,6 +460,7 @@ impl<'a, C: CircuitsParams> CircuitInputBuilder { // Generate EndTx step let end_tx_step = gen_associated_steps(&mut self.state_ref(&mut tx, &mut tx_ctx), ExecState::EndTx)?; + self.sdb.clear_transient_storage(); tx.steps_mut().push(end_tx_step.clone()); (end_tx_step, last_call) } else if self.feature_config.invalid_tx { diff --git a/bus-mapping/src/state_db.rs b/bus-mapping/src/state_db.rs index 39c044f0d6..6b92df6439 100644 --- a/bus-mapping/src/state_db.rs +++ b/bus-mapping/src/state_db.rs @@ -332,6 +332,11 @@ impl StateDB { } self.refund = 0; } + + /// Clear transient storage. + pub fn clear_transient_storage(&mut self) { + self.transient_storage = HashMap::new(); + } } #[cfg(test)]