File tree Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 16
16
copy .deepcopy (MUIR_GLACIER_OPCODES ),
17
17
UPDATED_OPCODES ,
18
18
)
19
+ | | | | | | | parent of eb1aad086 ... [WIP ]Implement simple subroutine opcodes
20
+ == == == =
21
+ import copy
22
+
23
+ from eth_utils .toolz import merge
24
+
25
+ from eth import constants
26
+ from eth .vm import (
27
+ mnemonics ,
28
+ opcode_values ,
29
+ )
30
+ from eth .vm .opcode import as_opcode
31
+ from eth .vm .forks .istanbul .opcodes import ISTANBUL_OPCODES
32
+
33
+
34
+ UPDATED_OPCODES = {
35
+ opcode_values .BEGINSUB : as_opcode (
36
+ logic_fn = ...,
37
+ mnemonic = mnemonics .BEGINSUB ,
38
+ gas_cost = constants .GAS_BASE ,
39
+ ),
40
+ opcode_values .JUMPSUB : as_opcode (
41
+ logic_fn = ...,
42
+ mnemonic = mnemonics .JUMPSUB ,
43
+ gas_cost = constants .GAS_MID ,
44
+ ),
45
+ opcode_values .ENDSUB : as_opcode (
46
+ logic_fn = ...,
47
+ mnemonic = mnemonics .ENDSUB ,
48
+ gas_cost = constants .GAS_VERYLOW ,
49
+ ),
50
+ }
51
+
52
+
53
+ BERLIN_OPCODES = merge (
54
+ copy .deepcopy (ISTANBUL_OPCODES ),
55
+ UPDATED_OPCODES ,
56
+ )
57
+ > >> >> >> eb1aad086 ... [WIP ]Implement simple subroutine opcodes
Original file line number Diff line number Diff line change 162
162
LOG3 = 'LOG3'
163
163
LOG4 = 'LOG4'
164
164
#
165
+ # Subroutines
166
+ #
167
+ BEGINSUB = 'BEGINSUB'
168
+ JUMPSUB = 'JUMPSUB'
169
+ ENDSUB = 'ENDSUB'
170
+ #
165
171
# System
166
172
#
167
173
CREATE = 'CREATE'
Original file line number Diff line number Diff line change 182
182
LOG4 = 0xa4
183
183
184
184
185
+ #
186
+ # Subroutines
187
+ #
188
+ BEGINSUB = 0xb2
189
+ JUMPSUB = 0xb3
190
+ ENDSUB = 0xb7
191
+
192
+
185
193
#
186
194
# System
187
195
#
You can’t perform that action at this time.
0 commit comments