@@ -187,7 +187,7 @@ where
187187 R : Default ,
188188 {
189189 // Used to record the external costs in the evm through the StackState implementation
190- let maybe_weight_info =
190+ let mut maybe_weight_info =
191191 WeightInfo :: new_from_weight_limit ( weight_limit, proof_size_base_cost) . map_err (
192192 |_| RunnerError {
193193 error : Error :: < T > :: GasLimitTooLow ,
@@ -220,17 +220,22 @@ where
220220 //
221221 // EIP-3607: https://eips.ethereum.org/EIPS/eip-3607
222222 // Do not allow transactions for which `tx.sender` has any code deployed.
223- if is_transactional
224- && <AccountCodesMetadata < T > >:: get ( source)
225- . unwrap_or_default ( )
226- . size != 0
227- {
223+ let account_code_metadata = <AccountCodesMetadata < T > >:: get ( source) ;
224+ if is_transactional && account_code_metadata. unwrap_or_default ( ) . size != 0 {
228225 return Err ( RunnerError {
229226 error : Error :: < T > :: TransactionMustComeFromEOA ,
230227 weight,
231228 } ) ;
232229 }
233230
231+ if let Some ( ref mut weight_info) = maybe_weight_info {
232+ weight_info
233+ . try_record_proof_size_or_fail ( ACCOUNT_CODES_METADATA_PROOF_SIZE )
234+ . map_err ( |_| RunnerError {
235+ error : Error :: < T > :: GasLimitTooLow ,
236+ weight,
237+ } ) ?;
238+ }
234239 let total_fee_per_gas = if is_transactional {
235240 match ( max_fee_per_gas, max_priority_fee_per_gas) {
236241 // Zero max_fee_per_gas for validated transactional calls exist in XCM -> EVM
@@ -332,12 +337,20 @@ where
332337 if actual_proof_size > estimated_proof_size {
333338 log:: debug!(
334339 target: "evm" ,
335- "Proof size underestimation detected! (estimated: {}, actual: {})" ,
340+ "Proof size underestimation detected! (estimated: {}, actual: {}, diff: {} )" ,
336341 estimated_proof_size,
337- actual_proof_size
342+ actual_proof_size,
343+ actual_proof_size. saturating_sub( estimated_proof_size) ,
338344 ) ;
339345 estimated_proof_size
340346 } else {
347+ log:: debug!(
348+ target: "evm" ,
349+ "Proof size overestimation detected! (estimated: {}, actual: {}, diff: {})" ,
350+ estimated_proof_size,
351+ actual_proof_size,
352+ estimated_proof_size. saturating_sub( actual_proof_size) ,
353+ ) ;
341354 actual_proof_size
342355 }
343356 } else {
0 commit comments