0xPolygonZero / zk_evm

Apache License 2.0
85 stars 37 forks source link

fix: check for gas limit overflow #711

Closed Nashtare closed 1 month ago

Nashtare commented 1 month ago

When initiating a child context for CALL-like ops, we do not check if the gas limit is smaller than the parent context's, and more specifically we don't even check if the value specified fits in a u32 (our assumption for gas-costs), which yields an IntegerTooLarge error triggered when exiting the kernel.

This is testable with txn 44 of block 2841 (the last STATICCALL has a gas arg of 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff67), added as regression test.

5.5/N @praetoriansentry