Conversation
CodSpeed Performance ReportMerging #3033 will degrade performances by 3.49%Comparing Summary
Benchmarks breakdown
|
mattsse
left a comment
There was a problem hiding this comment.
makes sense but unsure about the op changes
|
|
||
| let max_balance_spending = tx.max_balance_spending()?; | ||
|
|
||
| // Check if account has enough balance for `gas_limit * max_fee`` and value transfer. |
| .into()); | ||
| if !is_deposit && !is_balance_check_disabled { | ||
| // check additional cost and deduct it from the caller's balances | ||
| let Some(balance) = new_balance.checked_sub(additional_cost) else { |
There was a problem hiding this comment.
ah so this was moved inside here replacing max_balance_spending > new_balance ?
There was a problem hiding this comment.
Yes, the deposit and the rest of the transaction overlapped a lot, and it wasn't very clear to look.
max_balance_spending > new_balance is now done in ensure_enough_balance and additional_cost is checked first before ensure_ is called
There was a problem hiding this comment.
And additional_cost is not applicable for deposits, it is zero for it
| )?; | ||
| } | ||
|
|
||
| let max_balance_spending = tx.max_balance_spending()?.saturating_add(additional_cost); |
There was a problem hiding this comment.
we no longer chheck that this doesn't overflow for all txs, is this right?
There was a problem hiding this comment.
Yes, it was never checked. Deposit tx skips this check.
Helper function for
ensure_enough_balancefor Transaction that compares balance with max amount that tx could spend.Extracted from #2991