Closed
Description
In EVM the caller must define the available space for return values.
In the current EVM2 design this is carried over, however it could be improved:
call
doesn't defines the return value spacereturn
doesn't writes the value to the caller's memory space (I understand this today can depend on the VM anyway)return
places the values into an intermediate, in-memory storage (callstore
) and the contract is charged according to the size of this- a new opcode,
callResultCopy
is introduced for copying betweencallstore
and the caller's memory space (andcallResultSize
to retrieve the total size) - the
callstore
is erased when acall
is executed
It is a rough design, but it could be ironed out.