File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -786,8 +786,6 @@ pub fn get_tx_weights<S: StateReader>(
786786 add_maps ( & mut builtin_counters_without_casm_hash_computation, tx_builtin_counters) ;
787787 // The transaction builtin counters does not include the transaction overhead ('additional')
788788 // resources.
789- // TODO(AvivG): Builtins from `fee_transfer_call_info` are counted twice - in `os_vm_resources`
790- // and again in `tx_builtin_counters`. Remove the duplication.
791789 add_maps (
792790 & mut builtin_counters_without_casm_hash_computation,
793791 & tx_resources. computation . os_vm_resources . prover_builtins ( ) ,
Original file line number Diff line number Diff line change @@ -208,6 +208,11 @@ impl TransactionExecutionInfo {
208208 . chain ( self . fee_transfer_call_info . iter ( ) )
209209 }
210210
211+ /// Returns call infos excluding fee transfer (to avoid double-counting in bouncer calculations)
212+ pub fn call_infos_without_fee_transfer ( & self ) -> impl Iterator < Item = & CallInfo > {
213+ self . validate_call_info . iter ( ) . chain ( self . execute_call_info . iter ( ) )
214+ }
215+
211216 pub fn is_reverted ( & self ) -> bool {
212217 self . revert_error . is_some ( )
213218 }
@@ -222,7 +227,9 @@ impl TransactionExecutionInfo {
222227 }
223228
224229 pub fn summarize_builtins ( & self ) -> BuiltinCounterMap {
225- CallInfo :: summarize_many_builtins ( self . non_optional_call_infos ( ) )
230+ // Remove fee transfer builtins to avoid double-counting in `get_tx_weights`
231+ // in bouncer.rs (already included in os_vm_resources).
232+ CallInfo :: summarize_many_builtins ( self . call_infos_without_fee_transfer ( ) )
226233 }
227234}
228235pub trait ExecutionResourcesTraits {
You can’t perform that action at this time.
0 commit comments