Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update default vm rules #153

Merged
merged 1 commit into from
Apr 12, 2019
Merged

Conversation

njgheorghita
Copy link
Contributor

What was wrong?

eth-tester was pinned to use the Byzantium vm rules, which are not compatible with newer versions of solidity. Updated to use the Constantinople vm rules by default.

See this issue

Cute Animal Picture

image

Copy link
Member

@pipermerriam pipermerriam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there dead code related to forks that can/should be removed.

FORK_NAME_MAPPING = {
FORK_HOMESTEAD: 'homestead',
FORK_TANGERINE_WHISTLE: 'tangerine-whistle',
FORK_SPURIOUS_DRAGON: 'spurious-dragon',
FORK_BYZANTIUM: 'byzantium',
}
def _mk_fork_configuration_params(fork_config):
all_block_numbers = tuple(fork_config.values())
if len(all_block_numbers) != len(set(all_block_numbers)):
duplicates = tuple(sorted(
blk_num for blk_num, freq
in frequencies(all_block_numbers).items()
if freq > 1
))
raise ValueError("Duplicate block numbers: {0}".format(duplicates))
args = {
(block_number, FORK_NAME_MAPPING[fork_name])
for fork_name, block_number
in fork_config.items()
if (block_number is not None and fork_name != FORK_DAO)
}
if FORK_DAO in fork_config:
kwargs = {'dao_start_block': fork_config[FORK_DAO]}
else:
kwargs = {}
return args, kwargs

@to_dict
def get_default_fork_blocks(supported_forks):
for fork_name in supported_forks:
yield (fork_name, None)

SUPPORTED_FORKS = {
FORK_HOMESTEAD,
FORK_DAO,
FORK_SPURIOUS_DRAGON,
FORK_TANGERINE_WHISTLE,
FORK_BYZANTIUM,
}

@njgheorghita njgheorghita merged commit 60a4561 into ethereum:master Apr 12, 2019
@njgheorghita njgheorghita deleted the update-vm-rules branch April 12, 2019 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants