We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8950a35 commit 098356bCopy full SHA for 098356b
monad-eth-block-validator/src/lib.rs
@@ -290,7 +290,10 @@ where
290
}
291
292
// early return if sum of transaction gas limits exceed block gas limit
293
- let total_gas: u64 = transactions.iter().map(|tx| tx.gas_limit()).sum();
+ let total_gas: u64 = transactions
294
+ .iter()
295
+ .try_fold(0u64, |acc, tx| acc.checked_add(tx.gas_limit()))
296
+ .ok_or(BlockValidationError::TxnError)?;
297
if total_gas > chain_params.proposal_gas_limit {
298
return Err(BlockValidationError::TxnError);
299
0 commit comments