minimal
minimal copied to clipboard
EVM array overflow with memory set operations
There is a case for an overflow in the EVM with Opcodes that resize the memory like here. The memory set operation does not check if the resize length of the memory overflows the max size of an array in Go. This would fail in the gas cost, however, the gas cost is computed later so the error is not catched.
It will require a change in the flow of all the memory operations:
- Resize the memory to the correct size (or at least compute the cost)
- Calculate gas cost
- Set the value and resize if necessary
This issue is not covered in the ethereum/tests repo. There are 3 txns around block 300K that produce this error.