minimal icon indicating copy to clipboard operation
minimal copied to clipboard

EVM array overflow with memory set operations

Open ferranbt opened this issue 6 years ago • 0 comments

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.

ferranbt avatar May 02 '19 17:05 ferranbt