Skip to content

Commit f32f18a

Browse files
Merge pull request #32 from crytic/dev-petersburg
Add Petersburg fork, and switch to it by default
2 parents 2a075ff + 8d3b80d commit f32f18a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pyevmasm/evmasm.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from future.builtins import next, bytes
55
import copy
66

7-
DEFAULT_FORK = "byzantium"
7+
DEFAULT_FORK = "petersburg"
88

99
"""
1010
Example use::
@@ -474,7 +474,6 @@ def disassemble_all(bytecode, pc=0, fork=DEFAULT_FORK):
474474
475475
476476
"""
477-
478477
if isinstance(bytecode, bytes):
479478
bytecode = bytearray(bytecode)
480479
if isinstance(bytecode, str):
@@ -866,14 +865,15 @@ def __repr__(self):
866865

867866
serenity_instruction_table = InstructionTable({}, previous_fork=constantinople_instruction_table)
868867

869-
accepted_forks = ("frontier", "homestead", "tangerine_whistle", "spurious_dragon", "byzantium", "constantinople", "serenity")
868+
accepted_forks = ("frontier", "homestead", "tangerine_whistle", "spurious_dragon", "byzantium", "constantinople", "petersburg", "serenity")
870869
instruction_tables = {
871870
'frontier': frontier_instruction_table,
872871
'homestead': homestead_instruction_table,
873872
'tangerine_whistle': tangerine_whistle_instruction_table,
874873
'spurious_dragon': spurious_dragon_instruction_table,
875874
'byzantium': byzantium_instruction_table,
876875
'constantinople': constantinople_instruction_table,
876+
'petersburg': constantinople_instruction_table,
877877
'serenity': serenity_instruction_table,
878878
}
879879

@@ -902,10 +902,11 @@ def block_to_fork(block_number):
902902
0: "frontier",
903903
1150000: "homestead",
904904
# 1920000 Dao
905-
2463000: "tangerine_whistle",
905+
2463000: "tangerine_whistle",
906906
2675000: "spurious_dragon",
907907
4370000: "byzantium",
908-
7080000: "constantinople",
908+
#7280000: "constantinople", # Same Block as petersburg, commented to avoid conflicts
909+
7280000: "petersburg",
909910
9999999: "serenity" # to be replaced after Serenity launch
910911
}
911912
fork_names = list(forks_by_block.values())

0 commit comments

Comments
 (0)