@@ -53,6 +53,8 @@ type operation struct {
5353 valid bool
5454 // reverts determined whether the operation reverts state
5555 reverts bool
56+ // clearsReturndata determines whether the opertions clears the return data
57+ clearsReturndata bool
5658}
5759
5860var (
@@ -73,6 +75,19 @@ func NewMetropolisInstructionSet() [256]operation {
7375 memorySize : memoryStaticCall ,
7476 valid : true ,
7577 }
78+ instructionSet [RETURNDATASIZE ] = operation {
79+ execute : opReturnDataSize ,
80+ gasCost : constGasFunc (GasQuickStep ),
81+ validateStack : makeStackFunc (0 , 1 ),
82+ valid : true ,
83+ }
84+ instructionSet [RETURNDATACOPY ] = operation {
85+ execute : opReturnDataCopy ,
86+ gasCost : gasReturnDataCopy ,
87+ validateStack : makeStackFunc (3 , 0 ),
88+ memorySize : memoryReturnDataCopy ,
89+ valid : true ,
90+ }
7691 return instructionSet
7792}
7893
@@ -861,26 +876,29 @@ func NewFrontierInstructionSet() [256]operation {
861876 writes : true ,
862877 },
863878 CREATE : {
864- execute : opCreate ,
865- gasCost : gasCreate ,
866- validateStack : makeStackFunc (3 , 1 ),
867- memorySize : memoryCreate ,
868- valid : true ,
869- writes : true ,
879+ execute : opCreate ,
880+ gasCost : gasCreate ,
881+ validateStack : makeStackFunc (3 , 1 ),
882+ memorySize : memoryCreate ,
883+ valid : true ,
884+ writes : true ,
885+ clearsReturndata : true ,
870886 },
871887 CALL : {
872- execute : opCall ,
873- gasCost : gasCall ,
874- validateStack : makeStackFunc (7 , 1 ),
875- memorySize : memoryCall ,
876- valid : true ,
888+ execute : opCall ,
889+ gasCost : gasCall ,
890+ validateStack : makeStackFunc (7 , 1 ),
891+ memorySize : memoryCall ,
892+ valid : true ,
893+ clearsReturndata : true ,
877894 },
878895 CALLCODE : {
879- execute : opCallCode ,
880- gasCost : gasCallCode ,
881- validateStack : makeStackFunc (7 , 1 ),
882- memorySize : memoryCall ,
883- valid : true ,
896+ execute : opCallCode ,
897+ gasCost : gasCallCode ,
898+ validateStack : makeStackFunc (7 , 1 ),
899+ memorySize : memoryCall ,
900+ valid : true ,
901+ clearsReturndata : true ,
884902 },
885903 RETURN : {
886904 execute : opReturn ,
0 commit comments