Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
clear transient storage at end tx
Browse files Browse the repository at this point in the history
  • Loading branch information
zemse committed Apr 4, 2024
1 parent d28a696 commit c65544e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions bus-mapping/src/circuit_input_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ impl<'a, C: CircuitsParams> CircuitInputBuilder<C> {
// 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 {
Expand Down
5 changes: 5 additions & 0 deletions bus-mapping/src/state_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit c65544e

Please sign in to comment.