We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 13c5b25 commit 0567911Copy full SHA for 0567911
vm/rust/src/execution.rs
@@ -386,7 +386,11 @@ where
386
if balance > max_fee_without_l2_gas.0.into() {
387
// Calculate the maximum amount of L2 gas that can be bought with the balance.
388
let max_l2_gas = (balance - max_fee_without_l2_gas.0)
389
- / initial_resource_bounds.l2_gas.max_price_per_unit.0;
+ / initial_resource_bounds
390
+ .l2_gas
391
+ .max_price_per_unit
392
+ .0
393
+ .max(1u64.into());
394
Ok(u64::try_from(max_l2_gas).unwrap_or(u64::MAX).into())
395
} else {
396
// Balance is less than committed L1 gas and L1 data gas, transaction will fail.
0 commit comments