@@ -11,7 +11,7 @@ use crate::blockifier::config::TransactionExecutorConfig;
1111use crate :: bouncer:: { Bouncer , BouncerWeights } ;
1212use crate :: concurrency:: worker_logic:: WorkerExecutor ;
1313use crate :: context:: BlockContext ;
14- use crate :: state:: cached_state:: { CachedState , CommitmentStateDiff , TransactionalState } ;
14+ use crate :: state:: cached_state:: { CachedState , CommitmentStateDiff , StateMaps , TransactionalState } ;
1515use crate :: state:: errors:: StateError ;
1616use crate :: state:: state_api:: { StateReader , StateResult } ;
1717use crate :: state:: stateful_compression:: { allocate_aliases_in_storage, compress, CompressionError } ;
@@ -103,7 +103,7 @@ impl<S: StateReader> TransactionExecutor<S> {
103103 pub fn execute (
104104 & mut self ,
105105 tx : & Transaction ,
106- ) -> TransactionExecutorResult < TransactionExecutionInfo > {
106+ ) -> TransactionExecutorResult < ( TransactionExecutionInfo , StateMaps ) > {
107107 let mut transactional_state = TransactionalState :: create_transactional (
108108 self . block_state . as_mut ( ) . expect ( BLOCK_STATE_ACCESS_ERR ) ,
109109 ) ;
@@ -116,14 +116,15 @@ impl<S: StateReader> TransactionExecutor<S> {
116116 Ok ( tx_execution_info) => {
117117 let tx_state_changes_keys =
118118 transactional_state. get_actual_state_changes ( ) ?. state_maps . into_keys ( ) ;
119+ let state_diff = transactional_state. to_state_diff ( ) ?. state_maps ;
119120 self . bouncer . try_update (
120121 & transactional_state,
121122 & tx_state_changes_keys,
122123 & tx_execution_info. summarize ( & self . block_context . versioned_constants ) ,
123124 & tx_execution_info. receipt . resources ,
124125 ) ?;
125126 transactional_state. commit ( ) ;
126- Ok ( tx_execution_info)
127+ Ok ( ( tx_execution_info, state_diff ) )
127128 }
128129 Err ( error) => {
129130 transactional_state. abort ( ) ;
@@ -139,7 +140,7 @@ impl<S: StateReader> TransactionExecutor<S> {
139140 let mut results = Vec :: new ( ) ;
140141 for tx in txs {
141142 match self . execute ( tx) {
142- Ok ( tx_execution_info) => results. push ( Ok ( tx_execution_info) ) ,
143+ Ok ( ( tx_execution_info, _state_diff ) ) => results. push ( Ok ( tx_execution_info) ) ,
143144 Err ( TransactionExecutorError :: BlockFull ) => break ,
144145 Err ( error) => results. push ( Err ( error) ) ,
145146 }
0 commit comments