github.com/neatio-net/neatio@v1.7.3-0.20231114194659-f4d7a2226baa/chain/core/vm/jump_table.go (about)

     1  package vm
     2  
     3  import (
     4  	"errors"
     5  
     6  	"github.com/neatio-net/neatio/params"
     7  )
     8  
     9  type (
    10  	executionFunc func(pc *uint64, interpreter *EVMInterpreter, contract *Contract, memory *Memory, stack *Stack) ([]byte, error)
    11  	gasFunc       func(*EVM, *Contract, *Stack, *Memory, uint64) (uint64, error)
    12  
    13  	memorySizeFunc func(*Stack) (size uint64, overflow bool)
    14  )
    15  
    16  var errGasUintOverflow = errors.New("gas uint64 overflow")
    17  
    18  type operation struct {
    19  	execute     executionFunc
    20  	constantGas uint64
    21  	dynamicGas  gasFunc
    22  
    23  	minStack int
    24  
    25  	maxStack int
    26  
    27  	memorySize memorySizeFunc
    28  
    29  	halts   bool
    30  	jumps   bool
    31  	writes  bool
    32  	valid   bool
    33  	reverts bool
    34  	returns bool
    35  }
    36  
    37  var (
    38  	frontierInstructionSet         = newFrontierInstructionSet()
    39  	homesteadInstructionSet        = newHomesteadInstructionSet()
    40  	tangerineWhistleInstructionSet = newTangerineWhistleInstructionSet()
    41  	spuriousDragonInstructionSet   = newSpuriousDragonInstructionSet()
    42  	byzantiumInstructionSet        = newByzantiumInstructionSet()
    43  	constantinopleInstructionSet   = newConstantinopleInstructionSet()
    44  	istanbulInstructionSet         = newIstanbulInstructionSet()
    45  )
    46  
    47  type JumpTable [256]operation
    48  
    49  func newIstanbulInstructionSet() JumpTable {
    50  	instructionSet := newConstantinopleInstructionSet()
    51  
    52  	enable1344(&instructionSet)
    53  	enable1884(&instructionSet)
    54  	enable2200(&instructionSet)
    55  
    56  	return instructionSet
    57  }
    58  
    59  func newConstantinopleInstructionSet() JumpTable {
    60  	instructionSet := newByzantiumInstructionSet()
    61  	instructionSet[SHL] = operation{
    62  		execute:     opSHL,
    63  		constantGas: GasFastestStep,
    64  		minStack:    minStack(2, 1),
    65  		maxStack:    maxStack(2, 1),
    66  		valid:       true,
    67  	}
    68  	instructionSet[SHR] = operation{
    69  		execute:     opSHR,
    70  		constantGas: GasFastestStep,
    71  		minStack:    minStack(2, 1),
    72  		maxStack:    maxStack(2, 1),
    73  		valid:       true,
    74  	}
    75  	instructionSet[SAR] = operation{
    76  		execute:     opSAR,
    77  		constantGas: GasFastestStep,
    78  		minStack:    minStack(2, 1),
    79  		maxStack:    maxStack(2, 1),
    80  		valid:       true,
    81  	}
    82  	instructionSet[EXTCODEHASH] = operation{
    83  		execute:     opExtCodeHash,
    84  		constantGas: params.ExtcodeHashGasConstantinople,
    85  		minStack:    minStack(1, 1),
    86  		maxStack:    maxStack(1, 1),
    87  		valid:       true,
    88  	}
    89  	instructionSet[CREATE2] = operation{
    90  		execute:     opCreate2,
    91  		constantGas: params.Create2Gas,
    92  		dynamicGas:  gasCreate2,
    93  		minStack:    minStack(4, 1),
    94  		maxStack:    maxStack(4, 1),
    95  		memorySize:  memoryCreate2,
    96  		valid:       true,
    97  		writes:      true,
    98  		returns:     true,
    99  	}
   100  	return instructionSet
   101  }
   102  
   103  func newByzantiumInstructionSet() JumpTable {
   104  	instructionSet := newSpuriousDragonInstructionSet()
   105  	instructionSet[STATICCALL] = operation{
   106  		execute:     opStaticCall,
   107  		constantGas: params.CallGasEIP150,
   108  		dynamicGas:  gasStaticCall,
   109  		minStack:    minStack(6, 1),
   110  		maxStack:    maxStack(6, 1),
   111  		memorySize:  memoryStaticCall,
   112  		valid:       true,
   113  		returns:     true,
   114  	}
   115  	instructionSet[RETURNDATASIZE] = operation{
   116  		execute:     opReturnDataSize,
   117  		constantGas: GasQuickStep,
   118  		minStack:    minStack(0, 1),
   119  		maxStack:    maxStack(0, 1),
   120  		valid:       true,
   121  	}
   122  	instructionSet[RETURNDATACOPY] = operation{
   123  		execute:     opReturnDataCopy,
   124  		constantGas: GasFastestStep,
   125  		dynamicGas:  gasReturnDataCopy,
   126  		minStack:    minStack(3, 0),
   127  		maxStack:    maxStack(3, 0),
   128  		memorySize:  memoryReturnDataCopy,
   129  		valid:       true,
   130  	}
   131  	instructionSet[REVERT] = operation{
   132  		execute:    opRevert,
   133  		dynamicGas: gasRevert,
   134  		minStack:   minStack(2, 0),
   135  		maxStack:   maxStack(2, 0),
   136  		memorySize: memoryRevert,
   137  		valid:      true,
   138  		reverts:    true,
   139  		returns:    true,
   140  	}
   141  	return instructionSet
   142  }
   143  
   144  func newSpuriousDragonInstructionSet() JumpTable {
   145  	instructionSet := newTangerineWhistleInstructionSet()
   146  	instructionSet[EXP].dynamicGas = gasExpEIP158
   147  	return instructionSet
   148  
   149  }
   150  
   151  func newTangerineWhistleInstructionSet() JumpTable {
   152  	instructionSet := newHomesteadInstructionSet()
   153  	instructionSet[BALANCE].constantGas = params.BalanceGasEIP150
   154  	instructionSet[EXTCODESIZE].constantGas = params.ExtcodeSizeGasEIP150
   155  	instructionSet[SLOAD].constantGas = params.SloadGasEIP150
   156  	instructionSet[EXTCODECOPY].constantGas = params.ExtcodeCopyBaseEIP150
   157  	instructionSet[CALL].constantGas = params.CallGasEIP150
   158  	instructionSet[CALLCODE].constantGas = params.CallGasEIP150
   159  	instructionSet[DELEGATECALL].constantGas = params.CallGasEIP150
   160  	return instructionSet
   161  }
   162  
   163  func newHomesteadInstructionSet() JumpTable {
   164  	instructionSet := newFrontierInstructionSet()
   165  	instructionSet[DELEGATECALL] = operation{
   166  		execute:     opDelegateCall,
   167  		dynamicGas:  gasDelegateCall,
   168  		constantGas: params.CallGasFrontier,
   169  		minStack:    minStack(6, 1),
   170  		maxStack:    maxStack(6, 1),
   171  		memorySize:  memoryDelegateCall,
   172  		valid:       true,
   173  		returns:     true,
   174  	}
   175  	return instructionSet
   176  }
   177  
   178  func newFrontierInstructionSet() JumpTable {
   179  	return JumpTable{
   180  		STOP: {
   181  			execute:     opStop,
   182  			constantGas: 0,
   183  			minStack:    minStack(0, 0),
   184  			maxStack:    maxStack(0, 0),
   185  			halts:       true,
   186  			valid:       true,
   187  		},
   188  		ADD: {
   189  			execute:     opAdd,
   190  			constantGas: GasFastestStep,
   191  			minStack:    minStack(2, 1),
   192  			maxStack:    maxStack(2, 1),
   193  			valid:       true,
   194  		},
   195  		MUL: {
   196  			execute:     opMul,
   197  			constantGas: GasFastStep,
   198  			minStack:    minStack(2, 1),
   199  			maxStack:    maxStack(2, 1),
   200  			valid:       true,
   201  		},
   202  		SUB: {
   203  			execute:     opSub,
   204  			constantGas: GasFastestStep,
   205  			minStack:    minStack(2, 1),
   206  			maxStack:    maxStack(2, 1),
   207  			valid:       true,
   208  		},
   209  		DIV: {
   210  			execute:     opDiv,
   211  			constantGas: GasFastStep,
   212  			minStack:    minStack(2, 1),
   213  			maxStack:    maxStack(2, 1),
   214  			valid:       true,
   215  		},
   216  		SDIV: {
   217  			execute:     opSdiv,
   218  			constantGas: GasFastStep,
   219  			minStack:    minStack(2, 1),
   220  			maxStack:    maxStack(2, 1),
   221  			valid:       true,
   222  		},
   223  		MOD: {
   224  			execute:     opMod,
   225  			constantGas: GasFastStep,
   226  			minStack:    minStack(2, 1),
   227  			maxStack:    maxStack(2, 1),
   228  			valid:       true,
   229  		},
   230  		SMOD: {
   231  			execute:     opSmod,
   232  			constantGas: GasFastStep,
   233  			minStack:    minStack(2, 1),
   234  			maxStack:    maxStack(2, 1),
   235  			valid:       true,
   236  		},
   237  		ADDMOD: {
   238  			execute:     opAddmod,
   239  			constantGas: GasMidStep,
   240  			minStack:    minStack(3, 1),
   241  			maxStack:    maxStack(3, 1),
   242  			valid:       true,
   243  		},
   244  		MULMOD: {
   245  			execute:     opMulmod,
   246  			constantGas: GasMidStep,
   247  			minStack:    minStack(3, 1),
   248  			maxStack:    maxStack(3, 1),
   249  			valid:       true,
   250  		},
   251  		EXP: {
   252  			execute:    opExp,
   253  			dynamicGas: gasExpFrontier,
   254  			minStack:   minStack(2, 1),
   255  			maxStack:   maxStack(2, 1),
   256  			valid:      true,
   257  		},
   258  		SIGNEXTEND: {
   259  			execute:     opSignExtend,
   260  			constantGas: GasFastStep,
   261  			minStack:    minStack(2, 1),
   262  			maxStack:    maxStack(2, 1),
   263  			valid:       true,
   264  		},
   265  		LT: {
   266  			execute:     opLt,
   267  			constantGas: GasFastestStep,
   268  			minStack:    minStack(2, 1),
   269  			maxStack:    maxStack(2, 1),
   270  			valid:       true,
   271  		},
   272  		GT: {
   273  			execute:     opGt,
   274  			constantGas: GasFastestStep,
   275  			minStack:    minStack(2, 1),
   276  			maxStack:    maxStack(2, 1),
   277  			valid:       true,
   278  		},
   279  		SLT: {
   280  			execute:     opSlt,
   281  			constantGas: GasFastestStep,
   282  			minStack:    minStack(2, 1),
   283  			maxStack:    maxStack(2, 1),
   284  			valid:       true,
   285  		},
   286  		SGT: {
   287  			execute:     opSgt,
   288  			constantGas: GasFastestStep,
   289  			minStack:    minStack(2, 1),
   290  			maxStack:    maxStack(2, 1),
   291  			valid:       true,
   292  		},
   293  		EQ: {
   294  			execute:     opEq,
   295  			constantGas: GasFastestStep,
   296  			minStack:    minStack(2, 1),
   297  			maxStack:    maxStack(2, 1),
   298  			valid:       true,
   299  		},
   300  		ISZERO: {
   301  			execute:     opIszero,
   302  			constantGas: GasFastestStep,
   303  			minStack:    minStack(1, 1),
   304  			maxStack:    maxStack(1, 1),
   305  			valid:       true,
   306  		},
   307  		AND: {
   308  			execute:     opAnd,
   309  			constantGas: GasFastestStep,
   310  			minStack:    minStack(2, 1),
   311  			maxStack:    maxStack(2, 1),
   312  			valid:       true,
   313  		},
   314  		XOR: {
   315  			execute:     opXor,
   316  			constantGas: GasFastestStep,
   317  			minStack:    minStack(2, 1),
   318  			maxStack:    maxStack(2, 1),
   319  			valid:       true,
   320  		},
   321  		OR: {
   322  			execute:     opOr,
   323  			constantGas: GasFastestStep,
   324  			minStack:    minStack(2, 1),
   325  			maxStack:    maxStack(2, 1),
   326  			valid:       true,
   327  		},
   328  		NOT: {
   329  			execute:     opNot,
   330  			constantGas: GasFastestStep,
   331  			minStack:    minStack(1, 1),
   332  			maxStack:    maxStack(1, 1),
   333  			valid:       true,
   334  		},
   335  		BYTE: {
   336  			execute:     opByte,
   337  			constantGas: GasFastestStep,
   338  			minStack:    minStack(2, 1),
   339  			maxStack:    maxStack(2, 1),
   340  			valid:       true,
   341  		},
   342  		SHA3: {
   343  			execute:     opSha3,
   344  			constantGas: params.Sha3Gas,
   345  			dynamicGas:  gasSha3,
   346  			minStack:    minStack(2, 1),
   347  			maxStack:    maxStack(2, 1),
   348  			memorySize:  memorySha3,
   349  			valid:       true,
   350  		},
   351  		ADDRESS: {
   352  			execute:     opAddress,
   353  			constantGas: GasQuickStep,
   354  			minStack:    minStack(0, 1),
   355  			maxStack:    maxStack(0, 1),
   356  			valid:       true,
   357  		},
   358  		BALANCE: {
   359  			execute:     opBalance,
   360  			constantGas: params.BalanceGasFrontier,
   361  			minStack:    minStack(1, 1),
   362  			maxStack:    maxStack(1, 1),
   363  			valid:       true,
   364  		},
   365  		ORIGIN: {
   366  			execute:     opOrigin,
   367  			constantGas: GasQuickStep,
   368  			minStack:    minStack(0, 1),
   369  			maxStack:    maxStack(0, 1),
   370  			valid:       true,
   371  		},
   372  		CALLER: {
   373  			execute:     opCaller,
   374  			constantGas: GasQuickStep,
   375  			minStack:    minStack(0, 1),
   376  			maxStack:    maxStack(0, 1),
   377  			valid:       true,
   378  		},
   379  		CALLVALUE: {
   380  			execute:     opCallValue,
   381  			constantGas: GasQuickStep,
   382  			minStack:    minStack(0, 1),
   383  			maxStack:    maxStack(0, 1),
   384  			valid:       true,
   385  		},
   386  		CALLDATALOAD: {
   387  			execute:     opCallDataLoad,
   388  			constantGas: GasFastestStep,
   389  			minStack:    minStack(1, 1),
   390  			maxStack:    maxStack(1, 1),
   391  			valid:       true,
   392  		},
   393  		CALLDATASIZE: {
   394  			execute:     opCallDataSize,
   395  			constantGas: GasQuickStep,
   396  			minStack:    minStack(0, 1),
   397  			maxStack:    maxStack(0, 1),
   398  			valid:       true,
   399  		},
   400  		CALLDATACOPY: {
   401  			execute:     opCallDataCopy,
   402  			constantGas: GasFastestStep,
   403  			dynamicGas:  gasCallDataCopy,
   404  			minStack:    minStack(3, 0),
   405  			maxStack:    maxStack(3, 0),
   406  			memorySize:  memoryCallDataCopy,
   407  			valid:       true,
   408  		},
   409  		CODESIZE: {
   410  			execute:     opCodeSize,
   411  			constantGas: GasQuickStep,
   412  			minStack:    minStack(0, 1),
   413  			maxStack:    maxStack(0, 1),
   414  			valid:       true,
   415  		},
   416  		CODECOPY: {
   417  			execute:     opCodeCopy,
   418  			constantGas: GasFastestStep,
   419  			dynamicGas:  gasCodeCopy,
   420  			minStack:    minStack(3, 0),
   421  			maxStack:    maxStack(3, 0),
   422  			memorySize:  memoryCodeCopy,
   423  			valid:       true,
   424  		},
   425  		GASPRICE: {
   426  			execute:     opGasprice,
   427  			constantGas: GasQuickStep,
   428  			minStack:    minStack(0, 1),
   429  			maxStack:    maxStack(0, 1),
   430  			valid:       true,
   431  		},
   432  		EXTCODESIZE: {
   433  			execute:     opExtCodeSize,
   434  			constantGas: params.ExtcodeSizeGasFrontier,
   435  			minStack:    minStack(1, 1),
   436  			maxStack:    maxStack(1, 1),
   437  			valid:       true,
   438  		},
   439  		EXTCODECOPY: {
   440  			execute:     opExtCodeCopy,
   441  			constantGas: params.ExtcodeCopyBaseFrontier,
   442  			dynamicGas:  gasExtCodeCopy,
   443  			minStack:    minStack(4, 0),
   444  			maxStack:    maxStack(4, 0),
   445  			memorySize:  memoryExtCodeCopy,
   446  			valid:       true,
   447  		},
   448  		BLOCKHASH: {
   449  			execute:     opBlockhash,
   450  			constantGas: GasExtStep,
   451  			minStack:    minStack(1, 1),
   452  			maxStack:    maxStack(1, 1),
   453  			valid:       true,
   454  		},
   455  		COINBASE: {
   456  			execute:     opCoinbase,
   457  			constantGas: GasQuickStep,
   458  			minStack:    minStack(0, 1),
   459  			maxStack:    maxStack(0, 1),
   460  			valid:       true,
   461  		},
   462  		TIMESTAMP: {
   463  			execute:     opTimestamp,
   464  			constantGas: GasQuickStep,
   465  			minStack:    minStack(0, 1),
   466  			maxStack:    maxStack(0, 1),
   467  			valid:       true,
   468  		},
   469  		NUMBER: {
   470  			execute:     opNumber,
   471  			constantGas: GasQuickStep,
   472  			minStack:    minStack(0, 1),
   473  			maxStack:    maxStack(0, 1),
   474  			valid:       true,
   475  		},
   476  		DIFFICULTY: {
   477  			execute:     opDifficulty,
   478  			constantGas: GasQuickStep,
   479  			minStack:    minStack(0, 1),
   480  			maxStack:    maxStack(0, 1),
   481  			valid:       true,
   482  		},
   483  		GASLIMIT: {
   484  			execute:     opGasLimit,
   485  			constantGas: GasQuickStep,
   486  			minStack:    minStack(0, 1),
   487  			maxStack:    maxStack(0, 1),
   488  			valid:       true,
   489  		},
   490  		POP: {
   491  			execute:     opPop,
   492  			constantGas: GasQuickStep,
   493  			minStack:    minStack(1, 0),
   494  			maxStack:    maxStack(1, 0),
   495  			valid:       true,
   496  		},
   497  		MLOAD: {
   498  			execute:     opMload,
   499  			constantGas: GasFastestStep,
   500  			dynamicGas:  gasMLoad,
   501  			minStack:    minStack(1, 1),
   502  			maxStack:    maxStack(1, 1),
   503  			memorySize:  memoryMLoad,
   504  			valid:       true,
   505  		},
   506  		MSTORE: {
   507  			execute:     opMstore,
   508  			constantGas: GasFastestStep,
   509  			dynamicGas:  gasMStore,
   510  			minStack:    minStack(2, 0),
   511  			maxStack:    maxStack(2, 0),
   512  			memorySize:  memoryMStore,
   513  			valid:       true,
   514  		},
   515  		MSTORE8: {
   516  			execute:     opMstore8,
   517  			constantGas: GasFastestStep,
   518  			dynamicGas:  gasMStore8,
   519  			memorySize:  memoryMStore8,
   520  			minStack:    minStack(2, 0),
   521  			maxStack:    maxStack(2, 0),
   522  
   523  			valid: true,
   524  		},
   525  		SLOAD: {
   526  			execute:     opSload,
   527  			constantGas: params.SloadGasFrontier,
   528  			minStack:    minStack(1, 1),
   529  			maxStack:    maxStack(1, 1),
   530  			valid:       true,
   531  		},
   532  		SSTORE: {
   533  			execute:    opSstore,
   534  			dynamicGas: gasSStore,
   535  			minStack:   minStack(2, 0),
   536  			maxStack:   maxStack(2, 0),
   537  			valid:      true,
   538  			writes:     true,
   539  		},
   540  		JUMP: {
   541  			execute:     opJump,
   542  			constantGas: GasMidStep,
   543  			minStack:    minStack(1, 0),
   544  			maxStack:    maxStack(1, 0),
   545  			jumps:       true,
   546  			valid:       true,
   547  		},
   548  		JUMPI: {
   549  			execute:     opJumpi,
   550  			constantGas: GasSlowStep,
   551  			minStack:    minStack(2, 0),
   552  			maxStack:    maxStack(2, 0),
   553  			jumps:       true,
   554  			valid:       true,
   555  		},
   556  		PC: {
   557  			execute:     opPc,
   558  			constantGas: GasQuickStep,
   559  			minStack:    minStack(0, 1),
   560  			maxStack:    maxStack(0, 1),
   561  			valid:       true,
   562  		},
   563  		MSIZE: {
   564  			execute:     opMsize,
   565  			constantGas: GasQuickStep,
   566  			minStack:    minStack(0, 1),
   567  			maxStack:    maxStack(0, 1),
   568  			valid:       true,
   569  		},
   570  		GAS: {
   571  			execute:     opGas,
   572  			constantGas: GasQuickStep,
   573  			minStack:    minStack(0, 1),
   574  			maxStack:    maxStack(0, 1),
   575  			valid:       true,
   576  		},
   577  		JUMPDEST: {
   578  			execute:     opJumpdest,
   579  			constantGas: params.JumpdestGas,
   580  			minStack:    minStack(0, 0),
   581  			maxStack:    maxStack(0, 0),
   582  			valid:       true,
   583  		},
   584  		PUSH1: {
   585  			execute:     opPush1,
   586  			constantGas: GasFastestStep,
   587  			minStack:    minStack(0, 1),
   588  			maxStack:    maxStack(0, 1),
   589  			valid:       true,
   590  		},
   591  		PUSH2: {
   592  			execute:     makePush(2, 2),
   593  			constantGas: GasFastestStep,
   594  			minStack:    minStack(0, 1),
   595  			maxStack:    maxStack(0, 1),
   596  			valid:       true,
   597  		},
   598  		PUSH3: {
   599  			execute:     makePush(3, 3),
   600  			constantGas: GasFastestStep,
   601  			minStack:    minStack(0, 1),
   602  			maxStack:    maxStack(0, 1),
   603  			valid:       true,
   604  		},
   605  		PUSH4: {
   606  			execute:     makePush(4, 4),
   607  			constantGas: GasFastestStep,
   608  			minStack:    minStack(0, 1),
   609  			maxStack:    maxStack(0, 1),
   610  			valid:       true,
   611  		},
   612  		PUSH5: {
   613  			execute:     makePush(5, 5),
   614  			constantGas: GasFastestStep,
   615  			minStack:    minStack(0, 1),
   616  			maxStack:    maxStack(0, 1),
   617  			valid:       true,
   618  		},
   619  		PUSH6: {
   620  			execute:     makePush(6, 6),
   621  			constantGas: GasFastestStep,
   622  			minStack:    minStack(0, 1),
   623  			maxStack:    maxStack(0, 1),
   624  			valid:       true,
   625  		},
   626  		PUSH7: {
   627  			execute:     makePush(7, 7),
   628  			constantGas: GasFastestStep,
   629  			minStack:    minStack(0, 1),
   630  			maxStack:    maxStack(0, 1),
   631  			valid:       true,
   632  		},
   633  		PUSH8: {
   634  			execute:     makePush(8, 8),
   635  			constantGas: GasFastestStep,
   636  			minStack:    minStack(0, 1),
   637  			maxStack:    maxStack(0, 1),
   638  			valid:       true,
   639  		},
   640  		PUSH9: {
   641  			execute:     makePush(9, 9),
   642  			constantGas: GasFastestStep,
   643  			minStack:    minStack(0, 1),
   644  			maxStack:    maxStack(0, 1),
   645  			valid:       true,
   646  		},
   647  		PUSH10: {
   648  			execute:     makePush(10, 10),
   649  			constantGas: GasFastestStep,
   650  			minStack:    minStack(0, 1),
   651  			maxStack:    maxStack(0, 1),
   652  			valid:       true,
   653  		},
   654  		PUSH11: {
   655  			execute:     makePush(11, 11),
   656  			constantGas: GasFastestStep,
   657  			minStack:    minStack(0, 1),
   658  			maxStack:    maxStack(0, 1),
   659  			valid:       true,
   660  		},
   661  		PUSH12: {
   662  			execute:     makePush(12, 12),
   663  			constantGas: GasFastestStep,
   664  			minStack:    minStack(0, 1),
   665  			maxStack:    maxStack(0, 1),
   666  			valid:       true,
   667  		},
   668  		PUSH13: {
   669  			execute:     makePush(13, 13),
   670  			constantGas: GasFastestStep,
   671  			minStack:    minStack(0, 1),
   672  			maxStack:    maxStack(0, 1),
   673  			valid:       true,
   674  		},
   675  		PUSH14: {
   676  			execute:     makePush(14, 14),
   677  			constantGas: GasFastestStep,
   678  			minStack:    minStack(0, 1),
   679  			maxStack:    maxStack(0, 1),
   680  			valid:       true,
   681  		},
   682  		PUSH15: {
   683  			execute:     makePush(15, 15),
   684  			constantGas: GasFastestStep,
   685  			minStack:    minStack(0, 1),
   686  			maxStack:    maxStack(0, 1),
   687  			valid:       true,
   688  		},
   689  		PUSH16: {
   690  			execute:     makePush(16, 16),
   691  			constantGas: GasFastestStep,
   692  			minStack:    minStack(0, 1),
   693  			maxStack:    maxStack(0, 1),
   694  			valid:       true,
   695  		},
   696  		PUSH17: {
   697  			execute:     makePush(17, 17),
   698  			constantGas: GasFastestStep,
   699  			minStack:    minStack(0, 1),
   700  			maxStack:    maxStack(0, 1),
   701  			valid:       true,
   702  		},
   703  		PUSH18: {
   704  			execute:     makePush(18, 18),
   705  			constantGas: GasFastestStep,
   706  			minStack:    minStack(0, 1),
   707  			maxStack:    maxStack(0, 1),
   708  			valid:       true,
   709  		},
   710  		PUSH19: {
   711  			execute:     makePush(19, 19),
   712  			constantGas: GasFastestStep,
   713  			minStack:    minStack(0, 1),
   714  			maxStack:    maxStack(0, 1),
   715  			valid:       true,
   716  		},
   717  		PUSH20: {
   718  			execute:     makePush(20, 20),
   719  			constantGas: GasFastestStep,
   720  			minStack:    minStack(0, 1),
   721  			maxStack:    maxStack(0, 1),
   722  			valid:       true,
   723  		},
   724  		PUSH21: {
   725  			execute:     makePush(21, 21),
   726  			constantGas: GasFastestStep,
   727  			minStack:    minStack(0, 1),
   728  			maxStack:    maxStack(0, 1),
   729  			valid:       true,
   730  		},
   731  		PUSH22: {
   732  			execute:     makePush(22, 22),
   733  			constantGas: GasFastestStep,
   734  			minStack:    minStack(0, 1),
   735  			maxStack:    maxStack(0, 1),
   736  			valid:       true,
   737  		},
   738  		PUSH23: {
   739  			execute:     makePush(23, 23),
   740  			constantGas: GasFastestStep,
   741  			minStack:    minStack(0, 1),
   742  			maxStack:    maxStack(0, 1),
   743  			valid:       true,
   744  		},
   745  		PUSH24: {
   746  			execute:     makePush(24, 24),
   747  			constantGas: GasFastestStep,
   748  			minStack:    minStack(0, 1),
   749  			maxStack:    maxStack(0, 1),
   750  			valid:       true,
   751  		},
   752  		PUSH25: {
   753  			execute:     makePush(25, 25),
   754  			constantGas: GasFastestStep,
   755  			minStack:    minStack(0, 1),
   756  			maxStack:    maxStack(0, 1),
   757  			valid:       true,
   758  		},
   759  		PUSH26: {
   760  			execute:     makePush(26, 26),
   761  			constantGas: GasFastestStep,
   762  			minStack:    minStack(0, 1),
   763  			maxStack:    maxStack(0, 1),
   764  			valid:       true,
   765  		},
   766  		PUSH27: {
   767  			execute:     makePush(27, 27),
   768  			constantGas: GasFastestStep,
   769  			minStack:    minStack(0, 1),
   770  			maxStack:    maxStack(0, 1),
   771  			valid:       true,
   772  		},
   773  		PUSH28: {
   774  			execute:     makePush(28, 28),
   775  			constantGas: GasFastestStep,
   776  			minStack:    minStack(0, 1),
   777  			maxStack:    maxStack(0, 1),
   778  			valid:       true,
   779  		},
   780  		PUSH29: {
   781  			execute:     makePush(29, 29),
   782  			constantGas: GasFastestStep,
   783  			minStack:    minStack(0, 1),
   784  			maxStack:    maxStack(0, 1),
   785  			valid:       true,
   786  		},
   787  		PUSH30: {
   788  			execute:     makePush(30, 30),
   789  			constantGas: GasFastestStep,
   790  			minStack:    minStack(0, 1),
   791  			maxStack:    maxStack(0, 1),
   792  			valid:       true,
   793  		},
   794  		PUSH31: {
   795  			execute:     makePush(31, 31),
   796  			constantGas: GasFastestStep,
   797  			minStack:    minStack(0, 1),
   798  			maxStack:    maxStack(0, 1),
   799  			valid:       true,
   800  		},
   801  		PUSH32: {
   802  			execute:     makePush(32, 32),
   803  			constantGas: GasFastestStep,
   804  			minStack:    minStack(0, 1),
   805  			maxStack:    maxStack(0, 1),
   806  			valid:       true,
   807  		},
   808  		DUP1: {
   809  			execute:     makeDup(1),
   810  			constantGas: GasFastestStep,
   811  			minStack:    minDupStack(1),
   812  			maxStack:    maxDupStack(1),
   813  			valid:       true,
   814  		},
   815  		DUP2: {
   816  			execute:     makeDup(2),
   817  			constantGas: GasFastestStep,
   818  			minStack:    minDupStack(2),
   819  			maxStack:    maxDupStack(2),
   820  			valid:       true,
   821  		},
   822  		DUP3: {
   823  			execute:     makeDup(3),
   824  			constantGas: GasFastestStep,
   825  			minStack:    minDupStack(3),
   826  			maxStack:    maxDupStack(3),
   827  			valid:       true,
   828  		},
   829  		DUP4: {
   830  			execute:     makeDup(4),
   831  			constantGas: GasFastestStep,
   832  			minStack:    minDupStack(4),
   833  			maxStack:    maxDupStack(4),
   834  			valid:       true,
   835  		},
   836  		DUP5: {
   837  			execute:     makeDup(5),
   838  			constantGas: GasFastestStep,
   839  			minStack:    minDupStack(5),
   840  			maxStack:    maxDupStack(5),
   841  			valid:       true,
   842  		},
   843  		DUP6: {
   844  			execute:     makeDup(6),
   845  			constantGas: GasFastestStep,
   846  			minStack:    minDupStack(6),
   847  			maxStack:    maxDupStack(6),
   848  			valid:       true,
   849  		},
   850  		DUP7: {
   851  			execute:     makeDup(7),
   852  			constantGas: GasFastestStep,
   853  			minStack:    minDupStack(7),
   854  			maxStack:    maxDupStack(7),
   855  			valid:       true,
   856  		},
   857  		DUP8: {
   858  			execute:     makeDup(8),
   859  			constantGas: GasFastestStep,
   860  			minStack:    minDupStack(8),
   861  			maxStack:    maxDupStack(8),
   862  			valid:       true,
   863  		},
   864  		DUP9: {
   865  			execute:     makeDup(9),
   866  			constantGas: GasFastestStep,
   867  			minStack:    minDupStack(9),
   868  			maxStack:    maxDupStack(9),
   869  			valid:       true,
   870  		},
   871  		DUP10: {
   872  			execute:     makeDup(10),
   873  			constantGas: GasFastestStep,
   874  			minStack:    minDupStack(10),
   875  			maxStack:    maxDupStack(10),
   876  			valid:       true,
   877  		},
   878  		DUP11: {
   879  			execute:     makeDup(11),
   880  			constantGas: GasFastestStep,
   881  			minStack:    minDupStack(11),
   882  			maxStack:    maxDupStack(11),
   883  			valid:       true,
   884  		},
   885  		DUP12: {
   886  			execute:     makeDup(12),
   887  			constantGas: GasFastestStep,
   888  			minStack:    minDupStack(12),
   889  			maxStack:    maxDupStack(12),
   890  			valid:       true,
   891  		},
   892  		DUP13: {
   893  			execute:     makeDup(13),
   894  			constantGas: GasFastestStep,
   895  			minStack:    minDupStack(13),
   896  			maxStack:    maxDupStack(13),
   897  			valid:       true,
   898  		},
   899  		DUP14: {
   900  			execute:     makeDup(14),
   901  			constantGas: GasFastestStep,
   902  			minStack:    minDupStack(14),
   903  			maxStack:    maxDupStack(14),
   904  			valid:       true,
   905  		},
   906  		DUP15: {
   907  			execute:     makeDup(15),
   908  			constantGas: GasFastestStep,
   909  			minStack:    minDupStack(15),
   910  			maxStack:    maxDupStack(15),
   911  			valid:       true,
   912  		},
   913  		DUP16: {
   914  			execute:     makeDup(16),
   915  			constantGas: GasFastestStep,
   916  			minStack:    minDupStack(16),
   917  			maxStack:    maxDupStack(16),
   918  			valid:       true,
   919  		},
   920  		SWAP1: {
   921  			execute:     makeSwap(1),
   922  			constantGas: GasFastestStep,
   923  			minStack:    minSwapStack(2),
   924  			maxStack:    maxSwapStack(2),
   925  			valid:       true,
   926  		},
   927  		SWAP2: {
   928  			execute:     makeSwap(2),
   929  			constantGas: GasFastestStep,
   930  			minStack:    minSwapStack(3),
   931  			maxStack:    maxSwapStack(3),
   932  			valid:       true,
   933  		},
   934  		SWAP3: {
   935  			execute:     makeSwap(3),
   936  			constantGas: GasFastestStep,
   937  			minStack:    minSwapStack(4),
   938  			maxStack:    maxSwapStack(4),
   939  			valid:       true,
   940  		},
   941  		SWAP4: {
   942  			execute:     makeSwap(4),
   943  			constantGas: GasFastestStep,
   944  			minStack:    minSwapStack(5),
   945  			maxStack:    maxSwapStack(5),
   946  			valid:       true,
   947  		},
   948  		SWAP5: {
   949  			execute:     makeSwap(5),
   950  			constantGas: GasFastestStep,
   951  			minStack:    minSwapStack(6),
   952  			maxStack:    maxSwapStack(6),
   953  			valid:       true,
   954  		},
   955  		SWAP6: {
   956  			execute:     makeSwap(6),
   957  			constantGas: GasFastestStep,
   958  			minStack:    minSwapStack(7),
   959  			maxStack:    maxSwapStack(7),
   960  			valid:       true,
   961  		},
   962  		SWAP7: {
   963  			execute:     makeSwap(7),
   964  			constantGas: GasFastestStep,
   965  			minStack:    minSwapStack(8),
   966  			maxStack:    maxSwapStack(8),
   967  			valid:       true,
   968  		},
   969  		SWAP8: {
   970  			execute:     makeSwap(8),
   971  			constantGas: GasFastestStep,
   972  			minStack:    minSwapStack(9),
   973  			maxStack:    maxSwapStack(9),
   974  			valid:       true,
   975  		},
   976  		SWAP9: {
   977  			execute:     makeSwap(9),
   978  			constantGas: GasFastestStep,
   979  			minStack:    minSwapStack(10),
   980  			maxStack:    maxSwapStack(10),
   981  			valid:       true,
   982  		},
   983  		SWAP10: {
   984  			execute:     makeSwap(10),
   985  			constantGas: GasFastestStep,
   986  			minStack:    minSwapStack(11),
   987  			maxStack:    maxSwapStack(11),
   988  			valid:       true,
   989  		},
   990  		SWAP11: {
   991  			execute:     makeSwap(11),
   992  			constantGas: GasFastestStep,
   993  			minStack:    minSwapStack(12),
   994  			maxStack:    maxSwapStack(12),
   995  			valid:       true,
   996  		},
   997  		SWAP12: {
   998  			execute:     makeSwap(12),
   999  			constantGas: GasFastestStep,
  1000  			minStack:    minSwapStack(13),
  1001  			maxStack:    maxSwapStack(13),
  1002  			valid:       true,
  1003  		},
  1004  		SWAP13: {
  1005  			execute:     makeSwap(13),
  1006  			constantGas: GasFastestStep,
  1007  			minStack:    minSwapStack(14),
  1008  			maxStack:    maxSwapStack(14),
  1009  			valid:       true,
  1010  		},
  1011  		SWAP14: {
  1012  			execute:     makeSwap(14),
  1013  			constantGas: GasFastestStep,
  1014  			minStack:    minSwapStack(15),
  1015  			maxStack:    maxSwapStack(15),
  1016  			valid:       true,
  1017  		},
  1018  		SWAP15: {
  1019  			execute:     makeSwap(15),
  1020  			constantGas: GasFastestStep,
  1021  			minStack:    minSwapStack(16),
  1022  			maxStack:    maxSwapStack(16),
  1023  			valid:       true,
  1024  		},
  1025  		SWAP16: {
  1026  			execute:     makeSwap(16),
  1027  			constantGas: GasFastestStep,
  1028  			minStack:    minSwapStack(17),
  1029  			maxStack:    maxSwapStack(17),
  1030  			valid:       true,
  1031  		},
  1032  		LOG0: {
  1033  			execute:    makeLog(0),
  1034  			dynamicGas: makeGasLog(0),
  1035  			minStack:   minStack(2, 0),
  1036  			maxStack:   maxStack(2, 0),
  1037  			memorySize: memoryLog,
  1038  			valid:      true,
  1039  			writes:     true,
  1040  		},
  1041  		LOG1: {
  1042  			execute:    makeLog(1),
  1043  			dynamicGas: makeGasLog(1),
  1044  			minStack:   minStack(3, 0),
  1045  			maxStack:   maxStack(3, 0),
  1046  			memorySize: memoryLog,
  1047  			valid:      true,
  1048  			writes:     true,
  1049  		},
  1050  		LOG2: {
  1051  			execute:    makeLog(2),
  1052  			dynamicGas: makeGasLog(2),
  1053  			minStack:   minStack(4, 0),
  1054  			maxStack:   maxStack(4, 0),
  1055  			memorySize: memoryLog,
  1056  			valid:      true,
  1057  			writes:     true,
  1058  		},
  1059  		LOG3: {
  1060  			execute:    makeLog(3),
  1061  			dynamicGas: makeGasLog(3),
  1062  			minStack:   minStack(5, 0),
  1063  			maxStack:   maxStack(5, 0),
  1064  			memorySize: memoryLog,
  1065  			valid:      true,
  1066  			writes:     true,
  1067  		},
  1068  		LOG4: {
  1069  			execute:    makeLog(4),
  1070  			dynamicGas: makeGasLog(4),
  1071  			minStack:   minStack(6, 0),
  1072  			maxStack:   maxStack(6, 0),
  1073  			memorySize: memoryLog,
  1074  			valid:      true,
  1075  			writes:     true,
  1076  		},
  1077  		CREATE: {
  1078  			execute:     opCreate,
  1079  			constantGas: params.CreateGas,
  1080  			dynamicGas:  gasCreate,
  1081  			minStack:    minStack(3, 1),
  1082  			maxStack:    maxStack(3, 1),
  1083  			memorySize:  memoryCreate,
  1084  			valid:       true,
  1085  			writes:      true,
  1086  			returns:     true,
  1087  		},
  1088  		CALL: {
  1089  			execute:     opCall,
  1090  			constantGas: params.CallGasFrontier,
  1091  			dynamicGas:  gasCall,
  1092  			minStack:    minStack(7, 1),
  1093  			maxStack:    maxStack(7, 1),
  1094  			memorySize:  memoryCall,
  1095  			valid:       true,
  1096  			returns:     true,
  1097  		},
  1098  		CALLCODE: {
  1099  			execute:     opCallCode,
  1100  			constantGas: params.CallGasFrontier,
  1101  			dynamicGas:  gasCallCode,
  1102  			minStack:    minStack(7, 1),
  1103  			maxStack:    maxStack(7, 1),
  1104  			memorySize:  memoryCall,
  1105  			valid:       true,
  1106  			returns:     true,
  1107  		},
  1108  		RETURN: {
  1109  			execute:    opReturn,
  1110  			dynamicGas: gasReturn,
  1111  			minStack:   minStack(2, 0),
  1112  			maxStack:   maxStack(2, 0),
  1113  			memorySize: memoryReturn,
  1114  			halts:      true,
  1115  			valid:      true,
  1116  		},
  1117  		SELFDESTRUCT: {
  1118  			execute:    opSuicide,
  1119  			dynamicGas: gasSelfdestruct,
  1120  			minStack:   minStack(1, 0),
  1121  			maxStack:   maxStack(1, 0),
  1122  			halts:      true,
  1123  			valid:      true,
  1124  			writes:     true,
  1125  		},
  1126  	}
  1127  }