Skip to content

Commit

Permalink
core/vm: add wrapper functions for all opcodes, all versions
Browse files Browse the repository at this point in the history
- for each opcode and each version, assign corresponding wrapper based on the version and opcodeName
- vm/jump_table/ExportInstructionSet: export instruction set attributes based on input version for generating codes, including unsupported instructions of different versions for dummy wrappers
- vm/interpreter: if not debug mode, call wrapper instead of execute opcodes directly
  • Loading branch information
Francesco4203 committed Jul 8, 2024
1 parent 9f74e7d commit 5d400f1
Show file tree
Hide file tree
Showing 12 changed files with 19,621 additions and 620 deletions.
3 changes: 3 additions & 0 deletions core/vm/eips.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func enable1884(jt *JumpTable) {

// New opcode
jt[SELFBALANCE] = &operation{
opcodeName: "opSelfBalance",
execute: opSelfBalance,
constantGas: GasFastStep,
minStack: minStack(0, 1),
Expand All @@ -89,6 +90,7 @@ func opSelfBalance(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext)
func enable1344(jt *JumpTable) {
// New opcode
jt[CHAINID] = &operation{
opcodeName: "opChainID",
execute: opChainID,
constantGas: GasQuickStep,
minStack: minStack(0, 1),
Expand Down Expand Up @@ -161,6 +163,7 @@ func enable3529(jt *JumpTable) {
func enable3198(jt *JumpTable) {
// New opcode
jt[BASEFEE] = &operation{
opcodeName: "opBaseFee",
execute: opBaseFee,
constantGas: GasQuickStep,
minStack: minStack(0, 1),
Expand Down
Loading

0 comments on commit 5d400f1

Please sign in to comment.