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