Furthermore there is a discussion about gas costs here: https://github.com/ethereum/EIPs/pull/2669#discussion_r430053819
To briefly summarise:
-
Current costs are defined as "
BEGINSUB
be base (2) ,JUMPSUB
be mid (8) , andRETURNSUB
be verylow (3)" -
@holiman suggests: "I don’t see why
RETURNSUB
should be so cheap. I’d actually prefer it to be same asJUMPSUB
– or, more specifically, thatcost of(JUMPSUB+RETURNSUB) == cost of (JUMP + JUMP)
. Which currently would put it atmid == 8
" -
I suggest that since
JUMPSUB
andRETURNSUB
both need to push to/pop from thereturn_stack
, they should be more expensive thanJUMP
(mid
). Maybe the difference is not measurable too much, but still they should not be the same. I suggestmid + 1
ormid + 2
as a hunch.