github.com/fly8eros/go-ethereum@v1.9.1/core/vm/jump_table.go (about)

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